Commit Graph

1376 Commits

Author SHA1 Message Date
shaw
9c9afe1528 feat: 实现账户分组管理功能和优化响应式设计
主要更新:
- 实现账户分组管理功能,支持创建、编辑、删除分组
- 支持将账户添加到分组进行统一调度
- 优化 API Keys 页面响应式设计,解决操作栏被隐藏的问题
- 优化账户管理页面布局,合并平台/类型列,改进操作按钮布局
- 修复代理信息显示溢出问题
- 改进表格列宽分配,充分利用屏幕空间

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 22:34:43 +08:00
shaw
329904ba72 fix: 修复仪表盘页面时间筛选功能
- 修复模型使用分布和详细统计数据不响应时间筛选的问题
- 后端/admin/model-stats端点添加startDate和endDate参数支持
- 支持自定义时间范围的模型统计数据聚合
- 前端loadModelStats函数添加时间范围参数传递
- 修复小时粒度和自定义时间筛选不生效的问题

现在时间筛选可以正确控制所有数据展示:
- Token使用趋势图 ✓
- 模型使用分布 ✓
- 详细统计数据 ✓
- API Keys使用趋势 ✓

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 22:34:42 +08:00
shaw
495c458e9a fix: 修复API Keys页面的undefined错误
- 修复filteredAndSortedApiKeys未定义错误,改为使用sortedApiKeys
- 添加缺失的分页相关变量定义(currentPage, pageSize, totalPages等)
- 添加paginatedApiKeys计算属性实现分页功能
- 修复CreateApiKeyModal和EditApiKeyModal中localAccounts防御性编程
- 添加筛选条件变化时重置页码的逻辑
- 修复"Cannot read properties of undefined (reading 'length')"错误

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 22:34:42 +08:00
shaw
6dd8d0076e fix: 解决Git合并冲突
- 解决ApiKeysView.vue中的合并冲突
- 解决CreateApiKeyModal.vue中的合并冲突
- 解决EditApiKeyModal.vue中的合并冲突
- 保留本地修改版本,包含更完善的功能:
  - Claude OAuth和Console账户分组显示
  - 移动端响应式优化
  - 批量创建API Key功能

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 22:34:41 +08:00
shaw
ecfc1050d3 feat: 优化移动端响应式设计
- 优化所有页面的移动端适配(手机、平板、PC)
- 修复AccountsView移动端状态显示和按钮功能问题
- 修复ApiKeysView移动端详情展开显示问题
- 移除ApiKeysView不必要的查看按钮
- 修复Dashboard页面PC版时间筛选按钮布局
- 改进所有组件的响应式设计
- 删除dist目录避免构建文件冲突

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 22:34:41 +08:00
github-actions[bot]
f22c8cbfcc chore: sync VERSION file with release v1.1.64 [skip ci] 2025-07-31 08:30:10 +00:00
shaw
8e89311dac feat: 使用API响应头中的准确时间戳修正会话窗口和限流时间
- 从429响应中提取 anthropic-ratelimit-unified-reset 响应头
- 使用准确的重置时间戳设置限流结束时间和会话窗口
- 会话窗口开始时间 = 重置时间戳 - 5小时
- 兼容旧逻辑:无响应头时使用预估的会话窗口时间

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 16:29:44 +08:00
github-actions[bot]
2612611795 chore: sync VERSION file with release v1.1.63 [skip ci] 2025-07-31 05:40:34 +00:00
Wesley Liddick
390d01e8b4 Merge pull request #152 from kevinconan/main
fix: 继续修正会话窗口的计算问题,这回应该正确了
2025-07-31 13:40:26 +08:00
KevinLiao
b7f4c2a560 Merge branch 'main' of https://github.com/Wei-Shaw/claude-relay-service 2025-07-31 13:37:23 +08:00
KevinLiao
0e84a979e9 fix: 继续修正会话窗口的计算问题,这回应该正确了 2025-07-31 13:36:24 +08:00
github-actions[bot]
065bd161d7 chore: sync VERSION file with release v1.1.62 [skip ci] 2025-07-31 05:00:40 +00:00
shaw
7ebcdbe72d fix: 优化限流机制,使限流时间与Claude会话窗口保持一致
- 限流结束时间现在基于5小时会话窗口而非硬编码1小时
- 新增 rateLimitEndAt 字段追踪限流结束时间
- 自动解除限流基于会话窗口结束时间
- 保持向后兼容,支持旧数据格式

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 13:00:19 +08:00
github-actions[bot]
aef39b10d9 chore: sync VERSION file with release v1.1.61 and rebuild frontend [skip ci] 2025-07-31 03:28:28 +00:00
Wesley Liddick
d04bbfec8b Merge pull request #149 from Alfonsxh/feature/api-keys-pagination
fix: 修复 API Key 统计页面链接指向错误的问题
2025-07-31 11:27:55 +08:00
Alfonsxh
1a620ba0fa fix: 修复 API Key 统计页面链接指向错误的问题
- 将统计页面 URL 从 /admin/api-stats 修正为 /admin-next/api-stats
- 确保链接指向正确的 SPA 路由

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 11:23:28 +08:00
github-actions[bot]
ca61807906 chore: sync VERSION file with release v1.1.60 and rebuild frontend [skip ci] 2025-07-31 02:54:24 +00:00
Wesley Liddick
aa253431c5 Merge pull request #148 from Alfonsxh/feature/api-keys-pagination
feat: 添加 API Keys 管理界面分页功能
2025-07-31 10:53:53 +08:00
Alfonsxh
fb23f09723 feat: 添加 API Keys 管理界面分页功能
- 实现表格分页显示,默认每页显示 10 条记录
- 添加每页数量选择器,支持 5/10/20/50/100 条选项
- 实现智能页码导航,包含上一页、下一页和页码按钮
- 优化界面样式,统一下拉框和按钮的视觉效果
- 筛选或排序时自动重置到第一页
- 显示总记录数统计信息

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-31 10:49:20 +08:00
github-actions[bot]
f191a5218c chore: sync VERSION file with release v1.1.59 [skip ci] 2025-07-31 01:31:23 +00:00
Wesley Liddick
7f48934c85 Merge pull request #146 from kevinconan/main
fix: 修复session窗口计算问题
2025-07-31 09:31:11 +08:00
KevinLiao
d93ce8713d fix: 修复session窗口计算问题 2025-07-31 09:15:33 +08:00
github-actions[bot]
0d98467688 chore: sync VERSION file with release v1.1.58 and rebuild frontend [skip ci] 2025-07-30 16:19:43 +00:00
Wesley Liddick
66d481c477 Merge pull request #144 from kevinconan/main
feat: Claude Console账号增强,升级模型支持列表为模型映射表!
2025-07-31 00:19:10 +08:00
KevinLiao
3c797a85e0 feat: Claude Console账号增强,升级模型支持列表为模型映射表! 2025-07-30 23:13:59 +08:00
github-actions[bot]
acf8dbb970 chore: sync VERSION file with release v1.1.57 and rebuild frontend [skip ci] 2025-07-30 12:51:30 +00:00
Wesley Liddick
d66754a6ca Merge pull request #142 from kevinconan/main
fix: 会话窗口修复
2025-07-30 20:50:54 +08:00
KevinLiao
6216433b0b Merge branch 'main' of https://github.com/Wei-Shaw/claude-relay-service
# Conflicts:
#	web/admin-spa/dist/assets/LoginView-BJ0LLv16.js
#	web/admin-spa/dist/assets/LogoTitle-DHj-MjwS.js
#	web/admin-spa/dist/assets/MainLayout-CLydIeqJ.js
#	web/admin-spa/dist/assets/SettingsView-DicW12bL.js
#	web/admin-spa/dist/assets/index-HYE9xPuR.js
#	web/admin-spa/dist/index.html
#	web/admin-spa/src/components/apikeys/CreateApiKeyModal.vue
#	web/admin-spa/src/components/apikeys/EditApiKeyModal.vue
#	web/admin-spa/src/views/ApiKeysView.vue
2025-07-30 20:41:10 +08:00
KevinLiao
b86adcd6d2 fix: 1.修复ClaudeConsole账号设置为专属绑定的功能
2. 修复Claude 官方账号会话窗口计算错误的问题
2025-07-30 20:20:12 +08:00
github-actions[bot]
7aa1982810 chore: sync VERSION file with release v1.1.56 [skip ci] 2025-07-30 10:42:46 +00:00
Wesley Liddick
2962d0f43d Merge pull request #138 from geminiwen/main
fix: 修复仪表盘统计中遗漏 Claude Console 账户的问题
2025-07-30 18:42:33 +08:00
Gemini Wen
ef6de13084 fix: 修复仪表盘统计中遗漏 Claude Console 账户的问题
将 Claude Console 账户统计信息纳入系统概览,确保仪表盘显示完整的账户状态和健康检查。

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 17:22:40 +08:00
github-actions[bot]
334823a5e6 chore: sync VERSION file with release v1.1.55 and rebuild frontend [skip ci] 2025-07-30 08:20:24 +00:00
Wesley Liddick
7b36171a84 Merge pull request #137 from Alfonsxh/fix/api-key-dedicated-account-dropdown
fix: 修复创建 API Key 时专属账号下拉框无选项的问题
2025-07-30 16:19:51 +08:00
Alfonsxh
0fc9fab621 fix: 修复创建 API Key 时专属账号下拉框无选项的问题
问题描述:
- 创建 API Key 时,专属账号下拉框中没有显示任何账号选项
- 原因是前端代码使用了错误的过滤条件 `a.isDedicated`

