diff --git a/packages/core/src/webui/ui-config.ts b/packages/core/src/webui/ui-config.ts index 0fdc817f..d8bec0c4 100644 --- a/packages/core/src/webui/ui-config.ts +++ b/packages/core/src/webui/ui-config.ts @@ -124,10 +124,37 @@ export interface UiLayout { navItems: UiLayoutItem[]; } +export interface UiHighlightRule { + keyword: string; + color: string; +} + +export interface UiLogsPrefs { + /** Log levels shown by default (client display filter). */ + visibleLevels: string[]; + /** Ring-buffer cap for the live view (100…5000). */ + maxLines: number; + autoScroll: boolean; + wrap: boolean; + /** Keyword → colour row highlights. */ + highlightRules: UiHighlightRule[]; +} + +export interface UiPages { + /** Route the operator lands on after login (a nav path; '/' if unset). */ + defaultRoute: string; + logs: UiLogsPrefs; + /** Default sort key for the processes page. */ + processesSort: string; + /** Default tab id for the node-config page ('' = first). */ + configTab: string; +} + export interface UiConfig { version: typeof UI_CONFIG_VERSION; appearance: UiAppearance; layout: UiLayout; + pages: UiPages; } // ─── Defaults ──────────────────────────────────────────────────────────── @@ -183,6 +210,21 @@ const DEFAULT_NAV_ITEMS: UiLayoutItem[] = [ { id: '/settings', visible: true }, ]; +const LOG_LEVELS = ['trace', 'debug', 'info', 'success', 'warn', 'error']; + +const DEFAULT_PAGES: UiPages = { + defaultRoute: '/', + logs: { + visibleLevels: [...LOG_LEVELS], + maxLines: 1000, + autoScroll: true, + wrap: true, + highlightRules: [], + }, + processesSort: 'pid', + configTab: '', +}; + export function defaultUiConfig(): UiConfig { return { version: UI_CONFIG_VERSION, @@ -191,9 +233,14 @@ export function defaultUiConfig(): UiConfig { overviewBlocks: DEFAULT_OVERVIEW_BLOCKS.map((b) => ({ ...b })), navItems: DEFAULT_NAV_ITEMS.map((b) => ({ ...b })), }, + pages: defaultPages(), }; } +function defaultPages(): UiPages { + return { ...DEFAULT_PAGES, logs: { ...DEFAULT_PAGES.logs, visibleLevels: [...LOG_LEVELS], highlightRules: [] } }; +} + // ─── Normalization helpers ───────────────────────────────────────────────── function isObject(value: unknown): value is Record { @@ -362,12 +409,47 @@ export function normalizeLayout(value: unknown): UiLayout { }; } +function normalizeHighlightRules(value: unknown): UiHighlightRule[] { + if (!Array.isArray(value)) return []; + const out: UiHighlightRule[] = []; + for (const raw of value) { + if (!isObject(raw) || typeof raw.keyword !== 'string') continue; + const keyword = raw.keyword.trim().slice(0, 50); + if (!keyword) continue; // drop empty / whitespace-only (would match every row) + const color = typeof raw.color === 'string' ? raw.color.slice(0, 32) : ''; + out.push({ keyword, color }); + if (out.length >= 20) break; // cap the rule count + } + return out; +} + +export function normalizePages(value: unknown): UiPages { + const v = isObject(value) ? value : {}; + const logs = isObject(v.logs) ? v.logs : {}; + const levels = Array.isArray(logs.visibleLevels) + ? LOG_LEVELS.filter((l) => (logs.visibleLevels as unknown[]).includes(l)) + : DEFAULT_PAGES.logs.visibleLevels; + return { + defaultRoute: idOr(v.defaultRoute, DEFAULT_PAGES.defaultRoute), + logs: { + visibleLevels: levels.length > 0 ? levels : [...LOG_LEVELS], + maxLines: clampInt(logs.maxLines, 100, 5000, DEFAULT_PAGES.logs.maxLines), + autoScroll: boolOr(logs.autoScroll, DEFAULT_PAGES.logs.autoScroll), + wrap: boolOr(logs.wrap, DEFAULT_PAGES.logs.wrap), + highlightRules: normalizeHighlightRules(logs.highlightRules), + }, + processesSort: idOr(v.processesSort, DEFAULT_PAGES.processesSort), + configTab: typeof v.configTab === 'string' ? v.configTab.slice(0, 64) : DEFAULT_PAGES.configTab, + }; +} + export function normalizeUiConfig(value: unknown, imageState: ServerImageState = DEFAULT_IMAGE_STATE): UiConfig { const v = isObject(value) ? value : {}; return { version: UI_CONFIG_VERSION, appearance: normalizeAppearance(v.appearance, imageState), layout: normalizeLayout(v.layout), + pages: normalizePages(v.pages), }; } @@ -446,6 +528,7 @@ export function saveUiConfig(incoming: unknown): UiConfig { ? normalizeAppearance(v.appearance, current.appearance.background) : current.appearance, layout: isObject(v.layout) ? normalizeLayout(v.layout) : current.layout, + pages: isObject(v.pages) ? normalizePages(v.pages) : (current.pages ?? defaultPages()), }; atomicWrite(next); cached = next; diff --git a/packages/webui/src/components/pages/config-page.tsx b/packages/webui/src/components/pages/config-page.tsx index 76701e0f..f02739e4 100644 --- a/packages/webui/src/components/pages/config-page.tsx +++ b/packages/webui/src/components/pages/config-page.tsx @@ -22,6 +22,7 @@ import type { } from '@/types'; import { useOneBotInstanceConfig } from '@/hooks/use-onebot-instance-config'; import { useAppState } from '@/contexts/AppStateContext'; +import { useLayout } from '@/contexts/LayoutContext'; import { AccountSidebar } from '@/components/config/account-sidebar'; import { GeneralSettingsTab } from '@/components/config/general-settings-tab'; import { NodeSummaryCard } from '@/components/config/node-summary-card'; @@ -55,7 +56,16 @@ export function ConfigPage() { onSelectedUinChange: setSelectedUin, }); - const [activeTab, setActiveTab] = useState('general'); + const { pages, setPages } = useLayout(); + const [activeTab, setActiveTabState] = useState(() => { + const t = pages.configTab; + return t === 'general' || (!!t && t in NETWORK_TABS) ? (t as TabKey) : 'general'; + }); + // Persist the last-used tab as the default for next time. + const setActiveTab = useCallback((t: TabKey) => { + setActiveTabState(t); + setPages({ configTab: t }); + }, [setPages]); // Default the account strip to its 56px avatar-only form on narrow screens // (≤lg) so the editor pane isn't squeezed; the user can still expand it. const [sidebarCollapsed, setSidebarCollapsed] = useState( diff --git a/packages/webui/src/components/pages/logs-page.tsx b/packages/webui/src/components/pages/logs-page.tsx index 4a55eb7d..ac5f9a9d 100644 --- a/packages/webui/src/components/pages/logs-page.tsx +++ b/packages/webui/src/components/pages/logs-page.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { motion } from 'motion/react'; -import { Pause, Play, RefreshCw, Trash2 } from 'lucide-react'; +import { ArrowDownToLine, Highlighter, Pause, Plus, RefreshCw, Trash2, WrapText, X } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; @@ -8,9 +8,10 @@ import { Input } from '@/components/ui/input'; import { ScrollArea } from '@/components/ui/scroll-area'; import { ConfirmDialog } from '@/components/confirm-dialog'; import { cn } from '@/lib/utils'; -import type { LogEntry, LogLevel } from '@/types'; +import type { LogEntry, LogLevel, UiHighlightRule } from '@/types'; import { useApi } from '@/lib/api'; import { useTheme } from '@/contexts/ThemeContext'; +import { useLayout } from '@/contexts/LayoutContext'; const levelClass: Record = { trace: 'text-muted-foreground/60', @@ -23,31 +24,60 @@ const levelClass: Record = { const LEVELS: LogLevel[] = ['trace', 'debug', 'info', 'success', 'warn', 'error']; +// Highlight palette — keyword rules tint a matching row. Stored as an id. +const HIGHLIGHT_COLORS: { id: string; label: string; swatch: string }[] = [ + { id: 'amber', label: '琥珀', swatch: '#f59e0b' }, + { id: 'rose', label: '玫瑰', swatch: '#f43f5e' }, + { id: 'emerald', label: '翡翠', swatch: '#10b981' }, + { id: 'sky', label: '天蓝', swatch: '#38bdf8' }, + { id: 'violet', label: '紫', swatch: '#8b5cf6' }, +]; +const colorSwatch = (id: string) => HIGHLIGHT_COLORS.find((c) => c.id === id)?.swatch ?? '#f59e0b'; + +function matchHighlight(message: string, rules: UiHighlightRule[]): string | null { + if (rules.length === 0) return null; + const m = message.toLowerCase(); + for (const r of rules) { + if (r.keyword && m.includes(r.keyword.toLowerCase())) return colorSwatch(r.color); + } + return null; +} + export function LogsPage() { const api = useApi(); const { formatClock } = useTheme(); + const { pages, setPages } = useLayout(); + const prefs = pages.logs; + const [logs, setLogs] = useState([]); const [streamStatus, setStreamStatus] = useState('连接中'); - const [paused, setPaused] = useState(false); const [filter, setFilter] = useState(''); - const [enabledLevels, setEnabledLevels] = useState>(new Set(LEVELS)); const [confirmClear, setConfirmClear] = useState(false); const [serverLevel, setServerLevel] = useState(null); const [levelBusy, setLevelBusy] = useState(false); + const [showHighlights, setShowHighlights] = useState(false); + const [newKeyword, setNewKeyword] = useState(''); + const [newColor, setNewColor] = useState(HIGHLIGHT_COLORS[0].id); const endRef = useRef(null); - const viewportRef = useRef(null); + + // maxLines is read through a ref so changing it doesn't re-subscribe the SSE. + const maxLines = prefs.maxLines; + const maxLinesRef = useRef(maxLines); + useEffect(() => { maxLinesRef.current = maxLines; }, [maxLines]); + + const enabled = useMemo(() => new Set(prefs.visibleLevels as LogLevel[]), [prefs.visibleLevels]); const loadLogs = useCallback(async () => { try { - setLogs(await api.logs.list(500)); + // Backfill is capped at the server's ring-buffer size (1000); `maxLines` + // can exceed that, but only the live SSE stream grows the view past 1000. + setLogs(await api.logs.list(Math.min(1000, maxLinesRef.current))); } catch (e) { console.error('logs', e); } }, [api]); - useEffect(() => { - void loadLogs(); - }, [loadLogs]); + useEffect(() => { void loadLogs(); }, [loadLogs]); useEffect(() => { api.logs.getLevel().then(({ level }) => setServerLevel(level)).catch((err) => { @@ -71,7 +101,7 @@ export function LogsPage() { useEffect(() => { return api.logs.stream({ onLine: (entry) => { - setLogs((prev) => [...prev.filter((it) => it.id !== entry.id), entry].slice(-1000)); + setLogs((prev) => [...prev.filter((it) => it.id !== entry.id), entry].slice(-maxLinesRef.current)); }, onStatus: (s) => { if (s === 'open') setStreamStatus('实时'); @@ -82,14 +112,15 @@ export function LogsPage() { }, [api]); useEffect(() => { - if (paused) return; + if (!prefs.autoScroll) return; endRef.current?.scrollIntoView({ block: 'end' }); - }, [logs, paused]); + }, [logs, prefs.autoScroll]); const filtered = useMemo(() => { const f = filter.trim().toLowerCase(); - return logs.filter((l) => { - if (!enabledLevels.has(l.level)) return false; + const capped = logs.slice(-maxLines); + return capped.filter((l) => { + if (!enabled.has(l.level)) return false; if (!f) return true; return ( l.message.toLowerCase().includes(f) || @@ -98,15 +129,22 @@ export function LogsPage() { (l.req !== undefined && String(l.req).includes(f)) ); }); - }, [logs, filter, enabledLevels]); + }, [logs, filter, enabled, maxLines]); const toggleLevel = (lv: LogLevel) => { - setEnabledLevels((prev) => { - const next = new Set(prev); - if (next.has(lv)) next.delete(lv); - else next.add(lv); - return next; - }); + const next = new Set(enabled); + if (next.has(lv)) next.delete(lv); else next.add(lv); + setPages({ logs: { ...prefs, visibleLevels: LEVELS.filter((l) => next.has(l)) } }); + }; + + const addHighlight = () => { + const kw = newKeyword.trim(); + if (!kw) return; + setPages({ logs: { ...prefs, highlightRules: [...prefs.highlightRules, { keyword: kw, color: newColor }].slice(0, 20) } }); + setNewKeyword(''); + }; + const removeHighlight = (idx: number) => { + setPages({ logs: { ...prefs, highlightRules: prefs.highlightRules.filter((_, i) => i !== idx) } }); }; return ( @@ -117,9 +155,7 @@ export function LogsPage() { 运行日志 {streamStatus} - - 最近 {filtered.length} / {logs.length} 条 · 通过 SSE 推送 - + 最近 {filtered.length} / {logs.length} 条 · 通过 SSE 推送
setFilter(e.target.value)} className="h-8 w-48" /> - + + -
+ {showHighlights && ( +
+
+ setNewKeyword(e.target.value)} + onKeyDown={(e) => { if (e.key === 'Enter') addHighlight(); }} + className="h-8 w-44" + /> +
+ {HIGHLIGHT_COLORS.map((c) => ( +
+ +
+ {prefs.highlightRules.length > 0 && ( +
+ {prefs.highlightRules.map((r, i) => ( + + + {r.keyword} + + + ))} +
+ )} +
+ )} +
视图过滤 {LEVELS.map((lv) => { - const active = enabledLevels.has(lv); + const active = enabled.has(lv); return ( +
+ {processList.length > 1 && ( +
+ 排序 + {SORT_OPTIONS.map((o) => ( + + ))} +
+ )} + +
{processActionStatus && ( @@ -71,7 +112,7 @@ export function ProcessesPage() {
) : (
- {processList.map((proc, idx) => { + {sorted.map((proc, idx) => { const op = statusOf(proc.pid); const loading = op === 'load' || proc.status === 'loading'; const unloading = op === 'unload'; diff --git a/packages/webui/src/components/pages/settings-page.tsx b/packages/webui/src/components/pages/settings-page.tsx index 05e635f4..28d8ea8d 100644 --- a/packages/webui/src/components/pages/settings-page.tsx +++ b/packages/webui/src/components/pages/settings-page.tsx @@ -28,7 +28,8 @@ import { type ThemeMode, type TimeFormat, } from '@/contexts/ThemeContext'; -import { DEFAULT_LAYOUT } from '@/contexts/LayoutContext'; +import { DEFAULT_LAYOUT, DEFAULT_PAGES, useLayout } from '@/contexts/LayoutContext'; +import { NAV_ITEMS } from '@/components/layout/sidebar'; import { ChangePasswordDialog } from '@/components/change-password-dialog'; import { ConfirmDialog } from '@/components/confirm-dialog'; import { useApi } from '@/lib/api'; @@ -112,7 +113,7 @@ function AdvancedPanel() { const doReset = async () => { setBusy(true); try { - await api.ui.save({ appearance: DEFAULT_APPEARANCE, layout: DEFAULT_LAYOUT }); + await api.ui.save({ appearance: DEFAULT_APPEARANCE, layout: DEFAULT_LAYOUT, pages: DEFAULT_PAGES }); window.location.reload(); } catch { setBusy(false); @@ -644,6 +645,7 @@ const TIME_FORMAT_OPTIONS: Opt[] = [ function DataPanel() { const { appearance, setAppearance } = useTheme(); + const { pages, setPages } = useLayout(); return (
@@ -662,6 +664,22 @@ function DataPanel() { + + + 登录后落地页 + 登录后默认打开的页面。 + + + + ({ value: n.to as string, label: n.label }))} + onChange={(defaultRoute) => setPages({ defaultRoute })} + /> + + + + 时间格式 diff --git a/packages/webui/src/contexts/LayoutContext.tsx b/packages/webui/src/contexts/LayoutContext.tsx index 66237d65..aca4dbfc 100644 --- a/packages/webui/src/contexts/LayoutContext.tsx +++ b/packages/webui/src/contexts/LayoutContext.tsx @@ -1,7 +1,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, type ReactNode } from 'react'; import { useApi } from '@/lib/api'; import { defaultOverviewGrid, migrateOverviewBlocks } from '@/lib/dashboard-layout'; -import type { UiLayout, UiLayoutItem } from '@/types'; +import type { UiLayout, UiLayoutItem, UiPages } from '@/types'; // Client-side layout customization (the "C" half). The server stores the // layout in config/ui.json; this context loads it (authed `GET /api/ui`), @@ -27,6 +27,19 @@ export const DEFAULT_LAYOUT: UiLayout = { navItems: DEFAULT_NAV_ITEMS.map((i) => ({ ...i })), }; +const ALL_LEVELS = ['trace', 'debug', 'info', 'success', 'warn', 'error']; + +export function defaultPages(): UiPages { + return { + defaultRoute: '/', + logs: { visibleLevels: [...ALL_LEVELS], maxLines: 1000, autoScroll: true, wrap: true, highlightRules: [] }, + processesSort: 'pid', + configTab: '', + }; +} + +export const DEFAULT_PAGES: UiPages = defaultPages(); + /** * Order + visibility for a known catalogue: keep stored items that still exist * (in their stored order + visibility), then append any catalogue entries the @@ -58,8 +71,14 @@ interface LayoutContextValue { setOverviewBlocks: (items: UiLayoutItem[]) => void; /** Persist a new nav order/visibility. */ setNavItems: (items: UiLayoutItem[]) => void; - /** Reset both to defaults. */ + /** Reset layout (blocks + nav) to defaults. */ resetLayout: () => void; + /** Per-page preferences (default route, logs/processes/config prefs). */ + pages: UiPages; + /** Merge a partial pages-prefs update (debounced-persisted). */ + setPages: (patch: Partial) => void; + /** True once the authed config load has resolved (gates the default-route redirect). */ + ready: boolean; } const LayoutContext = createContext(null); @@ -67,13 +86,18 @@ const LayoutContext = createContext(null); export function LayoutProvider({ children }: { children: ReactNode }) { const api = useApi(); const [layout, setLayout] = useState(DEFAULT_LAYOUT); + const [pages, setPagesState] = useState(DEFAULT_PAGES); + const [ready, setReady] = useState(false); const layoutRef = useRef(layout); + const pagesRef = useRef(pages); // Set once the user edits, so the initial GET (which may resolve AFTER the // first edit) never clobbers their change. const dirtyRef = useRef(false); const saveTimer = useRef | null>(null); + const pagesTimer = useRef | null>(null); useEffect(() => { layoutRef.current = layout; }, [layout]); + useEffect(() => { pagesRef.current = pages; }, [pages]); useEffect(() => { let cancelled = false; @@ -84,26 +108,35 @@ export function LayoutProvider({ children }: { children: ReactNode }) { // overview + editor are interactive immediately, before this resolves). // Overview blocks are migrated to the current grid catalogue (legacy // `stats`→tiles, default coords for new/coordless widgets). - if (!cancelled && !dirtyRef.current && config?.layout) { - setLayout({ - overviewBlocks: migrateOverviewBlocks(config.layout.overviewBlocks), - navItems: config.layout.navItems, - }); + if (!cancelled && !dirtyRef.current && config) { + if (config.layout) { + setLayout({ + overviewBlocks: migrateOverviewBlocks(config.layout.overviewBlocks), + navItems: config.layout.navItems, + }); + } + if (config.pages) setPagesState(config.pages); } } catch { - /* keep defaults — layout is non-critical */ + /* keep defaults — layout/pages are non-critical */ + } finally { + if (!cancelled) setReady(true); } })(); return () => { cancelled = true; }; }, [api]); - // On unmount (e.g. logout), flush a pending debounced save so a last-moment + // On unmount (e.g. logout), flush pending debounced saves so a last-moment // edit isn't lost; best-effort (a cleared token just 401s harmlessly). useEffect(() => () => { if (saveTimer.current) { clearTimeout(saveTimer.current); void api.ui.save({ layout: layoutRef.current }).catch(() => { /* best-effort */ }); } + if (pagesTimer.current) { + clearTimeout(pagesTimer.current); + void api.ui.save({ pages: pagesRef.current }).catch(() => { /* best-effort */ }); + } }, [api]); const persist = useCallback((next: UiLayout) => { @@ -132,13 +165,28 @@ export function LayoutProvider({ children }: { children: ReactNode }) { }); }, [persist]); + const setPages = useCallback((patch: Partial) => { + dirtyRef.current = true; + const next = { ...pagesRef.current, ...patch }; + pagesRef.current = next; + setPagesState(next); + if (pagesTimer.current) clearTimeout(pagesTimer.current); + pagesTimer.current = setTimeout(() => { + pagesTimer.current = null; + void api.ui.save({ pages: next }).catch(() => { /* best-effort */ }); + }, 300); + }, [api]); + const value = useMemo(() => ({ overviewBlocks: layout.overviewBlocks, navItems: layout.navItems, setOverviewBlocks, setNavItems, resetLayout, - }), [layout, setOverviewBlocks, setNavItems, resetLayout]); + pages, + setPages, + ready, + }), [layout, setOverviewBlocks, setNavItems, resetLayout, pages, setPages, ready]); return {children}; } diff --git a/packages/webui/src/router/app-layout.tsx b/packages/webui/src/router/app-layout.tsx index 59ee9e12..16a6de0e 100644 --- a/packages/webui/src/router/app-layout.tsx +++ b/packages/webui/src/router/app-layout.tsx @@ -1,16 +1,42 @@ -import { Suspense, useCallback, useEffect, useState } from 'react'; -import { Outlet } from '@tanstack/react-router'; +import { Suspense, useCallback, useEffect, useRef, useState } from 'react'; +import { Outlet, useNavigate, useRouterState } from '@tanstack/react-router'; import { useTheme } from '@/contexts/ThemeContext'; import { useApi } from '@/lib/api'; import { useHookProcessOps } from '@/hooks/use-hook-process-ops'; import { MainLayout } from '@/components/layout/main-layout'; +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 { LayoutProvider } from '@/contexts/LayoutContext'; +import { LayoutProvider, useLayout } from '@/contexts/LayoutContext'; import { useSession } from '@/contexts/SessionContext'; +import type { AppPath } from '@/router'; import type { AccountConnections, HookProcessInfo, QQInfo, SystemInfo, UpdateInfo } from '@/types'; +/** + * Redirects to the operator's configured landing page once (after the layout + * config loads), but only when arriving at the root and the target is a real, + * non-root nav route — so deep-links and later navigation are respected. + * Rendered INSIDE LayoutProvider (needs useLayout). + */ +function DefaultRouteRedirect() { + const { pages, ready } = useLayout(); + const navigate = useNavigate(); + const pathname = useRouterState({ select: (s) => s.location.pathname }); + const done = useRef(false); + + useEffect(() => { + if (!ready || done.current) return; + done.current = true; + const target = pages.defaultRoute; + if (target && target !== '/' && pathname === '/' && NAV_ITEMS.some((n) => n.to === target)) { + void navigate({ to: target as AppPath }); + } + }, [ready, pages.defaultRoute, pathname, navigate]); + + return null; +} + /** * The layout route. Owns the live state shared across the four pages * (polling lists, processOps, selectedUin) and renders `` inside @@ -131,6 +157,7 @@ export function AppLayout() { }} > + {/* Routes use `lazyRouteComponent` (router/index.tsx) for code-splitting, which suspends until the chunk is fetched. diff --git a/packages/webui/src/types.ts b/packages/webui/src/types.ts index 21ab0b00..a4a941eb 100644 --- a/packages/webui/src/types.ts +++ b/packages/webui/src/types.ts @@ -225,8 +225,29 @@ export interface UiLayout { navItems: UiLayoutItem[]; } +export interface UiHighlightRule { + keyword: string; + color: string; +} + +export interface UiLogsPrefs { + visibleLevels: string[]; + maxLines: number; + autoScroll: boolean; + wrap: boolean; + highlightRules: UiHighlightRule[]; +} + +export interface UiPages { + defaultRoute: string; + logs: UiLogsPrefs; + processesSort: string; + configTab: string; +} + export interface UiConfig { version: number; appearance: UiAppearance; layout: UiLayout; + pages: UiPages; }