feat: 实现网页 WebUI#71
Merged
Merged
Conversation
…radius, md-sys-color sync
# Conflicts: # .gitignore # docs/api.md # internal/config/config.go # internal/config/config_loader.go # internal/service/api/status.go
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
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
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.