Commit Graph

131 Commits

Author SHA1 Message Date
shaw
7fa75df1fd fix: 修复分组调度功能和API Keys统计弹窗UI问题
1. 分组调度功能修复:
   - 统一使用 unifiedClaudeScheduler 和 unifiedGeminiScheduler
   - 修复 schedulable 字段数据类型不一致问题(布尔值/字符串)
   - 添加 _isSchedulable() 辅助方法确保兼容性
   - 修复所有路由文件中的调度器调用

2. API Keys 统计弹窗UI优化:
   - 统一弹窗样式与系统UI风格
   - 添加右上角关闭按钮
   - 修复移动端宽度问题(设置为95%屏幕宽度)
   - 使用 Teleport 组件和项目通用样式

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-05 17:06:52 +08:00
mouyong
c36ae32928 Merge branch 'main' of github.com:Wei-Shaw/claude-relay-service
* 'main' of github.com:Wei-Shaw/claude-relay-service:
  chore: sync VERSION file with release v1.1.72 [skip ci]
  fix: 修复账户管理和API Key管理的多个问题
  fix: 修复 GitHub Actions 版本检测对合并提交的处理
2025-08-04 20:34:38 +08:00
mouyong
54ad8452c3 feat: gemini 流式响应 2025-08-04 20:34:17 +08:00
shaw
a69d1ae1dd fix: 修复账户管理和API Key管理的多个问题
- 修复 Claude Console 账号 supportedModels 导致的 be.join 错误
- 添加专属账号选择器组件,支持搜索和按创建时间倒序排序
- 修复搜索框图标与placeholder文字重叠的问题
- 修复选择共享账号池后显示文字不正确的问题
- 优化下拉框定位逻辑,解决超出视窗无法滚动的问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 18:44:36 +08:00
shaw
ef4f7483d3 feat: 完善 Gemini 功能与 Claude 保持一致
- 添加 Gemini 账户的 schedulable 字段和调度开关 API
- 实现 Gemini 调度器的模型过滤功能
- 完善 Gemini 数据统计,记录 token 使用量
- 修复 Gemini 流式响应的 SSE 解析和 AbortController 支持
- 在教程页面和 README 中添加 Gemini CLI 环境变量说明
- 修复前端 Gemini 账户调度开关限制

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 16:53:11 +08:00
shaw
be98d5c498 fix: 修复账户管理页面移动端布局数据显示问题
- 修复移动端数据路径不一致问题(usage.dailyRequests -> usage.daily.requests)
- 增强移动端会话窗口显示,添加进度百分比、时间窗口和剩余时间
- 改进会话窗口UI,使用卡片样式更清晰展示信息
- 检查确认API Keys页面无类似问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 12:48:15 +08:00
shaw
fce6d8e1ac fix: 修复仪表盘和API统计页面的多个问题
- 修复仪表盘天粒度下7天/30天快捷选择无数据的问题
- 修复API Keys页面统计按钮链接路由错误(admin -> admin-next)
- 改进统计页面限制展示,使用3个进度条更直观显示使用情况
- 后端API响应增加当前使用量数据(currentWindowRequests/Tokens/DailyCost)
- 修复教程页面window.location.origin为空的兼容性问题
- 无限制时使用无穷符号(∞)展示,提升用户体验

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 11:58:26 +08:00
shaw
4e3c826b6c fix: 修复API Keys页面时间窗口进度条和Token数值显示问题
- 修复时间窗口限制的请求次数和Token使用量进度条不更新的问题
  - 在apiKeyService.getAllApiKeys()中添加获取当前窗口统计数据的逻辑
  - 从Redis读取rate_limit:requests和rate_limit:tokens键的值

