Commit Graph

615 Commits

Author SHA1 Message Date
Wesley Liddick
e09c1dda12 Merge pull request #227 from mouyong/dev-local
增强账户管理页面的平台筛选和缓存优化功能
2025-08-10 13:25:02 +08:00
Wesley Liddick
6c5d9bfab2 Merge pull request #225 from kevinconan/main[skip ci]
fix: 修复Claude Console账号模型映射的的流式响应
2025-08-10 13:24:49 +08:00
mouyong
4bcd2878f2 feat: 增强账户管理页面的平台筛选和缓存优化功能
- 添加平台筛选功能到账户管理页面
  * 后端:在所有账户接口中支持platform和groupId查询参数
  * 前端:添加平台筛选下拉框,支持条件性API请求

- 使用智能缓存机制优化数据加载
  * 缓存API Keys、账户分组和分组成员数据
  * 通过Ctrl/⌘+点击刷新按钮实现强制重新加载
  * 在数据变更时自动清除相关缓存(创建/编辑/删除)

- 改进Gemini账户限流状态显示
  * 在geminiAccountService中添加限流信息支持
  * 统一所有平台的限流状态格式
  * 修复仪表板统计,排除被限流的账户

- 提升用户界面体验
  * 将原生title提示替换为Element Plus的el-tooltip组件
  * 支持跨平台键盘快捷键(Ctrl/⌘+点击)
  * ESLint规范合规和代码格式化改进

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-10 12:40:24 +08:00
KevinLiao
87775c9fb1 fix: 修复Claude Console账号模型映射的的流式响应 2025-08-10 08:46:26 +08:00
github-actions[bot]
112ed7a289 chore: sync VERSION file with release v1.1.96 [skip ci] 2025-08-09 06:39:56 +00:00
Wesley Liddick
f270018721 Merge pull request #220 from mouyong/dev-local
增加监控 scripts, 增加 gemini 的路由
2025-08-09 14:39:43 +08:00
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
github-actions[bot]
6a8a668798 chore: sync VERSION file with release v1.1.95 [skip ci] 2025-08-08 12:39:30 +00:00
Wesley Liddick
27ca140fc3 Merge pull request #219 from kevinconan/main
fix: 修复Claude Console账号的模型映射功能
2025-08-08 20:39:18 +08:00
github-actions[bot]
62b0130387 chore: sync VERSION file with release v1.1.94 [skip ci] 2025-08-08 12:37:05 +00: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
KevinLiao
1ff0824a81 fix: 修复prettier格式化 2025-08-08 15:56:32 +08:00
KevinLiao
33df4bf943 fix: 恢复ClaudeConsole 账号模型映射能力 2025-08-08 15:18:41 +08:00
shaw
7e1a9daa6b feat: 完善管理界面功能和用户体验
- 添加 API Key 窗口倒计时组件 (WindowCountdown)
- 添加自定义下拉菜单组件 (CustomDropdown)
- 优化账户和 API Key 管理界面交互
- 改进教程页面布局和说明文字
- 完善账户状态显示和错误处理

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-08 14:14:46 +08:00
shaw
4adc8d9695 恢复并保存本地修改:仪表盘服务账户分类显示、WindowCountdown组件等功能 2025-08-08 11:56:24 +08:00
github-actions[bot]
5bed33cd9c chore: sync VERSION file with release v1.1.93 [skip ci] 2025-08-07 16:35:53 +00: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
github-actions[bot]
d8dd2faf72 chore: sync VERSION file with release v1.1.92 [skip ci] 2025-08-07 13:51:19 +00:00
Wesley Liddick
6b68604f88 Merge pull request #215 from qyinter/main
feat: add Setup Token OAuth flow for simplified Claude account setup
2025-08-07 21:51:05 +08:00
千羽
35e16038a5 feat: add Setup Token OAuth flow for simplified Claude account setup
Introduces a streamlined Setup Token authentication method that reduces the required OAuth scopes from 'org:create_api_key user:profile user:inference' to just 'user:inference', simplifying the account setup process for users who only need inference capabilities.

