Skip to content

Commit

Permalink
Fix sled instances prefetch (#1802)
Browse files Browse the repository at this point in the history
* fix sled instances prefetch

* do the same for /system/inventory and /system/inventory/sleds
  • Loading branch information
david-crespo authored Oct 31, 2023
1 parent 47d76db commit 57cc189
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/layouts/SystemLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export default function SystemLayout() {
const systemLinks = [
{ value: 'Silos', path: pb.silos() },
{ value: 'Utilization', path: pb.systemUtilization() },
{ value: 'Inventory', path: pb.sledInventory() },
{ value: 'Inventory', path: pb.inventory() },
]
// filter out the entry for the path we're currently on
.filter((i) => i.path !== pathname)
Expand Down
7 changes: 6 additions & 1 deletion app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ export const routes = createRoutesFromElements(
loader={InventoryPage.loader}
handle={{ crumb: 'Inventory' }}
>
<Route index element={<Navigate to="sleds" replace />} loader={SledsTab.loader} />
<Route path="sleds" element={<SledsTab />} loader={SledsTab.loader} />
<Route path="disks" element={<DisksTab />} loader={DisksTab.loader} />
</Route>
Expand All @@ -156,7 +157,11 @@ export const routes = createRoutesFromElements(
loader={SledPage.loader}
handle={{ crumb: 'Sleds' }}
>
<Route index element={<Navigate to="instances" replace />} />
<Route
index
element={<Navigate to="instances" replace />}
loader={SledInstancesTab.loader}
/>
<Route
path="instances"
element={<SledInstancesTab />}
Expand Down
1 change: 1 addition & 0 deletions app/util/path-builder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ test('path builder', () => {
"instancePage": "/projects/p/instances/i/storage",
"instanceStorage": "/projects/p/instances/i/storage",
"instances": "/projects/p/instances",
"inventory": "/system/inventory",
"nics": "/projects/p/instances/i/network-interfaces",
"profile": "/settings/profile",
"project": "/projects/p",
Expand Down
1 change: 1 addition & 0 deletions app/util/path-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export const pb = {
systemNetworking: () => '/system/networking',
systemSettings: () => '/system/settings',

inventory: () => '/system/inventory',
rackInventory: () => '/system/inventory/racks',
sledInventory: () => '/system/inventory/sleds',
diskInventory: () => '/system/inventory/disks',
Expand Down

0 comments on commit 57cc189

Please sign in to comment.