- 优化Token数值展示,添加K/M单位格式化
  - UsageDetailModal组件中5处Token数值改用formatTokenCount
  - ApiKeysView模型统计中5处Token数值改用formatTokenCount
  - 统一使用K/M单位简化大数字显示

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 10:55:17 +08:00
shaw
2ceac331dd feat: 优化 API Keys 页面的分组显示和使用统计展示
- 修复分组调度显示,正确展示分组名称
- 重新设计使用统计列,添加进度条显示每日费用和窗口限制
- 创建使用详情弹窗组件,展示完整统计信息
- 优化时间窗口限制显示,支持请求次数和Token双维度进度条
- 改进移动端自适应布局
- 修复 ESLint 警告,提升代码质量

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 10:31:59 +08:00
shaw
9ef18a72bd chore: 停止跟踪 web/admin-spa/dist/ 构建文件
- 从 git 中移除 dist 目录的跟踪
- 这些文件由 GitHub Actions 自动构建生成
- 避免本地构建和远程构建之间的冲突

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 08:57:19 +08:00
千羽
a80b36896d feat: 更新 Gemini OAuth 流程支持新的授权方式
- 使用 codeassist.google.com 作为新的回调地址
- 实现 PKCE 认证流程增强安全性
- 更新前端授权流程指引
- 简化授权码输入流程

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 00:16:29 +08:00
github-actions[bot]
5378cb8910 chore: sync VERSION file with release v1.1.65 and rebuild frontend [skip ci] 2025-08-03 14:49:11 +00:00
shaw
dcf175b366 fix: 修复 web/admin-spa 合并冲突和构建错误
- 恢复 web/admin-spa 目录到 dev 分支状态
- 修复 ApiKeysView.vue 中的重复变量声明问题
- 重新构建前端项目确保正常运行

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 22:48:20 +08:00
shaw
a5c7eeaf84 fix: 修复专属账号下拉框,仅显示dedicated类型账号
- 修改CreateApiKeyModal和EditApiKeyModal的过滤逻辑
- 专属账号下拉框只显示accountType='dedicated'的账号
- 移除accountType='group'的账号,这些账号通过分组调度
- 更新标签文字为'专属账号'以更准确描述
2025-08-03 22:34:44 +08:00
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]
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
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]
0d98467688 chore: sync VERSION file with release v1.1.58 and rebuild frontend [skip ci] 2025-07-30 16:19:43 +00: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
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]
334823a5e6 chore: sync VERSION file with release v1.1.55 and rebuild frontend [skip ci] 2025-07-30 08:20:24 +00: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
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
Alfonsxh
fc5c24e1ca feat: 增强 API Key 标签选择功能
- 添加获取已存在标签的 API 端点 /admin/api-keys/tags
- 重构标签输入 UI,从下拉菜单改为平铺展示
- 支持点击选择已有标签,避免重复创建
- 增加弹框宽度 (max-w-4xl),改善布局和用户体验
- 统一创建和编辑 API Key 的标签管理体验

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 11:24:27 +08:00
shaw
6eae292922 fix(admin-spa): 修正时区计算双重偏移问题
- 重写getSystemTimezoneDay函数,修复之前的双重偏移错误
- 简化时间计算逻辑,直接使用Date.UTC创建系统时区时间
- 移除不必要的getDateInSystemTimezone调用

问题原因:
之前的实现在计算系统时区日期时进行了双重偏移,导致时间范围错误

修复后:
- 正确计算系统时区某一天的起止UTC时间
- "昨天"选项现在正确显示系统时区的完整一天(如29号0:00到29号23:59)
- 适配所有时区的用户,不依赖用户浏览器时区

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 11:01:51 +08:00
shaw
a265ebf335 fix(admin-spa): 修复仪表板图表时区处理问题
- 修复前端时间计算逻辑,正确处理不同时区用户的时间范围选择
- 添加系统时区信息到dashboard API响应
- 修改getSystemTimezoneDay函数,确保正确处理系统时区的日期转换
- 修复"昨天"和"前天"时间范围计算,基于系统时区而非用户时区
- 添加后端调试日志以便追踪时间转换问题

问题描述:
- 选择"昨天"时显示29号7:00到30号6:00(错误)
- 选择"近24小时"时显示29号17:00到30号17:00(错误)

修复后:
- "昨天"正确显示完整一天(如29号0:00到29号23:59)
- "近24小时"正确显示从当前时间往前24小时
- 支持所有时区的用户,不再硬编码UTC+8偏移

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-30 10:52:26 +08:00
shaw
496569d110 修复仪表板折线图时间范围计算错误(UTC+8时区) 2025-07-30 10:34:20 +08:00
shaw
43dce7db4e 合并 main 分支到 dev 分支 2025-07-30 10:18:35 +08:00