Skip to content

Commit 9a2e964

Browse files
committed
make /system/ip-pools the top-level route for now
1 parent d21d0ce commit 9a2e964

File tree

6 files changed

+17
-29
lines changed

6 files changed

+17
-29
lines changed

app/layouts/SystemLayout.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function SystemLayout() {
6666
{ value: 'Silos', path: pb.silos() },
6767
{ value: 'Utilization', path: pb.systemUtilization() },
6868
{ value: 'Inventory', path: pb.inventory() },
69-
{ value: 'Networking', path: pb.systemNetworking() },
69+
{ value: 'IP pools', path: pb.ipPools() },
7070
]
7171
// filter out the entry for the path we're currently on
7272
.filter((i) => i.path !== pathname)
@@ -111,14 +111,8 @@ export default function SystemLayout() {
111111
<NavLinkItem to={pb.sledInventory()}>
112112
<Storage16Icon /> Inventory
113113
</NavLinkItem>
114-
{/* <NavLinkItem to={pb.systemHealth()} disabled>
115-
<Health16Icon /> Health
116-
</NavLinkItem>
117-
<NavLinkItem to={pb.systemUpdates()} disabled>
118-
<SoftwareUpdate16Icon /> System Update
119-
</NavLinkItem> */}
120-
<NavLinkItem to={pb.systemNetworking()}>
121-
<Networking16Icon /> Networking
114+
<NavLinkItem to={pb.ipPools()}>
115+
<Networking16Icon /> IP pools
122116
</NavLinkItem>
123117
</Sidebar.Nav>
124118
</Sidebar>
File renamed without changes.

app/pages/system/networking/NetworkingPage.tsx renamed to app/pages/system/ip-pools/IpPoolsPage.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ const EmptyState = () => (
2222
/>
2323
)
2424

25-
NetworkingPage.loader = async function () {
25+
IpPoolsPage.loader = async function () {
2626
await apiQueryClient.prefetchQuery('ipPoolList', { query: { limit: 25 } })
2727
return null
2828
}
2929

30-
export function NetworkingPage() {
30+
export function IpPoolsPage() {
3131
const { Table, Column } = useQueryTable('ipPoolList', {})
3232
return (
3333
<>
3434
<PageHeader>
35-
<PageTitle icon={<Networking24Icon />}>Networking</PageTitle>
35+
<PageTitle icon={<Networking24Icon />}>IP pools</PageTitle>
3636
</PageHeader>
3737
<Table emptyState={<EmptyState />}>
3838
<Column accessor="name" cell={linkCell((pool) => pb.ipPool({ pool }))} />

app/routes.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ import { InventoryPage } from './pages/system/inventory/InventoryPage'
6565
import { SledInstancesTab } from './pages/system/inventory/sled/SledInstancesTab'
6666
import { SledPage } from './pages/system/inventory/sled/SledPage'
6767
import { SledsTab } from './pages/system/inventory/SledsTab'
68-
import { IpPoolPage } from './pages/system/networking/IpPoolPage'
69-
import { NetworkingPage } from './pages/system/networking/NetworkingPage'
68+
import { IpPoolPage } from './pages/system/ip-pools/IpPoolPage'
69+
import { IpPoolsPage } from './pages/system/ip-pools/IpPoolsPage'
7070
import { SiloImagesPage } from './pages/system/SiloImagesPage'
7171
import { SiloPage } from './pages/system/silos/SiloPage'
7272
import SilosPage from './pages/system/silos/SilosPage'
@@ -171,14 +171,10 @@ export const routes = createRoutesFromElements(
171171
</Route>
172172
<Route path="health" element={null} handle={{ crumb: 'Health' }} />
173173
<Route path="update" element={null} handle={{ crumb: 'Update' }} />
174-
<Route path="networking" handle={{ crumb: 'Networking' }}>
175-
<Route index element={<Navigate to="ip-pools" replace />} />
176-
<Route path="ip-pool-new" element={null} />
177-
{/* TODO: make this a tab on the networking page */}
178-
<Route path="ip-pools">
179-
<Route index element={<NetworkingPage />} loader={NetworkingPage.loader} />
180-
<Route path=":pool" element={<IpPoolPage />} loader={IpPoolPage.loader} />
181-
</Route>
174+
<Route path="ip-pools" handle={{ crumb: 'I' }}>
175+
<Route index element={<IpPoolsPage />} loader={IpPoolsPage.loader} />
176+
<Route path=":pool" element={<IpPoolPage />} loader={IpPoolPage.loader} />
177+
<Route path="ip-pools-new" element={null} />
182178
</Route>
183179
</Route>
184180

app/util/path-builder.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ test('path builder', () => {
3939
"instanceStorage": "/projects/p/instances/i/storage",
4040
"instances": "/projects/p/instances",
4141
"inventory": "/system/inventory",
42-
"ipPool": "/system/networking/ip-pools/pl",
43-
"ipPoolNew": "/system/networking/ip-pool-new",
44-
"ipPools": "/system/networking/ip-pools",
42+
"ipPool": "/system/ip-pools/pl",
43+
"ipPoolNew": "/system/ip-pools-new",
44+
"ipPools": "/system/ip-pools",
4545
"nics": "/projects/p/instances/i/network-interfaces",
4646
"profile": "/settings/profile",
4747
"project": "/projects/p",
@@ -76,7 +76,6 @@ test('path builder', () => {
7676
"system": "/system",
7777
"systemHealth": "/system/health",
7878
"systemIssues": "/system/issues",
79-
"systemNetworking": "/system/networking/ip-pools",
8079
"systemUtilization": "/system/utilization",
8180
"vpc": "/projects/p/vpcs/v",
8281
"vpcEdit": "/projects/p/vpcs/v/edit",

app/util/path-builder.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,8 @@ export const pb = {
7878
systemUtilization: () => '/system/utilization',
7979
systemHealth: () => '/system/health',
8080

81-
systemNetworking: () => '/system/networking/ip-pools',
82-
ipPools: () => '/system/networking/ip-pools',
83-
ipPoolNew: () => '/system/networking/ip-pool-new',
81+
ipPools: () => '/system/ip-pools',
82+
ipPoolNew: () => '/system/ip-pools-new',
8483
ipPool: (params: IpPool) => `${pb.ipPools()}/${params.pool}`,
8584

8685
inventory: () => '/system/inventory',

0 commit comments

Comments
 (0)