feat(claude-code): 支持通过 /api/oauth/usage 查询账号 5H/周额度并在号池展示

This commit is contained in:
dalamudx
2026-09-29 22:40:44 +08:00
parent 00a315e3bf
commit 8093899b5a
15 changed files with 653 additions and 33 deletions
+11
View File
@@ -6,6 +6,11 @@ import { legacyGuideEnglishMessages } from './legacy-guide-messages'
export const messages = {
'zh-CN': {
'common.loading': '加载中...',
'poolQuota.claudeCode.window5h': '5H',
'poolQuota.claudeCode.weekly': '周',
'poolQuota.claudeCode.weeklySonnet': '周 Sonnet',
'poolQuota.claudeCode.weeklyFable': '周 Fable',
'poolQuota.claudeCode.unknownWindow': '额度',
'common.confirmRead': '确认已读',
'common.confirming': '确认中...',
'common.copy': '复制',
@@ -491,6 +496,11 @@ export const messages = {
},
'en-US': {
'common.loading': 'Loading...',
'poolQuota.claudeCode.window5h': '5H',
'poolQuota.claudeCode.weekly': 'Weekly',
'poolQuota.claudeCode.weeklySonnet': 'Weekly Sonnet',
'poolQuota.claudeCode.weeklyFable': 'Weekly Fable',
'poolQuota.claudeCode.unknownWindow': 'Quota',
'common.confirmRead': 'Confirm read',
'common.confirming': 'Confirming...',
'common.copy': 'Copy',
@@ -3066,6 +3076,7 @@ const legacyDynamicPatterns: Array<[RegExp, (match: RegExpMatchArray) => string]
[/^(1[0-2]|[1-9])月$/u, match => new Intl.DateTimeFormat('en-US', { month: 'short', timeZone: 'UTC' }).format(new Date(Date.UTC(2020, Number(match[1]) - 1, 1)))],
[/^总可用:(.+)$/u, match => `Total available: ${match[1]}`],
[/^余额:(.+)$/u, match => `Balance: ${match[1]}`],
[/^oauth\/usage 返回状态码 (\d+)$/u, match => `oauth/usage returned status ${match[1]}`],
[/^(.+) 秒$/u, match => `${translateLegacyText(match[1], 'en-US')}s`],
[/^(.+) 分钟$/u, match => `${translateLegacyText(match[1], 'en-US')} min`],
[/^(.+) 小时$/u, match => `${translateLegacyText(match[1], 'en-US')} h`],