解决方案:
- 将过滤条件修改为 `a.accountType === 'dedicated'`
- 后端返回的账号对象使用 `accountType` 属性(值为 'shared' 或 'dedicated')

其他修改:
- 更新 package.json 中的 build:web 和 install:web 脚本路径

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 16:16:16 +08:00
github-actions[bot]
18e67f5632 chore: sync VERSION file with release v1.1.54 and rebuild frontend [skip ci] 2025-07-30 07:38:48 +00:00
shaw
7116a6e043 优化仪表盘自动刷新UI布局
- 调整Element Plus日期选择器宽度为400px,确保时间完整显示
- 重新设计自动刷新控制的样式和布局
- 统一控制栏所有元素的高度,保持视觉一致性
- 使用更精致的开关组件和优化的交互效果

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 15:37:59 +08:00
shaw
1ca753c79a fix: 修复API Keys使用趋势图费用计算不准确的问题
- 使用模型级别的详细统计数据计算费用,而非固定模型
- 按实际使用的模型(sonnet/opus/haiku等)分别计算价格
- 累加各模型费用得到准确的总费用
- 降级方案改用sonnet模型(中等价格)而非haiku(最低价格)

问题原因:之前使用固定的haiku模型计算所有token的费用,导致价格偏低
解决方案:获取模型级别的使用数据,按实际模型价格计算

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 15:37:59 +08:00
shaw
321be986a6 feat: 优化仪表盘数据展示和用户体验
- 优化实时TPM显示格式,添加智能单位(K/M)
- 折线图tooltip添加token数单位格式化
- API Keys使用趋势图增加USD金额计算和显示
- 实现鼠标悬浮时数据倒序展示,前3名添加🥇🥈🥉标识
- 后端API添加费用计算支持
- 删除测试脚本,保持代码整洁

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 15:37:58 +08:00
shaw
21461863af fix: 修复实时RPM/TPM指标显示为0的问题
- 添加调试日志以追踪数据读取过程
- 修复getRealtimeSystemMetrics中的数据验证逻辑
- 添加测试脚本用于验证时间戳匹配问题
- 改进错误处理和日志记录

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 15:37:58 +08:00
shaw
a6ab6b7abe feat: 实现基于滑动窗口的实时RPM/TPM统计
- 添加系统级分钟统计,支持1-60分钟可配置时间窗口
- 新增 getRealtimeSystemMetrics 方法计算滑动窗口内的平均值
- 前端显示实时RPM/TPM,标注时间窗口和数据来源
- 修复 EditApiKeyModal 中模型限制和客户端限制复选框状态错误
- 优化性能:使用Pipeline批量操作替代Promise.all
- TPM包含所有token类型:input、output、cache_creation、cache_read
- 添加降级方案:实时数据不可用时返回历史平均值

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 15:37:57 +08:00
github-actions[bot]
363d1c3ed3 chore: sync VERSION file with release v1.1.53 and rebuild frontend [skip ci] 2025-07-30 04:51:05 +00:00
shaw
9a346a22d0 Merge branch 'dev' into main
合并dev分支的时区修复和其他改进:
- 修复仪表板图表时区处理问题
- 修复自定义时间选择器的UTC转换
- 删除dist构建产物目录
2025-07-30 12:50:20 +08:00
shaw
81917c281e fix(admin-spa): 彻底修复时区计算和显示问题
- 修复 getSystemTimezoneDay 函数:正确计算UTC+8时区对应的UTC时间
- 修复时间筛选框显示:昨天/前天显示正确的系统时区日期
- 修复自定义时间范围:正确处理系统时区到UTC的转换
- 简化时区计算逻辑,避免复杂的条件判断
2025-07-30 12:38:08 +08:00
shaw
2bfb61e1d9 build: 重新构建前端 - 包含UTC+8时区修复 2025-07-30 12:26:45 +08:00
shaw
9d8d698238 fix(admin-spa): 修复时区计算问题 - 使用固定的UTC+8时区
- 修复 getSystemTimezoneDay:正确计算UTC+8时区的起止时间
- 修复自定义时间转换:使用固定的UTC+8时区偏移
- 解决了时区数据未初始化导致的计算错误
2025-07-30 12:25:51 +08:00
shaw
1e82a6af8b build: 重新构建前端应用 - 包含时区转换修复 2025-07-30 12:14:42 +08:00
shaw
3188f4d058 fix(admin-spa): 修复时区转换计算错误
- 修复 getSystemTimezoneDay 函数:正确使用 Date.UTC 创建UTC时间,避免本地时区干扰
- 修复自定义时间范围转换:使用 Date.UTC 正确转换系统时区时间到UTC
- 解决了昨天/前天日期计算错误的问题
- 解决了自定义时间选择器8小时偏差的问题
2025-07-30 12:13:53 +08:00
shaw
4eedc2e6b5 fix(admin-spa): 修复仪表板时区处理 - 前端显示系统时区,发送UTC时间
- 简化 getSystemTimezoneDay 函数,正确处理系统时区到UTC的转换
- 修复 setDateFilterPreset 中昨天/前天的计算逻辑,使用本地时间计算日期
- 确保自定义时间选择器显示系统时区时间,但发送UTC时间给后端
- API Keys页面已经使用正确的时间范围参数,无需修改
2025-07-30 12:05:30 +08:00
github-actions[bot]
555834227f chore: sync VERSION file with release v1.1.52 and rebuild frontend [skip ci] 2025-07-30 03:37:10 +00:00