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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Share platform table filter state
rcourtman829d43a0d290
diff --git a/frontend-modern/src/features/docker/DockerHostsTable.tsx b/frontend-modern/src/features/docker/DockerHostsTable.tsxindex 88cef19866..b10d279ec0 100644--- a/frontend-modern/src/features/docker/DockerHostsTable.tsx+++ b/frontend-modern/src/features/docker/DockerHostsTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+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';@@ -19,6 +19,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -71,12 +72,11 @@ export const DockerHostsTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.resources, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.resources.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.resources,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });return (<Show@@ -92,20 +92,20 @@ export const DockerHostsTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search Docker hosts"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="hosts"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -144,7 +144,7 @@ export const DockerHostsTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(host) => {const docker = () =>host.docker asdiff --git a/frontend-modern/src/features/docker/DockerServicesTable.tsx b/frontend-modern/src/features/docker/DockerServicesTable.tsxindex a3993ee7a9..ecf2c14ab3 100644--- a/frontend-modern/src/features/docker/DockerServicesTable.tsx+++ b/frontend-modern/src/features/docker/DockerServicesTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+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';@@ -19,6 +19,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -70,12 +71,11 @@ export const DockerServicesTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.resources, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.resources.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.resources,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });return (<Show@@ -91,20 +91,20 @@ export const DockerServicesTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search Swarm services"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="services"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -136,7 +136,7 @@ export const DockerServicesTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(service) => {const name = () => asTrimmedString(service.name) || service.id;const image = () => asTrimmedString(service.docker?.image) || '—';diff --git a/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsxindex 95fa5ce7cf..991df706d4 100644--- a/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx+++ b/frontend-modern/src/features/kubernetes/KubernetesClustersTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+import { For, Show, createMemo, 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';@@ -19,6 +19,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -54,12 +55,11 @@ export const KubernetesClustersTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.clusters, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.clusters.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.clusters,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });const countsByCluster = createMemo(() => {const map = new Map<string, { nodes: number; pods: number; deployments: number }>();@@ -112,20 +112,20 @@ export const KubernetesClustersTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search clusters"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="clusters"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -158,7 +158,7 @@ export const KubernetesClustersTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(cluster) => {const name = () =>asTrimmedString(cluster.kubernetes?.clusterName) ||diff --git a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsxindex b36c77661f..b0dae83a1d 100644--- a/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx+++ b/frontend-modern/src/features/kubernetes/KubernetesDeploymentsTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+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';@@ -19,6 +19,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -46,12 +47,11 @@ export const KubernetesDeploymentsTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.resources, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.resources.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.resources,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });return (<Show@@ -67,20 +67,20 @@ export const KubernetesDeploymentsTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search deployments"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="deployments"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -112,7 +112,7 @@ export const KubernetesDeploymentsTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(deployment) => {const name = () => asTrimmedString(deployment.name) || deployment.id;const ns = () => asTrimmedString(deployment.kubernetes?.namespace) || '—';diff --git a/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx b/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsxindex 5fc9bc79c5..86e256853b 100644--- a/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx+++ b/frontend-modern/src/features/kubernetes/KubernetesNodesTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+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';@@ -19,6 +19,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -77,12 +78,11 @@ export const KubernetesNodesTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.resources, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.resources.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.resources,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });return (<Show@@ -98,20 +98,20 @@ export const KubernetesNodesTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search nodes"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="nodes"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -147,7 +147,7 @@ export const KubernetesNodesTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(node) => {const meta = () => node.kubernetes;const name = () => asTrimmedString(node.name) || node.id;diff --git a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.tsindex c66c5a741c..58fb868a42 100644--- a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts+++ b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts@@ -57,6 +57,7 @@ describe('platform overview layout guardrails', () => {expect(sharedPlatformPageSource).toContain('getPlatformTableHeadClass');expect(sharedPlatformPageSource).toContain('getPlatformTableCellClass');expect(sharedPlatformPageSource).toContain('PlatformTableToolbar');+ expect(sharedPlatformPageSource).toContain('createPlatformTableFilterState');expect(sharedPlatformPageSource).toContain('PLATFORM_HEALTH_FILTER_OPTIONS');for (const source of platformTableSources) {@@ -71,9 +72,11 @@ describe('platform overview layout guardrails', () => {for (const source of platformToolbarTableSources) {expect(source).toContain('PlatformTableToolbar');+ expect(source).toContain('createPlatformTableFilterState');expect(source).toContain('PLATFORM_HEALTH_FILTER_OPTIONS');expect(source).not.toContain("from '@/components/shared/SearchInput'");expect(source).not.toContain("from '@/components/shared/FilterButtonGroup'");+ expect(source).not.toContain('createSignal');}});diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.tsindex a2891e0e75..57a06827dd 100644--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts@@ -1,6 +1,11 @@import { describe, expect, it } from 'vitest';+import { createRoot } from 'solid-js';import type { Resource } from '@/types/resource';-import { filterPlatformResources } from '../sharedPlatformPage';+import {+ createPlatformTableFilterState,+ filterPlatformResources,+ type PlatformResourceStatusFilter,+} from '../sharedPlatformPage';const makeResource = (partial: Partial<Resource> & Pick<Resource, 'id' | 'type' | 'status'>,@@ -65,4 +70,34 @@ describe('filterPlatformResources', () => {const filtered = filterPlatformResources(resources, 'host', 'degraded');expect(filtered.map((r) => r.id).sort()).toEqual(['host-charlie', 'host-foxtrot'].sort());});++ it('centralizes provider table filter state and row counts', () => {+ createRoot((dispose) => {+ try {+ const state = createPlatformTableFilterState({+ resources: () => resources,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });++ expect(state.total()).toBe(resources.length);+ expect(state.visible()).toBe(resources.length);++ state.setSearch('gpu');+ expect(state.filtered().map((r) => r.id)).toEqual(['host-with-tag']);+ expect(state.visible()).toBe(1);++ state.setSearch('host');+ state.setStatus('offline');+ expect(+ state+ .filtered()+ .map((r) => r.id)+ .sort(),+ ).toEqual(['host-delta', 'host-echo']);+ } finally {+ dispose();+ }+ });+ });});diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsxindex d596834c7d..f02cef1d11 100644--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx@@ -171,6 +171,28 @@ export const filterPlatformResources = (return result;};+export function createPlatformTableFilterState<Status extends string | number>(props: {+ resources: () => Resource[];+ initialStatus: Status;+ filter: (resources: Resource[], search: string, status: Status) => Resource[];+}) {+ const [search, setSearch] = createSignal('');+ const [status, setStatus] = createSignal<Status>(props.initialStatus);+ const filtered = createMemo(() => props.filter(props.resources(), search(), status()));+ const visible = createMemo(() => filtered().length);+ const total = createMemo(() => props.resources().length);++ return {+ search,+ setSearch,+ status,+ setStatus,+ filtered,+ visible,+ total,+ };+}+// Compact operator-facing counter shown at the right of the toolbar so// users can read total / matching at a glance, mirroring v5's dense// dashboard counters without spawning a card grid.@@ -234,15 +256,11 @@ export const PlatformResourceTable: Component<{searchPlaceholder?: string;}> = (props) => {const [expandedResourceId, setExpandedResourceId] = createSignal<string | null>(null);- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filteredResources = createMemo(() =>- filterPlatformResources(props.resources, search(), status()),- );-- const visibleCount = createMemo(() => filteredResources().length);- const totalCount = createMemo(() => props.resources.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.resources,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });return (<Show@@ -257,18 +275,18 @@ export const PlatformResourceTable: Component<{><div class="space-y-3"><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder={props.searchPlaceholder ?? 'Search rows'}- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_STATUS_FILTER_OPTIONS}- visible={visibleCount()}- total={totalCount()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="rows"/><Show- when={filteredResources().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -278,7 +296,7 @@ export const PlatformResourceTable: Component<{}><UnifiedResourceTable- resources={filteredResources()}+ resources={tableState.filtered()}expandedResourceId={expandedResourceId()}onExpandedResourceChange={setExpandedResourceId}groupingMode={props.groupingMode ?? 'grouped'}diff --git a/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx b/frontend-modern/src/features/truenas/TrueNASDisksTable.tsxindex 6f2c919080..258a5986c1 100644--- a/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx+++ b/frontend-modern/src/features/truenas/TrueNASDisksTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+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';@@ -18,6 +18,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -72,12 +73,11 @@ export const TrueNASDisksTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.resources, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.resources.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.resources,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });return (<Show@@ -93,20 +93,20 @@ export const TrueNASDisksTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search disks"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="disks"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -139,7 +139,7 @@ export const TrueNASDisksTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(disk) => {const meta = () => disk.physicalDisk;const name = () => asTrimmedString(disk.name) || disk.id;diff --git a/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx b/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsxindex 1be500b168..8f95e2969c 100644--- a/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx+++ b/frontend-modern/src/features/truenas/TrueNASSystemsTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+import { For, Show, createMemo, 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';@@ -19,6 +19,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -80,12 +81,11 @@ export const TrueNASSystemsTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.systems, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.systems.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.systems,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });// Single-system canonical mock is the common case today; counts span// the full TrueNAS resource scope per row. When multi-system support@@ -117,20 +117,20 @@ export const TrueNASSystemsTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search TrueNAS systems"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="systems"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -172,7 +172,7 @@ export const TrueNASSystemsTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(system) => {const name = () => asTrimmedString(system.name) || system.id;const version = () => asTrimmedString(system.agent?.osVersion) || '—';diff --git a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsxindex 1f1efbc85e..4cdf8472e7 100644--- a/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx+++ b/frontend-modern/src/features/vmware/VsphereDatastoresTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+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';@@ -20,6 +20,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,getPlatformTableCellClass,getPlatformTableHeadClass,} from '@/features/platformPage/sharedPlatformPage';@@ -135,37 +136,34 @@ export const VsphereDatastoresTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<DatastoreStatusFilter>('all');-- const filtered = createMemo(() => {- const term = search().trim().toLowerCase();- const want = status();- return props.resources.filter((row) => {- if (want !== 'all' && classify(row) !== want) return false;- if (!term) return true;- const haystack = [- row.name,- row.displayName,- row.vmware?.datacenterName,- row.vmware?.datastoreType,- row.vmware?.connectionName,- row.vmware?.vcenterHost,- ...(row.storage?.nodes ?? []),- ]- .filter(Boolean)- .join(' ')- .toLowerCase();- return haystack.includes(term);- });+ const tableState = createPlatformTableFilterState<DatastoreStatusFilter>({+ resources: () => props.resources,+ initialStatus: 'all',+ filter: (resources, search, status) => {+ const term = search.trim().toLowerCase();+ return resources.filter((row) => {+ if (status !== 'all' && classify(row) !== status) return false;+ if (!term) return true;+ const haystack = [+ row.name,+ row.displayName,+ row.vmware?.datacenterName,+ row.vmware?.datastoreType,+ row.vmware?.connectionName,+ row.vmware?.vcenterHost,+ ...(row.storage?.nodes ?? []),+ ]+ .filter(Boolean)+ .join(' ')+ .toLowerCase();+ return haystack.includes(term);+ });+ },});- const total = createMemo(() => props.resources.length);- const visible = createMemo(() => filtered().length);-return (<Show- when={total() > 0}+ when={tableState.total() > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -177,20 +175,20 @@ export const VsphereDatastoresTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search datastores, datacenters, hosts"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="datastores"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -223,7 +221,7 @@ export const VsphereDatastoresTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(row) => {const ind = indicatorFor(row);const name = asTrimmedString(row.name) || row.id;diff --git a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx b/frontend-modern/src/features/vmware/VsphereHostsTable.tsxindex e9e429a2cc..9b226ba0e4 100644--- a/frontend-modern/src/features/vmware/VsphereHostsTable.tsx+++ b/frontend-modern/src/features/vmware/VsphereHostsTable.tsx@@ -1,4 +1,4 @@-import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';+import { For, Show, createMemo, 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';@@ -19,6 +19,7 @@ import {PLATFORM_HEALTH_FILTER_OPTIONS,PlatformTableToolbar,PlatformTableEmptyState,+ createPlatformTableFilterState,filterPlatformResources,getPlatformTableCellClass,getPlatformTableHeadClass,@@ -72,12 +73,11 @@ export const VsphereHostsTable: Component<{title?: string;showToolbar?: boolean;}> = (props) => {- const [search, setSearch] = createSignal('');- const [status, setStatus] = createSignal<PlatformResourceStatusFilter>('all');-- const filtered = createMemo(() => filterPlatformResources(props.hosts, search(), status()));- const visible = createMemo(() => filtered().length);- const total = createMemo(() => props.hosts.length);+ const tableState = createPlatformTableFilterState({+ resources: () => props.hosts,+ initialStatus: 'all' as PlatformResourceStatusFilter,+ filter: filterPlatformResources,+ });const vmCountByHost = createMemo(() => {const map = new Map<string, number>();@@ -104,20 +104,20 @@ export const VsphereHostsTable: Component<{<div class="space-y-3"><Show when={props.showToolbar !== false}><PlatformTableToolbar- search={search}- onSearchChange={setSearch}+ search={tableState.search}+ onSearchChange={tableState.setSearch}searchPlaceholder="Search ESXi hosts"- status={status()}- onStatusChange={setStatus}+ status={tableState.status()}+ onStatusChange={tableState.setStatus}statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}- visible={visible()}- total={total()}+ visible={tableState.visible()}+ total={tableState.total()}rowNoun="hosts"/></Show><Show- when={filtered().length > 0}+ when={tableState.filtered().length > 0}fallback={<PlatformTableEmptyStateicon={props.emptyIcon}@@ -153,7 +153,7 @@ export const VsphereHostsTable: Component<{</TableRow></TableHeader><TableBody class={PLATFORM_TABLE_BODY_CLASS}>- <For each={filtered()}>+ <For each={tableState.filtered()}>{(host) => {const meta = () => host.vmware;const name = () => asTrimmedString(host.name) || host.id;