From 0c3d9d728784d676ecaf0e9ef5cadbd2039c503d Mon Sep 17 00:00:00 2001 From: Koha9 <36852125+Koha9@users.noreply.github.com> Date: Tue, 8 Jul 2025 19:44:07 +0900 Subject: [PATCH 1/3] Grey out user/password when token present --- app/templates/login.html | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/app/templates/login.html b/app/templates/login.html index d6caca2..d1f8a87 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -6,11 +6,11 @@

🔐 登录信息

- +
- +
@@ -38,4 +38,30 @@ {% if message %}
{{ message }}
{% endif %} -{% endblock %} \ No newline at end of file + +{% endblock %} From 77c38cd17d16ccc5774f347ffaef0f23549533c0 Mon Sep 17 00:00:00 2001 From: Koha9 <36852125+Koha9@users.noreply.github.com> Date: Tue, 8 Jul 2025 19:49:35 +0900 Subject: [PATCH 2/3] Disable highlight when user/pass grayed out --- app/templates/login.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/templates/login.html b/app/templates/login.html index d1f8a87..6587350 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -50,6 +50,11 @@ const hasToken = tokenInput.value.trim() !== ''; [userInput, pwInput].forEach(el => { el.readOnly = hasToken; + el.tabIndex = hasToken ? -1 : 0; + el.style.pointerEvents = hasToken ? 'none' : ''; + if (hasToken && document.activeElement === el) { + el.blur(); + } el.classList.toggle('bg-body-secondary', hasToken); el.classList.toggle('text-decoration-line-through', hasToken); el.classList.toggle('text-body-secondary', hasToken); From afd4981ba74aff9948e285556dbb80aeef1e4452 Mon Sep 17 00:00:00 2001 From: Koha9 <36852125+Koha9@users.noreply.github.com> Date: Tue, 8 Jul 2025 19:54:32 +0900 Subject: [PATCH 3/3] refactor login template --- app/templates/login.html | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/app/templates/login.html b/app/templates/login.html index 6587350..c5bfd43 100644 --- a/app/templates/login.html +++ b/app/templates/login.html @@ -39,29 +39,25 @@
{{ message }}
{% endif %}