diff --git a/frontend/src/views/components/SystemNotification/SystemNotification.css b/frontend/src/views/components/SystemNotification/SystemNotification.css index 94e107d..2e13604 100644 --- a/frontend/src/views/components/SystemNotification/SystemNotification.css +++ b/frontend/src/views/components/SystemNotification/SystemNotification.css @@ -335,6 +335,84 @@ margin-top: 0; } +.notification-row-actions { + display: inline-flex; + align-items: center; + gap: 4px; + white-space: nowrap; +} + +.notification-row-actions :deep(.el-button + .el-button) { + margin-left: 0; +} + +.notification-manager-secret { + flex: 1 0 100%; + display: grid; + grid-template-columns: minmax(0, 1fr) auto; + gap: 8px 14px; + align-items: center; + padding: 10px 12px; + border: 1px solid var(--el-color-success-light-5); + border-radius: 10px; + background: var(--el-color-success-light-9); +} + +.notification-manager-secret-heading { + display: flex; + align-items: center; + flex-wrap: wrap; + gap: 8px 14px; + min-width: 0; + font-size: 13px; + font-weight: 600; +} + +.notification-manager-secret .notification-credential-code { + grid-column: 1 / -1; + min-width: 0; + padding: 8px 10px; + border: 1px solid var(--el-border-color-light); + border-radius: 6px; + background: var(--el-bg-color); +} + +.notification-manager-secret .notification-credential-actions { + grid-column: 1 / -1; +} + +.notification-heading-actions { + display: inline-flex; + align-items: center; + gap: 8px; +} + +.notification-detail-modal-active { + position: fixed; + z-index: 2000; + inset: 0; + display: flex; + align-items: center; + justify-content: center; + width: auto !important; + min-width: 0; + max-height: 100vh; + padding: 24px !important; + border: 0; + border-radius: 0; + background: rgb(15 23 42 / 42%) !important; +} + +.notification-detail-modal-active > .notification-detail-dialog { + width: min(1080px, 100%); + max-height: calc(100vh - 48px); + overflow: auto; + padding: 18px; + border: 1px solid var(--el-border-color-light); + border-radius: 16px; + box-shadow: 0 20px 60px rgb(15 23 42 / 22%); +} + .notification-settings:has(> .notification-manager-panel) > .notification-detail-panel { display: flex; flex-direction: column; @@ -508,6 +586,10 @@ .notification-settings:has(> .notification-manager-panel) > .notification-manager-panel .el-pagination { margin-left: auto; } + + .notification-row-actions { + flex-wrap: wrap; + } } @media (max-width: 820px) { @@ -520,6 +602,16 @@ padding: 12px; } + .notification-detail-modal-active { + align-items: flex-start; + padding: 12px !important; + } + + .notification-detail-modal-active > .notification-detail-dialog { + max-height: calc(100vh - 24px); + padding: 12px; + } + .notification-settings:has(> .notification-manager-panel) > .notification-detail-panel .notification-columns { grid-template-columns: 1fr; } @@ -559,4 +651,14 @@ padding-inline: 4px; font-size: 12px; } + + .notification-row-actions { + display: flex; + flex-direction: column; + align-items: flex-start; + } + + .notification-manager-secret { + grid-template-columns: 1fr; + } } diff --git a/frontend/src/views/components/SystemNotification/SystemNotification.js b/frontend/src/views/components/SystemNotification/SystemNotification.js index 241e382..44a583f 100644 --- a/frontend/src/views/components/SystemNotification/SystemNotification.js +++ b/frontend/src/views/components/SystemNotification/SystemNotification.js @@ -22,6 +22,7 @@ export function usePage(props = {}) { const seconds = ref(0) const verifyVisible = ref(false) const verifyPassword = ref('') + const manageVisible = ref(false) let verifyTarget = null let secretSequence = 0 let secretTimer = null @@ -83,6 +84,29 @@ export function usePage(props = {}) { verifyTarget = status.value verifyVisible.value = true } + const openManage = async row => { + if (loading.value || submitting.value || !(await beforeLeave())) return + clearSecret() + status.value = null + selectedID.value = row.user_id + await loadStatus() + if (!disposed) manageVisible.value = true + } + const closeManage = async () => { + if (!(await beforeLeave())) return false + manageVisible.value = false + clearSecret() + return true + } + const revealAccount = async row => { + if (loading.value || submitting.value || !row.configured || !(await beforeLeave())) return + clearSecret() + status.value = null + selectedID.value = row.user_id + await loadStatus() + if (disposed || !status.value || status.value.user_id !== row.user_id) return + if (canReveal.value) openVerify() + } const verifyAndReveal = async () => { if (!verifyTarget || !verifyPassword.value || submitting.value || !canReveal.value) return const target = verifyTarget @@ -229,6 +253,7 @@ export function usePage(props = {}) { accountsSequence += 1 clearSecret() clearVerification() + manageVisible.value = false document.removeEventListener('visibilitychange', hideOnBackground) }) @@ -236,6 +261,7 @@ export function usePage(props = {}) { manager, loading, submitting, error, status, accounts, page, total, form, secret, secretAccount, secretVisible, seconds, canManage, stateText, dirty, canReveal, verifyVisible, verifyPassword, openVerify, verifyAndReveal, clearVerification, - loadAccounts, selectAccount, refresh, save, rotate, clearSecret, copySecret, beforeLeave + loadAccounts, selectAccount: openManage, openManage, closeManage, revealAccount, refresh, save, rotate, clearSecret, copySecret, beforeLeave, + manageVisible } } diff --git a/frontend/src/views/components/SystemNotification/SystemNotification.vue b/frontend/src/views/components/SystemNotification/SystemNotification.vue index 943c560..a321c54 100644 --- a/frontend/src/views/components/SystemNotification/SystemNotification.vue +++ b/frontend/src/views/components/SystemNotification/SystemNotification.vue @@ -29,9 +29,17 @@ - + @@ -43,14 +51,36 @@ :disabled="submitting" @current-change="loadAccounts" /> +
+
+ 账号 {{ secretAccount }} 的通知授权码 + {{ seconds }} 秒后自动隐藏 +
+ {{ secret }} +
+ 复制授权码 + 隐藏 +
+
-
+