Skip to content

feat: 实现网页 WebUI#71

Merged
vfyjxf merged 80 commits into
ZhiYi-R:mainfrom
KasumiNova:main
Jun 16, 2026
Merged

feat: 实现网页 WebUI#71
vfyjxf merged 80 commits into
ZhiYi-R:mainfrom
KasumiNova:main

Conversation

@KasumiNova

Copy link
Copy Markdown
Collaborator

No description provided.

KasumiNova added 30 commits May 24, 2026 16:23
@KasumiNova KasumiNova marked this pull request as ready for review June 13, 2026 11:22
@KasumiNova KasumiNova requested a review from ZhiYi-R June 13, 2026 11:22
@KasumiNova KasumiNova marked this pull request as draft June 13, 2026 16:00
Resource editing for routes/models/providers now uses compact summary
rows that open a Material md-dialog editor (new MaterialDialog wrapper
+ ResourceEditorDialog), so long lists stay scannable instead of stacking
full editor cards.

- summary rows: drop save/runtime/hot-reload markers; show key value
  facts (protocol/host/key, context window, model/provider, priority...)
- route model/provider: selects populated from configured models and
  providers, with brand/protocol icons and invalid/missing-value warnings
- dialog: embedded flattened card, no nested collapse, scrollbar-gutter
  for symmetric centering, widened host max-width for the form grid
- layout: content max-width + centering, de-nested overview panels,
  unified panel radii (--mb-shape-panel), square buttons
  (--mb-button-shape), unified locale-switch radius
- overview: thin fixed-height seamless bar charts; dev-only demo usage
  data (8 models / 3 providers) toggle for previewing the dashboard
- logs: redesigned rows (level badge + compact time + message), removed
  left border, centered level labels
- copy: less technical, shorter field help (i18n + configDocs), removed
  the meaningless top-bar API labels
- packaging: bump pkgrel to 3
@KasumiNova KasumiNova marked this pull request as ready for review June 14, 2026 08:56
When the server sets auth_token the webui was unreachable: the SPA loaded
(console assets are auth-exempt) but every /api/v1 call 401'd with no UI to
enter a token. The login card already existed (AuthGate.tsx) but was never
mounted — orphaned code.

Add ConsoleAuthProvider which subscribes to the React Query QueryCache and
locks the console (full-screen login card) when any query settles with a 401;
ConsoleAuthGate swaps the app shell for the card while locked. authenticate
verifies the token with a direct probe against GET /api/v1/status
(verify-then-open, so a wrong token never flashes the app), and the observer
re-arms automatically when the server token is rotated. A sign-out (lock)
button in the top app bar clears the token and re-locks.

Move shellStyles injection out of AppShell (which unmounts while locked) to
App + the test harness so the login card keeps global styles/tokens in the
locked state.

206 webui tests pass; build green; verified locked/unlocked/wrong-token
states in Chromium (card centered + Material controls, no-flash on wrong
token, sign-out button present when unlocked).
Align the login token field with the rest of the console by switching from
md-filled-text-field to md-outlined-text-field (matching the config editor
fields) and dropping the filled-specific color overrides.

Add a visibility toggle (MaterialIconButton slotted as trailing-icon) that
shows/hides the token. The token already lives in plaintext in the server
config, so it is shown by default (type=text) and can be hidden on demand.

207 webui tests pass; build green; verified in Chromium (outlined field,
default plaintext, trailing toggle switches to password and flips the icon).
…le; sharp field corners

- Login token field is hidden (password) by default; the eye toggle reveals it.
- Config editor secret fields (api_key, auth_token, …) get the same visibility
  toggle in the trailing slot alongside the help button, and reveal on click.
- The visibility toggle is ~25% smaller (state-layer 30px / icon 18px) via a
  shared .field-visibility-toggle class so it doesn't dominate the field.
- Text fields and outlined selects revert to the Material Web default
  container shape (sharp) instead of the rounder 12px override — globally.

208 webui tests pass; build green; verified in Chromium (login + editor secret
field default hidden + toggle, smaller toggle, sharp field/select corners).
…o overflow)

Putting both the eye toggle and the help button in an outlined text field's
trailing slot overflowed the outline: Material Web's trailing slot is hard-wired
to one icon (fixed-width container + absolutely-positioned slotted content, a
shadow-DOM internal the skill forbids overriding). The leading slot's wrapper is
aria-hidden (decorative only), so an interactive help button can't go there
either, and the skill bars external help buttons.

So secret fields now use the single trailing slot for the visibility toggle
only; the per-field help button is removed from secret fields specifically
(they keep their supporting text; all non-secret fields keep their help button).
The rich-tooltip spacing test now uses a non-secret field, since it validates
tooltip styling rather than secret behavior.

208 webui tests pass; build green; verified in Chromium that the secret field
trailing edge no longer overflows (single toggle icon, within the outline).
@vfyjxf vfyjxf merged commit 8254b41 into ZhiYi-R:main Jun 16, 2026
8 checks passed
@KasumiNova KasumiNova removed the request for review from ZhiYi-R June 16, 2026 06:08
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.

2 participants