refactor(webui): migrate routing to TanStack Router
The four-page switch lived as a string union (Page) plus an if/else
chain in AppInner, with TopBar reverse-importing Sidebar's NAV_ITEMS
to find the icon for the active tab. Adding a page touched four
places and there was no URL, no history, no deep-linking.
Move routing behind @tanstack/react-router with a layout route
(AppLayout) that owns the polling lists, processOps, selectedUin
and the unload-failed alert; child routes render through <Outlet/>
and read shared state from a new AppStateContext. AuthBoundary still
gates login / forced-password-change above the router. Sidebar uses
<Link> + useRouterState for active state; TopBar and MainLayout look
up the current path the same way.
Behaviour-preserving:
- LoginPage / ChangePasswordPage still mount above the router.
- AppLayout never unmounts during navigation, so selectedUin,
processOps state, the polling state and the unload-failed dialog
all survive page switches just like before.
- Logout calls history.replaceState('/') so the next login lands on
the overview page, matching pre-router behaviour.
- The sidebar-active-pill layoutId animation and the page-transition
AnimatePresence are preserved, keyed off pathname instead of the
removed `active` prop.
New URLs (/, /config, /logs, /settings) work on refresh because the
backend already had SPA fallback in core/src/webui/server.ts. Bundle
grows ~84KB (gzip +27KB) for the router runtime.
This commit is contained in:
13 files changed
+413
-209
No files matched your search
@@ -18,6 +18,7 @@
|
|||||||
"@radix-ui/react-separator": "^1.1.3",
|
"@radix-ui/react-separator": "^1.1.3",
|
||||||
"@radix-ui/react-slot": "^1.1.3",
|
"@radix-ui/react-slot": "^1.1.3",
|
||||||
"@radix-ui/react-tooltip": "^1.1.9",
|
"@radix-ui/react-tooltip": "^1.1.9",
|
||||||
|
"@tanstack/react-router": "^1.169.2",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^0.469.0",
|
"lucide-react": "^0.469.0",
|
||||||
|
|||||||
+16
-134
@@ -1,18 +1,12 @@
|
|||||||
import { useCallback, useEffect, useMemo, useState } from 'react';
|
import { useCallback, useEffect, useMemo, useState } from 'react';
|
||||||
|
import { RouterProvider } from '@tanstack/react-router';
|
||||||
import { TooltipProvider } from '@/components/ui/tooltip';
|
import { TooltipProvider } from '@/components/ui/tooltip';
|
||||||
import { ThemeProvider, useTheme } from '@/contexts/ThemeContext';
|
import { ThemeProvider } from '@/contexts/ThemeContext';
|
||||||
|
import { SessionProvider } from '@/contexts/SessionContext';
|
||||||
import { LoginPage } from '@/components/pages/login-page';
|
import { LoginPage } from '@/components/pages/login-page';
|
||||||
import { MainLayout } from '@/components/layout/main-layout';
|
|
||||||
import { OverviewPage } from '@/components/pages/overview-page';
|
|
||||||
import { ConfigPage } from '@/components/pages/config-page';
|
|
||||||
import { LogsPage } from '@/components/pages/logs-page';
|
|
||||||
import { SettingsPage } from '@/components/pages/settings-page';
|
|
||||||
import { ChangePasswordPage } from '@/components/pages/change-password-page';
|
import { ChangePasswordPage } from '@/components/pages/change-password-page';
|
||||||
import { ConfirmDialog } from '@/components/confirm-dialog';
|
|
||||||
import type { Page } from '@/components/layout/sidebar';
|
|
||||||
import type { HookProcessInfo, QQInfo, SystemInfo } from '@/types';
|
|
||||||
import { ApiProvider, createApiClient, useApi, type ApiClient } from '@/lib/api';
|
import { ApiProvider, createApiClient, useApi, type ApiClient } from '@/lib/api';
|
||||||
import { useHookProcessOps } from '@/hooks/use-hook-process-ops';
|
import { appRouter } from '@/router';
|
||||||
|
|
||||||
export default function App() {
|
export default function App() {
|
||||||
return (
|
return (
|
||||||
@@ -51,6 +45,15 @@ function AuthBoundary() {
|
|||||||
})();
|
})();
|
||||||
}, [client]);
|
}, [client]);
|
||||||
|
|
||||||
|
const handleLogoutComplete = useCallback(() => {
|
||||||
|
// Reset the URL so the next login lands on the overview page, matching
|
||||||
|
// the pre-router behaviour.
|
||||||
|
window.history.replaceState({}, '', '/');
|
||||||
|
setAuthed(false);
|
||||||
|
setStatus('未连接');
|
||||||
|
setMustChange(false);
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ApiProvider client={client}>
|
<ApiProvider client={client}>
|
||||||
<TooltipProvider delayDuration={150}>
|
<TooltipProvider delayDuration={150}>
|
||||||
@@ -69,14 +72,9 @@ function AuthBoundary() {
|
|||||||
) : mustChange ? (
|
) : mustChange ? (
|
||||||
<ForcedChangePasswordGate onSuccess={() => setMustChange(false)} />
|
<ForcedChangePasswordGate onSuccess={() => setMustChange(false)} />
|
||||||
) : (
|
) : (
|
||||||
<AppInner
|
<SessionProvider value={{ status, onLogoutComplete: handleLogoutComplete }}>
|
||||||
status={status}
|
<RouterProvider router={appRouter} />
|
||||||
onLogoutComplete={() => {
|
</SessionProvider>
|
||||||
setAuthed(false);
|
|
||||||
setStatus('未连接');
|
|
||||||
setMustChange(false);
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
)}
|
)}
|
||||||
</TooltipProvider>
|
</TooltipProvider>
|
||||||
</ApiProvider>
|
</ApiProvider>
|
||||||
@@ -108,119 +106,3 @@ function ForcedChangePasswordGate({ onSuccess }: { onSuccess: () => void }) {
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AppInnerProps {
|
|
||||||
status: string;
|
|
||||||
onLogoutComplete: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
function AppInner({ status, onLogoutComplete }: AppInnerProps) {
|
|
||||||
const api = useApi();
|
|
||||||
const { pollInterval } = useTheme();
|
|
||||||
const [active, setActive] = useState<Page>('overview');
|
|
||||||
|
|
||||||
const [qqList, setQqList] = useState<QQInfo[]>([]);
|
|
||||||
const [processList, setProcessList] = useState<HookProcessInfo[]>([]);
|
|
||||||
const [systemInfo, setSystemInfo] = useState<SystemInfo | null>(null);
|
|
||||||
// Lives at AppInner level so the user's selection survives across page
|
|
||||||
// navigation (ConfigPage gets unmounted when you switch tabs).
|
|
||||||
const [selectedUin, setSelectedUin] = useState<string | null>(null);
|
|
||||||
|
|
||||||
const refreshQqList = useCallback(async () => {
|
|
||||||
try {
|
|
||||||
setQqList(await api.qqList());
|
|
||||||
} catch (e) {
|
|
||||||
console.error('qq-list', e);
|
|
||||||
}
|
|
||||||
}, [api]);
|
|
||||||
|
|
||||||
const refreshProcesses = useCallback(async () => {
|
|
||||||
try {
|
|
||||||
setProcessList(await api.processes.list());
|
|
||||||
} catch (e) {
|
|
||||||
console.error('processes', e);
|
|
||||||
}
|
|
||||||
}, [api]);
|
|
||||||
|
|
||||||
const refreshSystem = useCallback(async () => {
|
|
||||||
try {
|
|
||||||
setSystemInfo(await api.system());
|
|
||||||
} catch (e) {
|
|
||||||
console.error('system', e);
|
|
||||||
}
|
|
||||||
}, [api]);
|
|
||||||
|
|
||||||
const { ops: processOps, unloadFailedAlert, dismissUnloadFailedAlert } = useHookProcessOps({
|
|
||||||
onAfterOp: refreshProcesses,
|
|
||||||
});
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (pollInterval <= 0) return;
|
|
||||||
let cancelled = false;
|
|
||||||
const tick = async () => {
|
|
||||||
if (cancelled) return;
|
|
||||||
await Promise.all([refreshQqList(), refreshProcesses(), refreshSystem()]);
|
|
||||||
};
|
|
||||||
tick();
|
|
||||||
const interval = setInterval(tick, pollInterval);
|
|
||||||
return () => {
|
|
||||||
cancelled = true;
|
|
||||||
clearInterval(interval);
|
|
||||||
};
|
|
||||||
}, [pollInterval, refreshQqList, refreshProcesses, refreshSystem]);
|
|
||||||
|
|
||||||
const handleLogout = useCallback(async () => {
|
|
||||||
await api.logout();
|
|
||||||
setQqList([]);
|
|
||||||
setProcessList([]);
|
|
||||||
setSystemInfo(null);
|
|
||||||
setSelectedUin(null);
|
|
||||||
onLogoutComplete();
|
|
||||||
}, [api, onLogoutComplete]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<MainLayout active={active} onNavigate={setActive} status={status} onLogout={handleLogout}>
|
|
||||||
{active === 'overview' && (
|
|
||||||
<OverviewPage
|
|
||||||
qqList={qqList}
|
|
||||||
status={status}
|
|
||||||
processList={processList}
|
|
||||||
systemInfo={systemInfo}
|
|
||||||
onRefreshProcesses={refreshProcesses}
|
|
||||||
onRefreshSystem={refreshSystem}
|
|
||||||
processOps={processOps}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{active === 'config' && (
|
|
||||||
<ConfigPage
|
|
||||||
qqList={qqList}
|
|
||||||
selectedUin={selectedUin}
|
|
||||||
onSelectedUinChange={setSelectedUin}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{active === 'logs' && <LogsPage />}
|
|
||||||
{active === 'settings' && <SettingsPage onLogout={handleLogout} />}
|
|
||||||
</MainLayout>
|
|
||||||
|
|
||||||
<ConfirmDialog
|
|
||||||
open={!!unloadFailedAlert}
|
|
||||||
onOpenChange={(open) => !open && dismissUnloadFailedAlert()}
|
|
||||||
title="卸载失败"
|
|
||||||
description={
|
|
||||||
unloadFailedAlert ? (
|
|
||||||
<>
|
|
||||||
<p>进程 {unloadFailedAlert.pid} 的 SnowLuma DLL 卸载失败。</p>
|
|
||||||
<p className="mt-2 text-sm">{unloadFailedAlert.error}</p>
|
|
||||||
<p className="mt-2 text-sm text-muted-foreground">
|
|
||||||
系统将继续尝试重新连接该进程。如需彻底卸载,请重启 QQ 进程。
|
|
||||||
</p>
|
|
||||||
</>
|
|
||||||
) : null
|
|
||||||
}
|
|
||||||
confirmText="知道了"
|
|
||||||
onConfirm={dismissUnloadFailedAlert}
|
|
||||||
/>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,26 +1,26 @@
|
|||||||
import { useEffect, useState, type ReactNode } from 'react';
|
import { useEffect, useState, type ReactNode } from 'react';
|
||||||
import { motion, AnimatePresence } from 'motion/react';
|
import { motion, AnimatePresence } from 'motion/react';
|
||||||
|
import { useRouterState } from '@tanstack/react-router';
|
||||||
import { Sheet, SheetContent } from '@/components/ui/sheet';
|
import { Sheet, SheetContent } from '@/components/ui/sheet';
|
||||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||||
import { Sidebar, type Page } from '@/components/layout/sidebar';
|
import { Sidebar } from '@/components/layout/sidebar';
|
||||||
import { TopBar } from '@/components/layout/top-bar';
|
import { TopBar } from '@/components/layout/top-bar';
|
||||||
import { useMediaQuery } from '@/hooks/use-media-query';
|
import { useMediaQuery } from '@/hooks/use-media-query';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
interface MainLayoutProps {
|
interface MainLayoutProps {
|
||||||
active: Page;
|
|
||||||
onNavigate: (page: Page) => void;
|
|
||||||
status: string;
|
status: string;
|
||||||
onLogout: () => void;
|
onLogout: () => void;
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function MainLayout({ active, onNavigate, status, onLogout, children }: MainLayoutProps) {
|
export function MainLayout({ status, onLogout, children }: MainLayoutProps) {
|
||||||
const isMobile = !useMediaQuery('(min-width: 768px)');
|
const isMobile = !useMediaQuery('(min-width: 768px)');
|
||||||
const [collapsed, setCollapsed] = useState(() => {
|
const [collapsed, setCollapsed] = useState(() => {
|
||||||
return localStorage.getItem('snowluma_sidebar_collapsed') === '1';
|
return localStorage.getItem('snowluma_sidebar_collapsed') === '1';
|
||||||
});
|
});
|
||||||
const [mobileOpen, setMobileOpen] = useState(false);
|
const [mobileOpen, setMobileOpen] = useState(false);
|
||||||
|
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
localStorage.setItem('snowluma_sidebar_collapsed', collapsed ? '1' : '0');
|
localStorage.setItem('snowluma_sidebar_collapsed', collapsed ? '1' : '0');
|
||||||
@@ -36,7 +36,7 @@ export function MainLayout({ active, onNavigate, status, onLogout, children }: M
|
|||||||
transition={{ type: 'spring', stiffness: 280, damping: 32 }}
|
transition={{ type: 'spring', stiffness: 280, damping: 32 }}
|
||||||
className="relative h-full shrink-0 border-r overflow-hidden"
|
className="relative h-full shrink-0 border-r overflow-hidden"
|
||||||
>
|
>
|
||||||
<Sidebar active={active} onNavigate={onNavigate} collapsed={collapsed} />
|
<Sidebar collapsed={collapsed} />
|
||||||
</motion.aside>
|
</motion.aside>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@@ -44,11 +44,7 @@ export function MainLayout({ active, onNavigate, status, onLogout, children }: M
|
|||||||
{isMobile && (
|
{isMobile && (
|
||||||
<Sheet open={mobileOpen} onOpenChange={setMobileOpen}>
|
<Sheet open={mobileOpen} onOpenChange={setMobileOpen}>
|
||||||
<SheetContent side="left" className="w-64 max-w-[80vw] p-0">
|
<SheetContent side="left" className="w-64 max-w-[80vw] p-0">
|
||||||
<Sidebar
|
<Sidebar onItemClick={() => setMobileOpen(false)} />
|
||||||
active={active}
|
|
||||||
onNavigate={onNavigate}
|
|
||||||
onItemClick={() => setMobileOpen(false)}
|
|
||||||
/>
|
|
||||||
</SheetContent>
|
</SheetContent>
|
||||||
</Sheet>
|
</Sheet>
|
||||||
)}
|
)}
|
||||||
@@ -56,7 +52,6 @@ export function MainLayout({ active, onNavigate, status, onLogout, children }: M
|
|||||||
{/* Main column */}
|
{/* Main column */}
|
||||||
<div className="flex min-w-0 flex-1 flex-col">
|
<div className="flex min-w-0 flex-1 flex-col">
|
||||||
<TopBar
|
<TopBar
|
||||||
active={active}
|
|
||||||
status={status}
|
status={status}
|
||||||
collapsed={collapsed}
|
collapsed={collapsed}
|
||||||
onToggleCollapse={() => setCollapsed((v) => !v)}
|
onToggleCollapse={() => setCollapsed((v) => !v)}
|
||||||
@@ -70,7 +65,7 @@ export function MainLayout({ active, onNavigate, status, onLogout, children }: M
|
|||||||
<div className="mx-auto w-full max-w-7xl px-4 py-5 sm:px-6 sm:py-6 lg:px-8">
|
<div className="mx-auto w-full max-w-7xl px-4 py-5 sm:px-6 sm:py-6 lg:px-8">
|
||||||
<AnimatePresence mode="wait">
|
<AnimatePresence mode="wait">
|
||||||
<motion.div
|
<motion.div
|
||||||
key={active}
|
key={pathname}
|
||||||
initial={{ opacity: 0, y: 10 }}
|
initial={{ opacity: 0, y: 10 }}
|
||||||
animate={{ opacity: 1, y: 0 }}
|
animate={{ opacity: 1, y: 0 }}
|
||||||
exit={{ opacity: 0, y: -8 }}
|
exit={{ opacity: 0, y: -8 }}
|
||||||
|
|||||||
@@ -1,27 +1,34 @@
|
|||||||
import { LayoutDashboard, Settings, SlidersHorizontal, Terminal } from 'lucide-react';
|
import { LayoutDashboard, Settings, SlidersHorizontal, Terminal } from 'lucide-react';
|
||||||
import { motion } from 'motion/react';
|
import { motion } from 'motion/react';
|
||||||
|
import { Link, useRouterState } from '@tanstack/react-router';
|
||||||
import { ScrollArea } from '@/components/ui/scroll-area';
|
import { ScrollArea } from '@/components/ui/scroll-area';
|
||||||
import { Separator } from '@/components/ui/separator';
|
import { Separator } from '@/components/ui/separator';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
import { APP_NAME, APP_VERSION } from '@/types';
|
import { APP_NAME, APP_VERSION } from '@/types';
|
||||||
|
import type { AppPath } from '@/router';
|
||||||
|
|
||||||
export type Page = 'overview' | 'config' | 'logs' | 'settings';
|
export interface NavItem {
|
||||||
|
to: AppPath;
|
||||||
|
label: string;
|
||||||
|
icon: typeof LayoutDashboard;
|
||||||
|
description: string;
|
||||||
|
}
|
||||||
|
|
||||||
export const NAV_ITEMS: { page: Page; label: string; icon: typeof LayoutDashboard; description: string }[] = [
|
export const NAV_ITEMS: NavItem[] = [
|
||||||
{ page: 'overview', label: '总览', icon: LayoutDashboard, description: '主机与服务状态' },
|
{ to: '/', label: '总览', icon: LayoutDashboard, description: '主机与服务状态' },
|
||||||
{ page: 'config', label: '节点配置', icon: Settings, description: 'OneBot 协议端点' },
|
{ to: '/config', label: '节点配置', icon: Settings, description: 'OneBot 协议端点' },
|
||||||
{ page: 'logs', label: '日志', icon: Terminal, description: '实时事件流' },
|
{ to: '/logs', label: '日志', icon: Terminal, description: '实时事件流' },
|
||||||
{ page: 'settings', label: '系统设置', icon: SlidersHorizontal, description: '主题与账号' },
|
{ to: '/settings', label: '系统设置', icon: SlidersHorizontal, description: '主题与账号' },
|
||||||
];
|
];
|
||||||
|
|
||||||
interface SidebarProps {
|
interface SidebarProps {
|
||||||
active: Page;
|
|
||||||
onNavigate: (page: Page) => void;
|
|
||||||
collapsed?: boolean;
|
collapsed?: boolean;
|
||||||
onItemClick?: () => void;
|
onItemClick?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function Sidebar({ active, onNavigate, collapsed = false, onItemClick }: SidebarProps) {
|
export function Sidebar({ collapsed = false, onItemClick }: SidebarProps) {
|
||||||
|
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="flex h-full w-full flex-col bg-sidebar text-sidebar-foreground">
|
<div className="flex h-full w-full flex-col bg-sidebar text-sidebar-foreground">
|
||||||
{/* Brand */}
|
{/* Brand */}
|
||||||
@@ -43,23 +50,21 @@ export function Sidebar({ active, onNavigate, collapsed = false, onItemClick }:
|
|||||||
{/* Nav */}
|
{/* Nav */}
|
||||||
<ScrollArea className="flex-1 min-h-0" viewportClassName="[&>div]:!block">
|
<ScrollArea className="flex-1 min-h-0" viewportClassName="[&>div]:!block">
|
||||||
<nav className={cn('flex flex-col gap-1 p-2', collapsed && 'items-center')}>
|
<nav className={cn('flex flex-col gap-1 p-2', collapsed && 'items-center')}>
|
||||||
{NAV_ITEMS.map(({ page, label, icon: Icon, description }) => {
|
{NAV_ITEMS.map(({ to, label, icon: Icon, description }) => {
|
||||||
const isActive = active === page;
|
const isActive = pathname === to;
|
||||||
return (
|
return (
|
||||||
<button
|
<Link
|
||||||
key={page}
|
key={to}
|
||||||
type="button"
|
to={to}
|
||||||
title={collapsed ? label : undefined}
|
title={collapsed ? label : undefined}
|
||||||
onClick={() => {
|
onClick={onItemClick}
|
||||||
onNavigate(page);
|
aria-current={isActive ? 'page' : undefined}
|
||||||
onItemClick?.();
|
|
||||||
}}
|
|
||||||
className={cn(
|
className={cn(
|
||||||
'group relative flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors cursor-pointer outline-none',
|
'group relative flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-sm font-medium transition-colors cursor-pointer outline-none',
|
||||||
collapsed && 'w-10 justify-center px-0',
|
collapsed && 'w-10 justify-center px-0',
|
||||||
isActive
|
isActive
|
||||||
? 'text-sidebar-accent-foreground'
|
? 'text-sidebar-accent-foreground'
|
||||||
: 'text-muted-foreground hover:bg-sidebar-accent/40 hover:text-foreground'
|
: 'text-muted-foreground hover:bg-sidebar-accent/40 hover:text-foreground',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{isActive && (
|
{isActive && (
|
||||||
@@ -76,7 +81,7 @@ export function Sidebar({ active, onNavigate, collapsed = false, onItemClick }:
|
|||||||
<span className="text-[10px] font-normal text-muted-foreground truncate">{description}</span>
|
<span className="text-[10px] font-normal text-muted-foreground truncate">{description}</span>
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
</button>
|
</Link>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { LogOut, Menu, PanelLeftClose, PanelLeftOpen } from 'lucide-react';
|
import { LogOut, Menu, PanelLeftClose, PanelLeftOpen } from 'lucide-react';
|
||||||
import { motion, AnimatePresence } from 'motion/react';
|
import { motion, AnimatePresence } from 'motion/react';
|
||||||
|
import { useRouterState } from '@tanstack/react-router';
|
||||||
import { Button } from '@/components/ui/button';
|
import { Button } from '@/components/ui/button';
|
||||||
import { Badge } from '@/components/ui/badge';
|
import { Badge } from '@/components/ui/badge';
|
||||||
import { ThemeToggle } from '@/components/theme-toggle';
|
import { ThemeToggle } from '@/components/theme-toggle';
|
||||||
import { ConfirmDialog } from '@/components/confirm-dialog';
|
import { ConfirmDialog } from '@/components/confirm-dialog';
|
||||||
import type { Page } from '@/components/layout/sidebar';
|
|
||||||
import { NAV_ITEMS } from '@/components/layout/sidebar';
|
import { NAV_ITEMS } from '@/components/layout/sidebar';
|
||||||
|
|
||||||
interface TopBarProps {
|
interface TopBarProps {
|
||||||
active: Page;
|
|
||||||
status: string;
|
status: string;
|
||||||
collapsed: boolean;
|
collapsed: boolean;
|
||||||
onToggleCollapse: () => void;
|
onToggleCollapse: () => void;
|
||||||
@@ -19,7 +18,6 @@ interface TopBarProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TopBar({
|
export function TopBar({
|
||||||
active,
|
|
||||||
status,
|
status,
|
||||||
collapsed,
|
collapsed,
|
||||||
onToggleCollapse,
|
onToggleCollapse,
|
||||||
@@ -28,7 +26,8 @@ export function TopBar({
|
|||||||
isMobile,
|
isMobile,
|
||||||
}: TopBarProps) {
|
}: TopBarProps) {
|
||||||
const [confirmLogout, setConfirmLogout] = useState(false);
|
const [confirmLogout, setConfirmLogout] = useState(false);
|
||||||
const meta = NAV_ITEMS.find((n) => n.page === active);
|
const pathname = useRouterState({ select: (s) => s.location.pathname });
|
||||||
|
const meta = NAV_ITEMS.find((n) => n.to === pathname);
|
||||||
const PageIcon = meta?.icon;
|
const PageIcon = meta?.icon;
|
||||||
const online = status === '已连接';
|
const online = status === '已连接';
|
||||||
|
|
||||||
@@ -56,7 +55,7 @@ export function TopBar({
|
|||||||
{/* Page title */}
|
{/* Page title */}
|
||||||
<AnimatePresence mode="wait">
|
<AnimatePresence mode="wait">
|
||||||
<motion.div
|
<motion.div
|
||||||
key={active}
|
key={pathname}
|
||||||
initial={{ opacity: 0, x: -8 }}
|
initial={{ opacity: 0, x: -8 }}
|
||||||
animate={{ opacity: 1, x: 0 }}
|
animate={{ opacity: 1, x: 0 }}
|
||||||
exit={{ opacity: 0, x: 8 }}
|
exit={{ opacity: 0, x: 8 }}
|
||||||
|
|||||||
@@ -16,16 +16,10 @@ import type {
|
|||||||
NetworkKind,
|
NetworkKind,
|
||||||
OneBotConfig,
|
OneBotConfig,
|
||||||
OneBotNetworks,
|
OneBotNetworks,
|
||||||
QQInfo,
|
|
||||||
WsRole,
|
WsRole,
|
||||||
} from '@/types';
|
} from '@/types';
|
||||||
import { useOneBotInstanceConfig } from '@/hooks/use-onebot-instance-config';
|
import { useOneBotInstanceConfig } from '@/hooks/use-onebot-instance-config';
|
||||||
|
import { useAppState } from '@/contexts/AppStateContext';
|
||||||
interface ConfigPageProps {
|
|
||||||
qqList: QQInfo[];
|
|
||||||
selectedUin: string | null;
|
|
||||||
onSelectedUinChange: (uin: string | null) => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
function qqAvatarUrl(uin: string) {
|
function qqAvatarUrl(uin: string) {
|
||||||
return `/avatar/${encodeURIComponent(uin)}`;
|
return `/avatar/${encodeURIComponent(uin)}`;
|
||||||
@@ -95,7 +89,8 @@ function Section({ title, description, onAdd, children, count }: SectionProps) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function ConfigPage({ qqList, selectedUin, onSelectedUinChange }: ConfigPageProps) {
|
export function ConfigPage() {
|
||||||
|
const { qqList, selectedUin, setSelectedUin } = useAppState();
|
||||||
const {
|
const {
|
||||||
config,
|
config,
|
||||||
setConfig,
|
setConfig,
|
||||||
@@ -106,7 +101,10 @@ export function ConfigPage({ qqList, selectedUin, onSelectedUinChange }: ConfigP
|
|||||||
cancelSwitch,
|
cancelSwitch,
|
||||||
save,
|
save,
|
||||||
saveStatus,
|
saveStatus,
|
||||||
} = useOneBotInstanceConfig(qqList, { selectedUin, onSelectedUinChange });
|
} = useOneBotInstanceConfig(qqList, {
|
||||||
|
selectedUin,
|
||||||
|
onSelectedUinChange: setSelectedUin,
|
||||||
|
});
|
||||||
const [confirmSave, setConfirmSave] = useState(false);
|
const [confirmSave, setConfirmSave] = useState(false);
|
||||||
|
|
||||||
const update = (next: OneBotConfig) => setConfig(next);
|
const update = (next: OneBotConfig) => setConfig(next);
|
||||||
|
|||||||
@@ -22,18 +22,9 @@ import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
|||||||
import { Skeleton } from '@/components/ui/skeleton';
|
import { Skeleton } from '@/components/ui/skeleton';
|
||||||
import { ConfirmDialog } from '@/components/confirm-dialog';
|
import { ConfirmDialog } from '@/components/confirm-dialog';
|
||||||
import { cn, formatBytes, formatUptime } from '@/lib/utils';
|
import { cn, formatBytes, formatUptime } from '@/lib/utils';
|
||||||
import type { HookProcessInfo, QQInfo, SystemInfo } from '@/types';
|
import type { HookProcessInfo } from '@/types';
|
||||||
import type { HookProcessOps } from '@/hooks/use-hook-process-ops';
|
import { useAppState } from '@/contexts/AppStateContext';
|
||||||
|
import { useSession } from '@/contexts/SessionContext';
|
||||||
interface OverviewPageProps {
|
|
||||||
qqList: QQInfo[];
|
|
||||||
status: string;
|
|
||||||
processList: HookProcessInfo[];
|
|
||||||
systemInfo: SystemInfo | null;
|
|
||||||
onRefreshProcesses: () => void;
|
|
||||||
onRefreshSystem: () => void;
|
|
||||||
processOps: HookProcessOps;
|
|
||||||
}
|
|
||||||
|
|
||||||
const processStatusLabel: Record<HookProcessInfo['status'], string> = {
|
const processStatusLabel: Record<HookProcessInfo['status'], string> = {
|
||||||
available: '可加载',
|
available: '可加载',
|
||||||
@@ -91,15 +82,10 @@ function StatTile({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function OverviewPage({
|
export function OverviewPage() {
|
||||||
qqList,
|
const { qqList, processList, systemInfo, processOps, refreshProcesses, refreshSystem } =
|
||||||
status,
|
useAppState();
|
||||||
processList,
|
const { status } = useSession();
|
||||||
systemInfo,
|
|
||||||
onRefreshProcesses,
|
|
||||||
onRefreshSystem,
|
|
||||||
processOps,
|
|
||||||
}: OverviewPageProps) {
|
|
||||||
const { statusOf, banner: processActionStatus, load, unload, refresh } = processOps;
|
const { statusOf, banner: processActionStatus, load, unload, refresh } = processOps;
|
||||||
const [confirm, setConfirm] = useState<
|
const [confirm, setConfirm] = useState<
|
||||||
| { kind: 'load' | 'unload'; pid: number; name: string }
|
| { kind: 'load' | 'unload'; pid: number; name: string }
|
||||||
@@ -157,7 +143,7 @@ export function OverviewPage({
|
|||||||
: '正在采集主机信息…'}
|
: '正在采集主机信息…'}
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</div>
|
</div>
|
||||||
<Button variant="outline" size="sm" onClick={onRefreshSystem}>
|
<Button variant="outline" size="sm" onClick={refreshSystem}>
|
||||||
<RefreshCw className="size-3.5" /> 刷新
|
<RefreshCw className="size-3.5" /> 刷新
|
||||||
</Button>
|
</Button>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
@@ -260,7 +246,7 @@ export function OverviewPage({
|
|||||||
加载 SnowLuma 后会监听登录状态,登录后自动接入 OneBot 流程
|
加载 SnowLuma 后会监听登录状态,登录后自动接入 OneBot 流程
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</div>
|
</div>
|
||||||
<Button variant="outline" size="sm" onClick={onRefreshProcesses}>
|
<Button variant="outline" size="sm" onClick={refreshProcesses}>
|
||||||
<RefreshCw className="size-3.5" /> 刷新
|
<RefreshCw className="size-3.5" /> 刷新
|
||||||
</Button>
|
</Button>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|||||||
@@ -16,13 +16,9 @@ import {
|
|||||||
} from '@/contexts/ThemeContext';
|
} from '@/contexts/ThemeContext';
|
||||||
import { ChangePasswordPage } from '@/components/pages/change-password-page';
|
import { ChangePasswordPage } from '@/components/pages/change-password-page';
|
||||||
import { useApi } from '@/lib/api';
|
import { useApi } from '@/lib/api';
|
||||||
|
import { useAppState } from '@/contexts/AppStateContext';
|
||||||
import { cn } from '@/lib/utils';
|
import { cn } from '@/lib/utils';
|
||||||
|
|
||||||
interface SettingsPageProps {
|
|
||||||
/** Called after successful logout (e.g. all-sessions invalidated). */
|
|
||||||
onLogout: () => void;
|
|
||||||
}
|
|
||||||
|
|
||||||
const MODE_OPTIONS: { value: ThemeMode; label: string; icon: typeof Sun }[] = [
|
const MODE_OPTIONS: { value: ThemeMode; label: string; icon: typeof Sun }[] = [
|
||||||
{ value: 'light', label: '浅色', icon: Sun },
|
{ value: 'light', label: '浅色', icon: Sun },
|
||||||
{ value: 'dark', label: '深色', icon: Moon },
|
{ value: 'dark', label: '深色', icon: Moon },
|
||||||
@@ -34,8 +30,9 @@ const DENSITY_OPTIONS: { value: Density; label: string; description: string }[]
|
|||||||
{ value: 'compact', label: '紧凑', description: '更小的字号与行距,单屏放更多内容' },
|
{ value: 'compact', label: '紧凑', description: '更小的字号与行距,单屏放更多内容' },
|
||||||
];
|
];
|
||||||
|
|
||||||
export function SettingsPage({ onLogout }: SettingsPageProps) {
|
export function SettingsPage() {
|
||||||
const api = useApi();
|
const api = useApi();
|
||||||
|
const { onLogout } = useAppState();
|
||||||
const {
|
const {
|
||||||
mode, setMode,
|
mode, setMode,
|
||||||
accent, setAccent,
|
accent, setAccent,
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
import { createContext, useContext, type ReactNode } from 'react';
|
||||||
|
import type { HookProcessInfo, QQInfo, SystemInfo } from '@/types';
|
||||||
|
import type { HookProcessOps } from '@/hooks/use-hook-process-ops';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Live mutable state owned by AppLayout and shared with the child route
|
||||||
|
* components rendered inside its `<Outlet />`. Pages used to receive these
|
||||||
|
* via prop drilling — now they pull from context so adding a new page does
|
||||||
|
* not touch AppLayout.
|
||||||
|
*/
|
||||||
|
export interface AppStateValue {
|
||||||
|
qqList: QQInfo[];
|
||||||
|
processList: HookProcessInfo[];
|
||||||
|
systemInfo: SystemInfo | null;
|
||||||
|
selectedUin: string | null;
|
||||||
|
setSelectedUin: (uin: string | null) => void;
|
||||||
|
processOps: HookProcessOps;
|
||||||
|
refreshProcesses: () => void;
|
||||||
|
refreshSystem: () => void;
|
||||||
|
/** Triggered from the topbar logout button. */
|
||||||
|
onLogout: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const AppStateContext = createContext<AppStateValue | null>(null);
|
||||||
|
|
||||||
|
export function AppStateProvider({
|
||||||
|
value,
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
value: AppStateValue;
|
||||||
|
children: ReactNode;
|
||||||
|
}) {
|
||||||
|
return <AppStateContext.Provider value={value}>{children}</AppStateContext.Provider>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useAppState(): AppStateValue {
|
||||||
|
const v = useContext(AppStateContext);
|
||||||
|
if (!v) throw new Error('useAppState must be used inside <AppStateProvider>');
|
||||||
|
return v;
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { createContext, useContext, type ReactNode } from 'react';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auth-level state surfaced into the router subtree. `AuthBoundary` mints
|
||||||
|
* this and `AppLayout` consumes it — used to drive the status badge and to
|
||||||
|
* complete logout after page-local state has been cleared.
|
||||||
|
*/
|
||||||
|
export interface SessionValue {
|
||||||
|
status: string;
|
||||||
|
/** Invoked by AppLayout's logout handler after it has scrubbed its own state. */
|
||||||
|
onLogoutComplete: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const SessionContext = createContext<SessionValue | null>(null);
|
||||||
|
|
||||||
|
export function SessionProvider({
|
||||||
|
value,
|
||||||
|
children,
|
||||||
|
}: {
|
||||||
|
value: SessionValue;
|
||||||
|
children: ReactNode;
|
||||||
|
}) {
|
||||||
|
return <SessionContext.Provider value={value}>{children}</SessionContext.Provider>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function useSession(): SessionValue {
|
||||||
|
const v = useContext(SessionContext);
|
||||||
|
if (!v) throw new Error('useSession must be used inside <SessionProvider>');
|
||||||
|
return v;
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
import { useCallback, useEffect, useState } from 'react';
|
||||||
|
import { Outlet } 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 { ConfirmDialog } from '@/components/confirm-dialog';
|
||||||
|
import { AppStateProvider } from '@/contexts/AppStateContext';
|
||||||
|
import { useSession } from '@/contexts/SessionContext';
|
||||||
|
import type { HookProcessInfo, QQInfo, SystemInfo } from '@/types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The layout route. Owns the live state shared across the four pages
|
||||||
|
* (polling lists, processOps, selectedUin) and renders `<Outlet />` inside
|
||||||
|
* the chrome. The unload-failed alert sits here so it survives navigation
|
||||||
|
* away from the overview page.
|
||||||
|
*/
|
||||||
|
export function AppLayout() {
|
||||||
|
const api = useApi();
|
||||||
|
const { pollInterval } = useTheme();
|
||||||
|
const session = useSession();
|
||||||
|
|
||||||
|
const [qqList, setQqList] = useState<QQInfo[]>([]);
|
||||||
|
const [processList, setProcessList] = useState<HookProcessInfo[]>([]);
|
||||||
|
const [systemInfo, setSystemInfo] = useState<SystemInfo | null>(null);
|
||||||
|
const [selectedUin, setSelectedUin] = useState<string | null>(null);
|
||||||
|
|
||||||
|
const refreshQqList = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
setQqList(await api.qqList());
|
||||||
|
} catch (e) {
|
||||||
|
console.error('qq-list', e);
|
||||||
|
}
|
||||||
|
}, [api]);
|
||||||
|
|
||||||
|
const refreshProcesses = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
setProcessList(await api.processes.list());
|
||||||
|
} catch (e) {
|
||||||
|
console.error('processes', e);
|
||||||
|
}
|
||||||
|
}, [api]);
|
||||||
|
|
||||||
|
const refreshSystem = useCallback(async () => {
|
||||||
|
try {
|
||||||
|
setSystemInfo(await api.system());
|
||||||
|
} catch (e) {
|
||||||
|
console.error('system', e);
|
||||||
|
}
|
||||||
|
}, [api]);
|
||||||
|
|
||||||
|
const { ops: processOps, unloadFailedAlert, dismissUnloadFailedAlert } = useHookProcessOps({
|
||||||
|
onAfterOp: refreshProcesses,
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (pollInterval <= 0) return;
|
||||||
|
let cancelled = false;
|
||||||
|
const tick = async () => {
|
||||||
|
if (cancelled) return;
|
||||||
|
await Promise.all([refreshQqList(), refreshProcesses(), refreshSystem()]);
|
||||||
|
};
|
||||||
|
tick();
|
||||||
|
const interval = setInterval(tick, pollInterval);
|
||||||
|
return () => {
|
||||||
|
cancelled = true;
|
||||||
|
clearInterval(interval);
|
||||||
|
};
|
||||||
|
}, [pollInterval, refreshQqList, refreshProcesses, refreshSystem]);
|
||||||
|
|
||||||
|
const handleLogout = useCallback(async () => {
|
||||||
|
await api.logout();
|
||||||
|
setQqList([]);
|
||||||
|
setProcessList([]);
|
||||||
|
setSystemInfo(null);
|
||||||
|
setSelectedUin(null);
|
||||||
|
session.onLogoutComplete();
|
||||||
|
}, [api, session]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppStateProvider
|
||||||
|
value={{
|
||||||
|
qqList,
|
||||||
|
processList,
|
||||||
|
systemInfo,
|
||||||
|
selectedUin,
|
||||||
|
setSelectedUin,
|
||||||
|
processOps,
|
||||||
|
refreshProcesses,
|
||||||
|
refreshSystem,
|
||||||
|
onLogout: handleLogout,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<MainLayout status={session.status} onLogout={handleLogout}>
|
||||||
|
<Outlet />
|
||||||
|
</MainLayout>
|
||||||
|
|
||||||
|
<ConfirmDialog
|
||||||
|
open={!!unloadFailedAlert}
|
||||||
|
onOpenChange={(open) => !open && dismissUnloadFailedAlert()}
|
||||||
|
title="卸载失败"
|
||||||
|
description={
|
||||||
|
unloadFailedAlert ? (
|
||||||
|
<>
|
||||||
|
<p>进程 {unloadFailedAlert.pid} 的 SnowLuma DLL 卸载失败。</p>
|
||||||
|
<p className="mt-2 text-sm">{unloadFailedAlert.error}</p>
|
||||||
|
<p className="mt-2 text-sm text-muted-foreground">
|
||||||
|
系统将继续尝试重新连接该进程。如需彻底卸载,请重启 QQ 进程。
|
||||||
|
</p>
|
||||||
|
</>
|
||||||
|
) : null
|
||||||
|
}
|
||||||
|
confirmText="知道了"
|
||||||
|
onConfirm={dismissUnloadFailedAlert}
|
||||||
|
/>
|
||||||
|
</AppStateProvider>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import {
|
||||||
|
createRootRoute,
|
||||||
|
createRoute,
|
||||||
|
createRouter,
|
||||||
|
Outlet,
|
||||||
|
} from '@tanstack/react-router';
|
||||||
|
import { OverviewPage } from '@/components/pages/overview-page';
|
||||||
|
import { ConfigPage } from '@/components/pages/config-page';
|
||||||
|
import { LogsPage } from '@/components/pages/logs-page';
|
||||||
|
import { SettingsPage } from '@/components/pages/settings-page';
|
||||||
|
import { AppLayout } from './app-layout';
|
||||||
|
|
||||||
|
const rootRoute = createRootRoute({
|
||||||
|
component: () => <Outlet />,
|
||||||
|
});
|
||||||
|
|
||||||
|
const appLayoutRoute = createRoute({
|
||||||
|
id: 'app-layout',
|
||||||
|
getParentRoute: () => rootRoute,
|
||||||
|
component: AppLayout,
|
||||||
|
});
|
||||||
|
|
||||||
|
const overviewRoute = createRoute({
|
||||||
|
path: '/',
|
||||||
|
getParentRoute: () => appLayoutRoute,
|
||||||
|
component: OverviewPage,
|
||||||
|
});
|
||||||
|
|
||||||
|
const configRoute = createRoute({
|
||||||
|
path: '/config',
|
||||||
|
getParentRoute: () => appLayoutRoute,
|
||||||
|
component: ConfigPage,
|
||||||
|
});
|
||||||
|
|
||||||
|
const logsRoute = createRoute({
|
||||||
|
path: '/logs',
|
||||||
|
getParentRoute: () => appLayoutRoute,
|
||||||
|
component: LogsPage,
|
||||||
|
});
|
||||||
|
|
||||||
|
const settingsRoute = createRoute({
|
||||||
|
path: '/settings',
|
||||||
|
getParentRoute: () => appLayoutRoute,
|
||||||
|
component: SettingsPage,
|
||||||
|
});
|
||||||
|
|
||||||
|
const routeTree = rootRoute.addChildren([
|
||||||
|
appLayoutRoute.addChildren([overviewRoute, configRoute, logsRoute, settingsRoute]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
export const appRouter = createRouter({
|
||||||
|
routeTree,
|
||||||
|
defaultPreload: 'intent',
|
||||||
|
});
|
||||||
|
|
||||||
|
declare module '@tanstack/react-router' {
|
||||||
|
interface Register {
|
||||||
|
router: typeof appRouter;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Paths registered on the layout — single source of truth for nav metadata. */
|
||||||
|
export type AppPath = '/' | '/config' | '/logs' | '/settings';
|
||||||
Generated
+90
@@ -110,6 +110,9 @@ importers:
|
|||||||
'@radix-ui/react-tooltip':
|
'@radix-ui/react-tooltip':
|
||||||
specifier: ^1.1.9
|
specifier: ^1.1.9
|
||||||
version: 1.2.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
|
version: 1.2.8(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])
|
||||||
|
'@tanstack/react-router':
|
||||||
|
specifier: ^1.169.2
|
||||||
|
version: 1.169.2([email protected]([email protected]))([email protected])
|
||||||
class-variance-authority:
|
class-variance-authority:
|
||||||
specifier: ^0.7.1
|
specifier: ^0.7.1
|
||||||
version: 0.7.1
|
version: 0.7.1
|
||||||
@@ -1150,6 +1153,30 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
vite: ^5.2.0 || ^6 || ^7 || ^8
|
vite: ^5.2.0 || ^6 || ^7 || ^8
|
||||||
|
|
||||||
|
'@tanstack/[email protected]':
|
||||||
|
resolution: {integrity: sha512-NaOGLRrddszbQj9upGat6HG/4TKvXLvu+osAIgfxPYA+eIvYKv8GKDJOrY2D3/U9MRnKfMWD7bU4jeD4xmqyIg==}
|
||||||
|
engines: {node: '>=20.19'}
|
||||||
|
|
||||||
|
'@tanstack/[email protected]':
|
||||||
|
resolution: {integrity: sha512-OJM7Kguc7ERnweaNRWsyWgIKcl3z23rD1B4jaxjzd9RGdnzpt2HfrWa9rggbT0Hfzhfo4D2ZmsfoTme035tniQ==}
|
||||||
|
engines: {node: '>=20.19'}
|
||||||
|
peerDependencies:
|
||||||
|
react: '>=18.0.0 || >=19.0.0'
|
||||||
|
react-dom: '>=18.0.0 || >=19.0.0'
|
||||||
|
|
||||||
|
'@tanstack/[email protected]':
|
||||||
|
resolution: {integrity: sha512-y2iHd/N9OkoQbFJLUX1T9vbc2O9tjH0pQRgTcx1/Nz4IlwLvkgpuglXUx+mXt0g5ZDFrEeDnONPqkbfxXJKwRg==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
|
react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
|
|
||||||
|
'@tanstack/[email protected]':
|
||||||
|
resolution: {integrity: sha512-5sm0DJF1A7Mz+9gy4Gz/lLovNailK3yot4vYvz9MkBUPw26uLnhQiR8hSCYxucjE0wD6Mdlc5l+Z0/XTlZ7xHw==}
|
||||||
|
engines: {node: '>=20.19'}
|
||||||
|
|
||||||
|
'@tanstack/[email protected]':
|
||||||
|
resolution: {integrity: sha512-8reSzl/qGWGGVKhBoxXPMWzATSbZLZFWhwBAFO9NAyp0TxzfBP0mIrGb8CP8KrQTmvzXlR/vFPPUrHTLBGyFyw==}
|
||||||
|
|
||||||
'@tybys/[email protected]':
|
'@tybys/[email protected]':
|
||||||
resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==}
|
resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==}
|
||||||
|
|
||||||
@@ -1371,6 +1398,9 @@ packages:
|
|||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
|
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
|
||||||
|
|
||||||
|
[email protected]:
|
||||||
|
resolution: {integrity: sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg==}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==}
|
resolution: {integrity: sha512-GsYosgnACZTADcmEyJctkJIoqAhHjttw7RsFrVoJNXbsWWqaq6Ym+7kZjq6mS45O0jij6vtiReppKQEtqWy6Dw==}
|
||||||
engines: {node: '>=20'}
|
engines: {node: '>=20'}
|
||||||
@@ -1632,6 +1662,10 @@ packages:
|
|||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-120PeT8LdXO7m503rQtOapWA7lHBtWErN+asRxKyxF/SFGeqLEAZhlItjNynNVABHteRMSjomQCdAnxEJldMMQ==}
|
resolution: {integrity: sha512-120PeT8LdXO7m503rQtOapWA7lHBtWErN+asRxKyxF/SFGeqLEAZhlItjNynNVABHteRMSjomQCdAnxEJldMMQ==}
|
||||||
|
|
||||||
|
[email protected]:
|
||||||
|
resolution: {integrity: sha512-yNeeynhhtIVRBk12tBV4eHNxwB42HzR4Q3Ea7vCOiJhImGaAIdIMrbJtacQlBizGLjUPw+akkFI5Dn9T70XoVQ==}
|
||||||
|
engines: {node: '>=18'}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
|
resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
|
||||||
|
|
||||||
@@ -1922,6 +1956,16 @@ packages:
|
|||||||
engines: {node: '>=10'}
|
engines: {node: '>=10'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
|
[email protected]:
|
||||||
|
resolution: {integrity: sha512-S0xQPhUTefAhNvNWFg0c1J8qJArHt5KdtJ/cFAofo06KD1MVSeFWyl4iiu+ApDIuw0WhjpOfCdgConOfAnLgkw==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
peerDependencies:
|
||||||
|
seroval: ^1.0
|
||||||
|
|
||||||
|
[email protected]:
|
||||||
|
resolution: {integrity: sha512-46uFvgrXTVxZcUorgSSRZ4y+ieqLLQRMlG4bnCZKW3qI6BZm7Rg4ntMW4p1mILEEBZWrFlcpp0AyIIlM6jD9iw==}
|
||||||
|
engines: {node: '>=10'}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
|
resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==}
|
||||||
engines: {node: '>=8'}
|
engines: {node: '>=8'}
|
||||||
@@ -2044,6 +2088,11 @@ packages:
|
|||||||
'@types/react':
|
'@types/react':
|
||||||
optional: true
|
optional: true
|
||||||
|
|
||||||
|
[email protected]:
|
||||||
|
resolution: {integrity: sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==}
|
||||||
|
peerDependencies:
|
||||||
|
react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
resolution: {integrity: sha512-qxKGH3v9wPwUDbDchJf4IH4mRE1zkLWgzZSxwrl8LapwUWm48IFS7SlbRmcF4NquC/fESA5cHFge9E2Ps+woxg==}
|
resolution: {integrity: sha512-qxKGH3v9wPwUDbDchJf4IH4mRE1zkLWgzZSxwrl8LapwUWm48IFS7SlbRmcF4NquC/fESA5cHFge9E2Ps+woxg==}
|
||||||
engines: {node: '>=14.18.0', vite: '>=3.1.0'}
|
engines: {node: '>=14.18.0', vite: '>=3.1.0'}
|
||||||
@@ -2944,6 +2993,33 @@ snapshots:
|
|||||||
tailwindcss: 4.2.2
|
tailwindcss: 4.2.2
|
||||||
vite: 8.0.8(@types/[email protected])([email protected])([email protected])([email protected])([email protected])
|
vite: 8.0.8(@types/[email protected])([email protected])([email protected])([email protected])([email protected])
|
||||||
|
|
||||||
|
'@tanstack/[email protected]': {}
|
||||||
|
|
||||||
|
'@tanstack/[email protected]([email protected]([email protected]))([email protected])':
|
||||||
|
dependencies:
|
||||||
|
'@tanstack/history': 1.161.6
|
||||||
|
'@tanstack/react-store': 0.9.3([email protected]([email protected]))([email protected])
|
||||||
|
'@tanstack/router-core': 1.169.2
|
||||||
|
isbot: 5.1.40
|
||||||
|
react: 19.2.5
|
||||||
|
react-dom: 19.2.5([email protected])
|
||||||
|
|
||||||
|
'@tanstack/[email protected]([email protected]([email protected]))([email protected])':
|
||||||
|
dependencies:
|
||||||
|
'@tanstack/store': 0.9.3
|
||||||
|
react: 19.2.5
|
||||||
|
react-dom: 19.2.5([email protected])
|
||||||
|
use-sync-external-store: 1.6.0([email protected])
|
||||||
|
|
||||||
|
'@tanstack/[email protected]':
|
||||||
|
dependencies:
|
||||||
|
'@tanstack/history': 1.161.6
|
||||||
|
cookie-es: 3.1.1
|
||||||
|
seroval: 1.5.4
|
||||||
|
seroval-plugins: 1.5.4([email protected])
|
||||||
|
|
||||||
|
'@tanstack/[email protected]': {}
|
||||||
|
|
||||||
'@tybys/[email protected]':
|
'@tybys/[email protected]':
|
||||||
dependencies:
|
dependencies:
|
||||||
tslib: 2.8.1
|
tslib: 2.8.1
|
||||||
@@ -3206,6 +3282,8 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@epic-web/invariant': 1.0.0
|
'@epic-web/invariant': 1.0.0
|
||||||
@@ -3467,6 +3545,8 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
@@ -3715,6 +3795,12 @@ snapshots:
|
|||||||
|
|
||||||
[email protected]: {}
|
[email protected]: {}
|
||||||
|
|
||||||
|
[email protected]([email protected]):
|
||||||
|
dependencies:
|
||||||
|
seroval: 1.5.4
|
||||||
|
|
||||||
|
[email protected]: {}
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
shebang-regex: 3.0.0
|
shebang-regex: 3.0.0
|
||||||
@@ -3811,6 +3897,10 @@ snapshots:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
'@types/react': 19.2.14
|
'@types/react': 19.2.14
|
||||||
|
|
||||||
|
[email protected]([email protected]):
|
||||||
|
dependencies:
|
||||||
|
react: 19.2.5
|
||||||
|
|
||||||
[email protected]:
|
[email protected]:
|
||||||
dependencies:
|
dependencies:
|
||||||
fs-extra: 11.3.4
|
fs-extra: 11.3.4
|
||||||
|
|||||||
Reference in new issue
Block a user