add SPA config UI, wire media/rss adapters, event-driven layout push
- React SPA: dashboard, data sources CRUD, widgets CRUD, layout builder, presets. TanStack Router + Query, shadcn/ui, Vite proxy to :3000 - wire media + rss adapters into polling loop, remove xtb source type - media adapter: read username/password from headers, proper subsonic auth - event handler: subscribe to LayoutChanged, push screen update to clients - fix clippy warnings across workspace (Default impls, collapsible ifs, redundant closures, is_none_or, unused imports)
This commit is contained in:
66
spa/src/router.tsx
Normal file
66
spa/src/router.tsx
Normal file
@@ -0,0 +1,66 @@
|
||||
import {
|
||||
createRootRoute,
|
||||
createRoute,
|
||||
createRouter,
|
||||
Outlet,
|
||||
} from "@tanstack/react-router"
|
||||
import { AppShell } from "@/components/app-shell"
|
||||
import { DashboardPage } from "@/pages/dashboard"
|
||||
import { DataSourcesPage } from "@/pages/data-sources"
|
||||
import { WidgetsPage } from "@/pages/widgets"
|
||||
import { LayoutBuilderPage } from "@/pages/layout-builder"
|
||||
import { PresetsPage } from "@/pages/presets"
|
||||
|
||||
const rootRoute = createRootRoute({
|
||||
component: () => (
|
||||
<AppShell>
|
||||
<Outlet />
|
||||
</AppShell>
|
||||
),
|
||||
})
|
||||
|
||||
const indexRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: "/",
|
||||
component: DashboardPage,
|
||||
})
|
||||
|
||||
const dataSourcesRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: "/data-sources",
|
||||
component: DataSourcesPage,
|
||||
})
|
||||
|
||||
const widgetsRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: "/widgets",
|
||||
component: WidgetsPage,
|
||||
})
|
||||
|
||||
const layoutRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: "/layout",
|
||||
component: LayoutBuilderPage,
|
||||
})
|
||||
|
||||
const presetsRoute = createRoute({
|
||||
getParentRoute: () => rootRoute,
|
||||
path: "/presets",
|
||||
component: PresetsPage,
|
||||
})
|
||||
|
||||
const routeTree = rootRoute.addChildren([
|
||||
indexRoute,
|
||||
dataSourcesRoute,
|
||||
widgetsRoute,
|
||||
layoutRoute,
|
||||
presetsRoute,
|
||||
])
|
||||
|
||||
export const router = createRouter({ routeTree })
|
||||
|
||||
declare module "@tanstack/react-router" {
|
||||
interface Register {
|
||||
router: typeof router
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user