Skip to content

Add channel concurrency settings section to default console - #741

Merged
think-back merged 1 commit into
mainfrom
feat/default-console-concurrency-settings
Aug 18, 2026
Merged

Add channel concurrency settings section to default console#741
think-back merged 1 commit into
mainfrom
feat/default-console-concurrency-settings

Conversation

@think-back

Copy link
Copy Markdown
Collaborator

目标

把渠道并发/冷却设置面板补进 default(新 UI)管理台。#739 的面板只做在了 classic 里,而生产管理员日常用的是 default——这组配置在新 UI 里没有任何入口。

实现

系统设置 → Operations 新增 "Channel Concurrency Limits" section(侧边导航自动出现,路由 /system-settings/operations/channel-concurrency):

  • 排队:并发满时允许排队 / 排队超时毫秒 / 每渠道排队上限(0 = 等于该渠道并发上限)
  • 冷却:总开关 / 冷却时长秒 / 上游 429 触发(默认开)/ 错误消息关键词触发(默认关,标注易误伤);总开关关闭时下级控件置灰
  • 性能:负载快照缓存开关

实现沿用 PerformanceSection 的既有模式:react-hook-form 嵌套 schema(避开 dotted-name 陷阱)+ zod 校验(数字字段整数且非负/≥1,杜绝空值落库)+ 仅保存变更的 key + getOptionValue 按默认值类型解析 option 字符串("false" 不会被当 truthy)。#739 OCR 指出的 classic 面板两个问题(类型反序列化、保存前校验)在这套模式里天然不存在。

验证

  • tsc 0 新增错误(存量 rsbuild.config process 报错除外)
  • bun test src/i18n/config.test.ts 14 项全过(新增 15 个 key 8 语言齐全)
  • eslint 错误仅存量文件(web-preview / json-editor 的 setState-in-effect,与本 PR 无关)
  • 未做:浏览器内视觉验证

Follow-up to #739(classic 面板)/ #735(实时并发展示)

Mirror the classic console's channel concurrency panel in the default console: a new Channel Concurrency Limits section under System Settings > Operations exposing queueing (wait_enabled, timeout, per-channel cap), cooldown (master switch, duration, 429 trigger, keyword-match trigger), and the load snapshot cache toggle, persisted per changed key through the existing option update flow.

Constraint: The section follows the PerformanceSection pattern — nested form schema flattened to channel_concurrency_setting.* keys on save, because react-hook-form treats dotted names as nested paths.

Confidence: high

Scope-risk: narrow

Tested: web/default tsc 0 new errors; bun test src/i18n/config.test.ts (14 pass, locale parity for the new keys across 8 languages); eslint errors limited to pre-existing files.

Not-tested: visual check in a running console.
@think-back
think-back merged commit ff07435 into main Aug 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant