Commit Graph

143 Commits

Author SHA1 Message Date
Wesley Liddick
af06fe0f35 Revert "feat: 新增AD域控用户认证系统" 2025-08-28 08:49:05 +08:00
Wesley Liddick
9e8e74ce6b Merge pull request #292 from iRubbish/dev
feat: 新增AD域控用户认证系统
2025-08-28 08:43:21 +08:00
iRubbish
8a5d4b5d8f feat: 完善AD域控用户系统,增加配置说明
- 完善用户API Key创建流程,移除名称编辑权限
- 清理硬编码敏感信息,改用环境变量配置
- 在README.md和.env.example中添加AD域控配置说明
- 修复ESLint no-shadow错误
- 删除测试文件test-fixed-auto-link.js

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-26 15:55:13 +08:00
iRubbish
82f545c3b0 保存当前API Key管理功能的修改
- 统一用户创建和admin创建API Key的逻辑
- 修复admin更新用户创建的API Key功能
- 用户创建API Key名称改为displayName
- 默认无限制配置

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-26 13:42:02 +08:00
sczheng189
e69ab2161d feat: 实现账户多分组调度功能
- 添加账户分组管理功能,支持创建、编辑、删除分组
- 实现基于分组的账户调度逻辑
- 添加分组权重和优先级支持
- 提供测试脚本验证多分组调度功能
- 修复代码格式化问题(统一使用LF换行符)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 20:11:18 +08:00
iRubbish
7624c383e8 feat: 完整实现AD域控用户认证系统
主要功能:
- 新增LDAP服务连接AD域控服务器
- 实现多格式AD用户认证(sAMAccountName, UPN, 域\用户名, DN)
- 支持中文显示名和拼音用户名搜索
- 添加用户账户状态检查(禁用账户检测)
- 实现JWT token认证和用户会话管理

新增文件:
- src/services/ldapService.js - LDAP核心服务
- src/routes/ldapRoutes.js - AD认证API路由
- src/services/userMappingService.js - 用户映射服务
- web/admin-spa/src/views/UserDashboardView.vue - 用户控制台
- web/admin-spa/src/components/user/ - 用户组件目录

修改功能:
- ApiStatsView.vue 增加用户登录按钮和模态框
- 路由系统增加用户专用页面
- 安装ldapjs和jsonwebtoken依赖

技术特性:
- 多种认证格式自动尝试
- LDAP referral错误处理
- 详细认证日志和错误码记录
- 前后端完整用户认证流程

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-25 18:03:55 +08:00
shaw
e56a49d7ed fix: 修复codex 添加账号缺少oauth步骤 2025-08-24 16:47:45 +08:00
shaw
b426a759a8 feat: 支持后台配置webhook 2025-08-23 20:20:32 +08:00
shaw
74bcb99142 feat: 新增支持Azure OpenAI账户 2025-08-23 10:30:29 +08:00
shaw
e4e72ba5e9 fix: 修复仪表盘Keys统计展示问题 2025-08-23 08:55:52 +08:00
shaw
85c1e84b42 fix: 修复批量编辑组件的 Prettier 格式化问题
- 格式化所有不符合 Prettier 规范的代码
- 修复长标签元素的换行问题
- 确保前端构建成功通过
2025-08-22 22:29:58 +08:00
shaw
47a1b37243 feat: 为批量编辑API Keys组件添加暗黑模式支持
- 为所有文本、背景、边框添加暗黑模式样式
- 更新表单控件(输入框、选择框、按钮)的暗黑模式样式
- 确保与项目其他组件的暗黑模式风格保持一致
2025-08-22 22:24:33 +08:00
shaw
15c8478a96 Merge branch 'pr-272' into dev 2025-08-22 22:19:00 +08:00
shaw
d2f0ac37a9 feat: 支持Dark Mode 2025-08-22 22:09:38 +08:00
iRubbish
ee93018c20 增加 API keys 批量编辑管理 2025-08-22 16:12:04 +08:00
iRubbish
59d013f02f feat: 批量编辑API Keys功能优化和Bug修复
- 添加批量编辑API Keys路由和验证逻辑
- 修复标签操作(添加、移除、替换)功能
- 新增批量编辑前端组件,支持共享账号池选择
- 完善Bedrock账户显示和绑定功能
- 优化账户选择UI,统一所有平台选项
- 修复前端构建错误和代码格式问题
- 添加comprehensive测试场景文档

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-22 13:55:39 +08:00
shaw
4aa562be21 fix: 去除logger自动添加metadata字段 2025-08-20 21:45:48 +08:00
Wesley Liddick
d27c84b13b Merge pull request #262 from mouyong/dev
fix(proxy): 强制 SOCKS5 代理使用 IPv4
2025-08-20 21:43:40 +08:00
mouyong
54dca0f285 fix(frontend): 修复编辑分组模态框显示问题
WHAT: 修复账户分组管理中编辑分组表单无法显示的问题
WHY: 编辑模态框使用无效的 z-60 类名导致层级冲突,编辑表单被主模态框遮挡
HOW: 将编辑模态框的 z-index 类名从 z-60 改为 z-50,与主模态框同级但利用 DOM 顺序确保正确显示;保持其他样式和功能不变
2025-08-20 21:37:19 +08:00
iRubbish
1ee71ffbc9 feat: 完善 API Keys 批量删除功能并修复搜索跨选择问题
## 主要改进

### 🔧 核心修复
- 修复搜索时勾选状态无法保存的问题
- 优化全选/取消全选逻辑,支持跨搜索结果保持选择状态
- 改进批量删除的用户体验
- 添加 Unicode 字符处理中间件,提升请求体解析稳定性

