Commit Graph

38 Commits

Author SHA1 Message Date
mouyong
8bdf495ffa feat: enhance monitoring and Gemini service functionality
- Add enhanced monitoring scripts (monitor-enhanced.sh, status-unified.sh)
- Improve Gemini relay service with better error handling and token management
- Update authentication middleware for better compatibility
- Add new package dependencies for enhanced functionality
- Update .gitignore and app configuration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-09 14:06:56 +08:00
shaw
8085a00d24 chore: 更新 .gitignore 和管理脚本
- 在 .gitignore 中添加更多备份文件忽略规则
- 在 manage.sh 脚本中添加切换分支功能
- 优化脚本执行权限设置逻辑

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-08 20:36:33 +08:00
shaw
66857af148 feat: 在 API Keys 页面使用统计栏添加最后使用时间显示
- 在桌面端表格视图的使用统计列中增加最后使用时间
- 在移动端卡片视图的统计区域增加最后使用时间
- 添加 formatLastUsed 函数格式化时间显示
- 时间显示规则与 Accounts 页面保持一致(刚刚/X分钟前/X小时前/X天前/具体日期)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-08 20:27:20 +08:00
shaw
31bdb4aa8c feat: add comprehensive 401 error handling and account status management
- Add 401 error detection and automatic account suspension after 3 consecutive failures
- Implement account status reset functionality for clearing all error states
- Enhance admin interface with status reset controls and improved status display
- Upgrade service management script with backup protection and retry mechanisms
- Add mandatory code formatting requirements using Prettier
- Improve account selector with detailed status information and color coding

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-08 00:35:26 +08:00
千羽
8a74bf5afe refactor: standardize code formatting and linting configuration
- Replace .eslintrc.js with .eslintrc.cjs for better ES module compatibility
- Add .prettierrc configuration for consistent code formatting
- Update package.json with new lint and format scripts
- Add nodemon.json for development hot reloading configuration
- Standardize code formatting across all JavaScript and Vue files
- Update web admin SPA with improved linting rules and formatting
- Add prettier configuration to web admin SPA

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 18:19:31 +09:00
andersonby
657b7b0a05 feat: Add test scripts for Bedrock models and model mapping functionality 2025-08-06 19:23:36 +08:00
shaw
c972ea485d fix: manage.sh在centos上异常的问题 2025-08-06 14:18:56 +08:00
shaw
0c1eb3eae2 fix: 修复多个部署和管理脚本问题
- 修复workflow中web-dist分支推送node_modules的问题
  - 添加.gitignore文件排除node_modules
  - 使用git add --all -- ':\!node_modules'命令排除node_modules目录

- 修复scripts/manage.sh脚本问题
  - 移除软链创建时的覆盖询问,默认使用代码中的最新版本
  - 安装时自动给scripts/manage.sh添加执行权限
  - 创建软链时确保目标脚本有执行权限

- 修复CentOS 9系统上服务启动失败的问题
  - 改进systemd服务配置,添加环境变量和日志目录创建
  - 添加systemctl daemon-reload确保配置生效
  - 增加启动状态检查和失败时的npm回退机制

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 13:50:30 +08:00
shaw
616079b16b fix: 修复 web-dist 分支 README 文件日期变量替换问题
- 移除 heredoc 的单引号,允许变量和命令替换
- 确保 Build Date 能正确显示实际构建时间
- 同时修复了 workflow 和测试脚本中的相同问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 10:27:05 +08:00
shaw
1a423d3afd feat: 优化前端构建分发和模型价格更新机制
1. 前端构建分发优化:
   - 修改 GitHub Actions workflow,构建前端后推送到 web-dist 分支
   - 更新 manage.sh 安装脚本,从 web-dist 分支获取预构建文件
   - 解决部分机器无法本地编译前端的问题
   - 添加测试脚本 test-web-dist.sh 验证流程

2. 模型价格更新功能:
   - 添加手动更新模型价格脚本 update-model-pricing.js
   - 新增 npm run update:pricing 命令
   - 在 manage.sh 添加 update-pricing 命令和菜单选项
   - 支持备份、进度显示和统计信息

3. 其他改进:
   - 优化安装流程,减少对 Node.js 环境的依赖
   - 提供多种更新模型价格的方式
   - 改进错误处理和回退机制

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 10:24:03 +08:00
shaw
52718ef608 chore: 更新项目配置文件
- 更新 Docker 配置和构建脚本
- 优化项目文档和部署脚本

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-04 10:32:22 +08:00
shaw
29b331c7b4 fix: 修复 manage.sh 脚本软链接创建时的路径问题
- 修复找不到脚本文件 /root/claude-relay-service/app/manage.sh 的错误
- 优先使用项目中的 $APP_DIR/scripts/manage.sh 路径
- 改进 load_config 函数以支持不同的项目目录结构
- 添加 symlink 命令执行前的检查,确保 APP_DIR 已设置
- 增加详细的诊断信息输出,方便调试路径问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-03 23:17:05 +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
KevinLiao
d93ce8713d fix: 修复session窗口计算问题 2025-07-31 09:15:33 +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
KevinLiao
27efca3afb Merge branch 'main' of https://github.com/Wei-Shaw/claude-relay-service 2025-07-30 08:22:05 +08:00
KevinLiao
fddd5ee3e9 feat: 新增标准Claude Console API账号支持 2025-07-30 08:19:44 +08:00
shaw
25094fe5e7 feat(pricing): 添加模型价格文件本地fallback机制 2025-07-29 22:58:44 +08:00
shaw
f6948a04f6 Merge pull request #106 from kevinconan/main - feat: 账号管理页面,给Claude账号添加了会话窗口管理与显示 2025-07-29 11:08:56 +08:00
KevinLiao
718733b78b feat: 增加账号session窗口管理与显示。后续可以据此优化账号轮转逻辑。
scripts目录有相关管理脚本,请自行探索
2025-07-28 15:51:38 +08:00
shaw
4913be3b21 Merge remote-tracking branch 'origin/main' into dev 2025-07-28 09:30:33 +08:00
shaw
25ab1575ed feat: 改进 Gemini token 刷新测试脚本和添加解密测试脚本
- 修正加密盐值为 'gemini-account-salt'(之前错误使用了其他值)
- 在 test-gemini-refresh.js 中添加详细的调试信息
  - 显示配置信息和加密参数
  - 显示原始加密数据
  - 尝试手动解密并显示结果
  - 更详细的错误信息
