feat: 新增部分套餐账单查询(v0.6.4)
Release / Version consistency (push) Canceled after 0s
Release / Build (macos-latest) (push) Canceled after 0s
Release / Build (ubuntu-latest) (push) Canceled after 0s
Release / Build (windows-latest) (push) Canceled after 0s

- 账单/用量查询:balance:kimi(Moonshot 开放平台余额)、NewAPI 中转站余额(accessToken+userId)、Kimi/智谱/MiniMax 套餐档位(5小时/7天)
- managed:kimi-code 走 Kimi Code OAuth 登录凭据查询订阅用量,access token 过期自动 refresh 并写回凭据(单 flight 锁 + 写回前重读防 CLI 竞态)
- 全屏「配置用量查询」页面:启用开关 / 自动检测 vs NewAPI 模板 / 超时与自动查询间隔 / 测试查询
- 供应商卡片紧凑用量行(切换使用左侧)+ 多档明细行;managed 供应商列表置顶(仅展示层)
- 用量显示中英文适配(five_hour→5小时、weekly_limit→7天,Rust 错误串本地化映射)
- 修复:usage_kinds serde rename 导致账单入口不显示;测试查询因 save 触发 loading 翻页卸载面板导致结果丢失(silent save)
This commit is contained in:
KimiSwitch Dev committed 2026-08-01 09:44:36 +08:00
1 parent 12dcb17771
commit ace9842556
26 files changed
+1822 -60

No files matched your search

+41
View File
@@ -372,6 +372,47 @@ export const enTranslations: Record<TranslationKey, string> = {
usageResetIn: "resets in {time}",
usageResetDone: "reset",
usageLoading: "Querying…",
usageQueryOk: "Query succeeded",
// Usage config panel (cc-switch style)
usageConfigTitle: "Configure Usage Query - {name}",
usageConfigBtn: "Configure usage query",
usageEnable: "Enable usage query",
usageTemplate: "Query template",
usageTemplateAuto: "Auto-detect",
usageTemplateNewapi: "NewAPI gateway",
usageAutoDetectHint: "Query balance / plan with the provider's API Key and Base URL",
usageNewapiHint: "Query a NewAPI / OneAPI gateway balance (requires a web-console Access Token, not the sk- inference key)",
usageOAuthManagedHint: "Official OAuth managed: queries the subscription with your Kimi Code login credentials",
usageDetectedKinds: "Detected query kinds",
usageNoKinds: "Not detected (switch to the NewAPI template to configure manually)",
usageBaseUrl: "Query URL (Base URL)",
usageAccessToken: "Access Token",
usageAccessTokenPlaceholder: "Access Token from the web console",
usageAccessTokenHint: "Generated in the NewAPI web console (Personal Settings → Access Token) — NOT the sk- inference key",
usageUserId: "User ID",
usageUserIdPlaceholder: "NewAPI user id (numeric)",
usageUserIdHint: "User id from the web console profile page, sent as the New-Api-User header",
usageAutoInterval: "Auto query interval (minutes)",
usageAutoIntervalHint: "0 = query only on page open or manual refresh",
usageTimeout: "Timeout (seconds)",
usageTimeoutHint: "0 = use the default (8 seconds)",
usageSupportedVars: "Supported variables",
usageBack: "Back",
usageNoKindsHint: "No auto-detected query type for this provider. Switch to the NewAPI template to configure manually, or add a custom query script (coming soon).",
usageSwitchToNewapi: "Switch to NewAPI template",
usageUnsupportedProvider: "This provider is not supported by auto query",
usageTier5h: "5-hour",
usageTierWeekly: "Weekly",
usageErrNoKey: "No API key configured",
usageErrDisabled: "Usage query is disabled in the config panel",
usageErrLoginExpired: "Kimi Code login expired and auto-refresh failed; run `kimi login` again",
usageErrNoOauth: "No Kimi Code OAuth credentials found; run `kimi login` first",
usageErrNewapiCreds: "The NewAPI template requires Access Token and User ID",
usageTestQuery: "Test query",
usageUpdatedAgo: "{time} ago",
usageMinAgo: "{n} min ago",
usageHourAgo: "{n} h ago",
usageDayAgo: "{n} d ago",
// Billing mode (subscription / pay-as-you-go)
billingTabSubscription: "Subscription",