From fe3d94648dcc92fa773eef4d42c2112e9306ae3c Mon Sep 17 00:00:00 2001 From: shaw Date: Thu, 25 Sep 2025 17:50:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96codex=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E9=87=8F=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/admin-spa/src/views/AccountsView.vue | 280 ++++++++++------------- 1 file changed, 120 insertions(+), 160 deletions(-) diff --git a/web/admin-spa/src/views/AccountsView.vue b/web/admin-spa/src/views/AccountsView.vue index 13ce8b56..f3c76a09 100644 --- a/web/admin-spa/src/views/AccountsView.vue +++ b/web/admin-spa/src/views/AccountsView.vue @@ -656,82 +656,74 @@
-
-
-
- - 5小时窗口 -
- - {{ formatCodexUsagePercent(account.codexUsage.primary.usedPercent) }} - -
+
-
-
-
- - {{ formatCodexWindowDisplay(account.codexUsage.primary.windowMinutes) }} + + {{ getCodexWindowLabel('primary') }} +
+
+
+
+
+ + {{ formatCodexUsagePercent(account.codexUsage.primary.usedPercent) }} + +
+
-
+
重置剩余 {{ formatCodexRemaining(account.codexUsage.primary) }}
-
-
-
- - 7天窗口 -
- - {{ formatCodexUsagePercent(account.codexUsage.secondary.usedPercent) }} - -
+
-
-
-
- - {{ formatCodexWindowDisplay(account.codexUsage.secondary.windowMinutes) }} + + {{ getCodexWindowLabel('secondary') }} +
+
+
+
+
+ + {{ + formatCodexUsagePercent(account.codexUsage.secondary.usedPercent) + }} + +
+
-
+
重置剩余 {{ formatCodexRemaining(account.codexUsage.secondary) }}
-
- 短期/长期占比 - {{ formatCodexUsagePercent(account.codexUsage.primaryOverSecondaryPercent) }} -
-
- 更新 {{ formatRelativeTime(account.codexUsage.updatedAt) }} -
N/A @@ -982,86 +974,71 @@
-
-
-
- - 5小时窗口 +
+
+
+ + {{ getCodexWindowLabel('primary') }} + +
+
+
+
+
+ + {{ formatCodexUsagePercent(account.codexUsage.primary.usedPercent) }} + +
+
- - {{ formatCodexUsagePercent(account.codexUsage.primary.usedPercent) }} - -
-
-
-
+
+ 重置剩余 {{ formatCodexRemaining(account.codexUsage.primary) }}
- - {{ formatCodexWindowDisplay(account.codexUsage.primary.windowMinutes) }} -
-
- 重置剩余 {{ formatCodexRemaining(account.codexUsage.primary) }} -
-
-
-
-
- - 7天窗口 +
+
+ + {{ getCodexWindowLabel('secondary') }} + +
+
+
+
+
+ + {{ formatCodexUsagePercent(account.codexUsage.secondary.usedPercent) }} + +
+
- - {{ formatCodexUsagePercent(account.codexUsage.secondary.usedPercent) }} - -
-
-
-
+
+ 重置剩余 {{ formatCodexRemaining(account.codexUsage.secondary) }}
- - {{ formatCodexWindowDisplay(account.codexUsage.secondary.windowMinutes) }} -
-
- 重置剩余 {{ formatCodexRemaining(account.codexUsage.secondary) }} -
-
-
- 短期/长期占比 - {{ formatCodexUsagePercent(account.codexUsage.primaryOverSecondaryPercent) }} -
-
- 更新 {{ formatRelativeTime(account.codexUsage.updatedAt) }}
暂无统计
@@ -2249,29 +2226,12 @@ const getCodexUsageWidth = (percent) => { return `${clamped}%` } -// 格式化窗口时长 -const formatCodexWindowDisplay = (minutes) => { - if (!minutes || Number.isNaN(Number(minutes))) { - return '窗口 --' +// 时间窗口标签 +const getCodexWindowLabel = (type) => { + if (type === 'secondary') { + return '周限' } - const value = Number(minutes) - if (value >= 1440) { - const days = Math.floor(value / 1440) - const hours = Math.floor((value % 1440) / 60) - if (hours > 0) { - return `窗口 ${days}天${hours}小时` - } - return `窗口 ${days}天` - } - if (value >= 60) { - const hours = Math.floor(value / 60) - const remain = value % 60 - if (remain > 0) { - return `窗口 ${hours}小时${remain}分钟` - } - return `窗口 ${hours}小时` - } - return `窗口 ${value}分钟` + return '5h' } // 格式化剩余时间