Skip to content

修复管理台 UX 矛盾:状态一致性、术语统一与交互对齐 - #12

Merged
nextroad-dev merged 5 commits into
mainfrom
fix/ux-consistency
Oct 1, 2026
Merged

nextroad-dev merged 5 commits into
mainfrom
fix/ux-consistency

Conversation

@nextroad-dev

Copy link
Copy Markdown
Owner

修复管理台中界面状态与服务端不一致、同一概念多种叫法、同类操作交互不同的问题。按阶段分为 4 个提交,外加 1 个重新构建内嵌产物的提交。

状态与服务端一致

  • 模型分组:候选列表只允许勾选可路由的绑定(绑定、提供商、模型均已启用),不可用的绑定会标注原因。组内已失效的成员会被标出并可直接移除。每组限制 8 个。保存被拒绝时回滚到上次成功保存的快照。之前勾选失败后界面仍显示已勾选,且只要有一个过期成员,之后每次保存都会失败。
  • 提供商的"发现模型"列表:改为按 upstream_model_id 判断是否已绑定。已停用的绑定显示"重新启用",不再显示"绑定"。
  • 路由:模型分组页移至 /admin/groups,/admin/pairs 重定向过去以兼容旧书签。adminPageShells 和 OpenAPI 已同步更新。
  • 日志留存天数改为数字输入,覆盖后端允许的 0–3650 天(原滑块上限是 365 / 90)。

总览页

  • 模型和分组排行请求时带上所选的 window,整页数据口径一致。输出 TPS 标注为近 60 秒。
  • 环形图中心改标为"2xx 占比",与后端的请求成功率区分。去掉重复出现的指标,改为显示模型数与绑定数。
  • 健康检查失败时显示"状态未知",不再一直显示"检查中…"。数据为空时不再画 50/50 的比例条。

术语与文案

  • 客户端密钥统一为"推理密钥",提供商密钥为"上游密钥"。统一使用"已停用"、"提供商"、"指定模型"。
  • Jev content 模式在各处统一为"完整内容"(设置页原为"提取内容")。
  • 按错误码逐条重写错误说明,去掉原来拼在前面、与具体建议重复或矛盾的通用前缀。新增测试:同一条说明内出现重复句子即失败。
  • 密码提示改为与校验一致的"12 字节"规则。

交互

  • 管理台内统一的确认框替换 window.confirm 和设置页的内联重置确认。
  • 遮罩层支持叠放:只有最上层响应 Esc 和 Tab。之前在抽屉内弹出确认框时,一次 Esc 会关掉两层,焦点也会被抽屉抢走。
  • 提供商页、日志页的文本筛选改为边输入边查询。日志页会丢弃过期请求的响应。
  • 删除、解除绑定、撤销、重置成功后弹出提示。已撤销的推理密钥不再显示轮换和撤销按钮。不可删除的提供商显示禁用的删除按钮并说明原因。
  • Jev 未启用时显示说明,告知相关设置在启用后才生效。字段保持可编辑,因为启用 Jev 前必须先填好地址、模型和密钥。

测试

  • npm run typecheck
  • npm test:55 个通过
  • npx playwright test:28 个通过,新增 8 个,覆盖分组可用性与回滚、旧路径重定向、已停用绑定识别、总览时间窗口、健康状态未知、推理密钥撤销、边输入边搜索、叠放遮罩的 Esc
  • npm run build && npm run check:embedded-assets
  • go vet ./...、go test ./...

…he server

- Model groups only offer routable pairs (binding, provider and model all
  enabled), flag stale members with a remove action, cap each group at 8,
  and roll back to the last accepted snapshot when a save is rejected.
- Provider discovery matches bindings by upstream ID and offers to
  re-enable a disabled binding instead of binding it again.
- Jev input mode labels come from the shared vocabulary (content is
  "完整内容" everywhere).
- Log retention uses number inputs covering the full 0-3650 day range.
- Model groups page moves to /admin/groups; /admin/pairs redirects.
…states

- Usage rankings request the selected window, so every windowed figure on
  the page covers the same period; output TPS is labelled as 60 seconds.
- The donut centre is labelled as the 2xx share, distinct from the
  server's request success rate; duplicated auto-routing and latency
  figures are removed in favour of model and binding catalogue counts
  and a Jev invocation gauge.
- A failed health probe shows an unknown state instead of checking forever.
- Empty token and routing breakdowns say there is no data instead of
  drawing 50/50 bars.
- Inbound keys are "推理密钥" everywhere (nav, title, table, drawer, error
  copy); a provider's upstream credential is "上游密钥".
- "已停用", "提供商" and "指定模型" replace the mixed 已禁用/Provider/显式指定.
- Default group options use the task group names; password hints state the
  12-byte rule the validator applies.
- Error descriptions no longer prepend a category boilerplate that repeated
  or contradicted the specific advice; a test now rejects repeated sentences.
- One in-app confirmation dialog replaces window.confirm and the inline
  settings-reset prompt; overlays now stack, so Escape and Tab only act on
  the topmost surface and a confirmation over a drawer stays usable.
- Provider and log text filters run while typing, matching the model page;
  the log list ignores responses from superseded queries.
- Provider rows show their status text like model rows; the redundant
  enable switch leaves the binding drawer, as it already left the
  provider drawer.
- Deletes, unbinds, revokes and resets confirm success with a toast.
- Revoked inference keys read "已撤销" and offer no rotate or revoke.
- Non-deletable providers show a disabled delete with the reason.
- The Jev card says when Jev is off that its settings do not apply yet,
  without locking the fields that must be filled before enabling it.
@nextroad-dev
nextroad-dev merged commit 38a6f07 into main Oct 1, 2026
9 checks 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