### 🎯 具体变更
- **路由修复**: 解决批量删除路由匹配问题,调整路由顺序
- **API客户端**: 修复 DELETE 方法支持请求体数据传输
- **前端逻辑**: 分离筛选和搜索的监听器,搜索时保持已选中状态
- **全选优化**: 取消全选时只移除当前页选中项,保留其他页面选择
- **Unicode处理**: 添加无效 UTF-16 代理对清理和错误处理机制
- **配置管理**: 将 .mcp.json 添加到 .gitignore,避免本地配置被提交

### 🚀 用户体验提升
- 支持跨搜索结果批量选择和删除
- 批量删除按钮显示选中数量
- 智能的全选状态管理
- 更好的 Unicode 字符处理容错性

### 🧪 测试验证
- 验证搜索切换时选择状态保持
- 确认批量删除功能正常工作
- 检查 Redis 数据清理完整性
- 测试 Unicode 字符处理稳定性

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-19 09:59:54 +08:00
shaw
b1344fef8c fix: prettier format 2025-08-15 18:47:09 +08:00
shaw
812e98355f feat: 实现 OpenAI token 自动刷新功能并优化账户管理界面
主要更改:
1. OpenAI Token 自动刷新
   - 实现 refreshAccessToken 函数,支持 OAuth 2.0 refresh_token grant type
   - 使用 Codex CLI 官方 CLIENT_ID (app_EMoamEEZ73f0CkXaXp7hrann)
   - 支持 SOCKS5 和 HTTP/HTTPS 代理
   - 自动更新 access token、id token 和 refresh token

2. 账户管理界面优化
   - 移除手动刷新 token 按钮(桌面端和移动端)
   - 保留后端自动刷新机制
   - 优化代码结构,删除不再需要的函数和变量

3. 测试和文档
   - 添加 test-openai-refresh.js 测试脚本
   - 创建详细的实现文档

技术细节:
- Token 端点: https://auth.openai.com/oauth/token
- 默认有效期: 1小时
- 加密存储: AES-256-CBC

所有平台现在都支持自动 token 刷新:
 Claude - OAuth 自动刷新
 Gemini - Google OAuth2 自动刷新
 OpenAI - OAuth 自动刷新(新实现)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-15 16:56:44 +08:00
KevinLiao
f1febd320e fix: 去掉Free账号 2025-08-14 16:49:20 +08:00
KevinLiao
0e5f4e03c1 feat: 新增Claude账号订阅类型设置
1. OAuth可自动判断订阅类型,Setup Token请自行选择。无论那种类型都可以自己改
2. 优化调度,Pro账号不再接受opus模型请求的调度
2025-08-14 16:43:58 +08:00
shaw
5428462f55 fix: 修复 OpenAI 账户代理配置保存问题
- 修复 OAuth 方式添加 OpenAI 账户时缺少 priority 字段
- 修复创建 OpenAI 账户时错误检查 proxy.enabled 导致代理未保存
- 添加 OpenAI OAuth token 交换时的 SOCKS5 代理支持
- 添加 OpenAI API 请求转发时的代理支持
- 参考 Claude/Gemini 实现统一代理处理逻辑
2025-08-13 22:44:48 +08:00
Wesley Liddick
ceb1749859 Merge pull request #243 from tanaer/fixed
Fixed: 新增 Claude Console 账户限流机制开关
2025-08-13 17:49:47 +08:00
wt
171d35f33e Fix: Claude Console 账户的限流开关 2025-08-13 10:36:15 +08:00
wt
e338fb0e03 Fix: Claude Console 账户的限流开关 2025-08-13 00:05:03 +08:00
shaw
4ca9674772 feat: 完善多平台账户管理和API Keys页面展示
- 修复OpenAI路由中的gpt-5模型ID处理
- 增强统一调度器的账户选择日志输出
- 优化OAuth流程中的账户类型处理
- 完善API Keys页面的多平台账户信息展示

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 17:55:45 +08:00
Wesley Liddick
b250b6ee3b Merge pull request #235 from tanaer/feature
feat: 新增 Claude Console 账户限流机制开关
2025-08-12 16:21:10 +08:00
wt
6dfaf637aa feat: 新增 Claude Console 账户限流机制开关 2025-08-12 15:48:41 +08:00
shaw
b3cba9e091 feat: 完善API Keys页面多平台账户绑定信息展示
- 支持显示Claude、Gemini和OpenAI三个平台的账户绑定信息
- 添加账户状态提醒(不存在、专属、分组、共享池)
- 优化UI设计,使用彩色标签区分不同平台
- 改进响应式布局,适配移动端和平板设备
- 修复OpenAI账户绑定数量统计问题
- 修复删除账户时OpenAI绑定检查逻辑

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-12 15:01:56 +08:00
shaw
f462684f97 feat: 实现OpenAI账户管理和统一调度系统
- 新增 OpenAI 账户管理服务,支持多账户轮询和负载均衡
- 实现统一的 OpenAI API 调度器,智能选择最优账户
- 优化成本计算器,支持更精确的 token 计算
- 更新模型定价数据,包含最新的 OpenAI 模型价格
- 增强 API Key 管理,支持更灵活的配额控制
- 改进管理界面,添加教程视图和账户分组管理
- 优化限流配置组件,提供更直观的用户体验

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 13:58:43 +08:00
千羽
11fc856999 chore: commit all changes 2025-08-10 17:46:31 +09: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
Wesley Liddick
27ca140fc3 Merge pull request #219 from kevinconan/main
fix: 修复Claude Console账号的模型映射功能
2025-08-08 20:39:18 +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
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
千羽
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
千羽
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
KevinLiao
ae7f4e2405 fix: 修改Claude Console 账号的UA默认行为,默认透传客户端UA而非固定的UA值 2025-08-07 12:33:32 +08: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
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
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
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