import { useState } from 'react'; import { Route, Switch, Link, Router, useLocation } from 'wouter'; import { CommandCenter } from './pages/CommandCenter'; import { NodeDetail } from './pages/NodeDetail'; import { StorageBrowser } from './pages/StorageBrowser'; import { RefTrackingPage } from './pages/RefTrackingPage'; // Base path — matches the deploy mount. Detected from // window.location so a single SPA build serves both local // (:7700/v2/) and Tailscale (/clawstor). const BASE = (() => { if (typeof window === 'undefined') return ''; const p = window.location.pathname; if (p === '/clawstor' || p.startsWith('/clawstor/')) return '/clawstor'; if (p === '/v2' || p.startsWith('/v2/')) return '/v2'; return ''; })(); export default function App() { return ( ); } function Shell() { return (
{(params) => } {(params) => }
404
); } function NavBar() { const [loc] = useLocation(); const [advOpen, setAdvOpen] = useState(false); const advActive = loc.startsWith('/advanced'); const primary = [{ path: '/', label: 'Fleet health' }]; const advanced = [ { path: '/advanced/blobs', label: 'Blobs' }, { path: '/advanced/tags', label: 'Tags' }, { path: '/advanced/refs', label: 'Refs' }, { path: '/advanced/snapshots', label: 'Snapshots' }, { path: '/advanced/refs/tracking', label: 'Ref-tracking' }, ]; return (
clawstor · command center
); } function Tab({ path, label, active, }: { path: string; label: string; active: boolean; }) { return ( {label} ); } function AdvancedRedirect() { const [, nav] = useLocation(); nav('/advanced/blobs', { replace: true }); return null; }