1. 08 Feb, 2026 1 commit
    • bayma888's avatar
      feat(admin): add drag-and-drop group sort order · bac9e2bf
      bayma888 authored
      - Add `sort_order` field to groups table with migration
      - Add `PUT /api/v1/admin/groups/sort-order` API for batch update
      - Implement drag-and-drop UI using vue-draggable-plus
      - All queries now order groups by sort_order
      - Add i18n support (en/zh) for sort-related UI text
      - Update test stubs to satisfy new interface methods
      bac9e2bf
  2. 07 Feb, 2026 5 commits
  3. 05 Feb, 2026 10 commits
    • shaw's avatar
      feat: 新增全局错误透传规则功能 · 39e05a2d
      shaw authored
      支持管理员配置上游错误如何返回给客户端:
      - 新增 ErrorPassthroughRule 数据模型和 Ent Schema
      - 实现规则的 CRUD API(/admin/error-passthrough-rules)
      - 支持按错误码、关键词匹配,支持 any/all 匹配模式
      - 支持按平台过滤(anthropic/openai/gemini/antigravity)
      - 支持透传或自定义响应状态码和错误消息
      - 实现两级缓存(Redis + 本地内存)和多实例同步
      - 集成到 gateway_handler 的错误处理流程
      - 新增前端管理界面组件
      - 新增单元测试覆盖核心匹配逻辑
      
      优化:
      - 移除 refreshLocalCache 中的冗余排序(数据库已排序)
      - 后端 Validate() 增加匹配条件非空校验
      39e05a2d
    • LLLLLLiulei's avatar
      fix: remove unused listAllAccounts · 029994a8
      LLLLLLiulei authored
      029994a8
    • LLLLLLiulei's avatar
      fix: harden import/export flow · 37047919
      LLLLLLiulei authored
      37047919
    • LLLLLLiulei's avatar
      perf: batch fetch proxies for account export · 0b45d48e
      LLLLLLiulei authored
      0b45d48e
    • LLLLLLiulei's avatar
      feat: refine proxy export and toolbar layout · 0c660f83
      LLLLLLiulei authored
      0c660f83
    • LLLLLLiulei's avatar
      feat: add proxy import flow · ce9a247a
      LLLLLLiulei authored
      ce9a247a
    • LLLLLLiulei's avatar
      feat: add data import/export bundle · b4bd46d0
      LLLLLLiulei authored
      b4bd46d0
    • shaw's avatar
      feat: 支持用户专属分组倍率配置 · 2b192f7d
      shaw authored
      2b192f7d
    • shaw's avatar
      feat(auth): 实现 Refresh Token 机制 · 49a3c437
      shaw authored
      - 新增 Access Token + Refresh Token 双令牌认证
      - 支持 Token 自动刷新和轮转
      - 添加登出和撤销所有会话接口
      - 前端实现无感刷新和主动刷新定时器
      49a3c437
    • JIA-ss's avatar
      feat(gateway): filter /v1/usage stats by API Key instead of UserID · fa3ea5ee
      JIA-ss authored
      
      
      Previously the /v1/usage endpoint aggregated usage stats (today/total
      tokens, cost, RPM/TPM) across all API Keys belonging to the user.
      This made it impossible to distinguish usage from different API Keys
      (e.g. balance vs subscription keys).
      
      Now the usage stats are filtered by the current request's API Key ID,
      so each key only sees its own usage data. The balance/remaining fields
      are unaffected and still reflect the user-level wallet balance.
      
      Changes:
      - Add GetAPIKeyDashboardStats to repository interface and implementation
      - Add getPerformanceStatsByAPIKey helper (also fixes TPM to include
        cache_creation_tokens and cache_read_tokens)
      - Add GetAPIKeyDashboardStats to UsageService
      - Update Usage handler to call GetAPIKeyDashboardStats(apiKey.ID)
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      fa3ea5ee
  4. 03 Feb, 2026 9 commits
  5. 02 Feb, 2026 9 commits
    • bayma888's avatar
      feat(admin): add user balance/concurrency history modal · 606e29d3
      bayma888 authored
      - Add new API endpoint GET /admin/users/:id/balance-history with pagination and type filter
      - Add SumPositiveBalanceByUser for calculating total recharged amount
      - Create UserBalanceHistoryModal component with:
        - User info header (email, username, created_at, current balance, notes, total recharged)
        - Type filter dropdown (all/balance/admin_balance/concurrency/admin_concurrency/subscription)
        - Quick deposit/withdraw buttons
        - Paginated history list with icons and colored values
      - Add instant tooltip on balance column for better UX
      - Add z-index prop to BaseDialog for modal stacking control
      - Update i18n translations (zh/en)
      606e29d3
    • song's avatar
      chore: apply stashed changes · 3ecadf4a
      song authored
      3ecadf4a
    • song's avatar
      merge upstream main · 0170d19f
      song authored
      0170d19f
    • liuxiongfeng's avatar
      feat(groups): 添加从其他分组复制账号功能 · e1a4a7b8
      liuxiongfeng authored
      - 创建分组时可选择从已有分组复制账号
      - 编辑分组时支持同步账号(全量替换操作)
      - 仅允许选择相同平台的源分组
      - 添加完整的数据校验:去重、自引用检查、平台一致性检查
      - 前端支持多选源分组,带提示说明操作行为
      e1a4a7b8
    • liuxiongfeng's avatar
      feat(billing): 添加 Gemini 200K 长上下文双倍计费功能 · 45e1429a
      liuxiongfeng authored
      - 新增 CalculateCostWithLongContext 方法支持阈值双倍计费
      - 新增 RecordUsageWithLongContext 方法专用于 Gemini 计费
      - Gemini 超过 200K token 的部分按 2 倍费率计算
      - 其他平台(Claude/OpenAI)完全不受影响
      45e1429a
    • Zero Clover's avatar
      feat(ops): 支持过滤无效 API Key 错误,不写入错误日志 · ad1cdba3
      Zero Clover authored
      新增 IgnoreInvalidApiKeyErrors 开关,启用后 INVALID_API_KEY 和
      API_KEY_REQUIRED 错误将被完全跳过,不写入 Ops 错误日志。
      这些错误由用户错误配置导致,与服务质量无关。
      ad1cdba3
    • Zero Clover's avatar
      feat(ops): 将 USER_INACTIVE 错误排除在 SLA 统计之外 · 673caf41
      Zero Clover authored
      将账户停用 (USER_INACTIVE) 导致的请求失败视为业务限制类错误,不计入 SLA 和错误率统计。
      
      账户停用是预期内的业务结果,不应被视为系统错误或服务质量问题。此改动使错误分类更加准确,避免将预期的业务限制误报为系统故障。
      
      修改内容:
      - 在 classifyOpsIsBusinessLimited 函数中添加 USER_INACTIVE 错误码
      - 该类错误不再触发错误率告警
      
      Fixes Wei-Shaw/sub2api#453
      673caf41
    • JIA-ss's avatar
      feat(gateway): 增强 /v1/usage 端点返回完整用量统计 · c441638f
      JIA-ss authored
      
      
      为 CC Switch 集成增强 /v1/usage 网关端点,在保持原有 4 字段
      (isValid, planName, remaining, unit) 向后兼容的基础上,新增:
      
      - usage 对象:今日/累计的请求数、token 用量、费用,以及 RPM/TPM
      - subscription 对象(订阅模式):日/周/月用量和限额、过期时间
      - balance 字段(余额模式):当前钱包余额
      
      用量数据获取采用 best-effort 策略,失败不影响基础响应。
      Co-Authored-By: default avatarClaude Opus 4.5 <noreply@anthropic.com>
      c441638f
    • 小北's avatar
      feat: 向用户显示管理员调整余额的备注 · ae18397c
      小北 authored
      - 为RedeemCode DTO添加notes字段(仅用于admin_balance/admin_concurrency类型)
      - 更新mapper使其有条件地包含备注信息
      - 在用户兑换历史UI中显示备注
      - 备注以斜体显示,悬停时显示完整内容
      
      用户现在可以看到管理员调整其余额的原因说明。
      
      Changes:
      - backend/internal/handler/dto/types.go: RedeemCode添加notes字段
      - backend/internal/handler/dto/mappers.go: 条件性填充notes
      - frontend/src/api/redeem.ts: TypeScript接口添加notes
      - frontend/src/views/user/RedeemView.vue: UI显示备注信息
      ae18397c
  6. 30 Jan, 2026 2 commits
  7. 28 Jan, 2026 1 commit
  8. 27 Jan, 2026 3 commits