From 59d618d25f31578a7d08972cb0ce01113d0f0af4 Mon Sep 17 00:00:00 2001 From: anti Date: Tue, 21 Apr 2026 10:24:23 -0400 Subject: [PATCH] feat(web): topologies nav entry and /mazenet route guard New /topologies page lists topologies; a bare /mazenet now redirects there since the editor has no meaning without ?topology=. Wizard picks up a note style + tweaked copy. --- decnet_web/src/App.tsx | 12 ++++++++++- decnet_web/src/components/Layout.tsx | 1 + .../TopologyList/CreateTopologyWizard.css | 21 +++++++++++++++++++ .../TopologyList/CreateTopologyWizard.tsx | 8 +++++++ 4 files changed, 41 insertions(+), 1 deletion(-) diff --git a/decnet_web/src/App.tsx b/decnet_web/src/App.tsx index fe2c8e95..ce1e9ad7 100644 --- a/decnet_web/src/App.tsx +++ b/decnet_web/src/App.tsx @@ -13,6 +13,15 @@ import RemoteUpdates from './components/RemoteUpdates'; import SwarmHosts from './components/SwarmHosts'; import AgentEnrollment from './components/AgentEnrollment'; import MazeNET from './components/MazeNET/MazeNET'; +import TopologyList from './components/TopologyList/TopologyList'; + +/* Guard the /mazenet route so it's always bound to a real topology. + * Bare /mazenet → /topologies; ?topology= → editor. */ +function MazeNETRoute() { + const qs = typeof window !== 'undefined' ? window.location.search : ''; + const hasId = new URLSearchParams(qs).get('topology'); + return hasId ? : ; +} function isTokenValid(token: string): boolean { try { @@ -63,7 +72,8 @@ function App() { } /> } /> - } /> + } /> + } /> } /> } /> } /> diff --git a/decnet_web/src/components/Layout.tsx b/decnet_web/src/components/Layout.tsx index f0101292..666e9594 100644 --- a/decnet_web/src/components/Layout.tsx +++ b/decnet_web/src/components/Layout.tsx @@ -43,6 +43,7 @@ const Layout: React.FC = ({ children, onLogout, onSearch }) => {