diff --git a/app/pages/system/UtilizationPage.tsx b/app/pages/system/UtilizationPage.tsx index 90eaa16942..609227c97f 100644 --- a/app/pages/system/UtilizationPage.tsx +++ b/app/pages/system/UtilizationPage.tsx @@ -285,7 +285,7 @@ const UsageCell = ({ allocated: number unit?: string }) => ( -
+
{provisioned} /
diff --git a/app/pages/system/inventory/SledsTab.tsx b/app/pages/system/inventory/SledsTab.tsx index 1cde915438..c7d4e9c53f 100644 --- a/app/pages/system/inventory/SledsTab.tsx +++ b/app/pages/system/inventory/SledsTab.tsx @@ -20,6 +20,7 @@ import { TableEmptyBox } from '~/ui/lib/Table' import { Truncate } from '~/ui/lib/Truncate' import { ALL_ISH } from '~/util/consts' import { pb } from '~/util/path-builder' +import { formatSlot } from '~/util/str' import { ProvisionPolicyBadge, SledKindBadge, SledStateBadge } from './sled/SledBadges' @@ -35,11 +36,14 @@ export const handle = { crumb: 'Sleds' } const colHelper = createColumnHelper() const staticCols = [ colHelper.accessor('slot', { - cell: (info) => ( -
- {info.getValue() ?? } -
- ), + cell: (info) => { + const slot = info.getValue() + return slot == null ? ( + + ) : ( + {formatSlot(slot)} + ) + }, }), colHelper.accessor('id', { cell: (info) => ( diff --git a/app/pages/system/inventory/sled/SledPage.tsx b/app/pages/system/inventory/sled/SledPage.tsx index dbe2623720..d77a137332 100644 --- a/app/pages/system/inventory/sled/SledPage.tsx +++ b/app/pages/system/inventory/sled/SledPage.tsx @@ -18,6 +18,7 @@ import { PropertiesTable } from '~/ui/lib/PropertiesTable' import { truncate } from '~/ui/lib/Truncate' import { pb } from '~/util/path-builder' import type * as PP from '~/util/path-params' +import { formatSlot } from '~/util/str' import type { Route } from './+types/SledPage' import { ProvisionPolicyBadge, SledKindBadge, SledStateBadge } from './SledBadges' @@ -73,7 +74,11 @@ export default function SledPage() { bytes={sled.usablePhysicalRam} /> - {sled.slot ?? } + {sled.slot == null ? ( + + ) : ( + {formatSlot(sled.slot)} + )} diff --git a/app/ui/assets/fonts/SuisseIntl-Light-WebS.woff b/app/ui/assets/fonts/SuisseIntl-Light-WebS.woff deleted file mode 100644 index 26ee0382f1..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-Light-WebS.woff and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-Light-WebS.woff2 b/app/ui/assets/fonts/SuisseIntl-Light-WebS.woff2 deleted file mode 100644 index a8867d5bdb..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-Light-WebS.woff2 and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-Light.woff2 b/app/ui/assets/fonts/SuisseIntl-Light.woff2 new file mode 100644 index 0000000000..bc5358bca7 Binary files /dev/null and b/app/ui/assets/fonts/SuisseIntl-Light.woff2 differ diff --git a/app/ui/assets/fonts/SuisseIntl-Medium-WebS.woff b/app/ui/assets/fonts/SuisseIntl-Medium-WebS.woff deleted file mode 100644 index c68a5f6b54..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-Medium-WebS.woff and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-Medium-WebS.woff2 b/app/ui/assets/fonts/SuisseIntl-Medium-WebS.woff2 deleted file mode 100644 index 5d513472ab..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-Medium-WebS.woff2 and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-Medium.woff2 b/app/ui/assets/fonts/SuisseIntl-Medium.woff2 new file mode 100644 index 0000000000..260ace9c20 Binary files /dev/null and b/app/ui/assets/fonts/SuisseIntl-Medium.woff2 differ diff --git a/app/ui/assets/fonts/SuisseIntl-Regular-WebS.woff b/app/ui/assets/fonts/SuisseIntl-Regular-WebS.woff deleted file mode 100644 index b91bbc2535..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-Regular-WebS.woff and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-Regular-WebS.woff2 b/app/ui/assets/fonts/SuisseIntl-Regular-WebS.woff2 deleted file mode 100644 index 03fbdb0fcb..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-Regular-WebS.woff2 and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-Regular.woff2 b/app/ui/assets/fonts/SuisseIntl-Regular.woff2 new file mode 100644 index 0000000000..9d6bb3c380 Binary files /dev/null and b/app/ui/assets/fonts/SuisseIntl-Regular.woff2 differ diff --git a/app/ui/assets/fonts/SuisseIntl-RegularItalic-WebS.woff b/app/ui/assets/fonts/SuisseIntl-RegularItalic-WebS.woff deleted file mode 100644 index f375359ccb..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-RegularItalic-WebS.woff and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-RegularItalic-WebS.woff2 b/app/ui/assets/fonts/SuisseIntl-RegularItalic-WebS.woff2 deleted file mode 100644 index 708a489ebb..0000000000 Binary files a/app/ui/assets/fonts/SuisseIntl-RegularItalic-WebS.woff2 and /dev/null differ diff --git a/app/ui/assets/fonts/SuisseIntl-RegularItalic.woff2 b/app/ui/assets/fonts/SuisseIntl-RegularItalic.woff2 new file mode 100644 index 0000000000..86ca4ca25e Binary files /dev/null and b/app/ui/assets/fonts/SuisseIntl-RegularItalic.woff2 differ diff --git a/app/ui/styles/fonts.css b/app/ui/styles/fonts.css index ba3be2319c..b1e87f102e 100644 --- a/app/ui/styles/fonts.css +++ b/app/ui/styles/fonts.css @@ -30,36 +30,28 @@ /* Source: https://www.swisstypefaces.com/fonts/suisse/ */ @font-face { font-family: 'SuisseIntl'; - src: - url('../assets/fonts/SuisseIntl-Light-WebS.woff2') format('woff2'), - url('../assets/fonts/SuisseIntl-Light-WebS.woff') format('woff'); + src: url('../assets/fonts/SuisseIntl-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; } @font-face { font-family: 'SuisseIntl'; - src: - url('../assets/fonts/SuisseIntl-Regular-WebS.woff2') format('woff2'), - url('../assets/fonts/SuisseIntl-Regular-WebS.woff') format('woff'); + src: url('../assets/fonts/SuisseIntl-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; } @font-face { font-family: 'SuisseIntl'; - src: - url('../assets/fonts/SuisseIntl-RegularItalic-WebS.woff2') format('woff2'), - url('../assets/fonts/SuisseIntl-RegularItalic-WebS.woff') format('woff'); + src: url('../assets/fonts/SuisseIntl-RegularItalic.woff2') format('woff2'); font-weight: 400; font-style: italic; } @font-face { font-family: 'SuisseIntl'; - src: - url('../assets/fonts/SuisseIntl-Medium-WebS.woff2') format('woff2'), - url('../assets/fonts/SuisseIntl-Medium-WebS.woff') format('woff'); + src: url('../assets/fonts/SuisseIntl-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; } diff --git a/app/util/str.ts b/app/util/str.ts index 0eea97c4c5..4e88948deb 100644 --- a/app/util/str.ts +++ b/app/util/str.ts @@ -10,6 +10,9 @@ import React, { type ReactElement, type ReactNode } from 'react' export const capitalize = (s: string) => s && s.charAt(0).toUpperCase() + s.slice(1) +/** Zero-pad sled slot so 1- and 2-digit slots align (a rack has at most 32 slots) */ +export const formatSlot = (slot: number) => String(slot).padStart(2, '0') + export const pluralize = (s: string, n: number) => `${s}${n === 1 ? '' : 's'}` export const camelCase = (s: string) => diff --git a/test/e2e/inventory.e2e.ts b/test/e2e/inventory.e2e.ts index 824ce35707..bf56e56f17 100644 --- a/test/e2e/inventory.e2e.ts +++ b/test/e2e/inventory.e2e.ts @@ -24,7 +24,7 @@ test('Sled inventory page', async ({ page }) => { // grouping, hence the slightly weird column names await expectRowVisible(sledsTable, { id: expect.stringContaining(sleds[0].id), - slot: '0', + slot: '00', 'serial number': sleds[0].baseboard.serial, Kind: 'In service', 'Provision policy': 'Provisionable', @@ -55,14 +55,14 @@ test('Sled inventory page', async ({ page }) => { // rows are in slot order, with the sled without a slot last const slotCells = sledsTable.locator('tbody tr td:first-child') - await expect(slotCells).toHaveText(['0', '2', '15', '—']) + await expect(slotCells).toHaveText(['00', '02', '15', '—']) // Visit the sled detail page of the slot 0 sled await sledsTable.getByRole('link', { name: sleds[0].id }).click() await expectVisible(page, ['role=heading[name*="Sled"]']) await expect(page.getByText('serialBRM02222869')).toBeVisible() - await expect(page.getByText('slot0')).toBeVisible() + await expect(page.getByText('slot00')).toBeVisible() const instancesTab = page.getByRole('tab', { name: 'Instances' }) await expect(instancesTab).toBeVisible()