1. 20 Jan, 2026 1 commit
  2. 19 Jan, 2026 8 commits
  3. 18 Jan, 2026 2 commits
  4. 16 Jan, 2026 2 commits
  5. 15 Jan, 2026 1 commit
  6. 14 Jan, 2026 5 commits
    • longgexx's avatar
      fix(admin): 修复使用记录页面趋势图筛选联动和日期选择问题 · 5efeabb0
      longgexx authored
         修复两个问题:
         1. Token使用趋势图和模型分布图未响应筛选条件
         2. 上午时段选择今天刷新后日期回退到前一天
      
         前端修改:
         - 更新 dashboard API 类型定义,添加 model、account_id、group_id、stream 参数支持
         - 修改 UsageView 趋势图加载逻辑,传递所有筛选参数到后端
         - 修复日期格式化函数,使用本地时区避免 UTC 转换导致的日期偏移
      
         后端修改:
         - Handler 层:接收并解析所有筛选参数(model、account_id、group_id、stream)
         - Service 层:传递完整的筛选参数到 Repository 层
         - Repository 层:SQL 查询动态添加所有过滤条件
         - 更新接口定义和测试 mock 以保持一致性
      
         影响范围:
         - /admin/dashboard/trend 端点现支持完整筛选
         - /admin/dashboard/models 端点现支持完整筛选
         - 用户在后台使用记录页面选择任意筛选条件时,趋势图和模型分布图会实时响应
         - 日期选择器在任何时区下都能正确保持今天的选择
      5efeabb0
    • LLLLLLiulei's avatar
      test: fix proxy repo stub · 02cb14c7
      LLLLLLiulei authored
      02cb14c7
    • LLLLLLiulei's avatar
      feat: enhance proxy management · 9bdb45be
      LLLLLLiulei authored
      9bdb45be
    • 墨颜's avatar
      feat(计费): 支持账号计费倍率快照与统计展示 · fb99ceac
      墨颜 authored
      - 新增 accounts.rate_multiplier(默认 1.0,允许 0)
      - 使用 usage_logs.account_rate_multiplier 记录倍率快照,避免历史回算
      - 统计/导出/管理端展示账号口径费用(total_cost * account_rate_multiplier)
      fb99ceac
    • IanShaw027's avatar
      fix(ops): 修复告警状态验证和错误处理逻辑 · 33f58d58
      IanShaw027 authored
      - 增强告警事件状态验证,添加合法状态值检查
      - 移除重试逻辑中的遗留字段赋值
      - 修正仓库不可用时的错误类型
      - 格式化测试文件代码
      33f58d58
  7. 11 Jan, 2026 5 commits
    • IanShaw027's avatar
      fix(lint): 修复代码格式和未使用变量问题 · ce3336e3
      IanShaw027 authored
      - 修复 ops_ws_handler.go 中的代码格式和返回值
      - 移除 ops_repo_latency_histogram_buckets.go 中不必要的错误检查
      - 修复 api_contract_test.go 缩进并添加运维监控配置项测试
      - 移除 ops_cleanup_service.go 中未使用的变量
      - 添加 ops_retry.go 中缺失的 status 字段
      ce3336e3
    • yangjianbo's avatar
      fix(账号管理): 调度批量结果明细与刷新优化 · 32953405
      yangjianbo authored
      补充批量调度返回 success_ids/failed_ids 并增加合约/单测
      
      前端加入降级处理与部分失败提示,表格行使用稳定 key
      
      测试: make test-frontend
      
      测试: go test ./internal/service -run BulkUpdateAccounts -tags=unit
      
      测试: go test ./internal/server -run APIContracts -tags=unit
      32953405
    • IanShaw027's avatar
      feat(ops): 添加运维监控配置开关 · c1a3dd41
      IanShaw027 authored
      - 在 .env.example 和 config.example.yaml 中添加 ops.enabled 配置项
      - 默认值为 true,保持现有行为
      - 当设置为 false 时,左侧栏隐藏运维监控菜单并禁用所有运维监控功能
      - 修改后端 GetSettings API,让 ops_monitoring_enabled 受 config.ops.enabled 控制
      - 数据清理和预聚合任务默认保持开启状态(通过运维监控设置对话框配置)
      c1a3dd41
    • yangjianbo's avatar
      fix(认证): 补齐余额与删除场景缓存失效 · cb3e08dd
      yangjianbo authored
      为 Usage/Promo/Redeem 注入认证缓存失效逻辑
      删除用户与分组前先失效认证缓存降低窗口
      补充回归测试验证失效调用
      
      测试: make test
      cb3e08dd
    • yangjianbo's avatar
      perf(认证): 引入 API Key 认证缓存与轻量删除查询 · 44a93c19
      yangjianbo authored
      增加 L1/L2 缓存、负缓存与单飞回源
      使用 key+owner 轻量查询替代全量加载并清理旧接口
      补充缓存失效与余额更新测试,修复随机抖动 lint
      
      测试: make test
      44a93c19
  8. 10 Jan, 2026 4 commits
  9. 09 Jan, 2026 7 commits
    • IanShaw027's avatar
      feat(运维监控): 增强监控功能和健康评分系统 · 585257d3
      IanShaw027 authored
      后端改进:
      - 新增健康评分计算服务(ops_health_score.go)
      - 添加分布式锁支持(ops_advisory_lock.go)
      - 优化指标采集和聚合逻辑
      - 新增运维指标采集间隔配置(60-3600秒)
      - 移除未使用的WebSocket查询token认证中间件
      - 改进清理服务和告警评估逻辑
      
      前端改进:
      - 简化OpsDashboard组件结构
      - 完善国际化文本(中英文)
      - 新增运维监控相关API类型定义
      - 添加运维指标采集间隔设置界面
      - 优化错误详情模态框
      
      测试:
      - 添加健康评分单元测试
      - 更新API契约测试
      585257d3
    • yangjianbo's avatar
      perf(网关): 复用分组上下文减少热路径查询 · 67554324
      yangjianbo authored
      新增 GetByIDLite 并在网关与 Gemini 选择流程复用上下文 group,避免 COUNT 触发
      更新 API key 中间件注入 group 上下文,减少重复查库
      补充 gateway/gemini 中间件与仓库层回归测试
      
      测试: make test
      67554324
    • Edric.Li's avatar
      feat(api-key): 添加 IP 白名单/黑名单限制功能 (#221) · 0a4641c2
      Edric.Li authored
      * feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking
      
      - Add IP restriction feature for API keys (whitelist/blacklist with CIDR support)
      - Add IP address logging to usage logs (admin-only visibility)
      - Remove billing_type column from usage logs UI (redundant)
      - Use generic "Access denied" error message for security
      
      Backend:
      - New ip package with IP/CIDR validation and matching utilities
      - Database migrations for ip_whitelist, ip_blacklist (api_keys) and ip_address (usage_logs)
      - Middleware IP restriction check after API key validation
      - Input validation for IP/CIDR patterns on create/update
      
      Frontend:
      - API key form with enable toggle for IP restriction
      - Shield icon indicator in table for keys with IP restriction
      - Removed billing_type filter and column from usage views
      
      * fix: update API contract tests for ip_whitelist/ip_blacklist fields
      
      Add ip_whitelist and ip_blacklist fields to expected JSON responses
      in API contract tests to match the new API key schema.
      0a4641c2
    • Edric Li's avatar
      fix: update API contract tests for ip_whitelist/ip_blacklist fields · e83f644c
      Edric Li authored
      Add ip_whitelist and ip_blacklist fields to expected JSON responses
      in API contract tests to match the new API key schema.
      e83f644c
    • IanShaw027's avatar
      test(后端): 更新 API 契约测试支持 ops 监控端点 · e8464580
      IanShaw027 authored
      - 更新 api_contract_test.go 包含 ops 相关端点测试
      e8464580
    • IanShaw027's avatar
      fix(admin): 代码审查修复 - 输入验证和测试完善 · 7c3d5cad
      IanShaw027 authored
      根据 Codex 代码审查报告,修复所有 P0 和 P1 优先级问题。
      
      ## P0 紧急修复
      
      ### 1. 修复集成测试编译错误
      - 更新 group_repo_integration_test.go 中所有 ListWithFilters 调用
      - 添加缺失的 search 参数(传入空字符串)
      - 修复 4 处旧签名调用,避免 CI 编译失败
      
      ### 2. 添加统一的 search 参数输入验证
      为所有 admin handler 添加一致的输入验证逻辑:
      - group_handler.go: 添加 TrimSpace + 长度限制
      - proxy_handler.go: 添加 TrimSpace + 长度限制
      - redeem_handler.go: 添加 TrimSpace + 长度限制
      - user_handler.go: 添加 TrimSpace + 长度限制
      
      验证规则:
      - TrimSpace() 去除首尾空格
      - 最大长度 100 字符(防止 DoS 攻击)
      - 超长输入自动截断
      
      ## P1 改进
      
      ### 3. 补充 search 功能的单元测试
      新增 admin_service_group_test.go 中的测试:
      - TestAdminService_ListGroups_WithSearch
        - search 参数正常传递到 repository 层
        - search 为空字符串时的行为
        - search 与其他过滤条件组合使用
      
      新增 admin_service_search_test.go 文件:
      - 为其他 admin API 添加 search 测试覆盖
      - 统一的测试模式和断言
      
      ### 4. 补充 search 功能的集成测试
      新增 group_repo_integration_test.go 测试场景:
      - TestListWithFilters_Search
        - 搜索 name 字段匹配
        - 搜索 description 字段匹配
        - 搜索不存在内容(返回空)
        - 大小写不敏感测试
        - 特殊字符转义测试(%、_)
        - 与其他过滤条件组合
      
      ## 测试结果
      
      -  编译检查通过
      -  单元测试全部通过 (3/3)
      -  集成测试编译通过
      -  所有 service 测试通过
      
      ## 影响范围
      
      修改文件: 8 个
      代码变更: +234 行 / -8 行
      
      ## 相关 Issue
      
      解决代码审查中的安全性和稳定性问题:
      - 防止 DoS 攻击(超长搜索字符串)
      - 修复测试编译错误(CI 阻塞问题)
      - 提升测试覆盖率
      7c3d5cad
    • admin's avatar
      refactor(auth): 将 Linux DO OAuth 配置迁移到系统设置 · d1c2a61d
      admin authored
      - 将 LinuxDo Connect 配置从环境变量迁移到数据库持久化
      - 在管理后台系统设置中添加 LinuxDo OAuth 配置项
      - 简化部署流程,无需修改 docker-compose.override.yml
      
      🤖 Generated with [Claude Code](https://claude.com/claude-code
      
      )
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      d1c2a61d
  10. 08 Jan, 2026 1 commit
  11. 06 Jan, 2026 1 commit
  12. 05 Jan, 2026 1 commit
  13. 04 Jan, 2026 2 commits
    • IanShaw027's avatar
      fix(backend): 修复 CI 失败问题 · 06216aad
      IanShaw027 authored
      修复内容:
      1. 修复 6 个 golangci-lint 错误
         - 3 个 errcheck 错误:在 gateway_request_test.go 中添加类型断言检查
         - 3 个 gofmt 格式化问题:修复代码格式
      2. 修复 API 契约测试失败
         - 在测试中添加缺失的字段:enable_identity_patch 和 identity_patch_prompt
      
      所有测试和 linter 检查现已通过。
      06216aad
    • IanShaw027's avatar
      fix(lint): 修复所有 Go 命名规范问题 · a4953785
      IanShaw027 authored
      - 全局替换 ApiKey → APIKey(类型、字段、方法、变量)
      - 修复所有 initialism 命名(API, SMTP, HTML, URL 等)
      - 添加所有缺失的包注释
      - 修复导出符号的注释格式
      
      主要修改:
      - ApiKey → APIKey(所有出现的地方)
      - ApiKeyID → APIKeyID
      - ApiKeyIDs → APIKeyIDs
      - TestSmtpConnection → TestSMTPConnection
      - HtmlURL → HTMLURL
      - 添加 20+ 个包注释
      - 修复 10+ 个导出符号注释格式
      
      验证结果:
      - ✓ golangci-lint: 0 issues
      - ✓ 单元测试: 通过
      - ✓ 集成测试: 通过
      a4953785