app: rename the System map route /map -> /system

The nav label was already "System" and the page is SystemMap; only the URL
was stale. Move it to /system, add a back-compat redirect from /map, and update
the command-palette navigations. Unrelated graph node type "map" left as-is.
This commit is contained in:
2026-07-07 21:08:58 -07:00
parent a9f1e5b099
commit e33c505949
4 changed files with 9 additions and 7 deletions

View File

@@ -26,7 +26,7 @@ interface AppItem {
function detailPathFor(kind: string, name: string): string { function detailPathFor(kind: string, name: string): string {
if (kind === "job") return `/jobs/${name}` if (kind === "job") return `/jobs/${name}`
if (kind === "tool") return `/tools/${name}` if (kind === "tool") return `/tools/${name}`
if (kind === "reference") return `/map` if (kind === "reference") return `/system`
return `/services/${name}` return `/services/${name}`
} }
@@ -137,13 +137,13 @@ function PaletteBody({ onClose }: { onClose: () => void }) {
const launch = (a: AppItem) => { const launch = (a: AppItem) => {
onClose() onClose()
if (a.launchUrl) window.open(a.launchUrl, "_blank", "noreferrer") if (a.launchUrl) window.open(a.launchUrl, "_blank", "noreferrer")
else if (a.mapNodeId) navigate(`/map?focus=${encodeURIComponent(a.mapNodeId)}`) else if (a.mapNodeId) navigate(`/system?focus=${encodeURIComponent(a.mapNodeId)}`)
else navigate(a.detailPath) else navigate(a.detailPath)
} }
const goToMap = (a: AppItem) => { const goToMap = (a: AppItem) => {
if (!a.mapNodeId) return if (!a.mapNodeId) return
onClose() onClose()
navigate(`/map?focus=${encodeURIComponent(a.mapNodeId)}`) navigate(`/system?focus=${encodeURIComponent(a.mapNodeId)}`)
} }
const details = (a: AppItem) => { const details = (a: AppItem) => {
onClose() onClose()

View File

@@ -32,7 +32,7 @@ type NavGroup = { label: string; icon: LucideIcon; children: NavLeaf[] }
// "Deployments" parent. Programs (the catalog) stays top-level. // "Deployments" parent. Programs (the catalog) stays top-level.
const NAV: (NavLeaf | NavGroup)[] = [ const NAV: (NavLeaf | NavGroup)[] = [
{ to: "/", label: "Overview", icon: LayoutDashboard, end: true }, { to: "/", label: "Overview", icon: LayoutDashboard, end: true },
{ to: "/map", label: "System", icon: Gauge }, { to: "/system", label: "System", icon: Gauge },
{ to: "/gateway", label: "Gateway", icon: Globe }, { to: "/gateway", label: "Gateway", icon: Globe },
{ {
label: "Deployments", label: "Deployments",

View File

@@ -987,7 +987,7 @@ export function SystemMapPage() {
setFocus(picks.length === 1 ? picks[0].id : null) setFocus(picks.length === 1 ? picks[0].id : null)
}, []) }, [])
// "Go to on map" from the command palette (/map?focus=<id>): select + center it. // "Go to on map" from the command palette (/system?focus=<id>): select + center it.
useEffect(() => { useEffect(() => {
const f = searchParams.get("focus") const f = searchParams.get("focus")
if (!f) return if (!f) return

View File

@@ -1,4 +1,4 @@
import { createBrowserRouter } from "react-router-dom" import { createBrowserRouter, Navigate } from "react-router-dom"
import { Layout } from "@/components/Layout" import { Layout } from "@/components/Layout"
import { Overview } from "@/pages/Overview" import { Overview } from "@/pages/Overview"
import { Services } from "@/pages/Services" import { Services } from "@/pages/Services"
@@ -29,7 +29,9 @@ export const router = createBrowserRouter([
{ path: "gateway", element: <GatewayPage /> }, { path: "gateway", element: <GatewayPage /> },
{ path: "mesh", element: <MeshPage /> }, { path: "mesh", element: <MeshPage /> },
{ path: "secrets", element: <SecretsPage /> }, { path: "secrets", element: <SecretsPage /> },
{ path: "map", element: <SystemMapPage /> }, { path: "system", element: <SystemMapPage /> },
// Back-compat: the page was formerly at /map. Redirect old links/bookmarks.
{ path: "map", element: <Navigate to="/system" replace /> },
{ path: "services/:name", element: <ServiceDetailPage /> }, { path: "services/:name", element: <ServiceDetailPage /> },
{ path: "jobs/:name", element: <ScheduledDetailPage /> }, { path: "jobs/:name", element: <ScheduledDetailPage /> },
{ path: "tools/:name", element: <ToolDetailPage /> }, { path: "tools/:name", element: <ToolDetailPage /> },