From 83a1fc237696b29b468e03d0127e7fba820541c0 Mon Sep 17 00:00:00 2001 From: shuaiplus <2327005759@qq.com> Date: Tue, 12 May 2026 15:55:05 +0800 Subject: [PATCH] feat: enhance TOTP settings UI with improved layout and status indication --- webapp/src/components/SettingsPage.tsx | 11 +++++++++-- webapp/src/styles.css | 13 +++++++++++-- webapp/src/styles/management.css | 26 ++++++++++++++++++++++---- webapp/src/styles/responsive.css | 16 ++++++++++++++++ 4 files changed, 58 insertions(+), 8 deletions(-) diff --git a/webapp/src/components/SettingsPage.tsx b/webapp/src/components/SettingsPage.tsx index 740a089..a52c1b9 100644 --- a/webapp/src/components/SettingsPage.tsx +++ b/webapp/src/components/SettingsPage.tsx @@ -281,8 +281,15 @@ export default function SettingsPage(props: SettingsPageProps) {
-

{t('txt_totp')}

- {totpLocked &&
{t('txt_totp_is_enabled_for_this_account')}
} +
+

{t('txt_totp')}

+ {totpLocked && ( + + + )} +
TOTP QR diff --git a/webapp/src/styles.css b/webapp/src/styles.css index 6a8c36d..72a98e6 100644 --- a/webapp/src/styles.css +++ b/webapp/src/styles.css @@ -687,11 +687,16 @@ h4 { color: var(--muted); } -.settings-modules-grid, .import-export-panels, .backup-grid, .domain-rules-grid { - gap: 10px; + gap: 2px 10px; +} + +.settings-modules-grid { + --settings-grid-gap: 10px; + gap: 2px var(--settings-grid-gap); + grid-template-columns: repeat(2, minmax(0, calc((100% - var(--settings-grid-gap)) / 2))); } .settings-module h3 { @@ -889,6 +894,10 @@ h4 { gap: 8px; } + .settings-modules-grid { + grid-template-columns: minmax(0, 1fr); + } + .mobile-detail-sheet { background: var(--panel-soft); } diff --git a/webapp/src/styles/management.css b/webapp/src/styles/management.css index 2220d65..b8e6392 100644 --- a/webapp/src/styles/management.css +++ b/webapp/src/styles/management.css @@ -425,7 +425,7 @@ } .totp-grid { - @apply mb-3.5 grid gap-3.5; + @apply grid gap-3.5; grid-template-columns: 220px 1fr; } @@ -497,12 +497,15 @@ } .settings-modules-grid { - @apply grid gap-3; - grid-template-columns: repeat(2, minmax(0, 1fr)); + --settings-grid-gap: 12px; + @apply grid; + gap: var(--settings-grid-gap); + grid-template-columns: repeat(2, minmax(0, calc((100% - var(--settings-grid-gap)) / 2))); } .settings-module { @apply min-w-0; + width: 100%; } .sensitive-actions-module { @@ -517,6 +520,21 @@ color: var(--text); } +.settings-module-head { + @apply mb-[5px] flex items-center justify-between gap-3; +} + +.settings-module-head h3 { + @apply m-0; +} + +.totp-status-pill { + @apply inline-flex min-h-8 shrink-0 items-center gap-1.5 rounded-full px-3 text-sm font-extrabold; + border: 1px solid color-mix(in srgb, var(--success) 26%, var(--line)); + background: color-mix(in srgb, var(--success) 9%, var(--panel)); + color: var(--success); +} + .settings-module-placeholder { @apply flex min-h-[150px] flex-col items-center justify-center gap-3 text-base font-extrabold; color: var(--muted); @@ -536,7 +554,7 @@ } .sensitive-actions-grid { - @apply grid gap-3; + @apply grid gap-[3px]; } .sensitive-action { diff --git a/webapp/src/styles/responsive.css b/webapp/src/styles/responsive.css index 1c22f64..114d78a 100644 --- a/webapp/src/styles/responsive.css +++ b/webapp/src/styles/responsive.css @@ -855,6 +855,22 @@ line-height: 1.25; } + .settings-module-head { + margin-bottom: 8px; + align-items: center; + gap: 8px; + } + + .settings-module-head h3 { + margin: 0; + } + + .totp-status-pill { + min-height: 30px; + padding: 0 10px; + font-size: 13px; + } + .settings-module .field, .auth-card .field { margin-bottom: 8px;