feat(webui): settings tabs, password dialog, instant node save, error pages
Five WebUI changes: 1. Settings page rebuilt around mini tabs (外观 / 数据刷新 / 账号安全) instead of three stacked cards; content and behaviour unchanged. 2. "修改访问密码" now opens an independent ChangePasswordDialog modal rather than swapping the whole page for the forced-change screen. The form is extracted to a shared ChangePasswordForm used by both the modal and the forced full-screen ChangePasswordPage — behaviour identical. 3. Node config: creating / editing / deleting / enable-toggling an HTTP/WS endpoint now persists immediately — clicking 保存 in the editor dialog IS the save. Previously it only marked the config dirty until you also hit the top-right 保存, which silently cost many users their token edits. `save()` takes an explicit config so it persists the freshly computed value, not the stale closed-over state. The general-settings tab keeps its explicit top-right save. 4. Forced first-time change-password no longer renders an old-password field: it carries the password the user just logged in with. Browsers (Edge/Chrome) were autofilling that field on upgrade, so users thought the old password was pre-filled correctly and could never save. A returning already-authed session (no fresh login) still shows the field. 5. Added default error + 404 screens (status-screens.tsx), wired into the TanStack router via defaultErrorComponent / defaultNotFoundComponent.
This commit is contained in:
9 files changed
+768
-495
No files matched your search
@@ -6,6 +6,9 @@ import {
|
||||
Outlet,
|
||||
} from '@tanstack/react-router';
|
||||
import { AppLayout } from './app-layout';
|
||||
// Imported eagerly (not lazy): the error / not-found fallbacks must render
|
||||
// even when a route's own chunk failed to load.
|
||||
import { ErrorPage, NotFoundPage } from '@/components/pages/status-screens';
|
||||
|
||||
// Page components are loaded on demand so the initial paint only ships
|
||||
// the auth surface + layout shell. With `defaultPreload: 'intent'` set
|
||||
@@ -68,6 +71,8 @@ const routeTree = rootRoute.addChildren([
|
||||
export const appRouter = createRouter({
|
||||
routeTree,
|
||||
defaultPreload: 'intent',
|
||||
defaultNotFoundComponent: () => <NotFoundPage />,
|
||||
defaultErrorComponent: ({ error, reset }) => <ErrorPage error={error} reset={reset} />,
|
||||
});
|
||||
|
||||
declare module '@tanstack/react-router' {
|
||||
|
||||
Reference in new issue
Block a user