Key changes:
- Add Setup Token authorization endpoints in admin routes
- Implement Setup Token OAuth flow with PKCE support in oauthHelper
- Update AccountForm to support Setup Token as the default auth method
- Add automatic authorization code extraction from callback URLs
- Maintain full proxy configuration support for Setup Token flow
- Preserve existing OAuth flow for advanced users requiring API key creation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 22:48:48 +09:00
Wesley Liddick
5f01d87600 Merge pull request #213 from qyinter/main [skip ci]
refactor: standardize code formatting and linting configuration
2025-08-07 17:22:57 +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
github-actions[bot]
4a0eba117c chore: sync VERSION file with release v1.1.91 [skip ci] 2025-08-07 04:38:47 +00:00
Wesley Liddick
6626d1d32a Merge pull request #208 from kevinconan/main
fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值
2025-08-07 12:38:36 +08:00
Wesley Liddick
097f8d8d38 Merge pull request #206 from AndersonBY/main[skip ci]
fix: Update Claude console User Agent and fix bedrock encryption
2025-08-07 12:38:16 +08:00
KevinLiao
ae7f4e2405 fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值 2025-08-07 12:33:32 +08:00
andersonby
7ea899bd30 feat: add model name normalization for statistics aggregation in Redis and admin routes 2025-08-07 01:35:01 +08:00
andersonby
622c4047e9 fix: update account retrieval logic in BedrockAccountService to handle missing accounts and re-encrypt AWS credentials 2025-08-07 01:10:30 +08:00
andersonby
3dc0b7ff4f fix: improve decryption logic in BedrockAccountService to handle both encrypted and plaintext AWS credentials 2025-08-07 01:02:26 +08:00
andersonby
e553734e42 chore: update user agent version to 1.0.69 in claudeConsoleAccountService and claudeConsoleRelayService 2025-08-07 00:53:14 +08:00
github-actions[bot]
ec0e7671ae chore: sync VERSION file with release v1.1.90 [skip ci] 2025-08-06 16:43:40 +00:00
shaw
e57b98f343 fix: 修复 API Key 创建和编辑时账户绑定冲突问题
- 创建 API Key 时确保 OAuth 和 Console 账户不会同时设置
- 编辑 API Key 时正确清空未使用的账户类型字段
- 使用共享池时清空所有账户绑定

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-07 00:43:09 +08:00
github-actions[bot]
d6e472e849 chore: sync VERSION file with release v1.1.89 [skip ci] 2025-08-06 15:22:10 +00:00
Wesley Liddick
4bee81fb77 Merge pull request #204 from shinegod/feature/claude-code-client-support
feat: 全面增强 Claude Code 客户端支持与错误处理
2025-08-06 23:21:51 +08:00
Wesley Liddick
f63708cda4 Merge branch 'main' into feature/claude-code-client-support 2025-08-06 23:20:33 +08:00
shinegod
3616245d49 feat: 全面增强 Claude Code 客户端支持与错误处理
## 🚀 新功能
- **智能认证系统**: 根据 API Key 格式自动选择认证方式
  - `sk-ant-*` 开头使用 `x-api-key` 认证(兼容 Anthropic 官方)
  - 其他格式使用 `Authorization: Bearer` 认证(兼容标准 REST API)
- **Claude Code 客户端完整支持**: 新增必需的 API 端点
  - `GET /v1/models` - 返回支持的模型列表
  - `GET /v1/me` - 用户信息端点
  - `GET /v1/organizations/:org_id/usage` - 使用统计查询

## 🔧 修复与优化
- **HTTP 协议合规性**: 修复响应头冲突导致的 502 错误
  - 避免同时发送 `Content-Length` 和 `Transfer-Encoding` 头部
  - 优化响应头过滤机制,确保代理兼容性
- **完全透传错误响应**: 保持上游 API 原始响应格式
  - 透传原始状态码、响应头和内容
  - 移除错误包装,直接转发原始 JSON 格式
  - 支持流式和非流式请求的错误透传
- **流式响应处理优化**:
  - 添加 `validateStatus: () => true` 配置
  - 改进错误处理逻辑,避免异常中断

## 📝 代码质量
- 修复 ESLint 代码规范警告
- 优化敏感头部过滤列表
- 改进调试日志输出

