|
1 | 1 | import filesize from 'filesize' |
2 | | -import React, { Suspense, memo, useMemo } from 'react' |
| 2 | +import { useMemo } from 'react' |
3 | 3 | import type { LoaderFunctionArgs } from 'react-router-dom' |
4 | 4 | import { useNavigate } from 'react-router-dom' |
5 | 5 |
|
6 | 6 | import { apiQueryClient, useApiQuery, useApiQueryClient } from '@oxide/api' |
7 | | -import { Instances24Icon, PageHeader, PageTitle, PropertiesTable, Tab } from '@oxide/ui' |
| 7 | +import { Instances24Icon, PageHeader, PageTitle, PropertiesTable } from '@oxide/ui' |
8 | 8 | import { pick } from '@oxide/util' |
9 | 9 |
|
10 | 10 | import { MoreActionsMenu } from 'app/components/MoreActionsMenu' |
| 11 | +import { RouteTabs, Tab } from 'app/components/RouteTabs' |
11 | 12 | import { InstanceStatusBadge } from 'app/components/StatusBadge' |
12 | | -import { Tabs } from 'app/components/Tabs' |
13 | 13 | import { requireInstanceParams, useQuickActions, useRequiredParams } from 'app/hooks' |
14 | 14 | import { pb } from 'app/util/path-builder' |
15 | 15 |
|
16 | 16 | import { useMakeInstanceActions } from '../actions' |
17 | | -import { NetworkingTab } from './tabs/NetworkingTab' |
18 | | -import { SerialConsoleTab } from './tabs/SerialConsoleTab' |
19 | | -import { StorageTab } from './tabs/StorageTab' |
20 | | - |
21 | | -const MetricsTab = React.lazy(() => import('./tabs/MetricsTab')) |
22 | | - |
23 | | -const InstanceTabs = memo(() => ( |
24 | | - <Tabs id="tabs-instance" fullWidth> |
25 | | - <Tab>Storage</Tab> |
26 | | - <Tab.Panel> |
27 | | - <StorageTab /> |
28 | | - </Tab.Panel> |
29 | | - <Tab>Metrics</Tab> |
30 | | - <Tab.Panel> |
31 | | - <Suspense fallback={null}> |
32 | | - <MetricsTab /> |
33 | | - </Suspense> |
34 | | - </Tab.Panel> |
35 | | - <Tab>Networking</Tab> |
36 | | - <Tab.Panel> |
37 | | - <NetworkingTab /> |
38 | | - </Tab.Panel> |
39 | | - <Tab>Serial Console</Tab> |
40 | | - <Tab.Panel> |
41 | | - <SerialConsoleTab /> |
42 | | - </Tab.Panel> |
43 | | - </Tabs> |
44 | | -)) |
45 | 17 |
|
46 | 18 | InstancePage.loader = async ({ params }: LoaderFunctionArgs) => { |
47 | 19 | await apiQueryClient.prefetchQuery('instanceView', { |
@@ -111,7 +83,12 @@ export function InstancePage() { |
111 | 83 | </PropertiesTable.Row> |
112 | 84 | </PropertiesTable> |
113 | 85 | </PropertiesTable.Group> |
114 | | - <InstanceTabs /> |
| 86 | + <RouteTabs fullWidth> |
| 87 | + <Tab to={pb.instanceStorage(instanceParams)}>Storage</Tab> |
| 88 | + <Tab to={pb.instanceMetrics(instanceParams)}>Metrics</Tab> |
| 89 | + <Tab to={pb.nics(instanceParams)}>Network Interfaces</Tab> |
| 90 | + <Tab to={pb.serialConsole(instanceParams)}>Serial Console</Tab> |
| 91 | + </RouteTabs> |
115 | 92 | </> |
116 | 93 | ) |
117 | 94 | } |
0 commit comments