Skip to content

feat(cliproxy): 增加账号用量并重组管理工作台 - #312

Merged
g1331 merged 9 commits into
masterfrom
feat/cliproxy-account-usage-workbench
Sep 23, 2026
Merged

g1331 merged 9 commits into
masterfrom
feat/cliproxy-account-usage-workbench

Conversation

@g1331

@g1331 g1331 commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • 从 CLIProxyAPI auth-files 只读获取账号成功/失败请求数、近期请求分桶与可用的配额观测,提供独立可刷新的管理员查询接口。
  • 将实例选择和账号用量设为 CLIProxyAPI 工作台主视图,关联上游与实例日志改为次级视图;补齐中英文、窄屏和加载/失败/空状态。
  • 单实例桌面工作区使用侧栏外的可用宽度,实例选中态改用窄边框,消除过宽留白与整块琥珀色背景。

Related Issue

本轮工作无关联 Issue。

Type of Change

  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Tests (adding or updating tests)

Changes

  • 新增管理员鉴权的 GET /api/admin/cliproxy/instances/:id/auth-accounts/usage;仅投影展示必需字段,不读取会消费记录的用量队列,不写入数据库或认证文件。
  • 重组实例与账号页面,保留已有实例、账号及 OAuth 操作;账号目录与用量分别查询,避免用量失败遮蔽账号管理。
  • 参考 官方 Management Center 的页面布局与认证文件选中态:页面使用可用宽度及固定边距,单实例为紧凑横向栏,实例选中不用大面积填充色。
  • 多实例在 1280px 以下纵向排列,避免账号表被挤窄;更新账号列宽、窄屏地址显示、OpenSpec 设计与截图。

Test Plan

  • CLIProxy 相关 Vitest:33 个文件、292 项通过(前序验证);本次直接相关组件 3 个文件、25 项通过
  • Type check passes (tsc --noEmit)
  • Lint and Prettier checks pass
  • CLIProxy 主流程 E2E:7 项通过(含单实例宽度/选中态、1024px 多实例可读性)
  • CLIProxy 弹窗回归 E2E:6 项通过
  • 人工检查 1440px、1024px、390px、320px 截图,页面无水平溢出
  • 前序 OpenSpec 主规范严格校验通过,本次同步修订已归档变更的设计与验收语句
  • 完整 CI 检查通过(Quality、构建、E2E、迁移、代理稳定性、文档与 CodeQL)

Checklist

  • Code follows the project's coding standards
  • Tests have been added where necessary
  • Documentation has been updated
  • Changes do not introduce security vulnerabilities
  • Commit messages follow conventions

Screenshots

桌面账号工作台:

CLIProxy 工作台桌面

390px 账号工作台:

CLIProxy 工作台移动端

320px 账号详情:

CLIProxy 账号详情 320px

Additional Notes

请求计数来自 CLIProxyAPI 进程内数据,进程重启后会归零;配额信息仅为被动观测,不能当作供应商完整剩余额度。未引入数据库迁移。

@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.58065% with 51 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.49%. Comparing base (977ebb3) to head (4483981).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master     #312    +/-   ##
========================================
  Coverage   71.49%   71.49%            
========================================
  Files         249      250     +1     
  Lines       14997    15112   +115     
  Branches     4910     4974    +64     
========================================
+ Hits        10722    10805    +83     
- Misses       2862     2867     +5     
- Partials     1413     1440    +27     
Flag Coverage Δ
verify 71.49% <72.58%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@g1331
g1331 merged commit df16bba into master Sep 23, 2026
14 checks passed
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.

1 participant