fix(web): refine health loading and quota labels

Hide request health granularity until analytics are loaded and remove the placeholder daily granularity. Use compact uppercase quota badges and localized five-hour labels.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zyy
2026-10-25 00:08:42 +08:00
co-authored by Codex
parent a36137bafb
commit efaed4c3a6
9 changed files with 17 additions and 10 deletions
+1 -1
View File
@@ -44,7 +44,7 @@
"usageRate": "Usage rate",
"moreGroups": "{count} more quota groups, expand the account to view them",
"windows": {
"fiveHour": "5 h limit",
"fiveHour": "5h limit",
"daily": "Daily limit",
"weekly": "Weekly limit",
"monthly": "Monthly limit",
+2 -1
View File
@@ -18,7 +18,8 @@
"requestVolume": "Requests",
"noServiceResult": "No service result",
"title": "Health",
"description": "Request outcomes · {granularityText}",
"description": "Request outcomes",
"descriptionWithGranularity": "Request outcomes · {granularityText}",
"completionRate": "Completion",
"abnormalEnd": "Abnormal",
"loading": "Loading requests",
@@ -44,7 +44,7 @@
"usageRate": "使用率",
"moreGroups": "另有 {count} 个额度组,可展开账号查看",
"windows": {
"fiveHour": "5 h 额度",
"fiveHour": "5小时额度",
"daily": "日额度",
"weekly": "周额度",
"monthly": "月额度",
+2 -1
View File
@@ -18,7 +18,8 @@
"requestVolume": "请求量",
"noServiceResult": "无服务结果",
"title": "请求健康",
"description": "请求状态分布 · {granularityText}",
"description": "请求状态分布",
"descriptionWithGranularity": "请求状态分布 · {granularityText}",
"completionRate": "完成率",
"abnormalEnd": "非正常结束",
"loading": "正在加载请求数据",
@@ -44,7 +44,7 @@
"usageRate": "使用率",
"moreGroups": "另有 {count} 個額度組,可展開賬號查看",
"windows": {
"fiveHour": "5 h 額度",
"fiveHour": "5小時額度",
"daily": "日額度",
"weekly": "周額度",
"monthly": "月額度",
+2 -1
View File
@@ -18,7 +18,8 @@
"requestVolume": "請求量",
"noServiceResult": "無服務結果",
"title": "請求健康",
"description": "請求狀態分佈 · {granularityText}",
"description": "請求狀態分佈",
"descriptionWithGranularity": "請求狀態分佈 · {granularityText}",
"completionRate": "完成率",
"abnormalEnd": "非正常結束",
"loading": "正在加載請求數據",
@@ -59,9 +59,9 @@ function quotaWindowCode(windowSeconds: number | null, role: AccountQuotaWindow[
const hourSeconds = 60 * 60
if (windowSeconds >= daySeconds && windowSeconds % daySeconds === 0)
return `${windowSeconds / daySeconds} d`
return `${windowSeconds / daySeconds}D`
if (windowSeconds >= hourSeconds && windowSeconds % hourSeconds === 0)
return `${windowSeconds / hourSeconds} h`
return `${windowSeconds / hourSeconds}H`
}
switch (role) {
@@ -61,6 +61,10 @@ const granularityText = computed(() => {
return labels[props.granularity] ?? props.granularity
})
const description = computed(() => props.loading || !granularityText.value
? t('usage.health.description')
: t('usage.health.descriptionWithGranularity', { granularityText: granularityText.value }))
const chartOption = computed<EChartsOption>(() => {
const theme = palette.value
const chartPoints = points.value
@@ -165,7 +169,7 @@ function formatTooltip(params: unknown) {
<ZCard
as="article"
:title="t('usage.health.title')"
:description="t('usage.health.description', { granularityText })"
:description="description"
class="min-h-90 xl:h-full"
>
<template #body>
@@ -282,7 +282,7 @@ function emptyInsights() {
function emptyOverview() {
const overview: LoadingAnalytics<Awaited<ReturnType<typeof getUsageRecordInsightsOverview>>> = {
analytics: null,
granularity: '1d',
granularity: '',
health: {
totalRequests: 0,
successRequests: 0,