Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Fix storage table responsive layouts

rcourtmane8555e429c2f
diff --git a/frontend-modern/src/components/Storage/DiskList.tsx b/frontend-modern/src/components/Storage/DiskList.tsx
index 6fa7fddf26..2309f46d29 100644
--- a/frontend-modern/src/components/Storage/DiskList.tsx
+++ b/frontend-modern/src/components/Storage/DiskList.tsx
@@ -25,6 +25,14 @@ import {
PHYSICAL_DISK_CELL_SIZE_CLASS,
PHYSICAL_DISK_CELL_SOURCE_CLASS,
PHYSICAL_DISK_CELL_TEMP_CLASS,
+ PHYSICAL_DISK_COL_DISK_CLASS,
+ PHYSICAL_DISK_COL_HEALTH_CLASS,
+ PHYSICAL_DISK_COL_HOST_CLASS,
+ PHYSICAL_DISK_COL_PARENT_CLASS,
+ PHYSICAL_DISK_COL_ROLE_CLASS,
+ PHYSICAL_DISK_COL_SIZE_CLASS,
+ PHYSICAL_DISK_COL_SOURCE_CLASS,
+ PHYSICAL_DISK_COL_TEMP_CLASS,
PHYSICAL_DISK_DETAIL_ROW_CELL_CLASS,
PHYSICAL_DISK_EMPTY_CARD_CLASS,
PHYSICAL_DISK_EMPTY_FALLBACK_CLASS,
@@ -175,13 +183,40 @@ export const DiskList: Component<DiskListProps> = (props) => {
style={{ '-webkit-overflow-scrolling': 'touch' }}
>
<Table class={PHYSICAL_DISK_TABLE_CLASS}>
+ <colgroup>
+ <col class={PHYSICAL_DISK_COL_DISK_CLASS} />
+ <col class={PHYSICAL_DISK_COL_SOURCE_CLASS} />
+ <col class={PHYSICAL_DISK_COL_HOST_CLASS} />
+ <col class={PHYSICAL_DISK_COL_ROLE_CLASS} />
+ <col class={PHYSICAL_DISK_COL_PARENT_CLASS} />
+ <col class={PHYSICAL_DISK_COL_HEALTH_CLASS} />
+ <col class={PHYSICAL_DISK_COL_TEMP_CLASS} />
+ <col class={PHYSICAL_DISK_COL_SIZE_CLASS} />
+ </colgroup>
<TableHeader>
<TableRow class={PHYSICAL_DISK_TABLE_HEADER_ROW_CLASS}>
<TableHead class={PHYSICAL_DISK_HEADER_DISK_CLASS}>Disk</TableHead>
- <TableHead class={PHYSICAL_DISK_HEADER_SOURCE_CLASS}>Source</TableHead>
+ <TableHead
+ class={PHYSICAL_DISK_HEADER_SOURCE_CLASS}
+ aria-label="Source"
+ title="Source"
+ >
+ <span aria-hidden="true" class="hidden sm:inline">
+ Source
+ </span>
+ <span aria-hidden="true" class="sm:hidden">
+ Src
+ </span>
+ </TableHead>
<TableHead class={PHYSICAL_DISK_HEADER_HOST_CLASS}>Host</TableHead>
<TableHead class={PHYSICAL_DISK_HEADER_ROLE_CLASS}>Role</TableHead>
- <TableHead class={PHYSICAL_DISK_HEADER_PARENT_CLASS}>Belongs To</TableHead>
+ <TableHead
+ class={PHYSICAL_DISK_HEADER_PARENT_CLASS}
+ aria-label="Belongs To"
+ title="Belongs To"
+ >
+ Belongs
+ </TableHead>
<TableHead class={PHYSICAL_DISK_HEADER_HEALTH_CLASS}>Health</TableHead>
<TableHead class={PHYSICAL_DISK_HEADER_TEMP_CLASS}>Temp</TableHead>
<TableHead class={PHYSICAL_DISK_HEADER_SIZE_CLASS}>Size</TableHead>
diff --git a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
index 366604964f..60950c02c1 100644
--- a/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
+++ b/frontend-modern/src/components/Storage/StoragePoolsTable.tsx
@@ -71,10 +71,28 @@ export const StoragePoolsTable: Component<StoragePoolsTableProps> = (props) => {
>
<div class={STORAGE_POOLS_SCROLL_WRAP_CLASS}>
<Table class={STORAGE_POOLS_TABLE_CLASS}>
+ <colgroup>
+ <For each={getStoragePoolTableColumns(props.storageGrowthColumnLabel)}>
+ {(column) => <col class={column.colClassName} />}
+ </For>
+ </colgroup>
<TableHeader>
<TableRow class={STORAGE_POOLS_HEADER_ROW_CLASS}>
<For each={getStoragePoolTableColumns(props.storageGrowthColumnLabel)}>
- {(column) => <TableHead class={column.className}>{column.label}</TableHead>}
+ {(column) => (
+ <TableHead
+ class={column.className}
+ aria-label={column.label}
+ title={column.label}
+ >
+ <span aria-hidden="true" class="hidden xl:inline">
+ {column.label}
+ </span>
+ <span aria-hidden="true" class="xl:hidden">
+ {column.compactLabel}
+ </span>
+ </TableHead>
+ )}
</For>
</TableRow>
</TableHeader>
@@ -84,7 +102,10 @@ export const StoragePoolsTable: Component<StoragePoolsTableProps> = (props) => {
<>
<Show when={group.showHeader}>
{(() => {
- const groupSummaryScope = buildStorageSummaryGroupScope(group, props.groupBy);
+ const groupSummaryScope = buildStorageSummaryGroupScope(
+ group,
+ props.groupBy,
+ );
return (
<StorageGroupRow
group={group}
@@ -92,7 +113,9 @@ export const StoragePoolsTable: Component<StoragePoolsTableProps> = (props) => {
expanded={group.expanded}
onToggle={() => props.toggleGroup(group.key)}
summaryGroupScope={groupSummaryScope}
- summaryActive={props.activeSummaryGroupScope?.id === groupSummaryScope?.id}
+ summaryActive={
+ props.activeSummaryGroupScope?.id === groupSummaryScope?.id
+ }
summaryFocused={props.focusedSummaryGroupId === groupSummaryScope?.id}
onFocusChange={props.onGroupFocusChange}
onHoverChange={props.onGroupHoverChange}
diff --git a/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx b/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
index 7b092bb60d..9f65c12358 100644
--- a/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/DiskList.test.tsx
@@ -101,7 +101,7 @@ describe('DiskList', () => {
],
nodes: [buildNode('node-tower', 'tower')],
selectedNode: null,
- searchTerm: "",
+ searchTerm: '',
});
expect(screen.getByRole('columnheader', { name: 'Disk' })).toBeInTheDocument();
@@ -134,31 +134,31 @@ describe('DiskList', () => {
it('keeps api-backed TrueNAS disks on the canonical physical-disk surface even without hardware ids', () => {
renderDiskList({
disks: [
- ({
- ...buildDisk('sda', 'truenas-main', {
- model: 'Seagate IronWolf',
+ {
+ ...buildDisk('sda', 'truenas-main', {
+ model: 'Seagate IronWolf',
+ serial: '',
+ wwn: '',
+ }),
+ platformType: 'truenas',
+ metricsTarget: { resourceType: 'disk', resourceId: 'disk:truenas-main:sda' },
+ sourceType: 'api',
+ identity: { hostname: 'truenas-main' },
+ canonicalIdentity: { hostname: 'truenas-main' },
+ platformData: {
+ sources: ['truenas'],
+ physicalDisk: {
serial: '',
wwn: '',
- }),
- platformType: 'truenas',
- metricsTarget: { resourceType: 'disk', resourceId: 'disk:truenas-main:sda' },
- sourceType: 'api',
- identity: { hostname: 'truenas-main' },
- canonicalIdentity: { hostname: 'truenas-main' },
- platformData: {
- sources: ['truenas'],
- physicalDisk: {
- serial: '',
- wwn: '',
- },
},
- }) as Resource,
+ },
+ } as Resource,
],
nodes: [
- ({
- ...buildNode('truenas-main', 'truenas-main'),
- platformType: 'truenas',
- }) as Resource,
+ {
+ ...buildNode('truenas-main', 'truenas-main'),
+ platformType: 'truenas',
+ } as Resource,
],
selectedNode: null,
searchTerm: '',
diff --git a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
index 6d438a6ec0..a67b636f91 100644
--- a/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
+++ b/frontend-modern/src/components/Storage/__tests__/Storage.test.tsx
@@ -75,6 +75,10 @@ let hookResources: Resource[] = [];
let hookLoading = false;
let hookError: unknown = undefined;
let alertsActivationState: 'active' | 'pending_review' | 'snoozed' | null = 'active';
+
+const getStorageSourceSelect = (): HTMLSelectElement =>
+ screen.getByLabelText('Source', { selector: 'select' }) as HTMLSelectElement;
+
const fetchMock = vi.fn(async (input: RequestInfo | URL) => {
const url =
typeof input === 'string' ? input : input instanceof URL ? input.toString() : input.url;
@@ -707,7 +711,7 @@ describe('Storage', () => {
);
expect((screen.getByLabelText('Node') as HTMLSelectElement).value).toBe('node-2');
expect((screen.getByLabelText('Sort By') as HTMLSelectElement).value).toBe('usage');
- expect((screen.getByLabelText('Source') as HTMLSelectElement).value).toBe('proxmox-pve');
+ expect(getStorageSourceSelect().value).toBe('proxmox-pve');
expect((screen.getByLabelText('Status') as HTMLSelectElement).value).toBe('warning');
// Grouping controls are only shown on the Pools view.
@@ -749,7 +753,7 @@ describe('Storage', () => {
'true',
);
expect((screen.getByLabelText('Node') as HTMLSelectElement).value).toBe('node-2');
- expect((screen.getByLabelText('Source') as HTMLSelectElement).value).toBe('proxmox-pve');
+ expect(getStorageSourceSelect().value).toBe('proxmox-pve');
});
it('trims whitespace-padded storage URL params back to canonical state', async () => {
@@ -785,7 +789,7 @@ describe('Storage', () => {
'true',
);
expect((screen.getByLabelText('Node') as HTMLSelectElement).value).toBe('node-2');
- expect((screen.getByLabelText('Source') as HTMLSelectElement).value).toBe('proxmox-pve');
+ expect(getStorageSourceSelect().value).toBe('proxmox-pve');
expect((screen.getByLabelText('Status') as HTMLSelectElement).value).toBe('available');
expect((screen.getByLabelText('Sort By') as HTMLSelectElement).value).toBe('usage');
});
@@ -803,7 +807,7 @@ describe('Storage', () => {
);
});
- expect((screen.getByLabelText('Source') as HTMLSelectElement).value).toBe('proxmox-pve');
+ expect(getStorageSourceSelect().value).toBe('proxmox-pve');
});
it('collapses explicit all node sentinels in storage URL params back to canonical unset state', async () => {
@@ -832,9 +836,7 @@ describe('Storage', () => {
render(() => <Storage />);
await waitFor(() => {
- expect(
- document.querySelector('tr[data-summary-group-id="storage:node:pve1"]'),
- ).toBeTruthy();
+ expect(document.querySelector('tr[data-summary-group-id="storage:node:pve1"]')).toBeTruthy();
});
let groupRow = document.querySelector(
@@ -876,9 +878,7 @@ describe('Storage', () => {
render(() => <Storage />);
await waitFor(() => {
- expect(
- document.querySelector('tr[data-summary-group-id="storage:node:pve1"]'),
- ).toBeTruthy();
+ expect(document.querySelector('tr[data-summary-group-id="storage:node:pve1"]')).toBeTruthy();
});
const clearButton = within(screen.getByTestId('storage-content-surface')).getByRole('button', {
@@ -904,9 +904,7 @@ describe('Storage', () => {
render(() => <Storage />);
await waitFor(() => {
- expect(
- document.querySelector('tr[data-summary-group-id="storage:node:pve1"]'),
- ).toBeTruthy();
+ expect(document.querySelector('tr[data-summary-group-id="storage:node:pve1"]')).toBeTruthy();
});
const groupRow = document.querySelector(
@@ -1121,10 +1119,8 @@ describe('Storage', () => {
{ timestamp: Date.now() - 60_000, value: 45 },
{ timestamp: Date.now(), value: 47 },
],
- used: [
- ],
- avail: [
- ],
+ used: [],
+ avail: [],
},
'pool:beta': {
name: 'Beta-Store',
@@ -1544,12 +1540,12 @@ describe('Storage', () => {
render(() => <Storage />);
await waitFor(() => {
- expect(screen.getByLabelText('Source')).toHaveValue('truenas');
+ expect(getStorageSourceSelect()).toHaveValue('truenas');
});
expect(screen.getByLabelText('Node')).toHaveValue('truenas-main');
expect(
- Array.from(screen.getByLabelText('Source').querySelectorAll('option')).map((option) => ({
+ Array.from(getStorageSourceSelect().querySelectorAll('option')).map((option) => ({
value: option.value,
label: option.textContent,
})),
diff --git a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
index 65da42bbe0..dcb75e48a4 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/diskPresentation.test.ts
@@ -56,10 +56,10 @@ function makeDiskData(
describe('diskPresentation', () => {
it('returns critical presentation for failed disks', () => {
expect(PHYSICAL_DISK_EMPTY_CARD_CLASS).toBe('text-center');
- expect(PHYSICAL_DISK_TABLE_CLASS).toBe('w-full text-xs');
+ expect(PHYSICAL_DISK_TABLE_CLASS).toBe('w-full table-fixed text-xs');
expect(PHYSICAL_DISK_TABLE_ROW_HOVER_CLASS).toContain('hover:bg-surface-hover');
expect(PHYSICAL_DISK_HEADER_DISK_CLASS).toContain('uppercase');
- expect(PHYSICAL_DISK_HEADER_SOURCE_CLASS).toContain('w-[72px]');
+ expect(PHYSICAL_DISK_HEADER_SOURCE_CLASS).toContain('sm:w-[11%]');
expect(PHYSICAL_DISK_NAME_TEXT_CLASS).toContain('font-semibold');
expect(PHYSICAL_DISK_SOURCE_BADGE_CLASS).toContain('justify-center');
@@ -120,7 +120,7 @@ describe('diskPresentation', () => {
).toEqual({
label: 'PVE',
className:
- 'bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-400 inline-flex min-w-[3.25rem] justify-center px-1.5 py-px text-[9px] font-medium',
+ 'bg-orange-100 text-orange-700 dark:bg-orange-900 dark:text-orange-400 inline-flex max-w-full min-w-0 justify-center overflow-hidden text-ellipsis px-1 sm:px-1.5 py-px text-[9px] font-medium',
});
expect(
getPhysicalDiskSourceKey({
diff --git a/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts b/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts
index bca20f33c4..f3dc77c59b 100644
--- a/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts
+++ b/frontend-modern/src/features/storageBackups/__tests__/storagePagePresentation.test.ts
@@ -75,7 +75,7 @@ describe('storagePagePresentation', () => {
expect(STORAGE_POOLS_EMPTY_STATE_CLASS).toBe('p-6 text-sm text-muted');
expect(STORAGE_POOLS_LOADING_STATE_CLASS).toBe('p-6 text-sm text-muted');
expect(STORAGE_POOLS_SCROLL_WRAP_CLASS).toBe('overflow-x-auto');
- expect(STORAGE_POOLS_TABLE_CLASS).toBe('w-full text-xs');
+ expect(STORAGE_POOLS_TABLE_CLASS).toBe('w-full table-fixed text-xs');
expect(STORAGE_POOLS_HEADER_ROW_CLASS).toContain('bg-surface-alt');
expect(STORAGE_POOLS_BODY_CLASS).toBe('divide-y divide-border');
expect(getStorageTableHeading('pools')).toBe('Storage Pools');
@@ -99,6 +99,13 @@ describe('storagePagePresentation', () => {
'Usage',
'Growth (24h)',
]);
+ expect(getStoragePoolTableColumns('Growth (24h)').map((column) => column.compactLabel)).toEqual(
+ ['Storage', 'Issue', 'Src', 'Type', 'Host', 'Prot', 'Used', '24h'],
+ );
+ expect(getStoragePoolTableColumns('Growth (24h)')[0].colClassName).toContain('xl:w-[18%]');
+ expect(getStoragePoolTableColumns('Growth (24h)')[3].className).toContain(
+ 'hidden xl:table-cell',
+ );
});
it('shows the ceph summary card only for pool views with visible ceph records', () => {
@@ -112,8 +119,8 @@ describe('storagePagePresentation', () => {
const record = makeRecord();
expect(shouldShowCephSummaryCard('pools', summary, [record], () => true)).toBe(true);
expect(shouldShowCephSummaryCard('disks', summary, [record], () => true)).toBe(false);
- expect(shouldShowCephSummaryCard('pools', { ...summary, clusters: [] }, [record], () => true)).toBe(
- false,
- );
+ expect(
+ shouldShowCephSummaryCard('pools', { ...summary, clusters: [] }, [record], () => true),
+ ).toBe(false);
});
});
diff --git a/frontend-modern/src/features/storageBackups/diskPresentation.ts b/frontend-modern/src/features/storageBackups/diskPresentation.ts
index f5a2bf119a..dccdf1d6d7 100644
--- a/frontend-modern/src/features/storageBackups/diskPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/diskPresentation.ts
@@ -79,8 +79,11 @@ export const PHYSICAL_DISK_EMPTY_REQUIREMENTS_LIST_CLASS =
export const PHYSICAL_DISK_EMPTY_REQUIREMENTS_NOTE_CLASS =
'mt-3 text-xs italic text-blue-700 dark:text-blue-300';
+const PHYSICAL_DISK_TABLE_HEADER_CLASS =
+ 'overflow-hidden text-ellipsis whitespace-nowrap px-1 sm:px-1.5 lg:px-2 py-0.5 text-left text-[10px] sm:text-[11px] lg:text-xs font-medium uppercase tracking-wider';
+
export const PHYSICAL_DISK_TABLE_SCROLL_CLASS = 'overflow-x-auto';
-export const PHYSICAL_DISK_TABLE_CLASS = 'w-full text-xs';
+export const PHYSICAL_DISK_TABLE_CLASS = 'w-full table-fixed text-xs';
export const PHYSICAL_DISK_TABLE_HEADER_ROW_CLASS =
'border-b border-border bg-surface-alt text-muted';
export const PHYSICAL_DISK_TABLE_BODY_CLASS = 'divide-y divide-border';
@@ -90,45 +93,46 @@ export const PHYSICAL_DISK_TABLE_ROW_HOVER_CLASS = 'hover:bg-surface-hover';
export const PHYSICAL_DISK_TABLE_ROW_STYLE = { height: '38px' } as const;
export const PHYSICAL_DISK_DETAIL_ROW_CELL_CLASS =
'border-b border-border-subtle bg-surface-alt px-4 py-4 shadow-inner';
-export const PHYSICAL_DISK_HEADER_DISK_CLASS =
- 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider md:min-w-[220px]';
-export const PHYSICAL_DISK_HEADER_SOURCE_CLASS =
- 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[72px]';
-export const PHYSICAL_DISK_HEADER_HOST_CLASS =
- 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider md:min-w-[120px]';
-export const PHYSICAL_DISK_HEADER_ROLE_CLASS =
- 'hidden xl:table-cell px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider';
-export const PHYSICAL_DISK_HEADER_PARENT_CLASS = PHYSICAL_DISK_HEADER_ROLE_CLASS;
-export const PHYSICAL_DISK_HEADER_HEALTH_CLASS =
- 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider md:min-w-[160px]';
-export const PHYSICAL_DISK_HEADER_TEMP_CLASS =
- 'hidden md:table-cell px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[72px]';
-export const PHYSICAL_DISK_HEADER_SIZE_CLASS =
- 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider w-[96px]';
-export const PHYSICAL_DISK_CELL_DISK_CLASS =
- 'px-1.5 sm:px-2 py-1 align-middle text-xs md:min-w-[220px]';
-export const PHYSICAL_DISK_CELL_SOURCE_CLASS = 'px-1.5 sm:px-2 py-1 align-middle text-xs w-[72px]';
-export const PHYSICAL_DISK_CELL_HOST_CLASS =
- 'px-1.5 sm:px-2 py-1 align-middle text-xs md:min-w-[120px]';
-export const PHYSICAL_DISK_CELL_ROLE_CLASS =
- 'hidden xl:table-cell px-1.5 sm:px-2 py-1 align-middle text-xs';
-export const PHYSICAL_DISK_CELL_PARENT_CLASS = PHYSICAL_DISK_CELL_ROLE_CLASS;
-export const PHYSICAL_DISK_CELL_HEALTH_CLASS =
- 'px-1.5 sm:px-2 py-1 align-middle text-xs md:min-w-[160px]';
-export const PHYSICAL_DISK_CELL_TEMP_CLASS =
- 'hidden md:table-cell px-1.5 sm:px-2 py-1 align-middle text-xs whitespace-nowrap w-[72px]';
-export const PHYSICAL_DISK_CELL_SIZE_CLASS =
- 'px-1.5 sm:px-2 py-1 align-middle text-xs whitespace-nowrap w-[96px]';
+export const PHYSICAL_DISK_COL_DISK_CLASS = 'w-[42%] sm:w-[28%] md:w-[28%] xl:w-[22%]';
+export const PHYSICAL_DISK_COL_SOURCE_CLASS = 'w-[15%] sm:w-[11%] md:w-[9%] xl:w-[8%]';
+export const PHYSICAL_DISK_COL_HOST_CLASS =
+ 'hidden sm:table-column sm:w-[18%] md:w-[14%] xl:w-[12%]';
+export const PHYSICAL_DISK_COL_ROLE_CLASS = 'hidden xl:table-column xl:w-[10%]';
+export const PHYSICAL_DISK_COL_PARENT_CLASS = 'hidden xl:table-column xl:w-[13%]';
+export const PHYSICAL_DISK_COL_HEALTH_CLASS = 'w-[25%] sm:w-[24%] md:w-[20%] xl:w-[16%]';
+export const PHYSICAL_DISK_COL_TEMP_CLASS = 'hidden md:table-column md:w-[9%] xl:w-[7%]';
+export const PHYSICAL_DISK_COL_SIZE_CLASS = 'w-[18%] sm:w-[19%] md:w-[20%] xl:w-[12%]';
+const PHYSICAL_DISK_CELL_HOST_RESPONSIVE_CLASS =
+ 'hidden sm:table-cell sm:w-[18%] md:w-[14%] xl:w-[12%]';
+const PHYSICAL_DISK_CELL_ROLE_RESPONSIVE_CLASS = 'hidden xl:table-cell xl:w-[10%]';
+const PHYSICAL_DISK_CELL_PARENT_RESPONSIVE_CLASS = 'hidden xl:table-cell xl:w-[13%]';
+const PHYSICAL_DISK_CELL_TEMP_RESPONSIVE_CLASS = 'hidden md:table-cell md:w-[9%] xl:w-[7%]';
+export const PHYSICAL_DISK_HEADER_DISK_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_DISK_CLASS}`;
+export const PHYSICAL_DISK_HEADER_SOURCE_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_SOURCE_CLASS}`;
+export const PHYSICAL_DISK_HEADER_HOST_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_HOST_CLASS}`;
+export const PHYSICAL_DISK_HEADER_ROLE_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_ROLE_CLASS}`;
+export const PHYSICAL_DISK_HEADER_PARENT_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_PARENT_CLASS}`;
+export const PHYSICAL_DISK_HEADER_HEALTH_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_HEALTH_CLASS}`;
+export const PHYSICAL_DISK_HEADER_TEMP_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_TEMP_CLASS}`;
+export const PHYSICAL_DISK_HEADER_SIZE_CLASS = `${PHYSICAL_DISK_TABLE_HEADER_CLASS} ${PHYSICAL_DISK_COL_SIZE_CLASS}`;
+export const PHYSICAL_DISK_CELL_DISK_CLASS = `${PHYSICAL_DISK_COL_DISK_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs`;
+export const PHYSICAL_DISK_CELL_SOURCE_CLASS = `${PHYSICAL_DISK_COL_SOURCE_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs`;
+export const PHYSICAL_DISK_CELL_HOST_CLASS = `${PHYSICAL_DISK_CELL_HOST_RESPONSIVE_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs`;
+export const PHYSICAL_DISK_CELL_ROLE_CLASS = `${PHYSICAL_DISK_CELL_ROLE_RESPONSIVE_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs`;
+export const PHYSICAL_DISK_CELL_PARENT_CLASS = `${PHYSICAL_DISK_CELL_PARENT_RESPONSIVE_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs`;
+export const PHYSICAL_DISK_CELL_HEALTH_CLASS = `${PHYSICAL_DISK_COL_HEALTH_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs`;
+export const PHYSICAL_DISK_CELL_TEMP_CLASS = `${PHYSICAL_DISK_CELL_TEMP_RESPONSIVE_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs whitespace-nowrap`;
+export const PHYSICAL_DISK_CELL_SIZE_CLASS = `${PHYSICAL_DISK_COL_SIZE_CLASS} overflow-hidden px-1 sm:px-1.5 lg:px-2 py-1 align-middle text-xs whitespace-nowrap`;
export const PHYSICAL_DISK_NAME_WRAP_CLASS = 'flex min-w-0 items-center gap-1.5 whitespace-nowrap';
export const PHYSICAL_DISK_NAME_TEXT_CLASS =
'block min-w-0 truncate text-[12px] font-semibold text-base-content';
export const PHYSICAL_DISK_SOURCE_BADGE_CLASS =
- 'inline-flex min-w-[3.25rem] justify-center px-1.5 py-px text-[9px] font-medium';
+ 'inline-flex max-w-full min-w-0 justify-center overflow-hidden text-ellipsis px-1 sm:px-1.5 py-px text-[9px] font-medium';
export const PHYSICAL_DISK_VALUE_TEXT_CLASS = 'block truncate text-[11px] text-base-content';
export const PHYSICAL_DISK_MUTED_PLACEHOLDER_CLASS = 'text-[11px] text-muted';
export const PHYSICAL_DISK_HEALTH_WRAP_CLASS =
'flex min-w-0 items-center gap-1.5 whitespace-nowrap';
-export const PHYSICAL_DISK_HEALTH_LABEL_CLASS = 'shrink-0 text-[11px] font-semibold';
+export const PHYSICAL_DISK_HEALTH_LABEL_CLASS = 'min-w-0 truncate text-[11px] font-semibold';
export const PHYSICAL_DISK_HEALTH_SUMMARY_CLASS = 'hidden xl:block truncate text-[11px] text-muted';
export const PHYSICAL_DISK_TEMPERATURE_CLASS = 'text-[11px] font-medium';
export const PHYSICAL_DISK_SIZE_VALUE_CLASS = 'text-[11px] text-base-content';
diff --git a/frontend-modern/src/features/storageBackups/storagePagePresentation.ts b/frontend-modern/src/features/storageBackups/storagePagePresentation.ts
index 8b236063f4..3c913abe1f 100644
--- a/frontend-modern/src/features/storageBackups/storagePagePresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storagePagePresentation.ts
@@ -15,9 +15,14 @@ export type StorageViewOption = {
export type StoragePoolTableColumn = {
label: string;
+ compactLabel: string;
className: string;
+ colClassName: string;
};
+const STORAGE_POOL_TABLE_HEADER_CLASS =
+ 'overflow-hidden text-ellipsis whitespace-nowrap px-1 sm:px-1.5 lg:px-2 py-0.5 text-left text-[10px] sm:text-[11px] lg:text-xs font-medium uppercase tracking-wider';
+
export const STORAGE_VIEW_OPTIONS: readonly StorageViewOption[] = [
{ value: 'pools', label: 'Pools' },
{ value: 'disks', label: 'Physical Disks' },
@@ -28,39 +33,51 @@ export const getStoragePoolTableColumns = (
): readonly StoragePoolTableColumn[] => [
{
label: 'Storage',
- className: 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider',
+ compactLabel: 'Storage',
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} w-[34%] sm:w-[26%] md:w-[23%] xl:w-[18%]`,
+ colClassName: 'w-[34%] sm:w-[26%] md:w-[23%] xl:w-[18%]',
},
{
label: 'Primary Issue',
- className: 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider',
+ compactLabel: 'Issue',
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} w-[24%] sm:w-[20%] md:w-[17%] xl:w-[14%]`,
+ colClassName: 'w-[24%] sm:w-[20%] md:w-[17%] xl:w-[14%]',
},
{
label: 'Source',
- className: 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider',
+ compactLabel: 'Src',
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} w-[13%] sm:w-[10%] md:w-[8%]`,
+ colClassName: 'w-[13%] sm:w-[10%] md:w-[8%]',
},
{
label: 'Type',
- className:
- 'hidden xl:table-cell px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider',
+ compactLabel: 'Type',
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} hidden xl:table-cell xl:w-[8%]`,
+ colClassName: 'hidden xl:table-column xl:w-[8%]',
},
{
label: 'Host',
- className: 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider',
+ compactLabel: 'Host',
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} hidden sm:table-cell sm:w-[13%] md:w-[12%] xl:w-[10%]`,
+ colClassName: 'hidden sm:table-column sm:w-[13%] md:w-[12%] xl:w-[10%]',
},
{
label: 'Protection',
- className:
- 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider md:min-w-[180px]',
+ compactLabel: 'Prot',
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} hidden sm:table-cell sm:w-[15%] md:w-[15%] xl:w-[13%]`,
+ colClassName: 'hidden sm:table-column sm:w-[15%] md:w-[15%] xl:w-[13%]',
},
{
label: 'Usage',
- className:
- 'px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider md:min-w-[190px] xl:min-w-[220px]',
+ compactLabel: 'Used',
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} w-[29%] sm:w-[16%] md:w-[25%] xl:w-[18%]`,
+ colClassName: 'w-[29%] sm:w-[16%] md:w-[25%] xl:w-[18%]',
},
{
label: growthColumnLabel,
- className:
- 'hidden lg:table-cell px-1.5 sm:px-2 py-0.5 text-left text-[11px] sm:text-xs font-medium uppercase tracking-wider',
+ compactLabel: growthColumnLabel.replace(/^Growth\s*\((.+)\)$/i, '$1'),
+ className: `${STORAGE_POOL_TABLE_HEADER_CLASS} hidden xl:table-cell xl:w-[11%]`,
+ colClassName: 'hidden xl:table-column xl:w-[11%]',
},
];
@@ -81,7 +98,7 @@ export const STORAGE_CONTENT_CARD_BODY_CLASS = 'p-2';
export const STORAGE_POOLS_EMPTY_STATE_CLASS = 'p-6 text-sm text-muted';
export const STORAGE_POOLS_LOADING_STATE_CLASS = 'p-6 text-sm text-muted';
export const STORAGE_POOLS_SCROLL_WRAP_CLASS = 'overflow-x-auto';
-export const STORAGE_POOLS_TABLE_CLASS = 'w-full text-xs';
+export const STORAGE_POOLS_TABLE_CLASS = 'w-full table-fixed text-xs';
export const STORAGE_POOLS_HEADER_ROW_CLASS = 'bg-surface-alt text-muted border-b border-border';
export const STORAGE_POOLS_BODY_CLASS = 'divide-y divide-border';
@@ -120,9 +137,7 @@ export const getStoragePageBannerMessage = (kind: StoragePageBannerKind): string
}
};
-export const getStoragePageBannerActionLabel = (
- kind: StoragePageBannerKind,
-): string | null => {
+export const getStoragePageBannerActionLabel = (kind: StoragePageBannerKind): string | null => {
if (kind === 'reconnecting') return 'Retry now';
if (kind === 'disconnected') return 'Reconnect';
return null;
diff --git a/frontend-modern/src/features/storageBackups/storagePoolRowPresentation.ts b/frontend-modern/src/features/storageBackups/storagePoolRowPresentation.ts
index 0cf9718a84..1205492e9d 100644
--- a/frontend-modern/src/features/storageBackups/storagePoolRowPresentation.ts
+++ b/frontend-modern/src/features/storageBackups/storagePoolRowPresentation.ts
@@ -37,24 +37,30 @@ export interface StoragePoolRowModel {
export const STORAGE_POOL_ROW_CLASS = 'group cursor-pointer';
export const STORAGE_POOL_ROW_HEIGHT_CLASS = 'h-[38px]';
export const STORAGE_POOL_ROW_EXPANDED_CLASS = 'bg-surface-alt';
-export const STORAGE_POOL_ROW_NAME_CELL_CLASS = 'px-2 py-1 align-middle text-base-content';
+export const STORAGE_POOL_ROW_NAME_CELL_CLASS =
+ 'w-[34%] sm:w-[26%] md:w-[23%] xl:w-[18%] overflow-hidden px-1.5 sm:px-2 py-1 align-middle text-base-content';
export const STORAGE_POOL_ROW_NAME_TEXT_CLASS = 'block truncate text-[12px] font-semibold';
-export const STORAGE_POOL_ROW_SOURCE_CELL_CLASS = 'px-2 py-1 align-middle text-[11px]';
+export const STORAGE_POOL_ROW_SOURCE_CELL_CLASS =
+ 'w-[13%] sm:w-[10%] md:w-[8%] overflow-hidden px-1 sm:px-2 py-1 align-middle text-[11px]';
export const STORAGE_POOL_ROW_SOURCE_BADGE_CLASS =
- 'inline-flex min-w-[3.25rem] justify-center px-1.5 py-px text-[9px] font-medium';
+ 'inline-flex max-w-full min-w-0 justify-center overflow-hidden text-ellipsis px-1 sm:px-1.5 py-px text-[9px] font-medium';
export const STORAGE_POOL_ROW_TYPE_CELL_CLASS =
- 'hidden xl:table-cell px-2 py-1 align-middle text-[11px] text-base-content';
-export const STORAGE_POOL_ROW_HOST_CELL_CLASS = 'px-2 py-1 align-middle text-[11px] text-base-content';
+ 'hidden xl:table-cell xl:w-[8%] overflow-hidden px-2 py-1 align-middle text-[11px] text-base-content';
+export const STORAGE_POOL_ROW_HOST_CELL_CLASS =
+ 'hidden sm:table-cell sm:w-[13%] md:w-[12%] xl:w-[10%] overflow-hidden px-1.5 sm:px-2 py-1 align-middle text-[11px] text-base-content';
export const STORAGE_POOL_ROW_TEXT_TRUNCATE_CLASS = 'block truncate';
-export const STORAGE_POOL_ROW_PROTECTION_CELL_CLASS = 'px-2 py-1 align-middle text-[11px]';
+export const STORAGE_POOL_ROW_PROTECTION_CELL_CLASS =
+ 'hidden sm:table-cell sm:w-[15%] md:w-[15%] xl:w-[13%] overflow-hidden px-1.5 sm:px-2 py-1 align-middle text-[11px]';
export const STORAGE_POOL_ROW_PROTECTION_TEXT_CLASS = 'block truncate font-semibold';
-export const STORAGE_POOL_ROW_USAGE_CELL_CLASS = 'px-2 py-1 align-middle md:min-w-[190px] xl:min-w-[220px]';
+export const STORAGE_POOL_ROW_USAGE_CELL_CLASS =
+ 'w-[29%] sm:w-[16%] md:w-[25%] xl:w-[18%] overflow-hidden px-1.5 sm:px-2 py-1 align-middle';
export const STORAGE_POOL_ROW_USAGE_WRAP_CLASS = 'flex items-center whitespace-nowrap text-[11px]';
-export const STORAGE_POOL_ROW_USAGE_BAR_WRAP_CLASS = 'min-w-[120px] flex-1';
+export const STORAGE_POOL_ROW_USAGE_BAR_WRAP_CLASS = 'min-w-0 flex-1';
export const STORAGE_POOL_ROW_GROWTH_CELL_CLASS =
- 'hidden lg:table-cell px-2 py-1 align-middle text-[11px]';
+ 'hidden xl:table-cell xl:w-[11%] overflow-hidden px-2 py-1 align-middle text-[11px]';
export const STORAGE_POOL_ROW_GROWTH_TEXT_CLASS = 'block truncate font-mono font-semibold';
-export const STORAGE_POOL_ROW_ISSUE_CELL_CLASS = 'px-2 py-1 align-middle text-[11px] max-w-[14rem]';
+export const STORAGE_POOL_ROW_ISSUE_CELL_CLASS =
+ 'w-[24%] sm:w-[20%] md:w-[17%] xl:w-[14%] overflow-hidden px-1.5 sm:px-2 py-1 align-middle text-[11px]';
export const STORAGE_POOL_ROW_ISSUE_TEXT_CLASS = 'block truncate text-[11px] font-semibold';
export const STORAGE_POOL_ROW_PLACEHOLDER_CLASS = 'text-muted';
export const STORAGE_POOL_ROW_USAGE_FALLBACK_CLASS = 'text-[11px] text-muted';
@@ -88,4 +94,3 @@ export const buildStoragePoolRowModel = (
compactIssueSummary: getCompactStoragePoolIssueSummary(record),
};
};
-