Commit Graph

153 Commits

Author SHA1 Message Date
ianshaw
6dcb27632e fix(gateway): 自定义错误码触发停止调度
- 修改 HandleUpstreamError 逻辑,启用自定义错误码时所有在列表中的错误码都会停止调度
- 添加 handleCustomErrorCode 函数处理自定义错误码的账号停用
- 前端添加 429/529 错误码的警告提示,因为这些错误码已有内置处理机制
- 更新 EditAccountModal、CreateAccountModal、BulkEditAccountModal 的错误码添加逻辑
2026-01-11 22:20:02 -08:00
IanShaw027
3dfb62e996 merge: 合并main分支最新改动
解决冲突:
- backend/internal/config/config.go: 合并Ops和Dashboard配置
- backend/internal/server/api_contract_test.go: 合并handler初始化
- backend/internal/service/openai_gateway_service.go: 保留Ops错误追踪逻辑
- backend/internal/service/wire.go: 合并Ops和APIKeyAuth provider

主要合并内容:
- Dashboard缓存和预聚合功能
- API Key认证缓存优化
- Codex转换支持
- 使用日志分区表
2026-01-11 23:15:01 +08:00
IanShaw027
2548800c3f feat(ui): 增强Select组件功能和样式 2026-01-11 20:56:27 +08:00
Wesley Liddick
2b2f7a6dec Merge pull request #237 from cyhhao/main
feat: 补充 OpenCode 使用密钥配置示例
2026-01-11 20:53:58 +08:00
cyhhao
aa1a3b9a74 fix: update OpenCode use-key examples 2026-01-11 20:29:32 +08:00
yangjianbo
32953405b1 fix(账号管理): 调度批量结果明细与刷新优化
补充批量调度返回 success_ids/failed_ids 并增加合约/单测

前端加入降级处理与部分失败提示,表格行使用稳定 key

测试: make test-frontend

测试: go test ./internal/service -run BulkUpdateAccounts -tags=unit

测试: go test ./internal/server -run APIContracts -tags=unit
2026-01-11 20:22:17 +08:00
IanShaw027
645609d441 merge: 正确合并 main 分支改动
合并 origin/main 最新改动,正确保留所有配置:
- Ops 运维监控配置和功能
- LinuxDo Connect OAuth 配置
- Update 在线更新配置
- 优惠码功能
- 其他 main 分支新功能

修复之前合并时错误删除 LinuxDo 和 Update 配置的问题。
2026-01-11 11:41:10 +08:00
IanShaw027
3a67002cfe merge: 合并主分支改动并保留 ops 监控实现
合并 main 分支的最新改动到 ops 监控分支。
冲突解决策略:保留当前分支的 ops 相关改动,接受主分支的其他改动。

保留的 ops 改动:
- 运维监控配置和依赖注入
- 运维监控 API 处理器和中间件
- 运维监控服务层和数据访问层
- 运维监控前端界面和状态管理

接受的主分支改动:
- Linux DO OAuth 集成
- 账号过期功能
- IP 地址限制功能
- 用量统计优化
- 其他 bug 修复和功能改进
2026-01-10 13:24:40 +08:00
long
d2fc14fb97 feat: 实现注册优惠码功能
- 支持创建/编辑/删除优惠码,设置赠送金额和使用限制
  - 注册页面实时验证优惠码并显示赠送金额
  - 支持 URL 参数自动填充 (?promo=CODE)
  - 添加优惠码验证接口速率限制
  - 使用数据库行锁防止并发超限
  - 新增后台优惠码管理页面,支持复制注册链接
