/notifications/new could be a saved flow's own page, so the draft now opens at /notifications/draft/new, which has a segment more than any flow's route. The placeholder id no longer needs reserving. The .notify-node-hits rule styled the removed tree rows; nothing renders it.
64 lines
2.8 KiB
TypeScript
64 lines
2.8 KiB
TypeScript
// Root shell component — routing only. Each route's content is its own
|
|
// page component under `./pages/`; this file just maps paths to them.
|
|
import { Route, Router, Switch } from "wouter-preact";
|
|
import { Shell } from "./shell/Shell.js";
|
|
import { useGuardedLocation } from "./shell/useGuardedLocation.js";
|
|
import { AgentsPage } from "./pages/agents/AgentsPage.js";
|
|
import { AgentTerminalPage } from "./pages/agents/AgentTerminalPage.js";
|
|
import { AlertsPage } from "./pages/AlertsPage.js";
|
|
import { BuildsPage } from "./pages/builds/BuildsPage.js";
|
|
import { BroadcastPage } from "./pages/broadcast/BroadcastPage.js";
|
|
import { MessagesPage } from "./pages/messages/MessagesPage.js";
|
|
import { NEW_FLOW_PATH } from "./pages/notifications/FlowDraft.js";
|
|
import { FlowEditorPage } from "./pages/notifications/FlowEditorPage.js";
|
|
import { NotificationsPage } from "./pages/notifications/NotificationsPage.js";
|
|
import { ComponentsPage } from "./pages/ComponentsPage.js";
|
|
import { JobsPage } from "./pages/JobsPage.js";
|
|
import { HivesPage } from "./pages/HivesPage.js";
|
|
import { IssueReportPage } from "./pages/IssueReportPage.js";
|
|
import { ReviewPage } from "./pages/review/ReviewPage.js";
|
|
import { SchedulesPage } from "./pages/schedules/SchedulesPage.js";
|
|
import { StartPage } from "./pages/StartPage.js";
|
|
import { Panel } from "./ui/panel/Panel.js";
|
|
|
|
function NotFound() {
|
|
return (
|
|
<Panel title="404" icon="🧭">
|
|
<p>no route here.</p>
|
|
</Panel>
|
|
);
|
|
}
|
|
|
|
export function App() {
|
|
return (
|
|
<Router hook={useGuardedLocation}>
|
|
<Shell>
|
|
<Switch>
|
|
<Route path="/" component={StartPage} />
|
|
<Route path="/hives" component={HivesPage} />
|
|
<Route path="/alerts" component={AlertsPage} />
|
|
<Route path="/agents" component={AgentsPage} />
|
|
<Route path="/agents/:name/terminal" component={AgentTerminalPage} />
|
|
<Route
|
|
path="/agents/:name/subagents/:subagent/terminal"
|
|
component={AgentTerminalPage}
|
|
/>
|
|
<Route path="/jobs" component={JobsPage} />
|
|
<Route path="/schedules" component={SchedulesPage} />
|
|
<Route path="/builds" component={BuildsPage} />
|
|
<Route path="/broadcast" component={BroadcastPage} />
|
|
<Route path="/messages" component={MessagesPage} />
|
|
<Route path="/notifications" component={NotificationsPage} />
|
|
<Route path={NEW_FLOW_PATH}>
|
|
<FlowEditorPage params={{ flowId: "" }} isNew />
|
|
</Route>
|
|
<Route path="/notifications/:flowId" component={FlowEditorPage} />
|
|
<Route path="/issues" component={IssueReportPage} />
|
|
<Route path="/review" component={ReviewPage} />
|
|
<Route path="/components" component={ComponentsPage} />
|
|
<Route component={NotFound} />
|
|
</Switch>
|
|
</Shell>
|
|
</Router>
|
|
);
|
|
}
|