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.

Lock Kubernetes workloads page to pod-native columns

rcourtmane52476f35e6c
diff --git a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
index 7c8ba186b5..b3acb2370d 100644
--- a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts
@@ -9,7 +9,6 @@ import kubernetesPageSurfaceSource from '@/features/kubernetes/KubernetesPageSur
import proxmoxNodesTableSource from '@/features/proxmox/ProxmoxNodesTable.tsx?raw';
import proxmoxPageSurfaceSource from '@/features/proxmox/ProxmoxPageSurface.tsx?raw';
import sharedPlatformPageSource from '@/features/platformPage/sharedPlatformPage.tsx?raw';
-import truenasDisksTableSource from '@/features/truenas/TrueNASDisksTable.tsx?raw';
import truenasPageSurfaceSource from '@/features/truenas/TrueNASPageSurface.tsx?raw';
import truenasSystemsTableSource from '@/features/truenas/TrueNASSystemsTable.tsx?raw';
import vmwarePageSurfaceSource from '@/features/vmware/VmwarePageSurface.tsx?raw';
@@ -23,7 +22,6 @@ const platformTableSources = [
kubernetesNodesTableSource,
kubernetesDeploymentsTableSource,
truenasSystemsTableSource,
- truenasDisksTableSource,
vsphereHostsTableSource,
];
@@ -34,7 +32,6 @@ const platformToolbarTableSources = [
kubernetesNodesTableSource,
kubernetesDeploymentsTableSource,
truenasSystemsTableSource,
- truenasDisksTableSource,
vsphereHostsTableSource,
];
@@ -95,8 +92,8 @@ describe('platform overview layout guardrails', () => {
expect(kubernetesPageSurfaceSource).toContain('<KubernetesDeploymentsTable');
expect(truenasPageSurfaceSource).toContain('<TrueNASSystemsTable');
expect(truenasPageSurfaceSource).toContain('<StorageSurface');
- expect(truenasPageSurfaceSource).toContain('forcedView="pools"');
- expect(truenasPageSurfaceSource).toContain('<TrueNASDisksTable');
+ expect(truenasPageSurfaceSource).not.toContain('forcedView="pools"');
+ expect(truenasPageSurfaceSource).not.toContain('<TrueNASDisksTable');
expect(vmwarePageSurfaceSource).toContain('<VsphereHostsTable');
expect(vmwarePageSurfaceSource).toContain('<WorkloadsSurface');
expect(vmwarePageSurfaceSource).toContain('<StorageSurface');
diff --git a/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx b/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx
deleted file mode 100644
index 258a5986c1..0000000000
--- a/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx
+++ /dev/null
@@ -1,213 +0,0 @@
-import { For, Show, type Component, type JSX } from 'solid-js';
-import { StatusDot } from '@/components/shared/StatusDot';
-import { TableCard } from '@/components/shared/TableCard';
-import { TableCardHeader } from '@/components/shared/TableCardHeader';
-import {
- Table,
- TableBody,
- TableCell,
- TableHead,
- TableHeader,
- TableRow,
-} from '@/components/shared/Table';
-import { asTrimmedString } from '@/utils/stringUtils';
-import {
- PLATFORM_TABLE_BODY_CLASS,
- PLATFORM_TABLE_CARD_CLASS,
- PLATFORM_TABLE_HEADER_ROW_CLASS,
- PLATFORM_HEALTH_FILTER_OPTIONS,
- PlatformTableToolbar,
- PlatformTableEmptyState,
- createPlatformTableFilterState,
- filterPlatformResources,
- getPlatformTableCellClass,
- getPlatformTableHeadClass,
- type PlatformResourceStatusFilter,
-} from '@/features/platformPage/sharedPlatformPage';
-import type { Resource } from '@/types/resource';
-
-// TrueNAS physical disks are SMART-instrumented storage devices, not
-// compute hosts. The canonical infrastructure table's CPU / Memory /
-// Disk I/O / Uptime columns are conceptually N/A; the operator columns
-// are model, serial, type, size, health, temperature, and wearout.
-// This bespoke table surfaces those from the canonical `physicalDisk`
-// payload already attached to each row.
-
-const formatBytes = (bytes: number | undefined): string => {
- if (!bytes || bytes <= 0) return '—';
- const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
- let value = bytes;
- let unitIdx = 0;
- while (value >= 1024 && unitIdx < units.length - 1) {
- value /= 1024;
- unitIdx += 1;
- }
- return `${value.toFixed(value >= 100 ? 0 : value >= 10 ? 1 : 2)} ${units[unitIdx]}`;
-};
-
-const formatTemperature = (celsius: number | undefined): JSX.Element => {
- if (typeof celsius !== 'number' || celsius <= 0) return <span class="text-muted">—</span>;
- return <span class="tabular-nums">{celsius.toFixed(1)}°C</span>;
-};
-
-const formatWearout = (wearout: number | undefined): JSX.Element => {
- if (typeof wearout !== 'number' || wearout < 0) return <span class="text-muted">—</span>;
- return <span class="tabular-nums">{wearout.toFixed(0)}%</span>;
-};
-
-const healthVariant = (health: string | undefined): 'success' | 'warning' | 'danger' | 'muted' => {
- const normalized = (health || '').trim().toLowerCase();
- if (normalized === 'healthy' || normalized === 'passed' || normalized === 'pass')
- return 'success';
- if (normalized === 'warning' || normalized === 'degraded') return 'warning';
- if (normalized === 'failed' || normalized === 'fail' || normalized === 'critical')
- return 'danger';
- return 'muted';
-};
-
-export const TrueNASDisksTable: Component<{
- resources: Resource[];
- emptyIcon: JSX.Element;
- emptyTitle: string;
- emptyDescription: string;
- title?: string;
- showToolbar?: boolean;
-}> = (props) => {
- const tableState = createPlatformTableFilterState({
- resources: () => props.resources,
- initialStatus: 'all' as PlatformResourceStatusFilter,
- filter: filterPlatformResources,
- });
-
- return (
- <Show
- when={props.resources.length > 0}
- fallback={
- <PlatformTableEmptyState
- icon={props.emptyIcon}
- title={props.emptyTitle}
- description={props.emptyDescription}
- />
- }
- >
- <div class="space-y-3">
- <Show when={props.showToolbar !== false}>
- <PlatformTableToolbar
- search={tableState.search}
- onSearchChange={tableState.setSearch}
- searchPlaceholder="Search disks"
- status={tableState.status()}
- onStatusChange={tableState.setStatus}
- statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}
- visible={tableState.visible()}
- total={tableState.total()}
- rowNoun="disks"
- />
- </Show>
-
- <Show
- when={tableState.filtered().length > 0}
- fallback={
- <PlatformTableEmptyState
- icon={props.emptyIcon}
- title="No disks match current filters"
- description="Adjust the search or status filter to see more disks."
- />
- }
- >
- <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
- <TableCardHeader title={props.title ?? 'Disks'} />
- <Table class="min-w-full table-fixed text-xs md:min-w-[880px]">
- <TableHeader>
- <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
- <TableHead class={getPlatformTableHeadClass()}>Disk</TableHead>
- <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
- Model
- </TableHead>
- <TableHead class={getPlatformTableHeadClass()}>Type</TableHead>
- <TableHead class={getPlatformTableHeadClass('right')}>Size</TableHead>
- <TableHead class={getPlatformTableHeadClass()}>Health</TableHead>
- <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
- Temp
- </TableHead>
- <TableHead class={`${getPlatformTableHeadClass('right')} hidden md:table-cell`}>
- Wearout
- </TableHead>
- <TableHead class={`${getPlatformTableHeadClass()} hidden md:table-cell`}>
- Serial
- </TableHead>
- </TableRow>
- </TableHeader>
- <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
- <For each={tableState.filtered()}>
- {(disk) => {
- const meta = () => disk.physicalDisk;
- const name = () => asTrimmedString(disk.name) || disk.id;
- const model = () => asTrimmedString(meta()?.model) || '—';
- const type = () => asTrimmedString(meta()?.diskType) || '—';
- const health = () => asTrimmedString(meta()?.health) || '—';
- const serial = () => asTrimmedString(meta()?.serial) || '—';
- return (
- <TableRow class="text-[11px] sm:text-xs">
- <TableCell class={getPlatformTableCellClass()}>
- <span class="truncate font-semibold text-base-content" title={name()}>
- {name()}
- </span>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClass()} hidden text-base-content md:table-cell`}
- >
- <span class="inline-block max-w-[14rem] truncate" title={model()}>
- {model()}
- </span>
- </TableCell>
- <TableCell class={`${getPlatformTableCellClass()} text-base-content`}>
- {type()}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClass('right')} text-base-content`}
- >
- {formatBytes(meta()?.sizeBytes)}
- </TableCell>
- <TableCell class={getPlatformTableCellClass()}>
- <div class="flex items-center gap-2">
- <StatusDot
- size="sm"
- variant={healthVariant(meta()?.health)}
- title={meta()?.health || 'unknown'}
- ariaHidden
- />
- <span class="text-base-content">{health()}</span>
- </div>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
- >
- {formatTemperature(meta()?.temperature)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClass('right')} hidden text-base-content md:table-cell`}
- >
- {formatWearout(meta()?.wearout)}
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClass()} hidden font-mono text-[11px] text-base-content md:table-cell`}
- >
- <span class="inline-block max-w-[10rem] truncate" title={serial()}>
- {serial()}
- </span>
- </TableCell>
- </TableRow>
- );
- }}
- </For>
- </TableBody>
- </Table>
- </TableCard>
- </Show>
- </div>
- </Show>
- );
-};
-
-export default TrueNASDisksTable;
diff --git a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
index 24ad1ac735..f969ea28ec 100644
--- a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
+++ b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx
@@ -9,7 +9,6 @@ import {
PlatformSectionTabs,
PlatformTableEmptyState,
} from '@/features/platformPage/sharedPlatformPage';
-import { TrueNASDisksTable } from './TrueNASDisksTable';
import { TrueNASSystemsTable } from './TrueNASSystemsTable';
import {
TRUENAS_TAB_SPECS,
@@ -89,21 +88,6 @@ export function TrueNASPageSurface() {
emptyDescription="TrueNAS systems appear here once a TrueNAS connection reports its top-level appliance."
showToolbar={false}
/>
- <StorageSurface
- embedded
- tableOnly
- forcedView="pools"
- forcedSourceFilter={TRUENAS_PLATFORM_FILTER}
- />
- <Show when={model().disks.length > 0}>
- <TrueNASDisksTable
- resources={model().disks}
- emptyIcon={truenasIcon()}
- emptyTitle="No TrueNAS disks reported"
- emptyDescription="Physical disks appear here once a TrueNAS connection enumerates them."
- showToolbar={false}
- />
- </Show>
<Show when={model().apps.length > 0}>
<WorkloadsSurface
vms={[]}
diff --git a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts
index c11edbd406..36a6584182 100644
--- a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts
+++ b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts
@@ -18,7 +18,7 @@ describe('truenasPageModel', () => {
expect(TRUENAS_TAB_SPECS.map((tab) => tab.id)).toEqual(['overview', 'storage']);
});
- it('buckets systems, disks, apps, storage while ignoring non-TrueNAS resources', () => {
+ it('buckets systems and apps while keeping storage inventory in scope for shared surfaces', () => {
const model = buildTrueNASPageModel([
makeResource({ id: 'truenas-system', type: 'agent' }),
makeResource({ id: 'truenas-app', type: 'app-container' }),
@@ -29,7 +29,6 @@ describe('truenasPageModel', () => {
]);
expect(model.systems.map((r) => r.id)).toEqual(['truenas-system']);
- expect(model.disks.map((r) => r.id)).toEqual(['truenas-disk']);
expect(model.apps.map((r) => r.id)).toEqual(['truenas-app']);
expect(model.resources.map((r) => r.id).sort()).toEqual(
['truenas-app', 'truenas-disk', 'truenas-pool', 'truenas-system'].sort(),
diff --git a/frontend-modern/src/features/truenas/truenasPageModel.ts b/frontend-modern/src/features/truenas/truenasPageModel.ts
index b865456d3c..df8613e361 100644
--- a/frontend-modern/src/features/truenas/truenasPageModel.ts
+++ b/frontend-modern/src/features/truenas/truenasPageModel.ts
@@ -9,12 +9,10 @@ export type TrueNASTabSpec = {
path: string;
};
-// The Overview tab mirrors Proxmox / vSphere: systems table on top with the
-// pools-only StorageSurface, physical disks, and apps stacked beneath. The
-// standalone Disks and Apps tabs that used to live here were pure
-// duplicates — the Workloads filter inside Overview owns app
-// search/grouping, and the Storage tab provides the full StorageSurface
-// (pools + disks toggle, with toolbar) for richer storage exploration.
+// The Overview tab is intentionally narrow: appliance systems first, then apps
+// when present. Storage inventory, pool topology, and physical disks all live
+// on the Storage tab so operators have one canonical storage surface instead
+// of a duplicated overview snapshot plus a richer storage page.
export const TRUENAS_TAB_SPECS: readonly TrueNASTabSpec[] = [
{ id: 'overview', label: 'Overview', path: '/truenas/overview' },
{ id: 'storage', label: 'Storage', path: '/truenas/storage' },
@@ -35,7 +33,6 @@ const isTrueNASPlatform = (resource: Resource): boolean =>
export type TrueNASPageModel = {
resources: Resource[];
systems: Resource[];
- disks: Resource[];
apps: Resource[];
};
@@ -46,12 +43,9 @@ export function buildTrueNASPageModel(resources: Resource[]): TrueNASPageModel {
const systems = trueNasResources.filter((resource) => resource.type === 'agent');
const apps = trueNasResources.filter((resource) => resource.type === 'app-container');
- const disks = trueNasResources.filter((resource) => resource.type === 'physical_disk');
-
return {
resources: trueNasResources,
systems,
- disks,
apps,
};
}