use neighbors instead of protocols in url

This commit is contained in:
Annika Hannig 2023-11-20 12:28:11 +01:00
parent 085640170d
commit 108504b9f9
4 changed files with 36 additions and 24 deletions

View File

@ -37,6 +37,38 @@ import SearchGlobalPage
import NotFoundPage
from 'app/pages/NotFoundPage';
const Routing = () => (
<Routes>
<Route index element={<StartPage />} />
{/* RouteServers */}
<Route
path="routeservers/:routeServerId"
element={<RouteServerPage />}>
<Route index element={<NeighborsPage />} />
{/* Neighbors */}
<Route
path="neighbors/:neighborId/routes"
element={<RoutesPage />} />
{/* DEPRECATION NOTICE: The 'protocols' route will be */}
{/* removed and is only here for backwards compatibility */}
<Route
path="protocols/:neighborId/routes"
element={<RoutesPage />} />
</Route>
{/* Search */}
<Route path="search" element={<SearchGlobalPage />} />
{/* Fallback */}
<Route path="*" element={<NotFoundPage />} />
</Routes>
);
const Main = () => {
return (
<ErrorsProvider>
@ -45,27 +77,7 @@ const Main = () => {
<ContentProvider>
<BrowserRouter>
<Layout>
<Routes>
<Route index element={<StartPage />} />
{/* RouteServers */}
<Route path="routeservers/:routeServerId"
element={<RouteServerPage />}>
<Route index
element={<NeighborsPage />} />
<Route path="protocols/:neighborId/routes"
element={<RoutesPage />} />
</Route>
{/* Search */}
<Route path="search"
element={<SearchGlobalPage />} />
{/* Fallback */}
<Route path="*" element={<NotFoundPage />} />
</Routes>
<Routing />
</Layout>
</BrowserRouter>
</ContentProvider>

View File

@ -19,7 +19,7 @@ const LocalRelatedPeersTabs = () => {
}
const peerUrl = (n) =>
`/routeservers/${routeServerId}/protocols/${n.id}/routes`;
`/routeservers/${routeServerId}/neighbors/${n.id}/routes`;
const relatedPeers = peers.map((p) => (
<li key={p.id}

View File

@ -143,7 +143,7 @@ const RoutesLink = ({neighbor, children}) => {
if (!isUpState(neighbor.state)) {
return <>{children}</>;
};
const url = `/routeservers/${routeServerId}/protocols/${neighbor.id}/routes`;
const url = `/routeservers/${routeServerId}/neighbors/${neighbor.id}/routes`;
return (
<Link to={url}>{children}</Link>
);

View File

@ -49,7 +49,7 @@ const PeerLink = ({to, children}) => {
let peerUrl;
if (isUpState(neighbor.state)) {
peerUrl = `/routeservers/${rid}/protocols/${pid}/routes`;
peerUrl = `/routeservers/${rid}/neighbors/${pid}/routes`;
} else {
peerUrl = `/routeservers/${rid}#sessions-down`;
}