mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-06-20 13:00:39 +00:00
feat: enhance TOTP settings UI with improved layout and status indication
This commit is contained in:
@@ -281,8 +281,15 @@ export default function SettingsPage(props: SettingsPageProps) {
|
||||
</section>
|
||||
|
||||
<section className="card settings-module">
|
||||
<h3>{t('txt_totp')}</h3>
|
||||
{totpLocked && <div className="status-ok">{t('txt_totp_is_enabled_for_this_account')}</div>}
|
||||
<div className="settings-module-head">
|
||||
<h3>{t('txt_totp')}</h3>
|
||||
{totpLocked && (
|
||||
<span className="totp-status-pill">
|
||||
<ShieldCheck size={14} aria-hidden="true" />
|
||||
{t('txt_enabled')}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="totp-grid">
|
||||
<div className="totp-qr">
|
||||
<img src={qrDataUrl} alt="TOTP QR" />
|
||||
|
||||
+11
-2
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user