fix(accounts): hide zero token usage in the account list

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zyy
2026-12-03 10:28:00 +08:00
co-authored by Codex
parent f2d95cc3fa
commit 17e50df06f
2 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -1781,7 +1781,8 @@ OAuth 账号优先按可归属整个账号的实际周/月额度窗口统计,
Antigravity 按部署时区汇总今天及前 6 天,`usage.windowKind` 为 `recent_week`,管理端显示“近一周”;其他 Provider 默认使用过去 24 小时,返回 `daily`。
Token 与模型用量共用该范围,上游额度快照缺失时仍可展示本地统计;账号请求小时图仍独立展示最近 24 个 UTC 小时桶
账号列表展示额度桶时,Token 取自使用率对应窗口的 `localUsage`。桶内所有窗口的使用率均未知时取第一个展示窗口。窗口用量为零时显示 `0`,缺少统计时显示 `—`
账号列表展示额度桶时,Token 取自使用率对应窗口的 `localUsage`。桶内所有窗口的使用率均未知时取第一个展示窗口。
缺少窗口统计时显示 `—`。账号列表统一隐藏为零的 Token 用量
批量导入 AT / RT 使用 `accounts` JSON 数组,最多 200 项,不接受纯文本 token 列表。例如:
@@ -41,10 +41,17 @@ const recentUsageEntry = computed(() => recentlyUsedQuotaEntry(
const currentUsageWindow = computed(() => representativeQuotaWindow(recentUsageEntry.value))
const tokenDisplay = computed(() => {
const window = currentUsageWindow.value ?? recentUsageEntry.value?.windows[0]
if (window && !localUsageOnly.value)
return quotaWindowTokens(window)?.display ?? '—'
if (window && !localUsageOnly.value) {
const tokens = quotaWindowTokens(window)
return tokens?.total === 0
? null
: tokens?.display ?? '—'
}
const usage = props.account.usage
if (usage.totalTokens === 0)
return null
return localUsageOnly.value || (usage.totalTokens ?? 0) > 0
? usage.totalTokensDisplay
: null