diff --git a/apps/frontend/package.json b/apps/frontend/package.json
index 4119c24..ebb9b13 100644
--- a/apps/frontend/package.json
+++ b/apps/frontend/package.json
@@ -7,7 +7,7 @@
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview",
- "test": "node --test --experimental-strip-types src/app/theme.test.ts src/components/templates/template-config.test.ts",
+ "test": "node --test --experimental-strip-types src/app/theme.test.ts src/components/templates/template-config.test.ts src/views/dashboard-license.test.ts",
"typecheck": "vue-tsc -b",
"lint": "eslint . --fix",
"lint:check": "eslint .",
diff --git a/apps/frontend/src/views/DashboardView.vue b/apps/frontend/src/views/DashboardView.vue
index 13c85b0..e6fa339 100644
--- a/apps/frontend/src/views/DashboardView.vue
+++ b/apps/frontend/src/views/DashboardView.vue
@@ -24,6 +24,7 @@ import { useRouter } from '@/app/router'
import StateBlock from '@/components/StateBlock.vue'
import { alertClass, cardClass, inputClass, sectionHeaderClass, toneClass } from '@/components/ui'
import { Button } from '@/components/ui/button'
+import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip'
import {
cronLabel,
extractErrorMessage,
@@ -31,6 +32,11 @@ import {
statusLabel,
statusTone,
} from '@/utils/format'
+import {
+ canRefreshAuthorization,
+ formatAuthorizationExpiryTooltip,
+ formatRemainingDays,
+} from './dashboard-license'
const router = useRouter()
const auth = useAuth()
@@ -71,6 +77,9 @@ const tokenDetail = computed(() => {
if (tokenStatus.value.expiring_soon) return 'Token 即将过期,建议准备刷新授权。'
return `业务 Token 正常,${tokenStatus.value.days_until_expiry ?? '未知'} 天后过期。`
})
+const remainingDaysLabel = computed(() => formatRemainingDays(tokenStatus.value?.days_until_expiry))
+const expiryTooltip = computed(() => formatAuthorizationExpiryTooltip(tokenStatus.value))
+const canRefreshToken = computed(() => canRefreshAuthorization(tokenStatus.value))
const needsEmail = computed(() => !auth.state.user?.email)
const needsPassword = computed(() => auth.state.user?.has_password === false)
@@ -295,12 +304,23 @@ onMounted(load)
剩余
-
- {{
- tokenStatus?.days_until_expiry == null
- ? '未知'
- : `${tokenStatus.days_until_expiry} 天`
- }}
+
+
+
+
+ {{ remainingDaysLabel }}
+
+
+
+ {{ expiryTooltip }}
+
+
+
+
+ {{ remainingDaysLabel }}
@@ -309,7 +329,8 @@ onMounted(load)
{{ tokenDetail }}