2026-01-10 13:14:35 +08:00
Edric.Li
0a4641c24e feat(api-key): 添加 IP 白名单/黑名单限制功能 (#221)
* 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.
2026-01-09 21:59:32 +08:00
IanShaw027
8ae75e7f6e feat(前端UI): 实现运维监控前端界面
- 新增帮助提示组件(HelpTooltip.vue)
- 更新侧边栏添加 ops 监控菜单项
- 扩展设置视图集成 ops 配置面板
- 新增 ops 监控视图目录(dashboard, alerts, realtime, settings 等)
2026-01-09 21:00:04 +08:00
shaw
62dc0b953b Merge branch 'fix/table-pagination-and-features' 2026-01-09 20:42:05 +08:00
shaw
f060db0b30 fix: 加固 LinuxDo OAuth 登录安全与配置校验 2026-01-09 19:32:06 +08:00
IanShaw027
5e936fbf0e feat(admin): 添加账号批量调度开关功能
- 后端:支持批量更新账号的 schedulable 字段
  - 在 BulkUpdateAccountsRequest 中添加 schedulable 参数
  - 在 AccountBulkUpdate 中添加 schedulable 字段支持
  - 更新 repository 层批量更新 SQL 逻辑
- 前端:在账号管理页面添加批量调度控制
  - 新增"批量启用调度"和"批量停止调度"按钮
  - 添加 handleBulkToggleSchedulable 处理函数
  - 显示具体的成功提示信息(包含操作账号数量)
- 国际化:添加批量调度相关中英文翻译
- 优化:添加 search 参数标准化和验证(account_handler)
2026-01-09 19:26:32 +08:00
IanShaw027
3820232241 fix(admin): 修复表格批量操作和搜索功能问题
1. 恢复账号管理批量操作栏缺失的功能按钮
   - 添加"本页全选"按钮支持批量选择当前页所有账号
   - 添加"清除已选"按钮快速清空已选账号列表
   - 在重构拆分组件时遗漏,现已恢复

2. 修复分组管理搜索功能仅搜索当前页的问题
   - 前端:移除本地过滤逻辑,改用后端搜索
   - 后端:添加 search 参数支持,搜索名称和描述字段
   - 支持不区分大小写的模糊匹配
   - 统一所有管理页面的搜索体验
2026-01-09 18:58:06 +08:00
IanShaw
afcfbb458d fix(gemini): Google One 强制使用内置 OAuth client + 自动获取 project_id + UI 优化 (#212)
* fix(gemini): Google One 强制使用内置 OAuth client + 自动获取 project_id + UI 优化

## 后端改动

### 1. Google One 强制使用内置 Gemini CLI OAuth Client
**问题**:
- Google One 之前允许使用自定义 OAuth client,导致认证流程不稳定
- 与 Code Assist 的行为不一致

**解决方案**:
- 修改 `gemini_oauth_service.go`: Google One 现在与 Code Assist 一样强制使用内置 client (L122-135)
- 更新 `gemini_oauth_client.go`: ExchangeCode 和 RefreshToken 方法支持强制内置 client (L31-44, L77-86)
- 简化 `geminicli/oauth.go`: Google One scope 选择逻辑 (L187-190)
- 标记 `geminicli/constants.go`: DefaultGoogleOneScopes 为 DEPRECATED (L30-33)
- 更新测试用例以反映新行为

**OAuth 类型对比**:
| OAuth类型 | Client来源 | Scopes | Redirect URI |
|-----------|-----------|--------|-----------------|
| code_assist | 内置 Gemini CLI | DefaultCodeAssistScopes | https://codeassist.google.com/authcode |
| google_one | 内置 Gemini CLI (新) | DefaultCodeAssistScopes | https://codeassist.google.com/authcode |
| ai_studio | 必须自定义 | DefaultAIStudioScopes | http://localhost:1455/auth/callback |

### 2. Google One 自动获取 project_id
**问题**:
- Google One 个人账号测试模型时返回 403/404 错误
- 原因:cloudaicompanion API 需要 project_id,但个人账号无需手动创建 GCP 项目

**解决方案**:
- 修改 `gemini_oauth_service.go`: OAuth 流程中自动调用 fetchProjectID
- Google 通过 LoadCodeAssist API 自动分配 project_id
- 与 Gemini CLI 行为保持一致
- 后端根据 project_id 自动选择正确的 API 端点

**影响**:
- Google One 账号现在可以正常使用(需要重新授权)
- Code Assist 和 AI Studio 账号不受影响

### 3. 修复 Gemini 测试账号无内容输出问题
**问题**:
- 测试 Gemini 账号时只显示"测试成功",没有显示 AI 响应内容
- 原因:processGeminiStream 在检查到 finishReason 时立即返回,跳过了内容提取

**解决方案**:
- 修改 `account_test_service.go`: 调整逻辑顺序,先提取内容再检查是否完成
- 确保最后一个 chunk 的内容也能被正确显示

**影响**:
- 所有 Gemini 账号类型(API Key、OAuth)的测试现在都会显示完整响应内容
- 用户可以看到流式输出效果

## 前端改动

### 1. 修复图标宽度压缩问题
**问题**:
- 账户类型选择按钮中的图标在某些情况下会被压缩变形

**解决方案**:
- 修改 `CreateAccountModal.vue`: 为所有平台图标容器添加 `shrink-0` 类
- 确保 Anthropic、OpenAI、Gemini、Antigravity 图标保持固定 8×8 尺寸 (32px × 32px)

### 2. 优化重新授权界面
**问题**:
- 重新授权时显示三个可点击的授权类型选择按钮,可能导致用户误切换到不兼容的授权方式

**解决方案**:
- 修改 `ReAuthAccountModal.vue` (admin 和普通用户版本):
  - 将可点击的授权类型选择按钮改为只读信息展示框
  - 根据账号的 `credentials.oauth_type` 动态显示对应图标和文本
  - 删除 `geminiAIStudioOAuthEnabled` 状态和 `handleSelectGeminiOAuthType` 方法
  - 防止用户误操作

## 测试验证
-  所有后端单元测试通过
-  OAuth client 选择逻辑正确
-  Google One 和 Code Assist 行为一致
-  测试账号显示完整响应内容
-  UI 图标显示正常
-  重新授权界面只读展示正确

* fix(lint): 修复 golangci-lint 错误信息格式问题

- 将错误信息改为小写开头以符合 Go 代码规范
- 修复 ST1005: error strings should not be capitalized
2026-01-08 23:47:29 +08:00
Edric Li
70fcbd7006 feat(usage): add User-Agent column to usage logs
- Add user_agent field to UsageLog DTO and mapper
- Display User-Agent column in admin and user usage tables
- Add formatUserAgent helper to show friendly client names
- Include user_agent in Excel export
- Remove request_id column from admin usage table
2026-01-08 21:02:13 +08:00
shaw
169aa4716e Merge branch 'feature/account-expires-at' into main: feat: add account expires-at field and auto-pause expired accounts 2026-01-08 09:27:57 +08:00
LLLLLLiulei
2b528c5f81 feat: auto-pause expired accounts 2026-01-07 16:59:35 +08:00
Xu Kang
b19c7875a4 fix(i18n): use correct translation key for dashboard redeem code description (#194)
Changed dashboard.addBalance to dashboard.addBalanceWithCode to match the existing translation key in locale files.
2026-01-07 15:01:07 +08:00
shaw
fc8fa83fcc fix(keys): 修复代码框第一行多余空格问题
pre 标签会原样保留内部空白字符,导致 code 标签前的模板缩进
被渲染为实际空格。将 pre/code 标签写在同一行消除此问题。
2026-01-07 10:26:24 +08:00
shaw
d5ba7b80d3 fix(admin/usage): 恢复成本 Tooltip 明细并优化账号筛选
问题修复:
- 恢复 Cost Tooltip 的成本分项明细 (input_cost, output_cost, cache 成本)
- 修复 Token Tooltip 双分隔线显示问题
- 修复 Tooltip 翻译键缺失问题,新增 costDetails/tokenDetails
- 恢复 Excel 导出格式化 (aoa_to_sheet + 翻译列头)

功能优化:
- 账号筛选从前端搜索改为后端搜索,避免一次加载 1000 条数据
- 行为与用户/API Key 筛选保持一致 (debounce + 后端分页)
2026-01-07 09:35:21 +08:00
shaw
015974a27e feat(admin/usage): 优化管理员用量页面功能和体验
后端改进:
- 新增 GetStatsWithFilters 方法支持完整筛选条件
- Stats 端点支持 account_id, group_id, model, stream, billing_type 参数
- 统一使用 filters 结构体,移除冗余的分支逻辑

前端改进:
- 统计卡片添加"所选范围内"文字提示
- 优化总消费显示格式,清晰展示实际费用和标准计费
- Token 和费用列添加问号图标 tooltip 显示详细信息
- API Key 搜索框体验优化:点击即显示下拉选项
- 选择用户后自动加载该用户的所有 API Key
2026-01-06 22:19:07 +08:00
yangjianbo
1181b332f7 fix(前端): 修复编辑账号错误提示无法显示具体原因的问题
后端 API 返回 message 字段,但前端读取 detail 字段,导致无法显示具体错误信息。
现在优先读取 message 字段,兼容 detail 字段。

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 15:46:36 +08:00
yangjianbo
17ae51c0a0 merge: 合并远程分支并修复代码冲突
合并了远程分支 cb72262 的功能更新,同时保留了 ESLint 修复:

**冲突解决详情:**

1. AccountTableFilters.vue
   -  保留 emit 模式修复(避免 vue/no-mutating-props 错误)
   -  添加第三个筛选器 type(账户类型)
   -  新增 antigravity 平台和 inactive 状态选项

2. UserBalanceModal.vue
   -  保留 console.error 错误日志
   -  添加输入验证(金额校验、余额不足检查)
   -  使用 appStore.showError 向用户显示友好错误

3. AccountsView.vue
   -  保留所有 console.error 错误日志(避免 no-empty 错误)
   -  使用新 API:clearRateLimit 和 setSchedulable

4. UsageView.vue
   -  添加 console.error 错误日志
   -  添加图表功能(模型分布、使用趋势)
   -  添加粒度选择(按天/按小时)
   -  保留 XLSX 动态导入优化

**测试结果:**
-  Go tests: PASS
-  golangci-lint: 0 issues
-  ESLint: 0 errors
-  TypeScript: PASS

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 12:50:51 +08:00
yangjianbo
4790aced15 fix(前端): 修复 ESLint 代码规范问题
- 修复 AccountTableFilters.vue 中的 vue/no-mutating-props 错误,使用 emit 模式替代直接修改 props
- 修复 TypeScript 类型错误,支持 Select 组件的 null 值类型
- 为所有空 catch 块添加错误日志,提升代码可维护性和调试能力
- 涉及文件:AccountTableFilters.vue, UserAllowedGroupsModal.vue, UserApiKeysModal.vue, UserBalanceModal.vue, AccountsView.vue, UsageView.vue, DashboardView.vue, ProfileView.vue

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 12:42:06 +08:00
song
195e227c04 merge: 合并 upstream/main 并保留本地图片计费功能 2026-01-06 10:49:26 +08:00
shaw
752882a022 fix: Token 统计支持 M 单位并修复 lint 错误
- 用户仪表盘 Token 统计卡片支持 K/M 单位自动切换
- 更新 formatTokensK 工具函数支持百万级显示
- 修复 setup.go 中未检查返回值的 errcheck 错误
2026-01-06 10:13:12 +08:00
shaw
af753de481 fix: 修复账号修改代理更新无效的bug 2026-01-06 09:04:01 +08:00
shaw
706af2920f Merge branch 'fix/account-filters-menu-missing-features'
## Summary
- 修复账号管理页面组件拆分时遗漏的功能
- 统一所有内联 SVG 为 Icon 组件
- 修复 ProxySelector 选择"无代理"时发送错误值的问题

## Changes
- AccountTableFilters: 添加 Antigravity 平台选项、类型筛选器、inactive 状态
- AccountActionMenu: 恢复重置状态和清除限速按钮
- AccountsView: 修正 handleClearRateLimit 调用正确的 API
- ProxySelector: 修复选择"无代理"时发送 null 而不是 0

## Conflict Resolution
- ProxySelector.vue: 采用 PR 分支的正确逻辑(发送 null 而不是 0)
  这是正确的修复,因为后端使用 *int64 类型,nil 会触发 ClearProxyID()
2026-01-05 21:16:05 +08:00
shaw
4d078a8854 fix(admin): 修复零值字段无法保存的问题
- 用户允许分组:前端发送空数组而非 null 表示"允许全部"
- 账户代理:前端发送 0 而非 null 表示"无代理"
- 后端 UpdateAccount/BulkUpdate 正确处理 ProxyID=0 为清除代理
2026-01-05 20:53:38 +08:00
IanShaw027
4251a5a451 refactor(frontend): 完成所有组件的内联SVG统一替换为Icon组件
- 扩展 Icon.vue 组件,新增 60+ 图标路径
  - 导航类: arrowRight, arrowLeft, arrowUp, arrowDown, chevronUp, externalLink
  - 状态类: checkCircle, xCircle, exclamationCircle, exclamationTriangle, infoCircle
  - 用户类: user, userCircle, userPlus, users
  - 文档类: document, clipboard, copy, inbox
  - 操作类: download, upload, filter, sort
  - 安全类: key, lock, shield
  - UI类: menu, calendar, home, terminal, gift, creditCard, mail
  - 数据类: chartBar, trendingUp, database, cube
  - 其他: bolt, sparkles, cloud, server, sun, moon, book 等

- 重构 56 个 Vue 组件,用 Icon 组件替换内联 SVG
  - 净减少约 2200 行代码
  - 提升代码可维护性和一致性
  - 统一图标样式和尺寸管理
2026-01-05 20:22:48 +08:00
ianshaw
ef11abcbfd fix(frontend): 将 AccountTestModal 内联 SVG 替换为统一 Icon 组件 2026-01-05 02:33:51 -08:00
ianshaw
471b1c3eeb fix(frontend): 修复重构时遗漏的 SVG 图标,创建统一图标管理组件
- 创建 Icon.vue 统一管理 SVG 图标(20+ 常用图标)
- 修复 AccountActionMenu 中被错误替换为 emoji 的图标
- 修复 ProfileView 和 GroupsView 中的 emoji 图标
- 图标支持 size/strokeWidth 属性,便于复用
2026-01-04 22:26:33 -08:00
LLLLLLiulei
94750fb61f feat: add account notes field 2026-01-05 14:07:33 +08:00
ianshaw
5b57313c8a fix(frontend): 统一所有管理页面搜索框宽度为 w-full sm:w-64 2026-01-04 21:58:12 -08:00
ianshaw
c52c47e122 fix(frontend): 优化账号筛选工具条布局并修复IP管理表头翻译
- 筛选组件保持固定宽度,不再自动拉伸填充
- 左右分布布局,中间自然留空
- 修复 IP 管理页面表头缺失的中文翻译
2026-01-04 21:46:23 -08:00
ianshaw
e67dbbdb8a fix(frontend): 恢复 UsageTable 缺失的列和功能
- 恢复 API Key、账号、分组、类型、计费类型等列
- 恢复 Token 详情显示(含缓存读写)
- 恢复首Token时间、耗时列
- 恢复请求ID列及复制功能
2026-01-04 21:10:52 -08:00
ianshaw
85f53ef2dd fix(frontend): 完善表单校验并添加错误提示
- UserEditModal: 添加 email 必填和 concurrency 最小值校验
- UserAttributesConfigModal: 添加 key/name 必填和 options 非空校验
- GroupsView: 添加 name 必填校验
- ProxiesView: 添加 name/host 必填和 port 范围校验
- UserBalanceModal: 添加 amount 有效性和余额充足性校验
- RedeemView: 添加空兑换码错误提示
- i18n: 添加所有新增校验的中英文翻译
2026-01-04 20:22:59 -08:00
ianshaw
b05e90e4e4 fix(frontend): 修复账号管理页面组件拆分时遗漏的功能
- AccountTableFilters: 添加 Antigravity 平台选项、类型筛选器、inactive 状态
- AccountActionMenu: 恢复重置状态和清除限速按钮,添加 dark mode 样式
- AccountsView: 修正 handleClearRateLimit 调用正确的 API
2026-01-04 19:34:08 -08:00
ianshaw
118ca5cf6d fix: 修复空content处理及更新Gemini使用指南链接
- 修复FilterThinkingBlocksForRetry对空content数组的处理
- docker-compose添加SECURITY_URL_ALLOWLIST_UPSTREAM_HOSTS配置
- 更新Gemini使用指南链接:检查归属地、修改归属地、激活Gemini Web
2026-01-04 18:26:39 -08:00
IanShaw027
eef12cb900 refactor(frontend): 统一管理页面工具条布局和操作列样式
## 修复内容

### 1. 统一操作列按钮样式
- 所有操作列按钮统一为"图标+文字"垂直排列样式
- UsersView: 编辑和更多按钮添加文字标签
- 与 AccountsView、GroupsView 等页面保持一致

### 2. 统一顶部工具条布局(6个管理页面)
- 使用 flex + justify-between 布局
- 左侧:模糊搜索框、筛选器(可多行排列)
- 右侧:刷新、创建等操作按钮(靠右对齐)
- 响应式:宽度不够时右侧按钮自动换行到上一行

### 3. 修复的页面
- AccountsView: 合并 actions/filters 到单行工具条
- UsersView: 标准左右分栏,操作列添加文字
- GroupsView: 新增搜索框,左右分栏布局
- ProxiesView: 左右分栏,响应式布局
- SubscriptionsView: 新增用户模糊搜索,左右分栏
- UsageView: 补齐所有筛选项,左右分栏

### 4. 新增功能
- GroupsView: 新增分组名称/描述模糊搜索
- SubscriptionsView: 新增用户模糊搜索功能
- UsageView: 补齐 API Key 搜索筛选

### 5. 国际化
- 新增相关搜索框的 placeholder 文案(中英文)

## 技术细节
- 使用 flex-wrap-reverse 实现响应式换行
- 左侧筛选区使用 flex-wrap 支持多行
- 右侧按钮区使用 ml-auto + justify-end 保持右对齐
- 移动端使用 w-full sm:w-* 响应式宽度

## 验证结果
-  TypeScript 类型检查通过
-  所有页面布局统一
-  响应式布局正常工作
2026-01-05 01:00:00 +08:00
IanShaw027
64b52c4383 fix(frontend): 修复前端重构后的样式一致性和功能完整性
## 修复内容

### 1. AccountsView 功能恢复
- 恢复3个缺失的模态框组件:
  - ReAuthAccountModal.vue - 重新授权功能
  - AccountTestModal.vue - 测试连接功能
  - AccountStatsModal.vue - 查看统计功能
- 恢复 handleTest/handleViewStats/handleReAuth 调用模态框
- 修复 UpdateAccountRequest 类型定义(添加 schedulable 字段)

### 2. DashboardView 修复
- 恢复 formatBalance 函数(支持千位分隔符显示)
- 为 UserDashboardStats 添加完整 Props 类型定义
- 为 UserDashboardRecentUsage 添加完整 Props 类型定义
- 优化格式化函数到共享 utils/format.ts

### 3. 类型安全增强
- 修复 UserAttributeOption 索引签名兼容性
- 移除未使用的类型导入
- 所有组件 Props 类型完整

## 验证结果
-  TypeScript 类型检查通过(0 errors)
-  vue-tsc 检查通过(0 errors)
-  所有样式与重构前100%一致
-  所有功能完整恢复

## 影响范围
- AccountsView: 代码行数从974行优化到189行(提升80.6%可维护性)
- DashboardView: 保持组件化同时恢复所有原有功能
- 深色模式支持完整
- 所有颜色方案和 SVG 图标保持一致

Closes #149
2026-01-05 00:38:23 +08:00
IanShaw027
8664cff859 fix(frontend): 修复账号管理页面 Sync CRS 按钮国际化 2026-01-04 23:25:17 +08:00
IanShaw027
aa6f253374 merge: 合并 upstream/main 并解决冲突
解决了以下文件的冲突:
- backend/internal/handler/admin/setting_handler.go
  - 采用 upstream 的字段对齐风格和 *Configured 字段名
  - 添加 EnableIdentityPatch 和 IdentityPatchPrompt 字段

- backend/internal/handler/gateway_handler.go
  - 采用 upstream 的 billingErrorDetails 错误处理方式

- frontend/src/api/admin/settings.ts
  - 采用 upstream 的 *_configured 字段名
  - 添加 enable_identity_patch 和 identity_patch_prompt 字段

- frontend/src/views/admin/SettingsView.vue
  - 合并 turnstile_secret_key_configured 字段
  - 保留 enable_identity_patch 和 identity_patch_prompt 字段
2026-01-04 23:17:15 +08:00
shaw
46dda58355 Merge PR #146: feat: 提升流式网关稳定性与安全策略强化 2026-01-04 22:45:01 +08:00
IanShaw027
99308ab4fb refactor(frontend): comprehensive architectural optimization and base component extraction
- Standardized table loading logic with enhanced useTableLoader.
- Unified form submission patterns via new useForm composable.
- Extracted common UI components: SearchInput and StatusBadge.
- Centralized common interface definitions in types/index.ts.
- Achieved TypeScript zero-error status across refactored files.
- Greatly improved code reusability and maintainability.
2026-01-04 22:29:19 +08:00
IanShaw027
d4d21d5ef3 refactor(frontend): final component split and comprehensive type safety fixes
- Completed modular refactoring of KeysView.vue and SettingsView.vue.
- Resolved remaining TypeScript errors in new components.
- Standardized prop types and event emitters for sub-components.
- Optimized bundle size by eliminating redundant template code and unused script variables.
- Verified system stability with final type checking.
2026-01-04 22:23:19 +08:00
yangjianbo
f8e7255c32 feat(界面): 为 Gemini 配置片段添加语法高亮
补齐高亮渲染并保留纯文本回退
新增高亮 token 工具并做 HTML 转义
2026-01-04 22:19:11 +08:00
IanShaw027
e99063e12b refactor(frontend): comprehensive split of large view files into modular components
- Split UsersView.vue into UserCreateModal, UserEditModal, UserApiKeysModal, etc.
- Split UsageView.vue into UsageStatsCards, UsageFilters, UsageTable, etc.
- Split DashboardView.vue into UserDashboardStats, UserDashboardCharts, etc.
- Split AccountsView.vue into AccountTableActions, AccountTableFilters, etc.
- Standardized TypeScript types across new components to resolve implicit 'any' and 'never[]' errors.
- Improved overall frontend maintainability and code clarity.
2026-01-04 22:17:27 +08:00