Commit Graph

32 Commits

Author SHA1 Message Date
KevinLiao
718733b78b feat: 增加账号session窗口管理与显示。后续可以据此优化账号轮转逻辑。
scripts目录有相关管理脚本,请自行探索
2025-07-28 15:51:38 +08:00
Edric Li
9193d64d2a feat: 添加 OEM 设置功能并统一 API 统计页面样式
- 添加 OEM 设置管理功能,支持自定义网站名称和图标
- 支持图标文件上传和 Base64 编码存储
- 实现动态更新网站标题和 favicon
- 统一 API 统计页面与管理页面的样式和布局
- 修复文本颜色显示问题,提升可读性
- 优化错误处理和默认值回退机制
- 移除测试文件和冗余代码

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 23:20:44 +08:00
KevinLiao
2de9c9e843 fix: 修复新增编辑APIKeys时,填写Token限制报错 2025-07-27 20:05:26 +08:00
KevinLiao
ac1e367a69 feat: 增加每日费用限制 2025-07-27 14:47:59 +08:00
Gemini Wen
5ca568e693 feat: format numbers >= million with M suffix and remove billion k formatting
- Update formatNumber function to display numbers >= 1 million with 'M' suffix
- Remove previous billion formatting with 'k' suffix
- Example: 2,500,000 displays as '2M' for better readability
- Use Math.floor() to ensure no decimal points in formatted numbers

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 10:50:39 +08:00
Gemini Wen
2dbcb9d6f3 fix: remove decimal points from k-formatted numbers
- Use Math.floor() to display whole numbers for billion+ values
- Example: 2,500,123,456 displays as '2,500,123k' instead of '2,500,123.456k'
- Cleaner display for large token numbers

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 10:04:21 +08:00
Gemini Wen
53e9e421c8 feat: format numbers >= billion with k suffix
- Update formatNumber function to display numbers >= 1 billion with 'k' suffix
- Example: 2,500,000,000 displays as '2,500,000k' for better readability
- Improves token statistics display for large numbers

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-27 10:02:16 +08:00
Wesley Liddick
383f33fa77 Merge pull request #72 from kevinconan/main
feat: 增加APIKey 客户端限制功能
2025-07-26 11:03:06 +08:00
Wesley Liddick
cf0eaf0534 Merge branch 'main' into main 2025-07-26 10:05:24 +08:00
kevinconan
441361f3b4 Merge branch 'Wei-Shaw:main' into main 2025-07-26 08:57:03 +08:00
csdbit
fb306242c2 给API Keys和账号管理列表增加关键字段排序 2025-07-26 01:53:23 +08:00
KevinLiao
b8c7c3e9f5 feat: 增加APIKey 客户端限制功能 2025-07-25 23:36:48 +08:00
leslie
1cf70a627f 添加claude账号维度计算token费用 2025-07-25 21:36:17 +08:00
KevinLiao
e8d795713a feat: API页面增加统计时间选择 2025-07-25 10:42:19 +08:00
breaker
6a22163d83 feat: 支持通过URL参数切换管理界面标签页
- 添加URL参数解析功能,支持 ?tab=apiKeys 等参数直接跳转到指定标签页
- 切换标签页时自动更新URL,方便分享和书签
- 支持浏览器前进后退按钮,保持标签页状态同步
- 默认dashboard标签页不显示URL参数,保持简洁
2025-07-25 09:53:28 +08:00
KevinLiao
f614d54ab5 fix: APIKey列表费用及Token显示不准确的问题,目前显示总数
feat: 增加APIKey过期设置,以及到期续期的能力
2025-07-25 09:53:16 +08:00
shaw
521ba99f48 refactor: 重构GitHub Actions发布流程和修复管理界面问题
- 删除旧的auto-release.yml工作流,避免循环触发问题
- 新增auto-version-bump.yml:自动同步VERSION文件与release版本
- 新增release-on-version.yml:基于VERSION文件变更自动创建release
- 更新docker-publish.yml:简化触发条件,仅在tag推送时构建
- 添加RELEASE_PROCESS.md文档:详细说明新的发布流程
- 修复web管理界面:解决OAuth账户token刷新和代理配置相关问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-24 11:30:54 +08:00
shaw
2f4730baba 优化: 替换第三方CDN资源以提升加载速度
- 将所有第三方资源从 bootcdn 迁移到 cdnjs.cloudflare.com
- 移除 SRI 完整性校验以避免哈希值不匹配问题
- 添加 DNS 预取和预连接以加速资源加载
- 调整脚本加载顺序,确保依赖关系正确
- 保持所有库版本号不变 (Vue 3.3.4, Element Plus 2.4.4, Chart.js 4.4.0)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-23 11:15:33 +08:00
shaw
e77945a3e3 fix: 修复 API Key 编辑时服务权限和 Gemini 专属账号字段不显示的问题
- 创建 API Key 时添加 permissions 和 geminiAccountId 字段发送到后端
- 编辑 API Key 时正确加载和保存 permissions 和 geminiAccountId 字段
- 更新 openEditApiKeyModal 函数以包含这两个字段
- 更新 updateApiKey 函数的请求体以发送这两个字段

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-22 17:10:04 +08:00
shaw
11318c22b0 feat: 优化 Gemini OAuth 授权流程,使用固定的 localhost 回调地址
- 将 Gemini OAuth 回调地址固定为 http://localhost:45462
- 更新前端提示文字为"复制oauth后的链接"
- 实现自动提取 localhost:45462 链接中的 code 参数功能
- 删除不再需要的 web/auth_gemini 路由
- 添加详细的用户操作说明和错误处理提示
- 支持两种输入方式:完整链接或仅授权码

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-22 11:42:54 +08:00
shaw
38c1fc4785 feat: 添加多模型支持和OpenAI兼容接口
- 新增 Gemini 模型支持和账户管理功能
- 实现 OpenAI 格式到 Claude/Gemini 的请求转换
- 添加自动 token 刷新服务,支持提前刷新策略
- 增强 Web 管理界面,支持 Gemini 账户管理
- 优化 token 显示,添加掩码功能
- 完善日志记录和错误处理

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-22 10:17:39 +08:00
shaw
088ce266ba feat: 添加API Key时间窗口限流功能并移除累计总量限制
- 新增时间窗口限流功能,支持按分钟设置时间窗口
- 支持在时间窗口内限制请求次数和Token使用量
- 移除原有的累计总量限制,只保留时间窗口限制
- Token统计包含所有4种类型:输入、输出、缓存创建、缓存读取
- 前端UI优化,明确显示限流参数的作用范围
- 限流触发时提供友好的错误提示和重置时间

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-20 15:58:00 +08:00
shaw
f962083752 feat: 为API Key添加模型限制功能
- 前端:在API Key创建和编辑表单中添加模型限制开关和标签输入
- 前端:支持动态添加/删除限制的模型列表
- 后端:更新API Key数据结构,新增enableModelRestriction和restrictedModels字段
- 后端:在中转请求时检查模型访问权限
- 修复:Enter键提交表单问题,使用@keydown.enter.prevent
- 优化:限制模型数据持久化,关闭开关时不清空数据

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-19 20:54:26 +08:00
shaw
f5968e518e feat: 改进管理界面弹窗体验和滚动条美化
- 修复API Key创建/编辑弹窗和账户信息修改弹窗在低高度屏幕上被遮挡的问题
- 为所有弹窗添加自适应高度支持,最大高度限制为90vh
- 美化Claude账户弹窗的滚动条样式,使用紫蓝渐变色与主题保持一致
- 添加响应式适配,移动设备上弹窗高度调整为85vh
- 优化滚动条交互体验,支持悬停和激活状态

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18 23:49:55 +08:00
shaw
4372b29252 fix: 修复管理界面用户菜单z-index层级问题
- 修复了querySelector语法错误,移除了无效的@click属性选择器
- 为用户菜单容器添加专门的类名user-menu-container
- 简化点击检测逻辑,提高代码可维护性
- 解决了控制台报错问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 21:07:50 +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
ee9bd4aea4 feat: 实现Claude账户专属绑定功能
- 添加账户类型(dedicated/shared)支持
- API Key可绑定专属账户,优先使用绑定账户
- 未绑定的API Key继续使用共享池和粘性会话
- 修复专属账户下拉框显示问题(isActive类型不匹配)
- 修复getBoundAccountName方法未定义错误
- 添加删除账户前的API Key绑定检查
- 完全保留原有粘性会话机制

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-17 08:50:12 +08:00
shaw
c16c6b63cf fix: 修复用户菜单显示问题和真实用户名显示
- 修复登录接口返回真实用户名而非输入用户名
- 新增获取当前用户信息的API接口(/web/auth/user)
- 修复前端用户名显示逻辑,页面初始化时获取真实用户名
- 提高下拉菜单z-index确保正确显示
- 解决用户名显示为Admin而非data/init.json中真实用户名的问题

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 17:26:02 +08:00
shaw
156bfa9b58 feat: 添加管理员账户信息修改功能
- 新增右上角用户菜单,包含修改账户信息和退出登录选项
- 实现修改用户名和密码功能,支持独立修改或同时修改
- 添加密码强度验证(最少8位)和确认密码验证
- 修改后自动退出登录,确保安全性
- 同步更新Redis和data/init.json文件,保持数据一致性
- 优化用户体验,提供实时反馈和错误提示

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 17:16:29 +08:00
shaw
12b41ceb25 feat: 添加API Key并发控制和编辑功能
- 新增API Key并发控制功能
  - 创建API Key时可设置并发限制(0为不限制)
  - 在认证中间件中实现并发检查
  - 使用Redis原子操作确保计数准确
  - 添加自动清理机制处理异常情况

- 新增API Key编辑功能
  - 支持修改Token限制和并发限制
  - 前端添加编辑按钮和模态框
  - 后端限制只能修改指定字段

- 其他改进
  - 添加test-concurrency.js测试脚本
  - 添加详细的功能说明文档
  - 所有代码通过ESLint检查

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16 09:48:07 +08:00
shaw
fbf942a5fd feat: 支持手动添加 Claude 账户 Access Token
- 添加 OAuth 和手动输入两种账户添加方式
- 支持直接输入 Access Token 和 Refresh Token
- 新增账户编辑功能,可更新 Token 和代理设置
- 优化 Token 刷新失败时的回退机制
- 改进用户体验,支持手动维护长期有效的 Token

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-15 19:28:14 +08:00
shaw
b1ca3f307e first commit 2025-07-14 18:14:13 +08:00