feat(webui): kiosk (展示模式) for chrome-free wall displays (B2)
A session-sticky kiosk mode for showing the dashboard on a wall display: - Entry: `?kiosk=1` URL param (stripped after read) or a top-bar button (toggleable via topbarItems 'kiosk'). - Hides the sidebar + top bar (MainLayout) and any in-content edit entry marked data-kiosk-hide (the overview 编辑布局 toolbar) via an html[data-kiosk] CSS rule. - Exit: Esc key or a dim corner button. Purely cosmetic — never touches auth and issues no token. A new KioskProvider (sessionStorage-backed, mounted under LayoutProvider) owns the state. Completes the B2 dashboard/components batch.
This commit is contained in:
6 files changed
+134
-26
No files matched your search
@@ -8,6 +8,7 @@ import { NAV_ITEMS } from '@/components/layout/sidebar';
|
||||
import { ConfirmDialog } from '@/components/confirm-dialog';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { AppStateProvider } from '@/contexts/AppStateContext';
|
||||
import { KioskProvider } from '@/contexts/KioskContext';
|
||||
import { LayoutProvider, useLayout } from '@/contexts/LayoutContext';
|
||||
import { useSession } from '@/contexts/SessionContext';
|
||||
import type { AppPath } from '@/router';
|
||||
@@ -157,16 +158,18 @@ export function AppLayout() {
|
||||
}}
|
||||
>
|
||||
<LayoutProvider>
|
||||
<DefaultRouteRedirect />
|
||||
<MainLayout status={session.status} onLogout={handleLogout}>
|
||||
{/* Routes use `lazyRouteComponent` (router/index.tsx) for
|
||||
code-splitting, which suspends until the chunk is fetched.
|
||||
The chrome (sidebar / top bar) stays mounted across this
|
||||
boundary so only the page surface flashes a skeleton. */}
|
||||
<Suspense fallback={<PageFallback />}>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
</MainLayout>
|
||||
<KioskProvider>
|
||||
<DefaultRouteRedirect />
|
||||
<MainLayout status={session.status} onLogout={handleLogout}>
|
||||
{/* Routes use `lazyRouteComponent` (router/index.tsx) for
|
||||
code-splitting, which suspends until the chunk is fetched.
|
||||
The chrome (sidebar / top bar) stays mounted across this
|
||||
boundary so only the page surface flashes a skeleton. */}
|
||||
<Suspense fallback={<PageFallback />}>
|
||||
<Outlet />
|
||||
</Suspense>
|
||||
</MainLayout>
|
||||
</KioskProvider>
|
||||
</LayoutProvider>
|
||||
|
||||
<ConfirmDialog
|
||||
|
||||
Reference in new issue
Block a user