- 添加 test-gemini-decrypt.js 用于单独测试解密功能

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 13:56:52 +08:00
shaw
24858f7e51 chore: 删除调试加解密相关脚本
根据用户要求删除临时调试脚本,准备重新分析加密流程

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 13:47:34 +08:00
shaw
adb1868899 feat: 添加修复默认密钥加密的 Gemini 账户脚本
- 检测使用默认密钥加密的数据
- 尝试用默认密钥解密后重新用当前密钥加密
- 解决密钥变更导致的解密失败问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 12:37:41 +08:00
shaw
b3cd97ab18 feat: 添加 Gemini token 修复和更新脚本
- fix-gemini-encryption.js: 诊断和修复加密问题
- update-gemini-token.js: 手动更新 refresh token 的工具

解决线上环境加密密钥不一致导致的解密失败问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 12:27:06 +08:00
shaw
8f0da8e914 fix: 修复 Gemini 解密调试脚本的密钥生成逻辑
- 使用 config.security.encryptionKey 而不是直接读取环境变量
- 添加 crypto.scryptSync 和 ENCRYPTION_SALT 以匹配实际加密逻辑
- 显示实际使用的加密配置信息

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 12:18:57 +08:00
shaw
a939fcebac feat: 添加 Gemini refreshToken 解密调试脚本
- 检查环境变量中的 ENCRYPTION_KEY
- 显示加密数据的格式信息
- 尝试新旧两种解密方法
- 输出详细的调试信息帮助定位问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 12:16:08 +08:00
shaw
71c2ef5d6d fix: 修复 Gemini token 刷新测试脚本的逻辑问题
- 移除错误的 refreshToken 占位符判断
- 直接使用 getAccount 获取解密后的完整账户信息
- 只有真正没有 refresh token 时才跳过测试

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 12:01:56 +08:00
shaw
dd73045223 feat: 改进 Gemini token 刷新机制和错误处理
- 修复 token 刷新时的错误处理逻辑
- 添加详细的错误日志记录
- 新增 test-gemini-refresh.js 测试脚本
- 更新 CLAUDE.md 文档,添加 Gemini token 刷新故障排除指南

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 11:41:17 +08:00
KevinLiao
e53724aa61 feat: 测试数据生成脚本 2025-07-25 10:47:09 +08:00
KevinLiao
f614d54ab5 fix: APIKey列表费用及Token显示不准确的问题,目前显示总数
feat: 增加APIKey过期设置,以及到期续期的能力
2025-07-25 09:53:16 +08:00
shaw
2e511fa6f8 refactor: 简化Docker部署,使用环境变量替代.env文件映射
- 移除 docker-compose.yml 中的 .env 文件映射
- 添加所有必要的环境变量到 docker-compose.yml
- 简化 docker-entrypoint.sh,直接使用环境变量
- 更新 README,说明通过环境变量配置的方式
- 删除不再需要的初始化脚本
- 解决了 sed -i 在某些 Docker 环境下的 'Resource busy' 错误
2025-07-24 15:51:10 +08:00
shaw
232c276c8c docs: 加强 Docker 部署时 .env 文件创建的说明和提示
- 在 docker-compose.yml 顶部添加醒目的注释说明必须先创建 .env 文件
- 更新 README.md,在 Docker 部署章节开头突出强调创建 .env 的重要性
- 解释为什么必须先创建文件(避免 Docker 创建成目录)
- 改进 docker-compose-init.sh 脚本,增加错误检测和修复功能
- 提供清晰的步骤指引和故障排除方法
2025-07-24 15:51:10 +08:00
shaw
5c83cf1d53 feat: 添加 Docker Hub 自动构建和改进部署体验
- 支持环境变量预设管理员账号密码
- 添加 docker-entrypoint.sh 自动初始化脚本
- 配置 GitHub Actions 自动构建多平台镜像(amd64, arm64)
- 添加版本标签管理和自动发布流程
- 集成 Trivy 安全漏洞扫描
- 更新文档说明 Docker Hub 使用方法
- 优化 Docker 部署用户体验

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19 00:49:04 +08:00
shaw
11873ed78b fix: 统一管理员密码管理机制,以init.json为唯一数据源
- app.js: 每次启动强制从init.json加载管理员凭据到Redis,确保数据一致性
- web.js: 修改密码时先更新init.json,成功后再更新Redis缓存
- cli/index.js: CLI创建管理员时同时更新init.json和Redis
- setup.js: 优化提示信息,明确重置密码需要重启服务
- admin.js: 修复Claude账户专属绑定功能的验证逻辑

解决了之前存在的双重存储同步问题,现在init.json是唯一真实数据源。

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 20:57:31 +08:00
shaw
b1ca3f307e first commit 2025-07-14 18:14:13 +08:00