Wesley Liddick
ba1f130d28
Merge pull request #3864 from fengshao1227/fix/frontend-i18n-and-site-logo-sanitize
...
fix(frontend): 补齐 en 语言包缺失 key 并对 site_logo 统一应用 sanitizeUrl
2026-07-09 17:35:00 +08:00
li
15c59be787
fix(frontend): 补齐 en 语言包缺失 key 并对 site_logo 统一应用 sanitizeUrl
2026-07-09 17:22:04 +08:00
shaw
49fb18e073
Merge origin/main into worktree/brave-valley-9578
...
Resolve conflict in api_key_repo.go: keep both ListAllByUserID (this PR)
and attachLastUsedIPs/latestUsageLogIPs (main), and have ListAllByUserID
attach last-used IPs so the current_concurrency sort path keeps the
last_used_ip column populated.
2026-07-09 17:17:16 +08:00
Wesley Liddick
c842c3166c
Merge pull request #3847 from heathermhuang/codex/grok-45-official-support
...
Add official Grok 4.5 support
2026-07-09 16:07:42 +08:00
shaw
d4952154ff
fix: bill Grok video per second and harden video usage logging
...
Follow-up fixes for the #3775 audit findings:
- Bill Grok video generation per second of output, matching the xAI rate
card: parse the request duration (1-15s, upstream default 8s) and compute
cost as per-second price x duration x count. The built-in rate card values
were already xAI per-second prices but were previously charged per video,
undercharging up to 15x with a user-controlled duration.
- Group video_price_* fields are now documented and surfaced as per-second
rates (USD/s); admin UI labels, placeholders and hints updated accordingly.
- Persist video_count/video_resolution/video_duration_seconds on usage_logs
(migration 172) so video billing is auditable, and exempt any row with
video_count > 0 from the image_size check constraint: a video billed via a
token-mode channel price produces billing_mode='token' with image_count=1
and no image_size, which the previous constraint rejected, dropping the
whole billing transaction.
- Only refetch the group in apiKeyWithFreshGroupMediaPricing when the group
object actually looks like it is missing media pricing fields (both media
multipliers zero and all prices nil, impossible for a normally loaded
group), removing a per-usage DB query for groups without overrides.
- Frontend: drop the unused admin.groups.mediaPricing locale block, map
cleared price inputs to null (create) / -1 (update, cleared via backend
normalizePrice) instead of sending "" that failed *float64 unmarshalling,
and align video price placeholders with the text-to-video default model
(grok-imagine-video 0.05/0.07, 1080p only on 1.5 at 0.25).
2026-07-09 15:38:59 +08:00
Wesley Liddick
9ba0fb3084
Merge pull request #3775 from heathermhuang/codex/grok-media-pricing-labels
...
fix: add Grok video pricing controls
2026-07-09 15:03:38 +08:00
Wesley Liddick
e2c662e965
Merge pull request #3840 from feitianbubu/fix/crs-sync-frontend-timeout
...
fix(crs-sync): raise frontend sync timeout to 180s
2026-07-09 14:39:39 +08:00
Wesley Liddick
9392d1fc43
Merge pull request #3841 from fengshao1227/fix/html-escape-site-name-and-sanitize-doc-url
...
fix(security): HTML-escape site_name 并对 doc_url 统一应用 sanitizeUrl
2026-07-09 14:39:26 +08:00
Wesley Liddick
9ba6f3c2b0
Merge pull request #3845 from wucm667/feat/groups-quota-used-display
...
feat: 配额操控列表显示已用额度
2026-07-09 14:39:12 +08:00
Wesley Liddick
a57157b9fa
Merge pull request #3822 from wucm667/feat/api-key-last-used-ip
...
feat(api-key): 展示 API Key 最近使用 IP
2026-07-09 14:38:01 +08:00
Heatherm Huang
cccba9a82e
Add official Grok 4.5 support
2026-07-09 14:26:10 +08:00
wucm667
54859022aa
feat: show used quota in groups list
2026-07-09 11:45:59 +08:00
li
bfb827b879
fix(security): HTML-escape site_name 并对 doc_url 统一应用 sanitizeUrl
...
Refs #3839 (第 8、12 点)
2026-07-09 10:03:49 +08:00
feitianbubu
4e5be8f75e
fix(crs-sync): raise frontend sync timeout to 180s
2026-07-09 09:45:47 +08:00
superman2003 and Cursor
29a5fcd25e
fix(gateway,frontend): 修复鉴权绕过与前端支付/会话缺陷
...
后端:
- Gemini /v1beta 鉴权中间件补齐主中间件的授权校验: API Key 的 IP 白/黑名单、
专属分组授权、运行时过期/配额二次检查, 修复经 Gemini 端点绕过 IP ACL、
越权访问专属分组、以及状态未刷新时的配额/有效期绕过窗口。
- 粘性会话等待计划分支改走 newSelectionResult 以 hydrate 账号凭证, 修复调度
快照中账号凭证被剥离导致等待路径转发鉴权失败。
- SSE 流式转发客户端断开时不再 break 跳过当前事件 usage 合并, 修复少计费。
- Forward 对 nil gin.Context 的防御补齐; 上游错误体读取失败时记录日志避免静默。
前端:
- logout 将本地会话清理移入 finally, 服务端吊销失败也保证本地登出。
- Stripe 弹窗轮询改用正确的 auth_token 键并加防重入; 收到 INIT 后清除兜底
超时定时器, onUnmounted 清理 message 监听器。
- token 刷新请求补充 30s 超时, 避免挂起导致请求队列与 loading 永久卡死。
- 路由守卫在公共设置未加载时先 await fetchPublicSettings, 避免 payment/
risk_control 被误判为未启用而错误拦截。
- 支付状态轮询回调补充防重入与终态守卫。
Co-authored-by: Cursor <cursoragent@cursor.com >
2026-07-09 09:06:56 +08:00
Bestony@Homelab
5debe1db33
feat(keys): sort by current concurrency
2026-07-08 15:51:22 +08:00
wucm667
e0d149d511
feat(api-key): show last used IP
2026-07-08 15:26:54 +08:00
Heatherm Huang
376e03ded1
fix: update Grok media default rate card
2026-07-08 13:50:49 +08:00
Heatherm Huang
4d702e3234
fix: split Grok image and video pricing
2026-07-08 13:50:49 +08:00
Heatherm Huang
890cc2bb98
fix: clarify Grok media pricing controls
2026-07-08 13:44:09 +08:00
Wesley Liddick
6f43986c37
Merge pull request #3811 from jianjianai/hotfix/admin-scheduler-score-opt-in
...
fix(admin): 管理员账号列表默认关闭调度权值计算以降低负载
2026-07-08 10:22:10 +08:00
Wesley Liddick
f4e8bec54c
Merge pull request #3803 from fengshao1227/fix/sidebar-scroll-position-persist
...
fix(frontend): 路由切换后保持侧边栏滚动位置
2026-07-08 09:53:05 +08:00
shaw
d0bcaa8b09
test(i18n): 新增语言包 spread 组装键冲突守卫测试
2026-07-08 08:49:23 +08:00
shaw
d9e514f982
refactor(i18n): 拆分 zh/en 语言包为域模块(深比较等价校验通过)
2026-07-08 08:49:19 +08:00
jjaw
6ae5fc31b3
fix(admin): gate scheduler score calculation
2026-07-08 06:58:35 +08:00
li
a86c534cb0
test: 补充侧边栏滚动位置持久化的前端测试
...
- AppSidebar.spec.ts:验证 template ref 绑定、sidebarNavRef 声明、
onBeforeUnmount 保存 scrollTop、onMounted 恢复
- app.spec.ts:验证 sidebarScrollTop 默认值为 0 且可读写
2026-07-07 21:11:40 +08:00
li
c7e44a83ad
fix(frontend): 路由切换后保持侧边栏滚动位置
...
AppLayout 在每个页面组件内部包裹,路由切换时整个组件树(含
AppSidebar)被销毁重建,侧边栏滚动位置丢失。管理员菜单较长
或屏幕较矮时,每次点击靠下的菜单项后都要重新滚动。
在 appStore 增加 sidebarScrollTop 状态,AppSidebar 在
onBeforeUnmount 保存、onMounted 恢复滚动位置。
Fixes #3796
2026-07-07 21:08:03 +08:00
Wesley Liddick
4bcb13f77f
Merge pull request #3786 from creamtea47/codex/openai-fast-force-priority
...
add force priority fast policy action
2026-07-07 20:45:45 +08:00
NellPoi
e979990bf9
add force priority fast policy action
2026-07-07 15:27:23 +08:00
Turtle_Li
a6023840f7
Merge remote-tracking branch 'origin/main' into feature/batch-image-foundation
...
# Conflicts:
# deploy/Dockerfile
2026-07-07 15:14:37 +08:00
Wesley Liddick
571e0b8132
Merge pull request #3774 from heathermhuang/codex/grok-composer-image-bridge
...
fix: bridge Grok Composer image inputs
2026-07-07 14:13:28 +08:00
Heatherm Huang
c34db70a88
fix: bridge grok composer image inputs
2026-07-07 10:55:07 +08:00
Turtle_Li
5494261902
Merge remote-tracking branch 'origin/main' into feature/batch-image-foundation
...
# Conflicts:
# .github/audit-exceptions.yml
2026-07-07 10:53:17 +08:00
Wesley Liddick
d7a6a4513a
Merge pull request #3729 from starmiaoa/feat/account-import-dnd-batch-20260705
...
支持账号数据拖拽和批量导入
2026-07-07 10:44:39 +08:00
Wesley Liddick
96f3697ecb
Merge pull request #3767 from qqqianye/fix/admin-account-compact-probe
...
fix(frontend): add compact probe mode to admin account test modal
2026-07-07 09:09:05 +08:00
Wesley Liddick
913d838770
Merge pull request #3755 from wucm667/fix/subscription-usd-cny-rate-opt-in
...
feat(payment): 套餐编辑页展示订阅 CNY 实扣预览
2026-07-07 08:29:12 +08:00
Wesley Liddick
3828a48752
Merge pull request #3751 from heathermhuang/codex/grok-image-pricing-latest
...
fix: expose Grok image pricing controls
2026-07-07 08:29:01 +08:00
Turtle_Li
89edba8028
fix: restrict batch image groups to gemini
2026-07-07 04:14:09 +08:00
Turtle_Li
3c43fdec11
docs: add batch image PR readiness notes
2026-07-07 03:31:39 +08:00
Turtle_Li
1b07fe821a
merge: sync batch image branch with origin main
2026-07-07 03:27:11 +08:00
qqqy
7c2a828c56
fix(frontend): add compact probe mode to admin account test modal
2026-07-07 01:18:40 +08:00
shaw
31b6e0d94a
fix: 请求头覆写审计问题修复(禁止名单缺口/beta 对称性/批量清空防护)
...
后端:
- 禁止名单补充 content-type(multipart boundary 为每请求随机值,静态覆写必坏
images 路径)、x-claude-code-session-id / x-client-request-id(会击穿每请求
会话同步,与已禁的 session_id 等同类)、cookie / x-goog-api-key(与透传路径
的入站鉴权残留清洗保持一致)
- anthropic-beta 覆写与 body 净化对称:四个 Anthropic 构建器在
sanitizeAnthropicBodyForBetaTokens 前以覆写值为有效 finalBeta,避免覆写
丢 token 后 header/body 不对称被上游 400
- 保存/应用两路径共用 normalizeHeaderOverrideEntry,消除双份校验规则漂移
- GetHeaderOverrides 按 modelMappingCache 先例增加热路径缓存(WS 每消息
重建头场景收益最大);ApplyHeaderOverrides 移除无观测效果的排序
前端:
- 禁止名单镜像同步新增项;值长度改按 UTF-8 字节校验(与后端 len() 对齐)
- Create 弹窗切换平台时重置覆写配置,避免上一平台模板行串台
- BulkEdit:开启覆写但无有效行时拦截保存(防止整键替换静默清空所选账号
既有配置);开启分支显示整体替换警告;混合平台选择时隐藏模板按钮
- 删除未使用的 isBlockedHeaderOverrideName 导出
2026-07-06 20:05:50 +08:00
shaw
ec7b20649e
feat: apikey 账号支持请求头覆写(Anthropic/OpenAI)
...
- 账号 credentials 新增 header_override_enabled / header_overrides,
仅对 anthropic/openai 平台的 api_key 账号生效
- 转发前对同名请求头做大小写不敏感覆盖(EqualFold 全量删除后按
wire casing 写入单值),值为空的条目视为占位不参与覆盖
- 覆盖全部出站路径:/v1/messages(标准+透传)、count_tokens、
/v1/responses、chat completions、embeddings、images、全部 WS 模式、
账号测试/探测、上游模型列表
- 创建/编辑/批量更新统一校验:RFC 7230 名称格式、去重、长度/条目上限、
24 个禁止覆写头(认证/连接控制/accept-encoding/sec-websocket-*/
会话隔离头),应用时二次防御过滤
- 前端三个账号弹窗新增开关+键值行编辑器+模板按钮(Claude Code CLI /
Codex CLI 标准头,值为空),本地校验与后端规则对齐,i18n 中英文
2026-07-06 19:11:08 +08:00
wucm667
a23a263513
feat(payment): preview subscription CNY charge in plan editor
2026-07-06 17:52:53 +08:00
shaw
6cea1c35bb
feat: 适配 OpenAI 新模型 gpt-5.6-sol/terra/luna
2026-07-06 17:34:22 +08:00
Heatherm Huang
a42e9e3fc8
fix: expose Grok image pricing controls
2026-07-06 17:02:28 +08:00
Wesley Liddick
d1d3400b69
Merge pull request #3645 from bestony/worktree/lucky-harbor-dbe4
...
feat(keys): add api key concurrency stats
2026-07-06 16:45:15 +08:00
Turtle_Li
0b729496ee
fix: center batch image empty state
2026-07-06 15:39:57 +08:00
Turtle_Li
616cf17d9e
fix: hide batch image entry without allowed key
2026-07-06 15:03:17 +08:00
Albert Coady
27cb485d55
fix: share built-in payment method matching
2026-07-06 15:00:29 +08:00