feat: build vehicle data platform and production pipeline

This commit is contained in:
lingniu
2026-07-14 12:35:33 +08:00
parent b452be3b94
commit bb59303a4b
270 changed files with 88016 additions and 1975 deletions

View File

@@ -0,0 +1,47 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { lazy, Suspense } from 'react';
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
import { AppShell } from './layout/AppShell';
import { AuthGate } from './auth/AuthGate';
import { PageLoading } from './shared/AsyncState';
const MonitorPage = lazy(() => import('./pages/MonitorPage'));
const VehiclePage = lazy(() => import('./pages/VehiclePage'));
const TrackPage = lazy(() => import('./pages/TrackPage'));
const HistoryPage = lazy(() => import('./pages/HistoryPage'));
const AccessPage = lazy(() => import('./pages/AccessPage'));
const AlertsPage = lazy(() => import('./pages/AlertsPage'));
const OperationsPage = lazy(() => import('./pages/OperationsPage'));
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 15_000,
gcTime: 5 * 60_000,
retry: 1,
refetchOnWindowFocus: false
}
}
});
export function AppV2() {
return (
<QueryClientProvider client={queryClient}>
<AuthGate><BrowserRouter future={{ v7_startTransition: true, v7_relativeSplatPath: true }}>
<Routes>
<Route element={<AppShell />}>
<Route index element={<Navigate to="/monitor" replace />} />
<Route path="/monitor" element={<Suspense fallback={<PageLoading />}><MonitorPage /></Suspense>} />
<Route path="/vehicles/:vin?" element={<Suspense fallback={<PageLoading />}><VehiclePage /></Suspense>} />
<Route path="/tracks" element={<Suspense fallback={<PageLoading />}><TrackPage /></Suspense>} />
<Route path="/history" element={<Suspense fallback={<PageLoading />}><HistoryPage /></Suspense>} />
<Route path="/access" element={<Suspense fallback={<PageLoading />}><AccessPage /></Suspense>} />
<Route path="/alerts/*" element={<Suspense fallback={<PageLoading />}><AlertsPage /></Suspense>} />
<Route path="/operations" element={<Suspense fallback={<PageLoading />}><OperationsPage /></Suspense>} />
<Route path="*" element={<Navigate to="/monitor" replace />} />
</Route>
</Routes>
</BrowserRouter></AuthGate>
</QueryClientProvider>
);
}