1. 16 Jan, 2026 4 commits
  2. 15 Jan, 2026 1 commit
  3. 14 Jan, 2026 8 commits
    • IanShaw027's avatar
      fix(ops): 优化错误日志查询和详情展示 · 9584af5c
      IanShaw027 authored
      - 新增 GetErrorLogByID 接口用于获取单个错误日志详情
      - 优化 GetErrorLogs 过滤逻辑,简化参数处理
      - 简化前端错误详情模态框代码,提升可维护性
      - 更新相关 API 接口和 i18n 翻译
      9584af5c
    • 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
      feat(ops): 添加ops handler和路由配置 · 7c4309ea
      IanShaw027 authored
      7c4309ea
    • IanShaw027's avatar
      fix(ops): 修复告警状态验证和错误处理逻辑 · 33f58d58
      IanShaw027 authored
      - 增强告警事件状态验证,添加合法状态值检查
      - 移除重试逻辑中的遗留字段赋值
      - 修正仓库不可用时的错误类型
      - 格式化测试文件代码
      33f58d58
    • IanShaw027's avatar
      feat(handler): 新增ops管理接口和路由 · 659df6e2
      IanShaw027 authored
      - 添加告警静默管理接口
      - 扩展错误日志查询和操作接口
      - 新增重试和解决状态相关端点
      - 完善错误日志记录功能
      659df6e2
  4. 12 Jan, 2026 3 commits
    • IanShaw027's avatar
      feat(ops): 集成实时流量API接口 · 62771583
      IanShaw027 authored
      - 添加实时流量handler处理逻辑
      - 注册实时流量路由
      - 扩展ops service接口定义
      62771583
    • ianshaw's avatar
      feat(gateway): 添加流超时处理机制 · 2a0758bd
      ianshaw authored
      - 添加 StreamTimeoutSettings 配置结构体和系统设置
      - 实现 TimeoutCounterCache Redis 计数器用于累计超时次数
      - 在 RateLimitService 添加 HandleStreamTimeout 方法
      - 在 gateway_service、openai_gateway_service、antigravity_gateway_service 中调用超时处理
      - 添加后端 API 端点 GET/PUT /admin/settings/stream-timeout
      - 添加前端配置界面到系统设置页面
      - 支持配置:启用开关、超时阈值、处理方式、暂停时长、触发阈值、阈值窗口
      
      默认配置:
      - 启用:true
      - 超时阈值:60秒
      - 处理方式:临时不可调度
      - 暂停时长:5分钟
      - 触发阈值:3次
      - 阈值窗口:10分钟
      2a0758bd
    • IanShaw027's avatar
      feat(ops): 后端添加指标阈值管理API · 7536dbfe
      IanShaw027 authored
      - 新增GetMetricThresholds和UpdateMetricThresholds接口
      - 支持配置SLA、延迟P99、TTFT P99、请求错误率、上游错误率阈值
      - 添加参数验证逻辑
      - 提供默认阈值配置
      7536dbfe
  5. 11 Jan, 2026 9 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
    • IanShaw027's avatar
      fix(lint): 修复所有golangci-lint错误 · 54c5788b
      IanShaw027 authored
      - 修复depguard错误:为ops service文件添加redis导入例外
      - 修复errcheck错误:添加错误检查和类型断言检查
      - 修复gofmt错误:格式化代码
      - 修复ineffassign错误:移除无效的idx++赋值
      - 修复staticcheck错误:合并条件赋值
      - 修复unused错误:移除未使用的字段和函数
        - ops_cleanup_service.go: entryID字段
        - ops_retry.go: status字段
        - ops_upstream_context.go: getOpsUpstreamErrors函数
      54c5788b
    • yangjianbo's avatar
      fix(限流): 原子化 Redis 限流并支持故障策略 · 18b8bd43
      yangjianbo authored
      使用 Lua 脚本原子设置计数与过期,修复 TTL 缺失\n支持 fail-open/fail-close 并对优惠码验证启用 fail-close\n新增单元与集成测试覆盖关键分支\n\n测试:go test ./...
      18b8bd43
    • 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
    • IanShaw027's avatar
      feat(ops): 添加高级设置API支持 · 988b4d02
      IanShaw027 authored
      - 新增OpsAdvancedSettings数据模型
      - 支持数据保留策略配置(错误日志、分钟级指标、小时级指标)
      - 支持数据聚合开关配置
      - 添加GET/PUT /admin/ops/advanced-settings接口
      - 添加配置校验和默认值处理
      
      相关文件:
      - backend/internal/service/ops_settings_models.go
      - backend/internal/service/ops_settings.go
      - backend/internal/handler/admin/ops_settings_handler.go
      - backend/internal/server/routes/admin.go
      - backend/internal/service/domain_constants.go
      988b4d02
    • yangjianbo's avatar
      1a869547
    • 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
  6. 10 Jan, 2026 8 commits
    • yangjianbo's avatar
      fix(认证): 补齐余额与删除场景缓存失效 · 99e2391b
      yangjianbo authored
      为 Usage/Promo/Redeem 注入认证缓存失效逻辑
      删除用户与分组前先失效认证缓存降低窗口
      补充回归测试验证失效调用
      
      测试: make test
      99e2391b
    • yangjianbo's avatar
      perf(认证): 引入 API Key 认证缓存与轻量删除查询 · 9d0a4f3d
      yangjianbo authored
      增加 L1/L2 缓存、负缓存与单飞回源
      使用 key+owner 轻量查询替代全量加载并清理旧接口
      补充缓存失效与余额更新测试,修复随机抖动 lint
      
      测试: make test
      9d0a4f3d
    • Edric Li's avatar
    • Edric Li's avatar
      feat(settings): add home content customization and config injection · 5265b12c
      Edric Li authored
      - Add home_content setting for custom homepage (HTML or iframe URL)
      - Inject public settings into index.html to eliminate page flash
      - Support ETag caching with automatic invalidation on settings update
      - Add Vite plugin for dev mode settings injection
      - Refactor HomeView to use appStore instead of local API calls
      5265b12c
    • long's avatar
      feat: 实现注册优惠码功能 · 9f4d4e5a
      long authored
        - 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
        - 注册页面实时验证优惠码并显示赠送金额
        - 支持 URL 参数自动填充 (?promo=CODE)
        - 添加优惠码验证接口速率限制
        - 使用数据库行锁防止并发超限
        - 新增后台优惠码管理页面,支持复制注册链接
      9f4d4e5a
    • long's avatar
      feat: 实现注册优惠码功能 · d2fc14fb
      long authored
        - 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
        - 注册页面实时验证优惠码并显示赠送金额
        - 支持 URL 参数自动填充 (?promo=CODE)
        - 添加优惠码验证接口速率限制
        - 使用数据库行锁防止并发超限
        - 新增后台优惠码管理页面,支持复制注册链接
      d2fc14fb
    • yangjianbo's avatar
      test(分组): 增加无效上下文覆盖回归测试 · 435f6938
      yangjianbo authored
      补充 GatewayService 与 APIKey 中间件对无效 ctxkey.Group 的覆盖行为测试
      
      测试: make test-backend
      435f6938
    • yangjianbo's avatar
      fix(分组): 强化上下文分组可信校验 · 72f78f8a
      yangjianbo authored
      - 引入 Hydrated 标记限制复用来源
      
      - 无效上下文分组允许被新值覆盖自愈
      
      - 更新相关单测覆盖
      72f78f8a
  7. 09 Jan, 2026 7 commits
    • yangjianbo's avatar
      fix(分组): 防止降级环并校验上下文分组 · 2597fe78
      yangjianbo authored
      - 增加降级链路环检测并拦截配置
      
      - 仅复用合法分组上下文并必要时回退查询
      
      - 标注 GetByIDLite 轻量语义并补充测试
      2597fe78
    • 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
    • Edric Li's avatar
      feat(api-key): add IP whitelist/blacklist restriction and usage log IP tracking · 90798f14
      Edric Li authored
      - 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
      90798f14
    • IanShaw027's avatar
      test(后端): 更新 API 契约测试支持 ops 监控端点 · e8464580
      IanShaw027 authored
      - 更新 api_contract_test.go 包含 ops 相关端点测试
      e8464580