## 🎯 解决的问题
- Claude Code 客户端无法连接(502 Bad Gateway)
- 错误响应被包装而非透传原始格式
- sk-ant-* 格式 API Key 认证失败
- HTTP/2 代理环境下的响应头冲突

##  测试验证
- 本地测试完全透传上游错误响应
- Claude Code 客户端连接测试通过
- 智能认证机制验证成功
- HTTP 协议合规性确认
2025-08-06 14:27:57 +00:00
github-actions[bot]
ffa8b49e9e chore: sync VERSION file with release v1.1.88 [skip ci] 2025-08-06 13:58:29 +00:00
Wesley Liddick
f2474d1b2e Merge pull request #203 from AndersonBY/main
Add AWS bedrock support
2025-08-06 21:58:10 +08:00
andersonby
d8f949fb47 fix: update Bedrock model format check to use includes method for better accuracy 2025-08-06 21:44:03 +08:00
andersonby
79951920ea fix: update placeholder text in AccountForm.vue to correct model name from hiku to haiku 2025-08-06 20:40:59 +08:00
andersonby
9f5db37114 fix: update default model in config.example.js to the latest version 2025-08-06 20:39:54 +08:00
andersonby
5883a60fba Merge upstream changes and resolve conflicts
- Merged latest changes from Wei-Shaw/claude-relay-service
- Resolved conflict in AccountForm.vue to support both Bedrock and improved platform switching logic
- Maintained Bedrock integration while incorporating Gemini pricing improvements

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 19:26:31 +08:00
andersonby
657b7b0a05 feat: Add test scripts for Bedrock models and model mapping functionality 2025-08-06 19:23:36 +08:00
github-actions[bot]
829a06f966 chore: sync VERSION file with release v1.1.87 [skip ci] 2025-08-06 10:10:11 +00:00
shaw
b1ea32caba feat: 添加Gemini定价功能和界面优化
- 实现Gemini定价查询服务,支持实时计算token成本
- 改进API Key管理界面,添加模型快速选择功能
- 优化账户表单组件的渲染性能
- 更新Gemini账户服务,增强token刷新和错误处理

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 18:09:43 +08:00
andersonby
9a9a82c86f feat: Add comprehensive Amazon Bedrock integration support
Add complete Amazon Bedrock integration to Claude Relay Service with:

## Core Features
-  Bedrock account management with encrypted AWS credential storage
-  Full request routing to AWS Bedrock with streaming support
-  Integration with unified Claude scheduler system
-  Support for Inference Profiles and Application Inference Profiles
-  Configurable default and small-fast model settings

## Backend Services
- Add bedrockAccountService.js for account management
- Add bedrockRelayService.js for request forwarding
- Integrate Bedrock accounts into unifiedClaudeScheduler.js
- Update admin and API routes to support Bedrock endpoints
- Add comprehensive configuration options to config.example.js

## Frontend Integration
- Complete Vue.js Web UI for Bedrock account management
- Account creation form with AWS credentials and model configuration
- Real-time account status monitoring and statistics
- Edit/update capabilities for existing accounts

## CLI Support
- Interactive CLI commands for Bedrock account operations
- Account creation, listing, updating, and testing
- Status monitoring and connection validation

## Security & Performance
- AES encrypted storage of AWS credentials in Redis
- Support for temporary credentials (session tokens)
- Region-specific configuration support
- Rate limiting and error handling

This integration enables the relay service to support three AI platforms:
1. Claude (OAuth) - Original Claude.ai integration
2. Gemini - Google AI integration
3. Amazon Bedrock - New AWS Bedrock integration

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-06 17:41:16 +08:00
github-actions[bot]
d6ba97381d chore: sync VERSION file with release v1.1.86 [skip ci] 2025-08-06 07:34:59 +00:00
Wesley Liddick
79e1955585 Merge pull request #199 from mouyong/dev-local
fix: 修复无法转发 opus 4.1 的问题
2025-08-06 15:34:46 +08:00
mouyong
80c6bed8c2 fix: 修复无法转发 opus 4.1 的问题 2025-08-06 15:26:49 +08:00