Skip to content

fix(web): show used quota for unlimited API keys - #6224

Merged
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
RedwindA:fix/default-unlimited-key-used-quota
Jul 20, 2026
Merged

fix(web): show used quota for unlimited API keys#6224
Calcium-Ion merged 2 commits into
QuantumNous:mainfrom
RedwindA:fix/default-unlimited-key-used-quota

Conversation

@RedwindA

@RedwindA RedwindA commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

📝 变更描述 / Description

显示了无限额度key的已用额度,对齐旧版行为

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

image.png

Summary by CodeRabbit

  • Improvements
    • Updated unlimited API key quota indicators with an interactive “Unlimited” badge.
    • Added usage details in a tooltip, showing the amount of quota used in a readable format.
    • Applied the updated quota display consistently across desktop and mobile API key views.

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Unlimited-quota API keys now use a shared badge that displays formatted usage in a translated popover across desktop and mobile quota views.

Changes

API key quota badge

Layer / File(s) Summary
Unlimited quota badge
web/default/src/features/keys/components/api-keys-cells.tsx
Adds UnlimitedQuotaBadge, formatting used quota and displaying it in a translated popover.
Quota view integration
web/default/src/features/keys/components/api-keys-columns.tsx, web/default/src/features/keys/components/api-keys-table.tsx
Replaces static unlimited-quota labels in desktop and mobile views with the shared badge and used_quota value.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: calcium-ion, t0ng7u

Poem

I’m a rabbit with a quota to show,
An “Unlimited” badge now helps usage flow.
A popover reveals numbers neat,
Formatted and translated, short and sweet.
Hop through desktop and mobile with cheer!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: showing used quota for unlimited API keys.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Calcium-Ion
Calcium-Ion merged commit 0867756 into QuantumNous:main Jul 20, 2026
1 check passed
JacksonsY added a commit to JacksonsY/new-api that referenced this pull request Jul 22, 2026
同步上游 10 个提交(至 1721144),重点整合:

- QuantumNous#6329 鉴权重构:dashboard 会话全面改为无状态 token(access/refresh
  + 版本栅栏 + 会话管理),gin session 全部移除。fork 侧适配:
  - turnstile 一次性消费改为按 token 键控内存缓存(兼容发码+注册两步流)
  - TRUSTED_PROXY_CIDRS 作为 TRUSTED_PROXIES 的兼容别名保留
  - UserBase/ToBaseUser 保留 ParentId(子号计费),补 AuthVersion/CacheSchema
  - OAuth 绑定改 flow_token 流,保留 GitHub 账号年龄门禁(消费 flow 后校验)
  - RecordUserIP 反欺诈埋点移入 setupLoginAtAuthVersion
  - 子号/代理鉴权门(SubPermission/RejectSubAccount/AgentAuth)原样保留
  - profile 嫁接上游 LoginSessionsCard(会话管理 UI),绑定卡接入
    popup+postMessage 新绑定机制
  - 2FA/OAuth/微信登录后 redirect 目标经 handleLoginSuccess 传递恢复
- web/default → web/ 扁平化 + 删除 classic 主题:fork 全部前端定制
  (agent/supplier/detector/sub-account 等 180+ 文件)迁移至新路径,
  保留 fork 的 i18n 按需加载、每表分页记忆、主题调校与设计系统
- QuantumNous#6157 渠道代理客户端重构(别名缓存+失效清理),保留 fork 全局代理
  与 RELAY_DISABLE_HTTP2;QuantumNous#6074 suno CAS 防重复退款;QuantumNous#6163 playground
  自动分组;QuantumNous#6224 无限额度密钥显示已用量;QuantumNous#6032 realtime GA 去 beta 头
- 语言文件三方合并:fork ~6280 键 + 上游新增 55 键鉴权文案
- fork 刻意删除的组件与 workflows 维持删除(上次合并曾误恢复)

验证:go build/test 全绿,前端 tsgo 类型检查与 rsbuild 构建通过。

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
JacksonsY added a commit to JacksonsY/new-api that referenced this pull request Jul 22, 2026
- turnstile:后端退回上游纯校验版(删除 token 复用缓存,多实例安全);
  前端在登录/注册/发码/找回密码/签到每次消费 token 后重置 widget 换新
  token(Cloudflare token 单次有效),两步流程不再依赖后端状态
- trusted_proxies.go 删除 TRUSTED_PROXY_CIDRS 兼容回退,与上游逐字节
  一致;部署环境如设置过旧变量名需改为 TRUSTED_PROXIES
- 移动端 ApiKeyCard 无限额度改用 UnlimitedQuotaBadge,点击可见已用量
  (补齐上游 QuantumNous#6224 在自制移动卡片上的缺口)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@RedwindA
RedwindA deleted the fix/default-unlimited-key-used-quota branch July 23, 2026 07:03
zhaodechao2008 pushed a commit to zhaodechao2008/new-api that referenced this pull request Jul 27, 2026
lizhongyi1209 pushed a commit to lizhongyi1209/new-api that referenced this pull request Jul 28, 2026
Jaykebc1 added a commit to wrouter/wrouter that referenced this pull request Jul 30, 2026
Bring aurora to parity with three rc.22 web/ frontend changes, additively —
no aurora customizations altered:

- Keys: unlimited-quota API keys now surface used quota. New UnlimitedQuotaBadge
  (Unlimited badge + popover showing Used: <amount>) replaces the bare label in
  the key columns and the mobile card list (QuantumNous#6224).
- Channels: add Codex (type 57) to the fetch-upstream-models set (QuantumNous#6184);
  update the type-23 key prompt to mention TokenHub (QuantumNous#6232). Advanced-custom
  model fetch (QuantumNous#5971, type 58) intentionally NOT wired — aurora's custom
  advanced-custom editor has no model-list-route concept, so it needs a
  separate design discussion rather than a forced fit.
- Models: fix the model edit drawer resetting the form when system options
  refetch mid-edit — read modelSettings via a ref and key the load effect on a
  hasModelSettings boolean instead of the object reference.

i18n zh+en (zh-TW regenerated). aurora build + typecheck clean (6 pre-existing,
no new). Verified only aurora/ files changed.
330079598 pushed a commit to 330079598/new-api that referenced this pull request Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants