atoz03
ce496ed9e6
feat:单账户配置余额脚本 + 刷新按钮即用脚本”,并去掉独立页面/标签。
...
具体改动
- 后端
- src/models/redis.js:新增脚本配置存取 account_balance_script:{platform}:{accountId}。
- src/services/accountBalanceService.js:支持脚本查询。若账户有脚本配置且 queryApi=true,调用 balanceScriptService.execute 获取余额/配额,缓存后返回。
- src/routes/admin/accountBalance.js:新增接口
- GET /admin/accounts/:id/balance/script?platform=...
- PUT /admin/accounts/:id/balance/script?platform=...
- POST /admin/accounts/:id/balance/script/test?platform=...
- 前端
- 新增弹窗 AccountBalanceScriptModal,在账户管理页每个账户“余额/配额”下方有“配置余额脚本”按钮,支持填写 baseUrl/apiKey/token/extra/超时/自动间隔、编写脚本、测试、保存。
- 将余额脚本独立路由/标签移除。
- 格式/ lint 已通过(新组件及 AccountsView)。
2025-12-20 01:18:49 +08:00
atoz03
f6ed420401
feat(admin): 新增账户余额/配额查询与展示
...
- 新增 accountBalanceService 与多 Provider 适配(Claude/Claude Console/OpenAI Responses/通用)
- Redis 增加余额查询结果与本地统计缓存读写
- 管理端新增 /admin/accounts/balance 相关接口与汇总接口,并在应用启动时注册 Provider
- 后台前端新增余额组件与 Dashboard 余额/配额汇总、低余额/高使用提示
- 补充 accountBalanceService 单元测试
2025-12-20 01:15:33 +08:00
shaw
638d2ff189
feat: 支持claude单账户开启串行队列
2025-12-19 22:29:57 +08:00
guoyongchang
dd8a0c95c3
fix: use template literals instead of string concatenation
...
- Convert string concatenation to template literals per ESLint prefer-template rule
- Fixes ESLint errors in sessionKeyPrefix logging (lines 281, 330)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com >
2025-12-19 15:46:38 +08:00
guoyongchang
126eee3712
feat/cron-test-support format fix.
2025-12-19 14:59:47 +08:00
guoyongchang
cd3f51e9e2
refactor: optimize cron test support feature
...
**优化内容:**
1. **验证和安全性加强**
- 移除cron验证重复,统一使用accountTestSchedulerService.validateCronExpression()方法
- 添加model参数类型和长度验证(max 256 chars)
- 限制cronExpression长度至100字符防止DoS攻击
- 双层验证:service层和route层都进行长度检查
2. **性能优化**
- 优化_refreshAllTasks()使用Promise.all()并行加载所有平台配置(之前是顺序加载)
- 改进错误处理,平台加载失败时继续处理其他平台
3. **数据管理改进**
- 为test config添加1年TTL过期机制(之前没有过期设置)
- 保证test history已有30天TTL和5条记录限制
4. **错误响应标准化**
- 统一所有API响应格式,确保error状态都包含message字段
- 改进错误消息的可读性和上下文信息
5. **用户体验改进**
- Vue组件使用showToast()替代原生alert()
- 移除console.error()改用toast通知用户
- 成功保存时显示成功提示
6. **代码整理**
- 移除未使用的maxConcurrentTests变量及其getStatus()中的引用
- 保持代码整洁性
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com >
2025-12-19 13:39:39 +08:00
guoyongchang
09cf951cdc
[feat/cron-test-support]done.
2025-12-19 10:25:43 +08:00
XiaoXice
c79ea19aa1
fix: 全时间api-token统计因为日token记录过期导致不准的问题
2025-12-15 15:14:09 +08:00
John Doe
baafebbf7b
fix: correct API key cost calculation and UI display issues
...
- Fix admin panel cost display for "all time" period using permanent Redis key
- Fix user statistics total cost limit to show complete history
- Fix restricted models list overflow with scrollable container
Backend changes:
- src/routes/admin/apiKeys.js: Use allTimeCost for timeRange='all' instead of scanning TTL keys
- src/routes/apiStats.js: Prioritize permanent usage:cost:total key over monthly keys
Frontend changes:
- web/admin-spa/src/components/apistats/LimitConfig.vue: Add overflow-visible and scrolling to model list
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-12-12 18:11:02 +03:00
DaydreamCoding
07633ddbf8
feat: enhance concurrency queue with health check and admin endpoints
...
- Add queue health check for fast-fail when overloaded (P90 > threshold)
- Implement socket identity verification with UUID token
- Add wait time statistics (P50/P90/P99) and queue stats tracking
- Add admin endpoints for queue stats and cleanup
- Add CLEAR_CONCURRENCY_QUEUES_ON_STARTUP config option
- Update documentation with troubleshooting and proxy config guide
2025-12-12 14:32:09 +08:00
QTom
e3ca555df7
fix(security): add authenticateAdmin middleware to concurrency routes
...
fix(security): add authenticateAdmin middleware to concurrency routes
All concurrency management endpoints were missing authentication,
allowing unauthenticated access to view and clear concurrency data.
2025-12-10 13:59:25 +08:00
QTom
dc96447d72
style: 格式化文件以符合 Prettier 规范
2025-12-09 17:18:43 +08:00
QTom
f5d1c25295
feat: 添加用户消息串行队列功能,防止同账户并发请求触发限流
...
- 新增 userMessageQueueService.js 实现基于 Redis 的队列锁机制
- 在 claudeRelayService、claudeConsoleRelayService、bedrockRelayService、ccrRelayService 中集成队列锁
- 添加 Redis 原子性 Lua 脚本:acquireUserMessageLock、releaseUserMessageLock、refreshUserMessageLock
- 支持锁续租机制,防止长时间请求锁过期
- 添加可配置参数:USER_MESSAGE_QUEUE_ENABLED、USER_MESSAGE_QUEUE_DELAY_MS、USER_MESSAGE_QUEUE_TIMEOUT_MS
- 添加 Web 管理界面配置入口
- 添加 logger.performance 方法用于结构化性能日志
- 添加完整单元测试 (tests/userMessageQueue.test.js)
2025-12-09 17:04:01 +08:00
shaw
aa71c58400
fix: 修复强制会话绑定首次会话的bug
2025-12-08 21:05:21 +08:00
shaw
c79fdc4d71
feat: 增加Claude会话强制绑定
2025-12-08 16:06:23 +08:00
shaw
bab7073822
fix: 修复api-keys页面窗口费率显示问题
2025-12-08 09:58:54 +08:00
shaw
d49cc0cec8
fix: 修复api-keys页面窗口费率显示问题
2025-12-08 09:45:19 +08:00
Wesley Liddick
eb2341fb16
Merge pull request #771 from DaydreamCoding/patch-2 [skip ci]
...
Update model filtering to use blacklist approach
2025-12-06 22:43:52 -05:00
Wesley Liddick
e89e2964e7
Merge pull request #773 from DaydreamCoding/feature/concurrency [skip ci]
...
feat(concurrencyManagement): implement concurrency status management …
2025-12-06 22:43:29 -05:00
SunSeekerX
0828746281
fix: 修复 ESLint 错误 - if 语句花括号和箭头函数简写
2025-12-06 18:30:44 +08:00
SunSeekerX
e1df90684a
fix: 合并冲突 - 保留多选支持并添加暗黑模式样式
2025-12-06 18:28:03 +08:00
DaydreamCoding
f74f77ef65
feat(concurrencyManagement): implement concurrency status management API and enhance concurrency handling in middleware
2025-12-06 17:23:42 +08:00
QTom
b63c3217bc
Update model filtering to use blacklist approach
...
Change model filtering logic to blacklist restricted models.
2025-12-06 14:20:06 +08:00
Wesley Liddick
01c63bf5df
Merge pull request #760 from IanShaw027/upstream-pr-account-full [skip ci]
...
feat: 增强账户管理功能
2025-12-05 21:45:37 -05:00
Wesley Liddick
b66fd7f655
Merge pull request #766 from atoz03/feature/account-detail-timeline [skip ci]
...
feat(account): enhance detail timeline & remove redundant entries
2025-12-05 21:43:14 -05:00
atoz03
f78e376dea
fix:该文件的代码格式不符合 Prettier 规范
2025-12-05 22:29:45 +08:00
atoz03
fbb660138c
fix:调整去重策略
...
- 调整去重策略(src/routes/admin/usageStats.js):账户筛选改为按 accountId 聚合记录所有出现的 accountType,构建 options 时依次按历史类型解析账号,失败再全量回退,无法解析也保留为筛选项并带 rawTypes,避免渠道改名/删除导致选项被“去
重”丢失。
- 解析兜底(src/routes/admin/usageStats.js):resolveAccountInfo 在传入未知类型或过滤后为空时回退尝试全部服务,减轻渠道改名解析不到的问题。
2025-12-05 19:19:52 +08:00
QTom
9c970fda3b
Refactor model restriction checks to use blacklist
2025-12-05 17:06:21 +08:00
atoz03
9b0d0bee96
fix: 账户时间线入口与路由修复
...
- 移除账户列表下拉/卡片的时间线入口,仅保留详情弹窗顶部按钮
- ActionDropdown 全局互斥,避免多菜单堆叠
- 账户筛选去重,避免“未知渠道”重复泄露
2025-12-05 14:57:34 +08:00
atoz03
ff30bfab82
feat: 账户时间线详情页与接口完善
...
- 后端新增 /admin/accounts/:accountId/usage-records 接口,支持按账户聚合多 Key 记录并分页筛选、汇总统计
- 修复 API Key 时间线账户筛选跳过已删除账号,补充账户/Key 辅助解析
- 前端新增 AccountUsageRecordsView、路由及账户列表“时间线”入口,支持模型/API Key 筛选与 CSV 导出
- 补装 prettier-plugin-tailwindcss 并完成相关文件格式化
2025-12-05 14:23:25 +08:00
SunSeekerX
2429bad2b7
feat(api-keys): 添加模型筛选功能
2025-12-05 13:44:09 +08:00
shaw
6bfef2525a
Merge PR #753 : feat: 新增 API Key
...
请求时间线接口与管理端详情页面
2025-12-05 09:03:53 +08:00
IanShaw027
0b3cf5112b
refactor: 移除仪表盘使用记录功能以避免与PR #753重叠
...
移除了仪表盘中的使用记录展示功能,避免与PR #753的API Key详细使用记录功能重叠:
- 移除DashboardView.vue中的使用记录表格UI及相关函数
- 移除dashboard.js中的/dashboard/usage-records接口
- 保留核心账户管理功能(账户过滤、限流状态、统计模态框等)
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-12-05 02:54:14 +08:00
IanShaw027
3db268fff7
feat: 完善账户管理和仪表盘功能
...
- 修改使用记录API路由路径为 /dashboard/usage-records
- 增加对更多账户类型的支持(Bedrock、Azure、Droid、CCR等)
- 修复Codex模型识别逻辑,避免 gpt-5-codex 系列被错误归一化
- 在账户管理页面添加状态过滤器(正常/异常)
- 在账户管理页面添加限流时间过滤器(≤1h/5h/12h/1d)
- 增加账户统计汇总弹窗,按平台分类展示
- 完善仪表盘使用记录展示功能,支持分页加载
- 将 logs1/ 目录添加到 .gitignore
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-12-05 02:54:14 +08:00
IanShaw027
81971436e6
feat: 在仪表盘添加使用记录展示功能
...
- 新增后端API端点 /admin/dashboard/usage-records
- 支持分页查询所有API Key的使用记录
- 自动关联API Key名称和账户名称
- 按时间倒序排列(最新的在前)
- 新增仪表盘使用记录表格
- 显示时间、API Key、账户、模型、输入/输出/缓存创建/缓存读取tokens、成本
- 智能时间格式化(今天显示时分秒,昨天显示时间)
- 支持加载更多记录,分页展示
- 响应式设计,支持暗黑模式
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-12-05 02:54:14 +08:00
SunSeekerX
8aca1f9dd1
feat(account): 新增账户自动防护禁用开关
...
支持 disableAutoProtection 配置项,启用后上游 401/400/429/529 错误不再自动禁用账户
2025-12-04 20:47:12 +08:00
atoz03
3df0c7c650
feat:已修复 ESLint no-shadow 问题:geminiApiAccountService 不再重复声明,改用顶部引入的实例。后端/前端 lint 均通过(npm run lint:check、cd web/admin-spa && npm run lint)
2025-12-04 15:05:09 +08:00
atoz03
6a3dce523b
chore: format usage stats route
2025-12-04 15:02:07 +08:00
atoz03
92b30e1924
feat: add API key usage timeline API and admin UI
2025-12-04 14:41:38 +08:00
shaw
81e89d2dc4
feat: 支持sessionKey完成oauth授权
2025-12-02 20:43:47 +08:00
shaw
e8e6f972b4
fix: 增强console账号test端点
2025-12-01 15:08:40 +08:00
shaw
02018e10f3
feat: 为console类型账号增加count_tokens端点判断
2025-12-01 10:14:12 +08:00
shaw
326adaaeca
fix: 修复Openai-api账户分组调度设置问题
2025-11-29 14:12:42 +08:00
shaw
d89344ad87
fix: 修复Gemini-api账户分组调度设置不生效的问题
2025-11-29 14:11:58 +08:00
shaw
b58b8b1ac7
feat: 支持apikey测试claude端点
2025-11-28 17:16:37 +08:00
shaw
28caa93d99
feat: 重新支持apikey费用排序功能
2025-11-28 15:32:50 +08:00
shaw
d9476230c6
fix: 修复apikey窗口限制时间显示异常的问题
2025-11-28 14:02:58 +08:00
shaw
7db70e2dc0
feat: 为claude类型账号增加测试功能
2025-11-28 10:51:01 +08:00
shaw
fd2b8a0114
refacto: 重构admin.js
2025-11-27 22:16:45 +08:00
shaw
4aeb47062b
fix: droid增加comm端点
2025-11-27 20:38:50 +08:00