erio
ba98243cc2
feat(channel-monitor): gate UI by feature switch + polish form UX
...
- AppSidebar 三处菜单项(管理端渠道监控、用户端/个人页渠道状态)按
channel_monitor_enabled 条件展开,关闭时隐藏
- ChannelStatusView setInterval 随开关启停:关闭 clearInterval,
开启/未知态自动启动,避免禁用功能后仍在轮询
- MonitorFormDialog provider Select 改为 3 色单选按钮
(openai=emerald / anthropic=orange / gemini=sky),i18n 文案
供应商 → 平台 / Provider → Platform
- MonitorKeyPickerDialog 按钮列表改为 name/key/group 三列表格 +
搜索框,按 key.group.platform === provider 过滤,避免跨平台误选
- form.provider 变化时清空 api_key,修复切换平台仍保留旧 key 的
错配 bug
- providerPickerClass 抽取到 useChannelMonitorFormat composable,
统一 emerald/orange/sky 颜色语义,消除硬编码 Tailwind class 重复
- maskApiKey 工具函数统一(utils/maskApiKey.ts),KeysView 与
MonitorKeyPickerDialog 共用 slice(0,6)...slice(-4) 策略
- bump version to 0.1.114.27
2026-04-21 01:42:58 +08:00
erio
a1425b457d
feat(channel-monitor): redesign user dashboard as card grid
...
Reference check-cx UI: INTELLIGENCE MONITOR hero + 3-column card grid
with 60-point timeline bars.
Backend:
- Add PrimaryPingLatencyMs + Timeline[60] to UserMonitorView
- ListRecentHistoryForMonitors: batch CTE + ROW_NUMBER() window query
- indexLatestByModel / indexAvailabilityByModel helpers
Frontend:
- 7 new components: ProviderIcon, MonitorMetricPair, MonitorAvailabilityRow,
MonitorTimeline, MonitorHero, MonitorCard, MonitorCardGrid
- ChannelStatusView 381→~180 lines (delegated to subcomponents)
- AbortController reload concurrency protection
- HSL 0-120° availability color mapping
- Replace emoji with Icon component (bolt / globe)
- i18n: monitorCommon.* shared namespace, channelStatus.hero.*
Bump VERSION to 0.1.114.24
2026-04-20 23:38:59 +08:00
erio
20a4e41872
feat(monitor): admin channel monitor MVP with SSRF protection and batch aggregation
...
新增 admin「渠道监控」模块(参考 BingZi-233/check-cx),独立于现有 Channel 体系。
admin 配置 + 后台定时调用上游 LLM chat completions 健康检查 + 所有登录用户只读可见。
后端:
- ent: channel_monitor + channel_monitor_history(AES-256-GCM 加密 api_key)
- service 按职责拆分:service/aggregator/validate/checker/runner/ssrf
- provider strategy map 替代 switch(openai/anthropic/gemini)
- repository batch 聚合(ListLatestForMonitorIDs + ComputeAvailabilityForMonitors)消除 N+1
- runner: ticker(5s) + pond worker pool(5) + inFlight 防并发 + TrySubmit 防雪崩
+ 凌晨 3 点 cron 清理 30 天历史
- SSRF 防护:强制 https + 私网/loopback/云元数据 IP 拒绝(127/8、10/8、172.16/12、
192.168/16、169.254/16、100.64/10、::1、fc00::/7、fe80::/10)+ DialContext
在 socket 层防 DNS rebinding
- API key sanitize:擦除 url.Error 与上游响应 body 中的 sk-/sk-ant-/AIza/JWT 模式
- APIKeyDecryptFailed 标志位 + 单 monitor 路径检测,避免空 key 调用上游
handler:
- admin: CRUD + 手动触发 + 历史接口(api_key 脱敏)
- user: 只读列表 + 状态详情(去除 api_key/endpoint)
- ParseChannelMonitorID 共用 + dto.ChannelMonitorExtraModelStatus 共用
前端:
- 路由 /admin/channels/{pricing,monitor} + /monitor(用户只读)
- AppSidebar 父项 expandOnly 支持
- ChannelMonitorView 拆为 8 个子组件 + ChannelStatusView 拆出 detail dialog
- composables/useChannelMonitorFormat + constants/channelMonitor 共享
- i18n monitorCommon namespace 消除 admin/user 两 view 重复
合规:所有文件符合 CLAUDE.md(Go ≤ 500 行 / Vue ≤ 300 行 / 函数 ≤ 30 行)
CI: go build / gofmt / golangci-lint(0 issues) / make test-unit / pnpm build 全绿
2026-04-20 20:21:02 +08:00
shaw
4d0483f5b8
feat: 补充gpt生图模型测试功能
2026-04-22 18:12:03 +08:00
erio
bbc4aed3d9
fix(openai): 移除已下线 Codex 模型并修复归一化兜底副作用
...
- backend: 删除 gpt-5 / 5.1 / 5.1-codex / 5.1-codex-max / 5.1-codex-mini / 5.2-codex / 5.4-nano 的内置映射与 DefaultModels 条目
- backend: normalizeCodexModel 默认兜底由 gpt-5.1 改为 gpt-5.4,gpt-5.3-codex-spark 独立保留映射
- backend: 修复 isOpenAIGPT54Model 与 shouldAutoInjectPromptCacheKeyForCompat 对 claude / gpt-4o 的误判(之前依赖 gpt-5.1 作为非 GPT 族的隐式 sentinel,改后需要显式前缀守卫)
- backend: 清理 billing_service 中已不可达的 fallback 价格与 switch 分支
- frontend: 从白名单、OpenCode 配置、预设映射中移除已下线模型
- 同步更新所有相关单测
Refs: #1758 , parallels upstream #1759 but adds downstream guard fixes
2026-04-20 22:01:41 +08:00
shaw
a789c8c4c7
feat: 支持opus-4.7
2026-04-17 09:37:25 +08:00
erio
63f539b382
fix: merge general improvements from release branch
...
Backend:
- gateway_handler: pass subject.UserID instead of int64(0) for user-level routing
- setting_handler: add missing BalanceLowNotifyRechargeURL to UpdateSettings response
- openai_gateway_service: use applyAccountStatsCost for account stats pricing integration
- embed_on: add local file override (data/public/) for embedded frontend assets
Frontend:
- useTableSelection: add batchUpdate method for batch operations
- AccountsView: virtual scrolling params, Set-based isSelected, swipe virtualization
- ProxiesView: add batchUpdate to selection and swipe-select
- BulkEditAccountModal: fix submit handler to prevent event object as argument
- SettingsView: move payload construction outside try block
- i18n: add general translation keys (saved, deleted, view, validation, allowUserRefund)
- api/client: reorder error fields for consistency
- stores/payment: clarify pollOrderStatus JSDoc
2026-04-14 19:29:37 +08:00
erio
a9880ee7b9
fix: round-2 audit fixes — security, code quality, and UI improvements
...
Security (HIGH):
- Normalize all Redis cache keys to lowercase (verifyCode, passwordReset)
- Fix verify code TTL renewal on failed attempts: use remaining TTL via
ExpiresAt field instead of resetting to full 15-minute window
- Add 3 missing fields to diffSettings audit log (promo_code, invitation_code,
custom_endpoints)
Code quality (MEDIUM):
- Extract filterVerifiedEmails shared helper (balance_notify_service.go)
- Add Pricing array non-empty validation for channel pricing rules
- Add platform token semantics comment in gateway_service.go
- Complete validatePlanPatch test coverage (+10 test cases)
- Replace string types with QuotaThresholdType/QuotaResetMode across frontend
- Remove duplicate getPlatformTextColor/getRateBadgeClass in ChannelsView
- Return EMAIL_NOT_FOUND error on RemoveNotifyEmail miss
UI improvements:
- Reorder cost tooltip: user billing above separator, account billing below
- Add NaN guard to accountBilled function
- Move timezone selector inline into reset-mode row (no longer standalone)
2026-04-14 09:35:05 +08:00
erio
1b7c295199
refactor: M5 useQuotaNotifyState composable + H14 Vue file splits
...
M5: New composable frontend/src/composables/useQuotaNotifyState.ts
- Replaces 9 individual refs in both Create/Edit modals with reactive state
- Provides loadFromExtra/writeToExtra/reset helpers
- Eliminates ~120 lines of duplicated code across the two modals
H14: Vue file length violations fixed
- AdminPaymentPlansView.vue: 325 → 183 lines (extracted PlanEditDialog.vue)
- QuotaLimitCard.vue: 327 → 268 lines (extracted QuotaDimensionRow.vue)
- PlanEditDialog.vue: 181 lines (new, plan create/edit form)
- QuotaDimensionRow.vue: 108 lines (new, single quota dimension row)
2026-04-14 09:33:39 +08:00
IanShaw027
67a05dfccd
fix: honor table defaults and preserve dispatch mappings
2026-04-10 17:55:37 +08:00
IanShaw027
ad80606a44
feat(settings): 增加全局表格分页配置,支持自定义
2026-04-09 18:14:28 +08:00
erio
ff86154a03
refactor: remove unused OpenAIOAuthOptions after Sora platform removal
...
The options parameter only served to switch between 'openai' and 'sora'
platforms. With Sora removed, the parameter is unnecessary.
2026-04-05 17:19:27 +08:00
erio
fcee67e317
fix: remove remaining unused Sora variables causing TypeScript build failure
...
- Remove unused accessTokenInput ref from OAuthAuthorizationFlow
- Remove unused parsedSessionToken* computed and handleValidateSessionToken
- Prefix unused options parameter in useOpenAIOAuth
2026-04-05 17:19:27 +08:00
erio
155900e62f
fix: remove unused Sora references causing TypeScript build failure
...
- Remove handleImportAccessToken event binding from CreateAccountModal
- Remove unused imports/variables from OAuthAuthorizationFlow (useAppStore,
parsedAccessToken*, handleImportAccessToken)
- Remove unused oauthPlatform variable from useOpenAIOAuth composable
2026-04-05 17:19:27 +08:00
erio
62e80c602d
revert: completely remove all Sora functionality
2026-04-05 17:11:01 +08:00
QTom
91b1d812ce
feat(openai): Mobile RT 补全 plan_type、精确匹配账号、刷新时自动设置隐私
...
1. accounts/check 补全 plan_type:当 id_token 缺少 plan_type(如 Mobile RT),
自动调用 accounts/check 端点获取订阅类型
2. orgID 精确匹配账号:从 JWT 提取 poid 匹配正确账号,避免 Go map
遍历顺序随机导致 plan_type 不稳定
3. RT 刷新时设置隐私:调用 disableOpenAITraining 关闭训练数据共享,
结果存入 extra.privacy_mode,后续跳过重复设置
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-24 14:50:03 +08:00
QTom
1f05d9f79d
fix(openai): buildCredentials 对齐后端 BuildAccountCredentials 字段
...
补齐前端 buildCredentials 缺失的 id_token、email、plan_type 字段,
与后端 BuildAccountCredentials 保持一致。修复手动 RT 创建的账号
缺少订阅类型等关键信息的问题。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-24 14:50:03 +08:00
QTom
9f8cffe887
feat(openai): 新增"手动输入 Mobile RT"入口,使用 SoraClientID 刷新
...
在 OpenAI 平台添加独立的"手动输入 Mobile RT"选项,使用
client_id=app_LlGpXReQgckcGGUo2JrYvtJK 刷新 token,与现有
"手动输入 RT"(Codex CLI client_id)互不影响。
共享同一 UI 和批量创建逻辑,通过 clientId 参数区分。
同时修复空名称触发 ent NotEmpty() 校验导致 500 的问题。
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-24 14:50:03 +08:00
Wesley Liddick
a225a241d7
Merge pull request #1162 from remxcode/main
...
feat(openai): 增加 gpt-5.4-mini/nano 模型支持与定价配置
2026-03-20 13:57:47 +08:00
Wesley Liddick
7ec29638f4
Merge pull request #1147 from DaydreamCoding/feat/persisted-page-size
...
feat(frontend): 分页 pageSize 持久化到 localStorage,刷新后自动恢复
2026-03-19 21:53:54 +08:00
Remx
42d73118fd
feat(openai): 增加 gpt-5.4-mini/nano 模型支持与定价配置
...
- 接入 gpt-5.4-mini/nano 模型识别与规范化,补充默认模型列表
- 增加 gpt-5.4-mini/nano 输入/缓存命中/输出价格与计费兜底逻辑
- 同步前端模型白名单与 OpenCode 配置
- 补充 service tier(priority/flex) 计费回归测试
2026-03-19 19:03:13 +08:00
QTom
dfe99507b8
feat(frontend): 分页 pageSize 持久化到 localStorage,刷新后自动恢复
...
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com >
2026-03-19 12:44:03 +08:00
erio
a20c211162
perf(frontend): add virtual scrolling to DataTable
...
Replace direct row rendering with @tanstack/vue-virtual. The table
now only renders visible rows (~20) via padding <tr> placeholders,
eliminating the rendering bottleneck when displaying 100+ rows with
heavy cell components.
Key changes:
- DataTable.vue: integrate useVirtualizer (always-on), virtual row
template with measureElement for variable row heights, defineExpose
virtualizer/sortedData for external access, overflow-y/flex CSS
- useSwipeSelect.ts: dual-mode support via optional
SwipeSelectVirtualContext — data-driven row index lookup and
selection range when virtualizer is present, original DOM-based
path preserved for callers that don't pass virtualContext
2026-03-18 23:11:49 +08:00
SsageParuders
4644af2ccc
refactor: merge bedrock-apikey into bedrock with auth_mode credential
...
Consolidate two separate channel types (bedrock + bedrock-apikey) into
a single "AWS Bedrock" channel. Authentication mode is now distinguished
by credentials.auth_mode ("sigv4" | "apikey") instead of separate types.
Backend:
- Remove AccountTypeBedrockAPIKey constant
- IsBedrock() simplified; IsBedrockAPIKey() checks auth_mode
- Add IsAPIKeyOrBedrock() helper to eliminate repeated type checks
- Extend pool mode, quota scheduling, and billing to bedrock
- Add RetryableOnSameAccount to handleBedrockUpstreamErrors
- Add "bedrock" scope to Beta Policy for independent control
Frontend:
- Merge two buttons into one "AWS Bedrock" with auth mode radio
- Badge displays "Anthropic | AWS"
- Pool mode and quota limit UI available for bedrock
- Quota display in account list (usage bars, capacity badges, reset)
- Remove all bedrock-apikey type references
2026-03-14 17:13:30 +08:00
Ylarod
11f7b83522
sub2api: add bedrock support
2026-03-13 17:00:16 +08:00
Rose Ding
3fcefe6c32
feat: prioritize new gemini image models in frontend
2026-03-11 17:34:44 +08:00
Rose Ding
1c0519f1c7
feat: add gemini 2.5 flash image support
2026-03-11 15:21:52 +08:00
erio
0be003377f
feat(frontend): add swipe-to-select for admin tables
...
Squash of all swipe-select commits for clean rebase.
2026-03-08 21:07:43 +08:00
erio
2475d4a205
feat: add marquee selection box overlay during drag-to-select
...
Show a semi-transparent blue rectangle overlay while dragging to
select rows, matching the project's primary color theme with dark
mode support. The box spans the full table width from drag start
to current mouse position.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-03-08 01:45:22 +08:00
shaw
c0c322ba16
chore: openai账号模型映射新增claude->gpt快捷映射按钮
2026-03-07 10:26:30 +08:00
yangjianbo
f366026435
fix(openai): 修复 gpt-5.4 长上下文计费与快照白名单
...
补齐 gpt-5.4 fallback 的长上下文计费元信息,\n确保超过 272000 输入 token 时对整次会话应用\n2x 输入与 1.5x 输出计费规则。\n\n同时将官方快照 gpt-5.4-2026-03-05 加入前端\n白名单候选与回归测试,避免 whitelist 模式误拦截。\n\nCo-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
(cherry picked from commit d95497af87f608c6dadcbe7d6e851de9413ae147)
2026-03-06 10:16:23 +08:00
yangjianbo
1a0d4ed668
feat(openai): 增加 gpt-5.4 模型支持与定价配置
...
- 接入 gpt-5.4 模型识别与规范化,补充默认模型列表
- 增加 gpt-5.4 输入/缓存命中/输出价格与计费兜底逻辑
- 同步前端模型白名单与 OpenCode 上下文窗口(1050000/128000)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
(cherry picked from commit 924476dcac6181cd0f3ee731ec7b73672ff03793)
2026-03-06 10:16:23 +08:00
yangjianbo
bb664d9bbf
feat(sync): full code sync from release
2026-02-28 15:01:20 +08:00
erio
a6f9f9f968
feat: replace gemini-3-pro-image with gemini-3.1-flash-image
...
- Add migration 060 to update model_mapping for all antigravity accounts
- Remove gemini-3-pro-image and gemini-3-pro-image-preview mappings
- Add gemini-3.1-flash-image and gemini-3.1-flash-image-preview mappings
- Update frontend usage window to show GImage for new model
- Update isImageGenerationModel to support new model
2026-02-27 09:52:50 +08:00
cagedbird043
32b7c0ca9b
feat(frontend): 补齐 GPT-5.3 系列模型到白名单、批量编辑列表与预设映射
...
- useModelWhitelist.ts 添加 gpt-5.3-codex、gpt-5.3-codex-spark
- BulkEditAccountModal.vue 添加 5.3 模型选项与预设按钮(含 5.2→5.3 升级映射)
2026-02-26 16:04:15 +08:00
cagedbird043
f955b04a6f
feat(frontend): 补齐 Antigravity Claude 4.6 前端预设映射与显示
2026-02-26 14:27:51 +08:00
huangenjun
26060e702f
feat: Sora 平台支持手动导入 Access Token
...
新增 Access Token 输入方式,支持批量粘贴(每行一个)直接创建账号,
无需经过 OAuth 授权流程。
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-25 11:33:07 +08:00
Wesley Liddick
609abbbd7c
Merge pull request #624 from cagedbird043/pr/antigravity-gemini31-passthrough-buttons
...
feat: 补充 Antigravity 的 Gemini 3.1 Pro 透传快捷按钮
2026-02-25 08:45:49 +08:00
erio
8365a8328b
merge: resolve conflicts with upstream/main (Gemini 3→3.1 mappings)
2026-02-25 00:38:39 +08:00
erio
c671e8dd1d
fix: 统一gemini-3默认映射为非强制3.1
2026-02-24 23:24:48 +08:00
cagedbird043
c008649584
feat: 补充 antigravity 的 Gemini 3.1 Pro 透传快捷按钮
2026-02-24 22:53:53 +08:00
cagedbird043
076c00063d
feat: 补全 antigravity 模型映射快捷按钮
2026-02-24 20:31:36 +08:00
erio
645f283108
feat: add claude-sonnet-4-6 and gemini-3.1-pro model support
...
Add claude-sonnet-4-6 to identity injection modelInfoMap and
Antigravity model selector. Add gemini-3.1-pro-high/low to
Antigravity model list and Sonnet 4.6 preset mapping.
2026-02-24 19:30:01 +08:00
Wesley Liddick
84bd881e68
Merge pull request #608 from cagedbird043/feature/gemini-3-to-3.1-mapping
...
feat: Antigravity 将 gemini-3-pro 路由升级到 gemini-3.1-pro
2026-02-24 14:08:42 +08:00
cagedbird043
3f3efff065
feat: 添加 Gemini 3→3.1 前端快捷按钮及后端映射(包括 3.1 透传)
2026-02-23 23:06:07 +08:00
yangjianbo
900cce20a1
feat(sora): 对齐 Sora OAuth 流程并隔离网关请求路径
...
- 新增并接通 Sora 专用 OAuth 接口与 ST/RT 换取能力
- 完成前端 Sora 授权、RT/ST 手动导入与账号创建流程
- 强化 Sora token 恢复、转发日志与网关路由隔离行为
- 补充后端服务层与路由层相关测试覆盖
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com >
2026-02-19 08:02:56 +08:00
yangjianbo
5d9667d27a
Merge branch 'main' into test
...
# Conflicts:
# backend/cmd/server/VERSION
# backend/ent/migrate/schema.go
# backend/ent/mutation.go
# backend/ent/runtime/runtime.go
# backend/ent/usagelog.go
# backend/ent/usagelog/usagelog.go
# backend/ent/usagelog/where.go
# backend/ent/usagelog_create.go
# backend/ent/usagelog_update.go
# backend/internal/repository/usage_log_repo.go
# backend/internal/server/api_contract_test.go
# backend/internal/server/middleware/cors.go
# backend/internal/service/gateway_service.go
2026-02-18 20:16:31 +08:00
shaw
b41fa5e15f
feat: 前端新增sonnet4.6快捷映射按钮
2026-02-18 17:06:37 +08:00
yangjianbo
f6bff97d26
fix(frontend): 修复前端审计问题并补充回归测试
2026-02-14 11:56:08 +08:00
yangjianbo
3734abed4c
feat(openai): 支持 gpt-5.3-codex-spark 并统一 gpt-5.3 到 codex 计费
2026-02-13 09:28:07 +08:00