Skip to content

Commit

Permalink
take Capacity out of system utilization page header
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Oct 20, 2023
1 parent 4e16c9a commit c93a314
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { useDateTimeRangePicker } from 'app/components/form'

import { tabularizeSiloMetrics } from './metrics-util'

CapacityUtilizationPage.loader = async () => {
SystemUtilizationPage.loader = async () => {
await Promise.all([
apiQueryClient.prefetchQuery('siloList', {}),
apiQueryClient.prefetchQuery('systemMetric', {
Expand All @@ -57,7 +57,7 @@ CapacityUtilizationPage.loader = async () => {
return null
}

export function CapacityUtilizationPage() {
export function SystemUtilizationPage() {
const { data: sleds } = usePrefetchedApiQuery('sledList', {})
const { data: silos } = usePrefetchedApiQuery('siloList', {})

Expand All @@ -66,7 +66,7 @@ export function CapacityUtilizationPage() {
return (
<>
<PageHeader>
<PageTitle icon={<Metrics24Icon />}>Capacity &amp; Utilization</PageTitle>
<PageTitle icon={<Metrics24Icon />}>Utilization</PageTitle>
</PageHeader>

<div className="mb-12 flex min-w-min flex-col gap-3 lg+:flex-row">
Expand Down
6 changes: 3 additions & 3 deletions app/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ import { NetworkingTab } from './pages/project/instances/instance/tabs/Networkin
import { StorageTab } from './pages/project/instances/instance/tabs/StorageTab'
import { ProfilePage } from './pages/settings/ProfilePage'
import { SSHKeysPage } from './pages/settings/SSHKeysPage'
import { CapacityUtilizationPage } from './pages/system/CapacityUtilizationPage'
import { SiloImagesPage } from './pages/system/SiloImagesPage'
import { SiloPage } from './pages/system/SiloPage'
import SilosPage from './pages/system/SilosPage'
import { SystemUtilizationPage } from './pages/system/UtilizationPage'
import { DisksTab } from './pages/system/inventory/DisksTab'
import { InventoryPage } from './pages/system/inventory/InventoryPage'
import { SledsTab } from './pages/system/inventory/SledsTab'
Expand Down Expand Up @@ -137,8 +137,8 @@ export const routes = createRoutesFromElements(
<Route path="issues" element={null} />
<Route
path="utilization"
element={<CapacityUtilizationPage />}
loader={CapacityUtilizationPage.loader}
element={<SystemUtilizationPage />}
loader={SystemUtilizationPage.loader}
handle={{ crumb: 'Utilization' }}
/>
<Route
Expand Down
10 changes: 3 additions & 7 deletions app/test/e2e/utilization.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test.describe('System utilization', () => {
test('works for fleet viewer', async ({ page }) => {
await page.goto('/system/utilization')
await expectVisible(page, [
page.getByRole('heading', { name: 'Capacity & Utilization' }),
page.getByRole('heading', { name: 'Utilization' }),
page.getByText('Disk utilization'),
page.getByText('CPU utilization'),
page.getByText('Memory utilization'),
Expand All @@ -33,9 +33,7 @@ test.describe('System utilization', () => {
test.describe('Silo utilization', () => {
test('works for fleet viewer', async ({ page }) => {
await page.goto('/utilization')
await expectVisible(page, [
page.getByRole('heading', { name: 'Capacity & Utilization' }),
])
await expectVisible(page, [page.getByRole('heading', { name: 'Utilization' })])
await expectNotVisible(page, [
page.getByText('Disk utilization'),
page.getByText('CPU utilization'),
Expand All @@ -48,9 +46,7 @@ test.describe('Silo utilization', () => {
test('works for dev user', async ({ browser }) => {
const page = await getDevUserPage(browser)
await page.goto('/utilization')
await expectVisible(page, [
page.getByRole('heading', { name: 'Capacity & Utilization' }),
])
await expectVisible(page, [page.getByRole('heading', { name: 'Utilization' })])
await expectNotVisible(page, [
page.getByText('Disk utilization'),
page.getByText('CPU utilization'),
Expand Down

0 comments on commit c93a314

Please sign in to comment.