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:
@@ -26,7 +26,7 @@ interface AppItem {
|
||||
function detailPathFor(kind: string, name: string): string {
|
||||
if (kind === "job") return `/jobs/${name}`
|
||||
if (kind === "tool") return `/tools/${name}`
|
||||
if (kind === "reference") return `/map`
|
||||
if (kind === "reference") return `/system`
|
||||
return `/services/${name}`
|
||||
}
|
||||
|
||||
@@ -137,13 +137,13 @@ function PaletteBody({ onClose }: { onClose: () => void }) {
|
||||
const launch = (a: AppItem) => {
|
||||
onClose()
|
||||
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)
|
||||
}
|
||||
const goToMap = (a: AppItem) => {
|
||||
if (!a.mapNodeId) return
|
||||
onClose()
|
||||
navigate(`/map?focus=${encodeURIComponent(a.mapNodeId)}`)
|
||||
navigate(`/system?focus=${encodeURIComponent(a.mapNodeId)}`)
|
||||
}
|
||||
const details = (a: AppItem) => {
|
||||
onClose()
|
||||
|
||||
@@ -32,7 +32,7 @@ type NavGroup = { label: string; icon: LucideIcon; children: NavLeaf[] }
|
||||
// "Deployments" parent. Programs (the catalog) stays top-level.
|
||||
const NAV: (NavLeaf | NavGroup)[] = [
|
||||
{ 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 },
|
||||
{
|
||||
label: "Deployments",
|
||||
|
||||
@@ -987,7 +987,7 @@ export function SystemMapPage() {
|
||||
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(() => {
|
||||
const f = searchParams.get("focus")
|
||||
if (!f) return
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { createBrowserRouter } from "react-router-dom"
|
||||
import { createBrowserRouter, Navigate } from "react-router-dom"
|
||||
import { Layout } from "@/components/Layout"
|
||||
import { Overview } from "@/pages/Overview"
|
||||
import { Services } from "@/pages/Services"
|
||||
@@ -29,7 +29,9 @@ export const router = createBrowserRouter([
|
||||
{ path: "gateway", element: <GatewayPage /> },
|
||||
{ path: "mesh", element: <MeshPage /> },
|
||||
{ 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: "jobs/:name", element: <ScheduledDetailPage /> },
|
||||
{ path: "tools/:name", element: <ToolDetailPage /> },
|
||||
|
||||
Reference in New Issue
Block a user