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
千羽
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
mouyong
9fca0b0c20
feat: gemini 支持
2025-08-05 01:19:23 +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
Alfonsxh
7cdb75bdaa
fix: 优化请求日志记录格式
...
- 将请求开始日志从 logger.request 改为 logger.info
- 调整请求完成日志的格式,使用更结构化的参数传递
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-30 11:35:22 +08:00
KevinLiao
ac1e367a69
feat: 增加每日费用限制
2025-07-27 14:47:59 +08:00
KevinLiao
b8c7c3e9f5
feat: 增加APIKey 客户端限制功能
2025-07-25 23:36:48 +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
9ad7feb94c
fix: 修复 OpenAI 路由中的 req.apiKeyData undefined 错误
...
- 将所有路由中的 req.apiKeyData 改为 req.apiKey(与中间件一致)
- 在 authenticateApiKey 中间件中添加缺失的字段(permissions, geminiAccountId, usage)
- 修复 openaiClaudeRoutes.js、openaiGeminiRoutes.js 和 geminiRoutes.js 中的引用错误
- 确保 API 权限检查正常工作
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-22 13:08:24 +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
567e3b25aa
feat: 优化并发控制和移除冗余限制功能
...
主要改进:
1. 改进并发控制机制
- 使用 once 代替 on 避免重复监听
- 监听多个事件确保可靠性(close、finish)
- 支持客户端断开时立即释放并发槽位
2. 支持非流式请求的客户端断开处理
- 客户端断开时立即中断上游请求
- 避免资源浪费和不必要的 API 调用
3. 移除 requestLimit(请求数限制)功能
- 移除配置和验证逻辑
- 保留请求统计用于监控分析
4. 移除速率限制(Rate Limit)功能
- 移除 RATE_LIMIT_* 配置
- 简化中间件逻辑
- 避免与并发控制重复
现在系统仅保留:
- Token 使用量限制
- 并发数限制(更精确的资源控制)
🤖 Generated with [Claude Code](https://claude.ai/code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-16 14:40:37 +08:00
shaw
08f93e9872
fix: 修复并发计数器在请求异常时不能正确减少的问题
...
- 增强事件监听机制
- 监听 req 的 close 和 aborted 事件
- 监听 res 的 finish 和 error 事件
- 使用标志位确保只减少一次计数
- 改进日志记录
- 增加并发计数增减的详细日志
- 记录请求关闭和中断事件
- 确保计数器安全性
- 使用 Lua 脚本原子操作防止负数
- 优化 Redis 操作逻辑
- 增强管理界面
- API Keys 列表显示当前并发数
- 并发数超过 0 时用橙色标记
- 显示当前并发数/限制数格式
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com >
2025-07-16 10:21:17 +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
b1ca3f307e
first commit
2025-07-14 18:14:13 +08:00