diff --git a/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx b/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx index a64ae9361..e4f11df41 100644 --- a/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx +++ b/frontend-modern/src/features/truenas/TrueNASStorageTopologyTable.tsx @@ -22,6 +22,7 @@ import { createPlatformTableFilterState, getPlatformTableCellClassForKind, getPlatformTableHeadClassForKind, + platformChipStatusDot, type PlatformTableFilterOption, } from '@/features/platformPage/sharedPlatformPage'; import { @@ -42,9 +43,24 @@ import { const TRUENAS_STORAGE_STATUS_OPTIONS: PlatformTableFilterOption[] = [ { value: 'all', label: 'All' }, - { value: 'healthy', label: 'Healthy', tone: 'success' }, - { value: 'attention', label: 'Attention', tone: 'warning' }, - { value: 'offline', label: 'Offline', tone: 'danger' }, + { + value: 'healthy', + label: 'Healthy', + tone: 'success', + leading: platformChipStatusDot('bg-emerald-500'), + }, + { + value: 'attention', + label: 'Attention', + tone: 'warning', + leading: platformChipStatusDot('bg-amber-500'), + }, + { + value: 'offline', + label: 'Offline', + tone: 'danger', + leading: platformChipStatusDot('bg-red-500'), + }, ]; const titleCase = (value: string | undefined): string => { @@ -62,22 +78,6 @@ const kindLabel = (kind: TrueNASStorageTopologyKind): string => { return 'Disk'; }; -const stateLabel = (row: TrueNASStorageTopologyRow): string => { - if (row.kind === 'pool') { - return ( - asTrimmedString(row.resource.storage?.zfsPoolState)?.toUpperCase() || - titleCase(row.resource.status) - ); - } - if (row.kind === 'disk') { - return ( - asTrimmedString(row.resource.physicalDisk?.health)?.toUpperCase() || - titleCase(row.resource.status) - ); - } - return titleCase(row.resource.status); -}; - const subtitle = (row: TrueNASStorageTopologyRow): string => { if (row.kind === 'pool') return row.resource.parentName || 'TrueNAS pool'; if (row.kind === 'dataset') return row.resource.parentName || 'Dataset'; @@ -179,11 +179,6 @@ const diskCountLabel = (row: TrueNASStorageTopologyRow): string => { return '-'; }; -const shareCountLabel = (row: TrueNASStorageTopologyRow): string => { - if (row.kind === 'disk') return '-'; - return String(row.counts.shares); -}; - export const getTrueNASStorageTopologyIndentClass = (depth: number): string => { if (depth <= 0) return ''; if (depth === 1) return 'pl-5 sm:pl-7'; @@ -268,40 +263,30 @@ export const TrueNASStorageTopologyTable: Component<{ } > - + - + Resource - + Kind - - + Usage / Size - - + Health @@ -332,19 +317,9 @@ export const TrueNASStorageTopologyTable: Component<{ {kindLabel(row.kind)} - -