1. 13 Mar, 2026 1 commit
    • Rose Ding's avatar
      feat: 数据库定时备份与恢复(S3 兼容存储,支持 Cloudflare R2) · 53ad1645
      Rose Ding authored
      
      
      新增管理员专属的数据库备份与恢复功能:
      - 全量 PostgreSQL 备份(pg_dump),gzip 压缩后上传到 S3 兼容存储
      - 支持手动备份和 cron 定时备份
      - 支持从备份恢复(psql --single-transaction)
      - 备份文件自动过期清理(默认 14 天)
      - 前端完整管理页面(S3 配置、定时配置、备份列表、恢复/下载/删除)
      - 内置 Cloudflare R2 配置教程弹窗
      - Dockerfile 从 postgres 镜像多阶段复制 pg_dump/psql,确保版本一致
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      53ad1645
  2. 12 Mar, 2026 2 commits
    • Peter's avatar
      80d8d6c3
    • erio's avatar
      feat(groups): add rate multipliers management modal · d6488112
      erio authored
      Add a dedicated modal in group management for viewing, adding, editing,
      and deleting per-user rate multipliers within a group.
      
      Backend:
      - GET /admin/groups/:id/rate-multipliers - list entries with user details
      - PUT /admin/groups/:id/rate-multipliers - batch sync (full replace)
      - DELETE /admin/groups/:id/rate-multipliers - clear all entries
      - Repository: GetByGroupID, SyncGroupRateMultipliers methods on
        user_group_rate_multipliers table (same table as user-side rates)
      
      Frontend:
      - New GroupRateMultipliersModal component with:
        - User search and add with email autocomplete
        - Editable rate column with local edit mode (cancel/save)
        - Batch adjust: multiply all rates by a factor
        - Clear all (local operation, requires save to persist)
        - Pagination (10/20/50 per page)
        - Platform icon with brand colors in group info bar
        - Unsaved changes indicator with revert option
      - Unit tests for all three backend endpoints
      d6488112
  3. 11 Mar, 2026 3 commits
    • John Doe's avatar
      feat: add Backend Mode toggle to disable user self-service · 6826149a
      John Doe authored
      
      
      Add a system-wide "Backend Mode" that disables user self-registration
      and self-service while keeping admin panel and API gateway fully
      functional. When enabled, only admin can log in; all user-facing
      routes return 403.
      
      Backend:
      - New setting key `backend_mode_enabled` with atomic cached reads (60s TTL)
      - BackendModeUserGuard middleware blocks non-admin authenticated routes
      - BackendModeAuthGuard middleware blocks registration/password-reset auth routes
      - Login/Login2FA/RefreshToken handlers reject non-admin when enabled
      - TokenPairWithUser struct for role-aware token refresh
      - 20 unit tests (middleware + service layer)
      
      Frontend:
      - Router guards redirect unauthenticated users to /login
      - Admin toggle in Settings page
      - Login page hides register link and footer in backend mode
      - 9 unit tests for router guard logic
      - i18n support (en/zh)
      
      27 files changed, 833 insertions(+), 17 deletions(-)
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      6826149a
    • 7976723's avatar
      fix: 修复 Chat Completions 编译错误和运行时 panic · a17ac501
      7976723 authored
      1. 修复 WriteFilteredHeaders API 不兼容(2处):
         将 s.cfg.Security.ResponseHeaders 改为 s.responseHeaderFilter,
         因为 main 分支已将函数签名改为接受 *responseheaders.CompiledHeaderFilter
      
      2. 修复 writer 生命周期导致的 nil pointer panic:
         ChatCompletions handler 替换了 c.Writer 但未恢复,导致
         OpsErrorLogger 中间件的 defer 释放 opsCaptureWriter 后,
         Logger 中间件调用 c.Writer.Status() 触发空指针解引用。
         通过保存并恢复 originalWriter 修复。
      
      3. 为 chatCompletionsResponseWriter 添加防御性 Status() 和
         Written() 方法,包含 nil 安全检查
      
      4. 恢复 gateway.go 中被误删的 net/http import
      a17ac501
    • 7976723's avatar
      feat: 添加 OpenAI Chat Completions 兼容端点 · 656a77d5
      7976723 authored
      
      
      基于 @yulate 在 PR #648 (commit 0bb6a392) 的工作,解决了与最新
      main 分支的合并冲突。
      
      原始功能(@yulate):
      - 添加 /v1/chat/completions 和 /chat/completions 兼容端点
      - 将 Chat Completions 请求转换为 Responses API 格式并转换回来
      - 添加 API Key 直连转发支持
      - 包含单元测试
      Co-authored-by: default avataryulate <yulate@users.noreply.github.com>
      656a77d5
  4. 10 Mar, 2026 2 commits
  5. 09 Mar, 2026 1 commit
    • QTom's avatar
      feat: 支持批量重置状态和批量刷新令牌 · 252d6c53
      QTom authored
      - 提取 refreshSingleAccount 私有方法复用单账号刷新逻辑
      - 新增 BatchClearError handler (POST /admin/accounts/batch-clear-error)
      - 新增 BatchRefresh handler (POST /admin/accounts/batch-refresh)
      - 前端 AccountBulkActionsBar 添加批量重置状态/刷新令牌按钮
      - AccountsView 添加 handler 支持 partial success 反馈
      - i18n 中英文补充批量操作相关翻译
      252d6c53
  6. 08 Mar, 2026 1 commit
  7. 07 Mar, 2026 2 commits
    • kyx236's avatar
      feat(admin): 支持定时测试自动恢复并统一账号恢复入口 · 0c29468f
      kyx236 authored
      - 为定时测试计划增加 auto_recover 配置,补齐前后端类型、接口、仓储与数据库迁移
      - 在定时测试成功后自动恢复账号 error、rate-limit 等可恢复运行时状态
      - 新增 /admin/accounts/:id/recover-state 接口,合并原有重置状态与清限流操作
      - 更新账号管理菜单与定时测试面板,补充自动恢复开关、说明提示和状态展示
      - 补充账号恢复、限流清理与仓储同步相关测试
      0c29468f
    • shaw's avatar
      feat: 支持后台设置是否启用整流开关 · a3791104
      shaw authored
      a3791104
  8. 06 Mar, 2026 2 commits
    • 神乐's avatar
      fix(openai): support remote compact task · 34039093
      神乐 authored
      34039093
    • alfadb's avatar
      feat(openai): add /v1/messages endpoint and API compatibility layer · ff1f1149
      alfadb authored
      Add Anthropic Messages API support for OpenAI platform groups, enabling
      clients using Claude-style /v1/messages format to access OpenAI accounts
      through automatic protocol conversion.
      
      - Add apicompat package with type definitions and bidirectional converters
        (Anthropic  Chat, Chat  Responses, Anthropic 
      
       Responses)
      - Implement /v1/messages endpoint for OpenAI gateway with streaming support
      - Add model mapping UI for OpenAI OAuth accounts (whitelist + mapping modes)
      - Support prompt caching fields and codex OAuth transforms
      - Fix tool call ID conversion for Responses API (fc_ prefix)
      - Ensure function_call_output has non-empty output field
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      ff1f1149
  9. 05 Mar, 2026 2 commits
    • erio's avatar
      feat: add quota limit for API key accounts · 05527b13
      erio authored
      - Add configurable spending limit (quota_limit) for apikey-type accounts
      - Atomic quota accumulation via PostgreSQL JSONB operations on TotalCost
      - Scheduler filters out over-quota accounts with outbox-triggered snapshot refresh
      - Display quota usage ($used / $limit) in account capacity column
      - Add "Reset Quota" action in account menu to reset usage to zero
      - Editing account settings preserves quota_used (no accidental reset)
      - Covers all 3 billing paths: Anthropic, Gemini, OpenAI RecordUsage
      
      chore: bump version to 0.1.90.4
      05527b13
    • guoyongchang's avatar
      feat: 支持基于 crontab 的定时账号测试 · 3a089242
      guoyongchang authored
      
      
      每个测试计划绑定一个账号和一个模型,按 cron 表达式定期执行测试,
      保存历史结果并在前端账号管理页面中提供完整的增删改查和结果查看功能。
      
      主要变更:
      - 新增 scheduled_test_plans / scheduled_test_results 两张表及迁移
      - 后端 service 层:CRUD 服务 + 后台 cron runner(每分钟扫描到期计划并发执行)
      - RunTestBackground 方法通过 httptest 在内存中执行账号测试并解析 SSE 输出
      - Redis leader lock + pg_try_advisory_lock 双重保障多实例部署只执行一次
      - REST API:5 个管理端点(计划 CRUD + 结果查询)
      - 前端 ScheduledTestsPanel 组件:计划管理、启用开关、内联编辑、结果展开查看
      - 中英文 i18n 支持
      Co-Authored-By: default avatarClaude Opus 4.6 <noreply@anthropic.com>
      3a089242
  10. 04 Mar, 2026 1 commit
  11. 03 Mar, 2026 1 commit
    • QTom's avatar
      feat(gateway): 系统设置控制未分组 Key 调度 — Handler 层中间件拦截 · 0c7cbe35
      QTom authored
      新增系统设置 allow_ungrouped_key_scheduling(默认关闭),
      未分组的 API Key 在网关请求时直接返回 403,
      由 RequireGroupAssignment 中间件统一拦截,
      支持 Anthropic / Google 两种错误格式响应。
      
      全栈实现:常量 → 结构体 → 解析/更新/初始化 → DTO → 管理接口 →
      中间件 → 路由注册 → 前端设置界面 + i18n。
      0c7cbe35
  12. 01 Mar, 2026 1 commit
    • erio's avatar
      feat(dashboard): add group usage distribution chart to usage page · 65459a99
      erio authored
      Add a doughnut chart showing usage statistics broken down by group on
      the admin usage records page. The chart appears alongside the existing
      model distribution chart (2-column grid), with the token usage trend
      chart moved to a separate full-width row below.
      
      Changes:
      - backend/pkg/usagestats: add GroupStat type
      - backend/service: add GetGroupStatsWithFilters interface method and implementation
      - backend/repository: implement GetGroupStatsWithFilters with LEFT JOIN groups
      - backend/handler: add GetGroupStats handler with full filter support
      - backend/routes: register GET /admin/dashboard/groups route
      - backend/tests: add GetGroupStatsWithFilters stubs to contract/sora tests
      - frontend/types: add GroupStat interface
      - frontend/api: add getGroupStats API function and types
      - frontend/components: add GroupDistributionChart.vue doughnut chart
      - frontend/views: update UsageView layout and load group stats in parallel
      - frontend/i18n: add groupDistribution, group, noGroup keys (zh + en)
      65459a99
  13. 28 Feb, 2026 3 commits
    • erio's avatar
    • QTom's avatar
      feat(admin): 添加管理员直接修改用户 API Key 分组的功能 · 000e621e
      QTom authored
      - 新增 PUT /api/v1/admin/api-keys/:id 端点,允许管理员修改任意用户 API Key 的分组绑定
      - 跳过用户级权限校验但保留分组有效性验证,修改后触发认证缓存失效
      - Service 层支持三态语义:nil=不修改,0=解绑,>0=绑定,<0=拒绝
      - 指针值拷贝保证安全隔离,负数 groupID 返回 400 INVALID_GROUP_ID
      - 前端 UserApiKeysModal 新增可点击的分组选择下拉框,支持多 Key 并发更新
      - 下拉支持视口翻转和滚动关闭,按钮有 disabled 和加载状态
      - 覆盖:后端 20 个单元测试 (Service 11 + Handler 9) + 前端 16 个 E2E 测试
      - golangci-lint 0 issues, make test-unit 全部通过
      000e621e
    • yangjianbo's avatar
      feat(sync): full code sync from release · bb664d9b
      yangjianbo authored
      bb664d9b
  14. 24 Feb, 2026 1 commit
    • erio's avatar
      feat: add mixed-channel precheck API for account-group binding · aaac1aac
      erio authored
      Add a dedicated CheckMixedChannel endpoint that allows the frontend
      to pre-validate mixed channel risk before submitting create/update
      requests. This improves UX by showing warnings earlier in the flow
      instead of only after form submission.
      
      Backend changes:
      - Add CheckMixedChannelRequest struct and CheckMixedChannel handler
      - Register POST /check-mixed-channel route
      - Expose CheckMixedChannelRisk as public method on AdminService
      - Simplify Create/Update 409 responses (remove details/require_confirmation)
      - Add comprehensive handler tests and stub methods
      
      Frontend changes:
      - Add checkMixedChannelRisk API function and TypeScript types
      - Refactor CreateAccountModal to precheck before step transition and submission
      - Refactor EditAccountModal to precheck before update submission
      - Replace pendingPayload pattern with action-based dialog flow
      aaac1aac
  15. 21 Feb, 2026 1 commit
  16. 19 Feb, 2026 2 commits
  17. 14 Feb, 2026 1 commit
  18. 12 Feb, 2026 2 commits
  19. 10 Feb, 2026 1 commit
    • Tian's avatar
      feat(antigravity): 支持 Refresh Token 批量导入创建 OAuth 账号 · c8f87a9c
      Tian authored
      后端新增 ValidateRefreshToken service 方法和 POST /oauth/refresh-token 端点,
      前端新增 API/Composable/UI 集成,OAuthAuthorizationFlow i18n 动态化,
      支持在 Antigravity 创建账号时批量粘贴 Refresh Token 自动验证并创建账号。
      c8f87a9c
  20. 09 Feb, 2026 1 commit
    • QTom's avatar
      feat(admin): 新增 CRS 同步预览和账号选择功能 · 5e0d7894
      QTom authored
      - 后端新增 PreviewFromCRS 接口,允许用户先预览 CRS 中的账号
      - 后端支持在同步时选择特定账号,不选中的账号将被跳过
      - 前端重构 SyncFromCrsModal 为三步向导:输入凭据 → 预览账号 → 执行同步
      - 改进表单无障碍性:添加 for/id 关联和 required 属性
      - 修复 Back 按钮返回时的状态清理
      - 新增 buildSelectedSet 和 shouldCreateAccount 的单元测试
      - 完整的向后兼容性:旧客户端不发送 selected_account_ids 时行为不变
      5e0d7894
  21. 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
  22. 07 Feb, 2026 1 commit
    • erio's avatar
      feat(antigravity): comprehensive enhancements - model mapping, rate limiting, scheduling & ops · 5e98445b
      erio authored
      Key changes:
      - Upgrade model mapping: Opus 4.5 → Opus 4.6-thinking with precise matching
      - Unified rate limiting: scope-level → model-level with Redis snapshot sync
      - Load-balanced scheduling by call count with smart retry mechanism
      - Force cache billing support
      - Model identity injection in prompts with leak prevention
      - Thinking mode auto-handling (max_tokens/budget_tokens fix)
      - Frontend: whitelist mode toggle, model mapping validation, status indicators
      - Gemini session fallback with Redis Trie O(L) matching
      - Ops: enhanced concurrency monitoring, account availability, retry logic
      - Migration scripts: 049-051 for model mapping unification
      5e98445b
  23. 05 Feb, 2026 5 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
      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
  24. 03 Feb, 2026 1 commit
  25. 02 Feb, 2026 1 commit
    • 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