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
feat(workloads): add canonical platform scoping for api-backed workloads
rcourtman5defe4fef476
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 74d4f464e3..938ba63393 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -684,6 +684,11 @@ search-row, filter-row, and inline-leading-slot layout surface. Monitoringpages that need workspace tabs or count chips next to search should route thatthrough the shared `searchLeading` slot instead of recreating a second localheader strip above the control bar.+That same shared filter-toolbar boundary also owns controlled select continuity+when filter options materialize asynchronously. `LabeledFilterSelect` must keep+the caller-owned `value` visibly selected after option children arrive so+dashboard, recovery, and other canonical filter bars do not drop their active+selection until the operator reopens the control.When those workspace tabs need an embedded control-bar treatment, they shouldstill stay on the one canonical `frontend-modern/src/components/shared/Subtabs.tsx`primitive and reuse the established shell, list, and button class patterndiff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.mdindex 3ccbb93ab0..f384f001b0 100644--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md@@ -234,6 +234,16 @@ org-scope switching, and metadata refresh, andowns workload-route synchronization, deep-link normalization, and route-scopedfilter contracts. Future dashboard hot-path changes must extend through thoseowners instead of accreting back into `frontend-modern/src/components/Dashboard/Dashboard.tsx`.+That same route-owned filter contract now also includes canonical workload+`platform` scoping for API-backed runtimes. Dashboard URL-sync, filter-option+assembly, and workload drill-down routes must preserve+`platform=<owned-source-key>` for surfaces such as TrueNAS app-containers,+while treating host or cluster identity as secondary scope instead of+collapsing those routes back to generic agent-only semantics. The derived+workload hot path must also tolerate transient async route/data gaps by+treating missing filtered-workload collections as empty until the route and+resource snapshots converge, rather than crashing the dashboard between sync+phases.The shared infrastructure table hot path now also treats operator-facingresource identity as a protected boundary: sorting, searching, summary-seriesmatching, and row titles on the infrastructure page must use the canonicaldiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex 0cc7677191..4e413881f1 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -97,6 +97,7 @@ querying, and the operator-facing storage health presentation layer.9. Letting whitespace-padded recovery timeline params fall off canonical route state; shared recovery URLs must trim and normalize `day`, `range`, `scope`, `status`, `verification`, `cluster`, `node`, `namespace`, `itemType`, and adjacent history filters before the page model validates them so pasted or hand-edited links resolve to the same canonical timeline and filter state as UI-authored routes10. Letting explicit recovery `all` sentinels survive in canonical route state; shared recovery URLs must collapse case- or whitespace-variant `all` values for `cluster`, `node`, `namespace`, and `itemType` back to the canonical unset route state so copied links do not preserve fake active filters11. Letting non-canonical recovery platform values survive in route or transport state; shared recovery URLs must collapse unsupported or fake `platform` values back to the canonical unset state, and only owned source-platform options or canonical legacy aliases may reach rollups, points, series, and facets transport filters+11a. Letting adjacent workload-route changes in shared `frontend-modern/src/routing/resourceLinks.ts` perturb recovery parse/build semantics; expanding canonical `/workloads` platform scoping must not alter the owned `/recovery` `platform` and `itemType` vocabulary, legacy alias rewrites, or recovery drill-down workspace selection12. Letting protected-item recovery outcome filtering fork from the canonical history status filter; the protected inventory status control must drive the same route-backed `status` field and the same rollups, points, series, and facets transport filters as the history surface instead of keeping a protected-only local outcome branch13. Letting visible protected-item filters fall out of shared recovery links; the protected `Stale only` toggle must restore from the canonical recovery URL and rewrite to one owned `stale=1` route form instead of disappearing on refresh or copy/paste14. Reintroducing stacked full-width recovery tables as the primary desktop layout; the governed recovery surface must expose one primary data region at a time with explicit protected-items versus recovery-events view switching so Pulse stays inventory-first for Proxmox operators without collapsing the page back into a single-platform backup screendiff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 6a933ac3c6..b48e25923f 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -501,6 +501,14 @@ workload-to-infrastructure href builder used by dashboard row and drawerconsumers. Future workload-to-resource navigation changes must extend throughthat shared routing contract instead of reintroducing dashboard-local pathbuilders.+That same routing contract now also owns canonical `/workloads` platform+scoping. Shared workloads links, dashboard URL-sync state, and infrastructure+drill-down helpers must preserve `platform=<owned-source-key>` for API-backed+workloads such as TrueNAS app-containers instead of collapsing those routes+back to generic agent or Docker-only semantics when host telemetry is also+present. Runtime-local filters like `agent` or cluster context may still be+added as secondary scope, but the canonical platform query must remain the+first-class route boundary for shared workload navigation.That drawer shell now routes its canonical timeline filter, facet-bundle, andresource-intelligence state through`frontend-modern/src/components/Infrastructure/useResourceDetailDrawerHistoryState.ts`,diff --git a/frontend-modern/src/components/Dashboard/Dashboard.tsx b/frontend-modern/src/components/Dashboard/Dashboard.tsxindex 3464c70f96..fc3ed8ecd1 100644--- a/frontend-modern/src/components/Dashboard/Dashboard.tsx+++ b/frontend-modern/src/components/Dashboard/Dashboard.tsx@@ -83,6 +83,7 @@ export function Dashboard(props: DashboardProps) {containerRuntimeFilter={state.containerRuntimeFilterConfig()}hostFilter={state.hostFilterConfig()}namespaceFilter={state.namespaceFilterConfig()}+ platformFilter={state.platformFilterConfig()}/></Show>diff --git a/frontend-modern/src/components/Dashboard/DashboardFilter.tsx b/frontend-modern/src/components/Dashboard/DashboardFilter.tsxindex 32f6cc33e3..7a42228fe1 100644--- a/frontend-modern/src/components/Dashboard/DashboardFilter.tsx+++ b/frontend-modern/src/components/Dashboard/DashboardFilter.tsx@@ -81,6 +81,29 @@ export const DashboardFilter: Component<DashboardFilterProps> = (props) => {)}</Show>+ <Show when={props.platformFilter}>+ {(platformFilter) => (+ <LabeledFilterSelect+ id={platformFilter().id ?? 'dashboard-platform-filter'}+ label={platformFilter().label ?? 'Platform'}+ value={platformFilter().value}+ onChange={(e) => platformFilter().onChange(e.currentTarget.value)}+ selectClass="min-w-[8rem]"+ >+ <For each={platformFilter().options}>+ {(option) => (+ <option+ value={option.value}+ selected={option.value === platformFilter().value}+ >+ {option.label}+ </option>+ )}+ </For>+ </LabeledFilterSelect>+ )}+ </Show>+<Show when={props.namespaceFilter}>{(namespaceFilter) => (<LabeledFilterSelectdiff --git a/frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx b/frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsxindex 6e91038d1a..e3142c486c 100644--- a/frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx+++ b/frontend-modern/src/components/Dashboard/__tests__/DashboardFilter.test.tsx@@ -1,7 +1,11 @@import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';import { render, screen, cleanup, fireEvent } from '@solidjs/testing-library';+import { createSignal } from 'solid-js';import { DashboardFilter } from '../DashboardFilter';-import type { DashboardFilterProps } from '../dashboardFilterModel';+import {+ DEFAULT_DASHBOARD_SORT_KEY,+ type DashboardFilterProps,+} from '../dashboardFilterModel';// Mock useBreakpoint — hoist so tests can control isMobileconst { isMobileMock } = vi.hoisted(() => {@@ -197,6 +201,7 @@ describe('DashboardFilter', () => {it('resets all filters when clicked', () => {const hostOnChange = vi.fn();+ const platformOnChange = vi.fn();const namespaceOnChange = vi.fn();const props = makeProps({search: vi.fn(() => 'test'),@@ -211,6 +216,14 @@ describe('DashboardFilter', () => {],onChange: hostOnChange,},+ platformFilter: {+ value: 'truenas',+ options: [+ { value: '', label: 'All platforms' },+ { value: 'truenas', label: 'TrueNAS' },+ ],+ onChange: platformOnChange,+ },namespaceFilter: {value: 'ns-1',options: [@@ -225,12 +238,13 @@ describe('DashboardFilter', () => {fireEvent.click(screen.getByText('Reset'));expect(props.setSearch).toHaveBeenCalledWith('');- expect(props.setSortKey).toHaveBeenCalledWith('name');+ expect(props.setSortKey).toHaveBeenCalledWith(DEFAULT_DASHBOARD_SORT_KEY);expect(props.setSortDirection).toHaveBeenCalledWith('asc');expect(props.setViewMode).toHaveBeenCalledWith('all');expect(props.setStatusMode).toHaveBeenCalledWith('all');expect(props.setGroupingMode).toHaveBeenCalledWith('grouped');expect(hostOnChange).toHaveBeenCalledWith('');+ expect(platformOnChange).toHaveBeenCalledWith('');expect(namespaceOnChange).toHaveBeenCalledWith('');});@@ -327,6 +341,65 @@ describe('DashboardFilter', () => {});});+ describe('platform filter', () => {+ it('renders when platformFilter prop is provided', () => {+ const props = makeProps({+ platformFilter: {+ value: '',+ options: [+ { value: '', label: 'All platforms' },+ { value: 'truenas', label: 'TrueNAS' },+ ],+ onChange: vi.fn(),+ },+ });+ render(() => <DashboardFilter {...props} />);+ expect(screen.getByLabelText('Platform')).toBeInTheDocument();+ });++ it('calls onChange when platform selection changes', () => {+ const onChange = vi.fn();+ const props = makeProps({+ platformFilter: {+ value: '',+ options: [+ { value: '', label: 'All platforms' },+ { value: 'truenas', label: 'TrueNAS' },+ ],+ onChange,+ },+ });+ render(() => <DashboardFilter {...props} />);+ fireEvent.change(screen.getByLabelText('Platform'), { target: { value: 'truenas' } });+ expect(onChange).toHaveBeenCalledWith('truenas');+ });++ it('keeps the controlled platform value when async options arrive later', () => {+ const baseProps = makeProps();+ const [platformOptions, setPlatformOptions] = createSignal([+ { value: '', label: 'All platforms' },+ ]);++ render(() => (+ <DashboardFilter+ {...baseProps}+ platformFilter={{+ value: 'truenas',+ options: platformOptions(),+ onChange: vi.fn(),+ }}+ />+ ));++ setPlatformOptions([+ { value: '', label: 'All platforms' },+ { value: 'truenas', label: 'TrueNAS' },+ ]);++ expect(screen.getByLabelText('Platform')).toHaveValue('truenas');+ });+ });+// --- Namespace filter ---describe('namespace filter', () => {diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.tsindex 4b1ff4d1a1..e65319950d 100644--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadFilterConfigModel.test.ts@@ -4,6 +4,7 @@ import {buildDashboardContainerRuntimeFilterConfig,buildDashboardHostFilterConfig,buildDashboardNamespaceFilterConfig,+ buildDashboardPlatformFilterConfig,} from '../dashboardWorkloadFilterConfigModel';describe('dashboardWorkloadFilterConfigModel', () => {@@ -101,4 +102,29 @@ describe('dashboardWorkloadFilterConfigModel', () => {}),).toBeUndefined();});++ it('builds platform filter config when multiple platform scopes exist', () => {+ const onChange = vi.fn();++ expect(+ buildDashboardPlatformFilterConfig({+ isWorkloadsRoute: true,+ selectedPlatform: 'truenas',+ platformOptions: [+ { value: 'docker', label: 'Containers' },+ { value: 'truenas', label: 'TrueNAS' },+ ],+ onChange,+ }),+ ).toMatchObject({+ id: 'workloads-platform-filter',+ label: 'Platform',+ value: 'truenas',+ options: [+ { value: '', label: 'All platforms' },+ { value: 'docker', label: 'Containers' },+ { value: 'truenas', label: 'TrueNAS' },+ ],+ });+ });});diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.tsindex 93e85749a6..aec5477412 100644--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteModel.test.ts@@ -5,6 +5,7 @@ import {buildDashboardContainerRuntimeOptions,buildDashboardKubernetesContextOptions,buildDashboardKubernetesNamespaceOptions,+ buildDashboardPlatformOptions,buildDashboardWorkloadNodeOptions,deserializeDashboardWorkloadViewMode,} from '../dashboardWorkloadRouteModel';@@ -116,6 +117,37 @@ describe('dashboardWorkloadRouteModel', () => {).toEqual(['containerd', 'docker']);});+ it('builds canonical platform options from visible workload platforms', () => {+ expect(+ buildDashboardPlatformOptions(+ [+ makeGuest({+ id: 'app-a',+ type: 'app-container',+ workloadType: 'app-container',+ platformType: 'truenas',+ }),+ makeGuest({+ id: 'app-b',+ type: 'app-container',+ workloadType: 'app-container',+ platformType: 'docker',+ }),+ makeGuest({+ id: 'pod-a',+ type: 'pod',+ workloadType: 'pod',+ platformType: 'kubernetes',+ }),+ ],+ 'app-container',+ ),+ ).toEqual([+ { value: 'docker', label: 'Containers' },+ { value: 'truenas', label: 'TrueNAS' },+ ]);+ });+it('builds kubernetes namespace options with the selected context scope applied', () => {const guests = [makeGuest({diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.tsindex bfe163c21c..aaa6bf77f0 100644--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadRouteStateModel.test.ts@@ -18,6 +18,7 @@ describe('dashboardWorkloadRouteStateModel', () => {expect(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE).toEqual({selectedNode: null,selectedHostHint: null,+ selectedPlatform: null,selectedKubernetesContext: null,selectedKubernetesNamespace: null,containerRuntime: '',diff --git a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.tsindex 3348a5f3a0..88a8e130e8 100644--- a/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/dashboardWorkloadUrlSyncModel.test.ts@@ -11,10 +11,11 @@ describe('dashboardWorkloadUrlSyncModel', () => {it('parses canonical workload route params and keeps resource deep links intact', () => {expect(parseDashboardWorkloadUrlParams(- '?type=docker&runtime=containerd&context=prod&namespace=default&agent=node-a&resource=guest-1',+ '?type=docker&platform=truenas&runtime=containerd&context=prod&namespace=default&agent=node-a&resource=guest-1',),).toEqual({type: 'docker',+ platform: 'truenas',runtime: 'containerd',context: 'prod',namespace: 'default',@@ -27,6 +28,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {expect(resolveDashboardWorkloadTypeParam({type: 'docker',+ platform: '',runtime: '',context: '',namespace: '',@@ -37,6 +39,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {expect(resolveDashboardWorkloadTypeParam({type: 'vm',+ platform: '',runtime: '',context: 'prod',namespace: '',@@ -50,6 +53,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {expect(resolveDashboardWorkloadRuntimeParam({type: 'docker',+ platform: '',runtime: 'containerd',context: '',namespace: '',@@ -65,6 +69,7 @@ describe('dashboardWorkloadUrlSyncModel', () => {expect(resolveDashboardWorkloadRuntimeParam({type: 'vm',+ platform: '',runtime: 'containerd',context: 'prod',namespace: '',@@ -84,18 +89,20 @@ describe('dashboardWorkloadUrlSyncModel', () => {currentSearch: '?resource=guest-1&type=vm&agent=node-a',viewMode: 'pod',containerRuntime: 'docker',+ selectedPlatform: 'kubernetes',selectedKubernetesContext: 'prod',selectedKubernetesNamespace: 'default',selectedNode: 'cluster-a-node-a',selectedHostHint: null,}),- ).toBe('/workloads?resource=guest-1&type=pod&context=prod&namespace=default');+ ).toBe('/workloads?resource=guest-1&type=pod&platform=kubernetes&context=prod&namespace=default');expect(resolveDashboardManagedWorkloadsNavigateTarget({currentSearch: '?type=pod&context=prod&namespace=default',viewMode: 'pod',containerRuntime: '',+ selectedPlatform: null,selectedKubernetesContext: 'prod',selectedKubernetesNamespace: 'default',selectedNode: null,diff --git a/frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts b/frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.tsindex ecb05d0b0b..fe617c851f 100644--- a/frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/useDashboardFilterState.test.ts@@ -22,6 +22,7 @@ describe('useDashboardFilterState', () => {const [sortKey, setSortKey] = createSignal('cpu');const [sortDirection, setSortDirection] = createSignal('desc');const hostOnChange = vi.fn();+ const platformOnChange = vi.fn();const namespaceOnChange = vi.fn();const runtimeOnChange = vi.fn();@@ -42,6 +43,11 @@ describe('useDashboardFilterState', () => {options: [{ value: 'host-1', label: 'Host 1' }],onChange: hostOnChange,},+ platformFilter: {+ value: 'truenas',+ options: [{ value: 'truenas', label: 'TrueNAS' }],+ onChange: platformOnChange,+ },namespaceFilter: {value: 'ns-1',options: [{ value: 'ns-1', label: 'NS 1' }],@@ -55,7 +61,7 @@ describe('useDashboardFilterState', () => {}),);- expect(result.activeFilterCount()).toBe(5);+ expect(result.activeFilterCount()).toBe(6);expect(result.showReset()).toBe(true);expect(result.showToolbarFilters()).toBe(true);expect(result.filtersOpen()).toBe(false);@@ -74,6 +80,7 @@ describe('useDashboardFilterState', () => {expect(sortKey()).toBe('type');expect(sortDirection()).toBe('asc');expect(hostOnChange).toHaveBeenCalledWith('');+ expect(platformOnChange).toHaveBeenCalledWith('');expect(namespaceOnChange).toHaveBeenCalledWith('');expect(runtimeOnChange).not.toHaveBeenCalled();});diff --git a/frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts b/frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.tsindex db8e25d7ac..bf96bc03b7 100644--- a/frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts+++ b/frontend-modern/src/components/Dashboard/__tests__/workloadSelectors.test.ts@@ -218,6 +218,36 @@ describe('workloadSelectors', () => {});expect(withK8sContext.map((g) => g.name)).toEqual(['k8s-a']);});++ it('filters workloads by canonical platform type', () => {+ const guests = [+ makeGuest(1, {+ name: 'nextcloud',+ type: 'app-container',+ workloadType: 'app-container',+ platformType: 'truenas',+ }),+ makeGuest(2, {+ name: 'grafana',+ type: 'app-container',+ workloadType: 'app-container',+ platformType: 'docker',+ }),+ ];++ const result = filterWorkloads({+ guests,+ viewMode: 'app-container',+ statusMode: 'all',+ searchTerm: '',+ selectedNode: null,+ selectedHostHint: null,+ selectedPlatform: 'truenas',+ selectedKubernetesContext: null,+ });++ expect(result.map((guest) => guest.name)).toEqual(['nextcloud']);+ });});describe('createWorkloadSortComparator', () => {diff --git a/frontend-modern/src/components/Dashboard/dashboardFilterModel.ts b/frontend-modern/src/components/Dashboard/dashboardFilterModel.tsindex c3c5252174..3949195975 100644--- a/frontend-modern/src/components/Dashboard/dashboardFilterModel.ts+++ b/frontend-modern/src/components/Dashboard/dashboardFilterModel.ts@@ -37,6 +37,7 @@ export interface DashboardFilterProps {onColumnReset?: () => void;};hostFilter?: DashboardToolbarFilterConfig;+ platformFilter?: DashboardToolbarFilterConfig;namespaceFilter?: DashboardToolbarFilterConfig;containerRuntimeFilter?: DashboardToolbarFilterConfig;chartsCollapsed?: () => boolean;@@ -48,6 +49,7 @@ export interface CountActiveDashboardFiltersOptions {viewMode: ViewMode;statusMode: DashboardStatusMode;hostFilterValue?: string;+ platformFilterValue?: string;namespaceFilterValue?: string;}@@ -70,6 +72,7 @@ export const countActiveDashboardFilters = (if (options.viewMode !== DEFAULT_DASHBOARD_VIEW_MODE) count++;if (options.statusMode !== DEFAULT_DASHBOARD_STATUS_MODE) count++;if ((options.hostFilterValue ?? '') !== '') count++;+ if ((options.platformFilterValue ?? '') !== '') count++;if ((options.namespaceFilterValue ?? '') !== '') count++;return count;diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts b/frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.tsindex 0f512b4938..9550c41810 100644--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts+++ b/frontend-modern/src/components/Dashboard/dashboardWorkloadFilterConfigModel.ts@@ -33,6 +33,32 @@ export const buildDashboardContainerRuntimeFilterConfig = ({};};+interface DashboardPlatformFilterConfigOptions {+ isWorkloadsRoute: boolean;+ selectedPlatform: string | null;+ platformOptions: DashboardToolbarFilterConfig['options'];+ onChange: (value: string) => void;+}++export const buildDashboardPlatformFilterConfig = ({+ isWorkloadsRoute,+ selectedPlatform,+ platformOptions,+ onChange,+}: DashboardPlatformFilterConfigOptions): DashboardToolbarFilterConfig | undefined => {+ if (!isWorkloadsRoute) return undefined;+ if (platformOptions.length === 0) return undefined;+ if (platformOptions.length === 1 && !(selectedPlatform || '').trim()) return undefined;++ return {+ id: 'workloads-platform-filter',+ label: 'Platform',+ value: selectedPlatform ?? '',+ options: [{ value: '', label: 'All platforms' }, ...platformOptions],+ onChange,+ };+};+interface DashboardHostFilterConfigOptions {isWorkloadsRoute: boolean;viewMode: ViewMode;diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts b/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.tsindex 6981379813..906a84aef5 100644--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts+++ b/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteModel.ts@@ -1,5 +1,6 @@import type { WorkloadGuest, ViewMode } from '@/types/workloads';import { normalizeWorkloadViewModeParam, resolveWorkloadType } from '@/utils/workloads';+import { buildSourcePlatformOptions } from '@/utils/sourcePlatformOptions';import type { DashboardFilterSelectOption } from './dashboardFilterModel';import { getKubernetesContextKey, workloadNodeScopeId } from './workloadTopology';@@ -82,3 +83,16 @@ export const buildDashboardContainerRuntimeOptions = (guests: WorkloadGuest[]):}return Array.from(runtimes).sort((a, b) => a.localeCompare(b));};++export const buildDashboardPlatformOptions = (+ guests: WorkloadGuest[],+ viewMode: ViewMode,+): DashboardFilterSelectOption[] =>+ buildSourcePlatformOptions(+ guests+ .filter((guest) => viewMode === 'all' || resolveWorkloadType(guest) === viewMode)+ .map((guest) => guest.platformType || ''),+ ).map((option) => ({+ value: option.key,+ label: option.label,+ }));diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts b/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.tsindex b1af934465..493cbffbe8 100644--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts+++ b/frontend-modern/src/components/Dashboard/dashboardWorkloadRouteStateModel.ts@@ -4,6 +4,7 @@ export const deserializeDashboardContainerRuntime = (raw: unknown): string =>export const DASHBOARD_WORKLOAD_ROUTE_RESET_STATE = {selectedNode: null,selectedHostHint: null,+ selectedPlatform: null,selectedKubernetesContext: null,selectedKubernetesNamespace: null,containerRuntime: '',diff --git a/frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts b/frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.tsindex 3d66a829b9..e514b03d41 100644--- a/frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts+++ b/frontend-modern/src/components/Dashboard/dashboardWorkloadUrlSyncModel.ts@@ -10,6 +10,7 @@ import { normalizeWorkloadViewModeParam } from '@/utils/workloads';export interface DashboardWorkloadUrlParams {type: string;+ platform: string;runtime: string;context: string;namespace: string;@@ -27,6 +28,7 @@ interface DashboardManagedWorkloadsNavigateTargetOptions {containerRuntime: string;currentSearch: string;selectedHostHint: string | null;+ selectedPlatform: string | null;selectedKubernetesContext: string | null;selectedKubernetesNamespace: string | null;selectedNode: string | null;@@ -83,6 +85,7 @@ export const resolveDashboardManagedWorkloadsNavigateTarget = ({containerRuntime,currentSearch,selectedHostHint,+ selectedPlatform,selectedKubernetesContext,selectedKubernetesNamespace,selectedNode,@@ -91,6 +94,7 @@ export const resolveDashboardManagedWorkloadsNavigateTarget = ({const currentParams = new URLSearchParams(currentSearch);const nextParams = new URLSearchParams(currentSearch);const nextType = viewMode === 'all' ? '' : viewMode;+ const nextPlatform = selectedPlatform ?? '';const nextRuntime = viewMode === 'app-container' ? containerRuntime.trim() : '';const nextContext = viewMode === 'pod' ? (selectedKubernetesContext ?? '') : '';const nextNamespace = viewMode === 'pod' ? (selectedKubernetesNamespace ?? '') : '';@@ -98,6 +102,7 @@ export const resolveDashboardManagedWorkloadsNavigateTarget = ({const managedPath = buildWorkloadsPath({type: nextType || null,+ platform: nextPlatform || null,runtime: nextRuntime || null,context: nextContext || null,namespace: nextNamespace || null,@@ -105,6 +110,7 @@ export const resolveDashboardManagedWorkloadsNavigateTarget = ({});const managedUrl = new URL(managedPath, 'http://pulse.local');nextParams.delete(WORKLOADS_QUERY_PARAMS.type);+ nextParams.delete(WORKLOADS_QUERY_PARAMS.platform);nextParams.delete(WORKLOADS_QUERY_PARAMS.runtime);nextParams.delete(WORKLOADS_QUERY_PARAMS.context);nextParams.delete(WORKLOADS_QUERY_PARAMS.namespace);diff --git a/frontend-modern/src/components/Dashboard/useDashboardControlsState.ts b/frontend-modern/src/components/Dashboard/useDashboardControlsState.tsindex 8b63a6c29b..950fd19109 100644--- a/frontend-modern/src/components/Dashboard/useDashboardControlsState.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardControlsState.ts@@ -23,6 +23,7 @@ interface DashboardControlsStateOptions {containerRuntime: Accessor<string>;resetWorkloadRouteFilters: () => void;selectedHostHint: Accessor<string | null>;+ selectedPlatform: Accessor<string | null>;selectedKubernetesContext: Accessor<string | null>;selectedKubernetesNamespace: Accessor<string | null>;selectedNode: Accessor<string | null>;@@ -138,6 +139,7 @@ export function useDashboardControlsState(options: DashboardControlsStateOptionssortDirection() !== DEFAULT_DASHBOARD_SORT_DIRECTION ||options.selectedNode() !== null ||options.selectedHostHint() !== null ||+ options.selectedPlatform() !== null ||options.selectedKubernetesContext() !== null ||options.selectedKubernetesNamespace() !== null ||options.containerRuntime().trim() !== '' ||diff --git a/frontend-modern/src/components/Dashboard/useDashboardFilterState.ts b/frontend-modern/src/components/Dashboard/useDashboardFilterState.tsindex f4cf3cc2b6..d94fa11120 100644--- a/frontend-modern/src/components/Dashboard/useDashboardFilterState.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardFilterState.ts@@ -23,6 +23,7 @@ export const useDashboardFilterState = (props: DashboardFilterProps) => {viewMode: props.viewMode(),statusMode: props.statusMode(),hostFilterValue: props.hostFilter?.value,+ platformFilterValue: props.platformFilter?.value,namespaceFilterValue: props.namespaceFilter?.value,}),);@@ -34,6 +35,7 @@ export const useDashboardFilterState = (props: DashboardFilterProps) => {statusMode: props.statusMode(),groupingMode: props.groupingMode(),hostFilterValue: props.hostFilter?.value,+ platformFilterValue: props.platformFilter?.value,namespaceFilterValue: props.namespaceFilter?.value,}),);@@ -62,6 +64,7 @@ export const useDashboardFilterState = (props: DashboardFilterProps) => {props.setGroupingMode(DEFAULT_DASHBOARD_GROUPING_MODE);props.hostFilter?.onChange('');+ props.platformFilter?.onChange('');props.namespaceFilter?.onChange('');};diff --git a/frontend-modern/src/components/Dashboard/useDashboardState.ts b/frontend-modern/src/components/Dashboard/useDashboardState.tsindex 2754396711..a06aad2c55 100644--- a/frontend-modern/src/components/Dashboard/useDashboardState.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardState.ts@@ -85,13 +85,17 @@ export function useDashboardState(props: DashboardProps) {kubernetesContextOptions,kubernetesNamespaceOptions,namespaceFilterConfig,+ platformFilterConfig,+ platformOptions,resetWorkloadRouteFilters,selectedHostHint,+ selectedPlatform,selectedKubernetesContext,selectedKubernetesNamespace,selectedNode,setContainerRuntime,setSelectedNode,+ setSelectedPlatform,setSelectedKubernetesContext,setSelectedKubernetesNamespace,setViewMode,@@ -134,6 +138,7 @@ export function useDashboardState(props: DashboardProps) {containerRuntime,resetWorkloadRouteFilters,selectedHostHint,+ selectedPlatform,selectedKubernetesContext,selectedKubernetesNamespace,selectedNode,@@ -186,6 +191,7 @@ export function useDashboardState(props: DashboardProps) {searchTerm: search().trim(),selectedNode: selectedNode(),selectedHostHint: selectedHostHint(),+ selectedPlatform: selectedPlatform(),selectedKubernetesContext: selectedKubernetesContext(),selectedKubernetesNamespace: selectedKubernetesNamespace(),containerRuntime: containerRuntime().trim() || null,@@ -271,10 +277,14 @@ export function useDashboardState(props: DashboardProps) {navigate,nodeByInstance,namespaceFilterConfig,+ platformFilterConfig,+ platformOptions,reconnect,reconnectSurface,search,selectedGuestId,+ selectedHostHint,+ selectedPlatform,selectedKubernetesContext,selectedKubernetesNamespace,selectedNode,@@ -283,6 +293,7 @@ export function useDashboardState(props: DashboardProps) {setHoveredWorkloadId,setSearch,setSelectedGuestId,+ setSelectedPlatform,setSelectedKubernetesContext,setSelectedKubernetesNamespace,setSortDirection,diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts b/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.tsindex 8964d1103a..522a358cb8 100644--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardWorkloadDerivedState.ts@@ -43,12 +43,14 @@ interface DashboardWorkloadDerivedStateOptions {export function useDashboardWorkloadDerivedState(options: DashboardWorkloadDerivedStateOptions,) {+ const filteredGuests = createMemo<WorkloadGuest[]>(() => options.filteredGuests() ?? []);+const workloadsSummaryVisibleIds = createMemo<string[]>(() =>- options.filteredGuests().map((guest) => getCanonicalWorkloadId(guest)),+ filteredGuests().map((guest) => getCanonicalWorkloadId(guest)),);const workloadsSummaryFallbackCounts = createMemo(() => {- const guests = options.filteredGuests();+ const guests = filteredGuests();const running = guests.filter((guest) => guest.status === 'running' || guest.status === 'online',).length;@@ -60,7 +62,7 @@ export function useDashboardWorkloadDerivedState(});const workloadsSummaryFallbackSnapshots = createMemo<WorkloadSummarySnapshot[]>(() =>- options.filteredGuests().map((guest) => {+ filteredGuests().map((guest) => {const guestId = getCanonicalWorkloadId(guest);const memoryUsage = workloadMetricPercent(guest.memory?.usage);let diskUsage = workloadMetricPercent(guest.disk?.usage);@@ -118,7 +120,7 @@ export function useDashboardWorkloadDerivedState(const groupedGuests = createMemo(() =>groupWorkloads(- options.filteredGuests(),+ filteredGuests(),options.groupingMode(),options.guestSortComparator(),),@@ -159,7 +161,7 @@ export function useDashboardWorkloadDerivedState(});const groupedWindowing = useGroupedTableWindowing({- totalRowCount: () => options.filteredGuests().length,+ totalRowCount: () => filteredGuests().length,revealIndex: revealGuestIndex,});@@ -213,20 +215,20 @@ export function useDashboardWorkloadDerivedState(groupedWindowing.isWindowed()? Math.max(0,- (options.filteredGuests().length - groupedWindowing.endIndex()) * 32,+ (filteredGuests().length - groupedWindowing.endIndex()) * 32,): 0,);useDashboardWorkloadViewportSync({- filteredGuestCount: () => options.filteredGuests().length,+ filteredGuestCount: () => filteredGuests().length,groupedWindowing,rowHeight: DASHBOARD_TABLE_ESTIMATED_ROW_HEIGHT,tableBodyRef: options.tableBodyRef,});- const totalStats = createMemo(() => computeWorkloadStats(options.filteredGuests()));- const workloadIOEmphasis = createMemo(() => computeWorkloadIOEmphasis(options.filteredGuests()));+ const totalStats = createMemo(() => computeWorkloadStats(filteredGuests()));+ const workloadIOEmphasis = createMemo(() => computeWorkloadIOEmphasis(filteredGuests()));return {bottomSpacerHeight,diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts b/frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.tsindex 511bbeece5..0595609add 100644--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardWorkloadFilterOptions.ts@@ -5,12 +5,14 @@ import type { DashboardToolbarFilterConfig } from './dashboardFilterModel';import {buildDashboardContainerRuntimeOptions,buildDashboardKubernetesContextOptions,+ buildDashboardPlatformOptions,buildDashboardKubernetesNamespaceOptions,buildDashboardWorkloadNodeOptions,} from './dashboardWorkloadRouteModel';import {buildDashboardContainerRuntimeFilterConfig,buildDashboardHostFilterConfig,+ buildDashboardPlatformFilterConfig,buildDashboardNamespaceFilterConfig,} from './dashboardWorkloadFilterConfigModel';@@ -19,10 +21,12 @@ interface DashboardWorkloadFilterOptionsOptions {isWorkloadsRoute: Accessor<boolean>;viewMode: Accessor<ViewMode>;containerRuntime: Accessor<string>;+ selectedPlatform: Accessor<string | null>;selectedNode: Accessor<string | null>;selectedKubernetesContext: Accessor<string | null>;selectedKubernetesNamespace: Accessor<string | null>;setContainerRuntime: (value: string) => void;+ setSelectedPlatform: (value: string | null) => void;setSelectedKubernetesContext: (value: string | null) => void;handleNodeSelect: (nodeId: string | null, nodeType: 'pve' | 'pbs' | 'pmg' | null) => void;setSelectedKubernetesNamespace: (value: string | null) => void;@@ -50,6 +54,10 @@ export function useDashboardWorkloadFilterOptions(buildDashboardContainerRuntimeOptions(options.allGuests()),);+ const platformOptions = createMemo(() =>+ buildDashboardPlatformOptions(options.allGuests(), options.viewMode()),+ );+const containerRuntimeFilterConfig = createMemo<DashboardToolbarFilterConfig | undefined>(() =>buildDashboardContainerRuntimeFilterConfig({isWorkloadsRoute: options.isWorkloadsRoute(),@@ -60,6 +68,15 @@ export function useDashboardWorkloadFilterOptions(}),);+ const platformFilterConfig = createMemo<DashboardToolbarFilterConfig | undefined>(() =>+ buildDashboardPlatformFilterConfig({+ isWorkloadsRoute: options.isWorkloadsRoute(),+ selectedPlatform: options.selectedPlatform(),+ platformOptions: platformOptions(),+ onChange: (value) => options.setSelectedPlatform(value || null),+ }),+ );+const hostFilterConfig = createMemo<DashboardToolbarFilterConfig | undefined>(() =>buildDashboardHostFilterConfig({isWorkloadsRoute: options.isWorkloadsRoute(),@@ -90,6 +107,8 @@ export function useDashboardWorkloadFilterOptions(kubernetesContextOptions,kubernetesNamespaceOptions,namespaceFilterConfig,+ platformFilterConfig,+ platformOptions,workloadNodeOptions,} as const;}diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts b/frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.tsindex 5cdd94474e..034e76766c 100644--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardWorkloadRouteState.ts@@ -18,6 +18,7 @@ export interface DashboardWorkloadRouteStateOptions {export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteStateOptions) {const [selectedNode, setSelectedNode] = createSignal<string | null>(null);+ const [selectedPlatform, setSelectedPlatform] = createSignal<string | null>(null);const [selectedKubernetesContext, setSelectedKubernetesContext] = createSignal<string | null>(null,);@@ -56,6 +57,7 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteStconst resetWorkloadRouteFilters = () => {setSelectedNode(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedNode);setSelectedHostHint(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedHostHint);+ setSelectedPlatform(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedPlatform);setSelectedKubernetesContext(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedKubernetesContext);setSelectedKubernetesNamespace(DASHBOARD_WORKLOAD_ROUTE_RESET_STATE.selectedKubernetesNamespace,@@ -72,8 +74,10 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteStselectedKubernetesContext,selectedKubernetesNamespace,selectedNode,+ selectedPlatform,setContainerRuntime,setSelectedHostHint,+ setSelectedPlatform,setSelectedKubernetesContext,setSelectedKubernetesNamespace,setSelectedNode,@@ -89,10 +93,12 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteStisWorkloadsRoute,viewMode,containerRuntime,+ selectedPlatform,selectedNode,selectedKubernetesContext,selectedKubernetesNamespace,setContainerRuntime,+ setSelectedPlatform,setSelectedKubernetesContext,handleNodeSelect,setSelectedKubernetesNamespace,@@ -105,6 +111,8 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteStkubernetesContextOptions,kubernetesNamespaceOptions,namespaceFilterConfig,+ platformFilterConfig,+ platformOptions,workloadNodeOptions,} = filterOptions;@@ -118,13 +126,17 @@ export function useDashboardWorkloadRouteState(options: DashboardWorkloadRouteStkubernetesContextOptions,kubernetesNamespaceOptions,namespaceFilterConfig,+ platformFilterConfig,+ platformOptions,resetWorkloadRouteFilters,selectedHostHint,selectedKubernetesContext,selectedKubernetesNamespace,selectedNode,+ selectedPlatform,setContainerRuntime,setSelectedNode,+ setSelectedPlatform,setSelectedKubernetesContext,setSelectedKubernetesNamespace,setViewMode,diff --git a/frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts b/frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.tsindex f9c30e3e1b..88575ce22f 100644--- a/frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts+++ b/frontend-modern/src/components/Dashboard/useDashboardWorkloadUrlSync.ts@@ -25,11 +25,13 @@ export interface DashboardWorkloadUrlSyncOptions {containerRuntimeOptions: Accessor<string[]>;kubernetesNamespaceOptions: Accessor<string[]>;selectedHostHint: Accessor<string | null>;+ selectedPlatform: Accessor<string | null>;selectedKubernetesContext: Accessor<string | null>;selectedKubernetesNamespace: Accessor<string | null>;selectedNode: Accessor<string | null>;setContainerRuntime: Setter<string>;setSelectedHostHint: Setter<string | null>;+ setSelectedPlatform: Setter<string | null>;setSelectedKubernetesContext: Setter<string | null>;setSelectedKubernetesNamespace: Setter<string | null>;setSelectedNode: Setter<string | null>;@@ -51,6 +53,7 @@ export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOptconst [handledContextParam, setHandledContextParam] = createSignal('');const [handledNamespaceParam, setHandledNamespaceParam] = createSignal('');const [handledAgentParam, setHandledAgentParam] = createSignal('');+ const [handledPlatformParam, setHandledPlatformParam] = createSignal('');let pendingUrlSyncHandle: number | null = null;let pendingUrlSyncPath: string | null = null;@@ -165,6 +168,31 @@ export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOptsetHandledTypeParam(normalizedType);});+ createEffect(() => {+ const normalized = workloadUrlParams().platform;+ const currentSelected = options.selectedPlatform();++ if (normalized) {+ if (currentSelected !== normalized) {+ options.setSelectedPlatform(normalized);+ }+ if (!options.showFilters()) {+ options.setShowFilters(true);+ }+ if (handledPlatformParam() !== normalized) {+ setHandledPlatformParam(normalized);+ }+ return;+ }++ if (currentSelected !== null) {+ options.setSelectedPlatform(null);+ }+ if (handledPlatformParam() !== '') {+ setHandledPlatformParam('');+ }+ });+createEffect(() => {const normalized = workloadUrlParams().context;if (normalized === handledContextParam()) return;@@ -255,9 +283,11 @@ export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOptconst urlContext = parsed.context;const urlNamespace = parsed.namespace;const urlAgent = parsed.agent;+ const urlPlatform = parsed.platform;const urlResource = parsed.resource;if (handledTypeParam() !== urlType) return;+ if (handledPlatformParam() !== urlPlatform) return;if (handledRuntimeParam() !== urlRuntime) return;if (handledContextParam() !== urlContext) return;if (handledNamespaceParam() !== urlNamespace) return;@@ -272,6 +302,7 @@ export function useDashboardWorkloadUrlSync(options: DashboardWorkloadUrlSyncOptselectedKubernetesNamespace: options.selectedKubernetesNamespace(),selectedNode: options.selectedNode(),selectedHostHint: options.selectedHostHint(),+ selectedPlatform: options.selectedPlatform(),});if (nextPath) {scheduleUrlSyncNavigate(nextPath);diff --git a/frontend-modern/src/components/Dashboard/workloadSelectors.ts b/frontend-modern/src/components/Dashboard/workloadSelectors.tsindex 42b11b6a6c..a1e40b1518 100644--- a/frontend-modern/src/components/Dashboard/workloadSelectors.ts+++ b/frontend-modern/src/components/Dashboard/workloadSelectors.ts@@ -2,6 +2,7 @@ import type { WorkloadGuest, ViewMode } from '@/types/workloads';import type { WorkloadIOEmphasis } from './guestRowModel';import { computeIOScale } from '@/components/Infrastructure/infrastructureSelectors';import { parseFilterStack, evaluateFilterStack } from '@/utils/searchQuery';+import { normalizeSourcePlatformQueryValue } from '@/utils/sourcePlatforms';import { DEGRADED_HEALTH_STATUSES, OFFLINE_HEALTH_STATUSES } from '@/utils/status';import { resolveWorkloadType } from '@/utils/workloads';import { getKubernetesContextKey, workloadNodeScopeId } from './workloadTopology';@@ -13,6 +14,7 @@ export interface FilterWorkloadsParams {searchTerm: string;selectedNode: string | null;selectedHostHint: string | null;+ selectedPlatform?: string | null;selectedKubernetesContext: string | null;selectedKubernetesNamespace?: string | null;containerRuntime?: string | null;@@ -40,6 +42,7 @@ export const filterWorkloads = ({searchTerm,selectedNode,selectedHostHint,+ selectedPlatform,selectedKubernetesContext,selectedKubernetesNamespace,containerRuntime,@@ -79,6 +82,13 @@ export const filterWorkloads = ({guests = guests.filter((g) => resolveWorkloadType(g) === viewMode);}+ const normalizedPlatform = normalizeSourcePlatformQueryValue(selectedPlatform);+ if (normalizedPlatform) {+ guests = guests.filter(+ (g) => normalizeSourcePlatformQueryValue(g.platformType || '') === normalizedPlatform,+ );+ }+const normalizedRuntime = (containerRuntime || '').trim().toLowerCase();if (normalizedRuntime && viewMode === 'app-container') {guests = guests.filter((g) => {diff --git a/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.tsindex d465bcfea5..a468fdad8a 100644--- a/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts+++ b/frontend-modern/src/components/Infrastructure/__tests__/workloadsLink.test.ts@@ -25,7 +25,9 @@ describe('buildWorkloadsHref', () => {platformType: 'kubernetes',platformData: { kubernetes: { clusterName: 'prod-cluster' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=prod-cluster');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=prod-cluster',+ );});it('falls back to kubernetes.context when clusterName is missing', () => {@@ -34,7 +36,9 @@ describe('buildWorkloadsHref', () => {platformType: 'kubernetes',platformData: { kubernetes: { context: 'my-context' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=my-context');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=my-context',+ );});it('falls back to kubernetes.clusterId when clusterName and context are missing', () => {@@ -43,7 +47,9 @@ describe('buildWorkloadsHref', () => {platformType: 'kubernetes',platformData: { kubernetes: { clusterId: 'cid-123' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=cid-123');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=cid-123',+ );});it('falls back to resource.clusterId when platformData has no useful fields', () => {@@ -53,7 +59,9 @@ describe('buildWorkloadsHref', () => {clusterId: 'resource-cluster',platformData: { kubernetes: {} },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=resource-cluster');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=resource-cluster',+ );});it('falls back to resource.displayName then resource.name for k8s-cluster', () => {@@ -63,7 +71,9 @@ describe('buildWorkloadsHref', () => {name: 'fallback-name',displayName: 'Fallback Display',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=Fallback+Display');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=Fallback+Display',+ );});it('uses the local infrastructure label for redacted k8s-cluster fallback', () => {@@ -79,7 +89,9 @@ describe('buildWorkloadsHref', () => {aiSafeSummary: 'Governed Cluster',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=secret-cluster');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=secret-cluster',+ );});it('falls back to resource.name when displayName is empty for k8s-cluster', () => {@@ -89,7 +101,9 @@ describe('buildWorkloadsHref', () => {name: 'last-resort',displayName: '',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=last-resort');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=last-resort',+ );});it('returns path without context when all k8s-cluster fields are empty', () => {@@ -102,7 +116,7 @@ describe('buildWorkloadsHref', () => {clusterId: undefined,platformId: '',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod');+ expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&platform=kubernetes');});it('skips whitespace-only values in k8s-cluster resolution', () => {@@ -111,7 +125,9 @@ describe('buildWorkloadsHref', () => {platformType: 'kubernetes',platformData: { kubernetes: { clusterName: ' ', context: 'valid-context' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=valid-context');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=valid-context',+ );});});@@ -124,7 +140,9 @@ describe('buildWorkloadsHref', () => {platformType: 'kubernetes',platformData: { kubernetes: { clusterName: 'node-cluster' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=node-cluster');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=node-cluster',+ );});it('falls back to kubernetes.context for k8s-node', () => {@@ -133,7 +151,9 @@ describe('buildWorkloadsHref', () => {platformType: 'kubernetes',platformData: { kubernetes: { context: 'node-ctx' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=node-ctx');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=node-ctx',+ );});it('falls back to kubernetes.clusterId for k8s-node', () => {@@ -142,7 +162,9 @@ describe('buildWorkloadsHref', () => {platformType: 'kubernetes',platformData: { kubernetes: { clusterId: 'k-cid' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=k-cid');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=k-cid',+ );});it('falls back to resource.clusterId for k8s-node', () => {@@ -152,7 +174,9 @@ describe('buildWorkloadsHref', () => {clusterId: 'res-cluster-id',platformData: { kubernetes: {} },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=res-cluster-id');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=res-cluster-id',+ );});it('does NOT fall back to displayName/name for k8s-node (unlike k8s-cluster)', () => {@@ -164,7 +188,7 @@ describe('buildWorkloadsHref', () => {clusterId: undefined,});// k8s-node has no displayName/name fallback — context should be undefined- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod');+ expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&platform=kubernetes');});});@@ -177,7 +201,9 @@ describe('buildWorkloadsHref', () => {platformType: 'docker',platformData: { docker: { hostname: 'docker-box' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=app-container&agent=docker-box');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=app-container&platform=docker&agent=docker-box',+ );});it('falls back to agent.hostname when docker.hostname is missing', () => {@@ -186,7 +212,9 @@ describe('buildWorkloadsHref', () => {platformType: 'docker',platformData: { agent: { hostname: 'agent-host' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=app-container&agent=agent-host');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=app-container&platform=docker&agent=agent-host',+ );});it('falls back to identity.hostname', () => {@@ -196,7 +224,7 @@ describe('buildWorkloadsHref', () => {identity: { hostname: 'identity-host' },});expect(buildWorkloadsHref(resource)).toBe(- '/workloads?type=app-container&agent=identity-host',+ '/workloads?type=app-container&platform=docker&agent=identity-host',);});@@ -209,7 +237,9 @@ describe('buildWorkloadsHref', () => {platformId: 'docker-plat',id: 'docker-id',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=app-container&agent=docker-name');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=app-container&platform=docker&agent=docker-name',+ );});it('falls back to platformId when name is empty for docker-host', () => {@@ -221,7 +251,9 @@ describe('buildWorkloadsHref', () => {platformId: 'plat-id',id: 'docker-id',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=app-container&agent=plat-id');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=app-container&platform=docker&agent=plat-id',+ );});it('falls back to platformId when name and displayName are empty for docker-host', () => {@@ -234,7 +266,7 @@ describe('buildWorkloadsHref', () => {id: 'docker-id',});expect(buildWorkloadsHref(resource)).toBe(- '/workloads?type=app-container&agent=docker-plat-id',+ '/workloads?type=app-container&platform=docker&agent=docker-plat-id',);});@@ -248,7 +280,7 @@ describe('buildWorkloadsHref', () => {id: 'last-resort-id',});expect(buildWorkloadsHref(resource)).toBe(- '/workloads?type=app-container&agent=last-resort-id',+ '/workloads?type=app-container&platform=docker&agent=last-resort-id',);});});@@ -270,7 +302,9 @@ describe('buildWorkloadsHref', () => {docker: { hostname: 'tower' },},});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=app-container&agent=tower');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=app-container&platform=docker&agent=tower',+ );});it('prefers canonical docker runtime ids for hybrid host workload routes', () => {@@ -283,7 +317,7 @@ describe('buildWorkloadsHref', () => {},});expect(buildWorkloadsHref(resource)).toBe(- '/workloads?type=app-container&agent=docker-host-1',+ '/workloads?type=app-container&platform=docker&agent=docker-host-1',);});@@ -297,6 +331,18 @@ describe('buildWorkloadsHref', () => {});expect(buildWorkloadsHref(resource)).toBe('/workloads?agent=node-name');});++ it('routes truenas systems to platform-scoped app workloads', () => {+ const resource = makeResource({+ type: 'agent',+ platformType: 'truenas',+ name: 'truenas-main',+ });++ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=app-container&platform=truenas&agent=truenas-main',+ );+ });});// ── Unsupported types ───────────────────────────────────────────@@ -352,7 +398,9 @@ describe('buildWorkloadsHref', () => {platformType: 'docker',platformData: { docker: { hostname: ' trimmed-host ' } },});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=app-container&agent=trimmed-host');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=app-container&platform=docker&agent=trimmed-host',+ );});it('skips null values in the resolution chain', () => {@@ -362,7 +410,9 @@ describe('buildWorkloadsHref', () => {platformData: { kubernetes: { clusterName: null as unknown as string } },clusterId: 'real-value',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=real-value');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=real-value',+ );});it('skips undefined values in the resolution chain', () => {@@ -372,7 +422,9 @@ describe('buildWorkloadsHref', () => {platformData: { kubernetes: { clusterName: undefined, context: undefined } },clusterId: 'cluster-fallback',});- expect(buildWorkloadsHref(resource)).toBe('/workloads?type=pod&context=cluster-fallback');+ expect(buildWorkloadsHref(resource)).toBe(+ '/workloads?type=pod&platform=kubernetes&context=cluster-fallback',+ );});});});diff --git a/frontend-modern/src/components/Infrastructure/workloadsLink.ts b/frontend-modern/src/components/Infrastructure/workloadsLink.tsindex f333a68270..ad2856eff1 100644--- a/frontend-modern/src/components/Infrastructure/workloadsLink.ts+++ b/frontend-modern/src/components/Infrastructure/workloadsLink.ts@@ -47,18 +47,25 @@ const resolveDockerWorkloadsHint = (resource: Resource): string | undefined =>export const buildWorkloadsHref = (resource: Resource): string | null => {if (resource.type === 'k8s-cluster' || resource.type === 'k8s-node') {const context = resolveKubernetesContext(resource);- return buildWorkloadsPath({ type: 'pod', context });+ return buildWorkloadsPath({ type: 'pod', platform: 'kubernetes', context });}if (resource.type === 'docker-host') {const agent = resolveDockerWorkloadsHint(resource);- return buildWorkloadsPath({ type: 'app-container', agent });+ return buildWorkloadsPath({ type: 'app-container', platform: 'docker', agent });}if (resource.type === 'agent') {const agent = resolveHostHint(resource);+ if (resource.platformType === 'truenas') {+ return buildWorkloadsPath({ type: 'app-container', platform: 'truenas', agent });+ }if (hasDockerWorkloadsScope(resource)) {- return buildWorkloadsPath({ type: 'app-container', agent: resolveDockerWorkloadsHint(resource) });+ return buildWorkloadsPath({+ type: 'app-container',+ platform: 'docker',+ agent: resolveDockerWorkloadsHint(resource),+ });}return buildWorkloadsPath({ agent });}diff --git a/frontend-modern/src/components/shared/FilterToolbar.test.tsx b/frontend-modern/src/components/shared/FilterToolbar.test.tsxindex dfc7a56553..1dec7b0821 100644--- a/frontend-modern/src/components/shared/FilterToolbar.test.tsx+++ b/frontend-modern/src/components/shared/FilterToolbar.test.tsx@@ -1,6 +1,7 @@-import { cleanup, render, screen } from '@solidjs/testing-library';+import { cleanup, render, screen, waitFor } from '@solidjs/testing-library';+import { For, createSignal } from 'solid-js';import { afterEach, describe, expect, it, vi } from 'vitest';-import { FilterHeader, FilterSegmentedControl } from './FilterToolbar';+import { FilterHeader, FilterSegmentedControl, LabeledFilterSelect } from './FilterToolbar';import toggleSource from './Toggle.tsx?raw';import toggleModelSource from './toggleModel.ts?raw';import toggleStateSource from './useToggleState.ts?raw';@@ -60,4 +61,35 @@ describe('FilterHeader', () => {expect(toggleModelSource).toContain('getToggleKnobClass');expect(toggleModelSource).toContain('ToggleChangeEvent');});++ it('keeps controlled select state when options materialize asynchronously', async () => {+ const [options, setOptions] = createSignal<{ value: string; label: string }[]>([]);++ render(() => (+ <>+ <button+ type="button"+ onClick={() =>+ setOptions([+ { value: 'all', label: 'All platforms' },+ { value: 'truenas', label: 'TrueNAS' },+ ])+ }+ >+ Load options+ </button>+ <LabeledFilterSelect label="Platform" value="truenas" data-testid="platform-filter">+ <For each={options()}>{(option) => <option value={option.value}>{option.label}</option>}</For>+ </LabeledFilterSelect>+ </>+ ));++ const select = screen.getByTestId('platform-filter') as HTMLSelectElement;+ expect(select.value).toBe('');++ screen.getByRole('button', { name: 'Load options' }).click();++ await waitFor(() => expect(select.value).toBe('truenas'));+ expect(screen.getByRole('option', { name: 'TrueNAS' }).selected).toBe(true);+ });});diff --git a/frontend-modern/src/components/shared/FilterToolbar.tsx b/frontend-modern/src/components/shared/FilterToolbar.tsxindex 252c2e3a1a..4dbf5f67f5 100644--- a/frontend-modern/src/components/shared/FilterToolbar.tsx+++ b/frontend-modern/src/components/shared/FilterToolbar.tsx@@ -1,4 +1,4 @@-import { Component, For, JSX, Show, splitProps } from 'solid-js';+import { Component, For, JSX, Show, createEffect, onCleanup, splitProps } from 'solid-js';import ListFilterIcon from 'lucide-solid/icons/list-filter';import { segmentedButtonClass } from '@/utils/segmentedButton';@@ -228,14 +228,47 @@ export const LabeledFilterSelect: Component<LabeledFilterSelectProps> = (props)'children','groupClass','selectClass',+ 'value',]);+ let selectRef: HTMLSelectElement | undefined;const selectId = typeof selectProps.id === 'string' ? selectProps.id : undefined;++ createEffect(() => {+ const nextValue = local.value;+ if (!selectRef || typeof nextValue !== 'string') return;+ const applyValue = () => {+ if (!selectRef) return;+ let matched = false;+ for (const option of Array.from(selectRef.options)) {+ const shouldSelect = option.value === nextValue;+ if (option.selected !== shouldSelect) {+ option.selected = shouldSelect;+ }+ matched ||= shouldSelect;+ }+ if (!matched && selectRef.value !== nextValue) {+ selectRef.value = nextValue;+ }+ };++ applyValue();++ const observer = new MutationObserver(() => applyValue());+ observer.observe(selectRef, { childList: true, subtree: true });+ onCleanup(() => observer.disconnect());+ });+return (<div class={`${filterGroupClass} ${local.groupClass ?? ''}`.trim()}><label for={selectId} class={filterLabelClass}>{local.label}</label>- <select {...selectProps} class={`${filterSelectClass} ${local.selectClass ?? ''}`.trim()}>+ <select+ {...selectProps}+ ref={selectRef}+ value={local.value}+ class={`${filterSelectClass} ${local.selectClass ?? ''}`.trim()}+ >{local.children}</select></div>diff --git a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts b/frontend-modern/src/routing/__tests__/resourceLinks.test.tsindex f250cd0ad5..9b19f43fc4 100644--- a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts+++ b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts@@ -47,17 +47,19 @@ describe('resource link routing contract', () => {it('builds and parses workloads query params', () => {const href = buildWorkloadsPath({type: 'k8s',+ platform: 'kubernetes',context: 'cluster-a',agent: 'worker-1',resource: 'cluster-a:worker-1:101',});expect(href).toBe(- '/workloads?type=pod&context=cluster-a&agent=worker-1&resource=cluster-a%3Aworker-1%3A101',+ '/workloads?type=pod&platform=kubernetes&context=cluster-a&agent=worker-1&resource=cluster-a%3Aworker-1%3A101',);const parsed = parseWorkloadsLinkSearch(href.slice('/workloads'.length));expect(parsed).toEqual({type: 'pod',+ platform: 'kubernetes',runtime: '',context: 'cluster-a',namespace: '',@@ -66,6 +68,7 @@ describe('resource link routing contract', () => {});expect(WORKLOADS_QUERY_PARAMS.type).toBe('type');+ expect(WORKLOADS_QUERY_PARAMS.platform).toBe('platform');expect(WORKLOADS_QUERY_PARAMS.runtime).toBe('runtime');expect(WORKLOADS_QUERY_PARAMS.context).toBe('context');expect(WORKLOADS_QUERY_PARAMS.namespace).toBe('namespace');@@ -74,11 +77,11 @@ describe('resource link routing contract', () => {});it('canonicalizes legacy workloads type aliases when building links', () => {- expect(buildWorkloadsPath({ type: 'docker', agent: 'runtime-1' })).toBe(- '/workloads?type=app-container&agent=runtime-1',+ expect(buildWorkloadsPath({ type: 'docker', platform: 'docker', agent: 'runtime-1' })).toBe(+ '/workloads?type=app-container&platform=docker&agent=runtime-1',);- expect(buildWorkloadsPath({ type: 'kubernetes', context: 'cluster-a' })).toBe(- '/workloads?type=pod&context=cluster-a',+ expect(buildWorkloadsPath({ type: 'kubernetes', platform: 'kubernetes', context: 'cluster-a' })).toBe(+ '/workloads?type=pod&platform=kubernetes&context=cluster-a',);});@@ -137,12 +140,25 @@ describe('resource link routing contract', () => {baseGuest({type: 'app-container',workloadType: 'app-container',+ platformType: 'docker',contextLabel: 'docker-host-1',}),);expect(href).toBe('/infrastructure?source=docker&q=docker-host-1');});+ it('maps TrueNAS app-container workloads to the TrueNAS infrastructure source', () => {+ const href = buildInfrastructureHrefForWorkload(+ baseGuest({+ type: 'app-container',+ workloadType: 'app-container',+ platformType: 'truenas',+ contextLabel: 'truenas-main',+ }),+ );+ expect(href).toBe('/infrastructure?source=truenas&q=truenas-main');+ });+it('maps pod workloads to kubernetes infrastructure source with cluster query', () => {const href = buildInfrastructureHrefForWorkload(baseGuest({diff --git a/frontend-modern/src/routing/resourceLinks.ts b/frontend-modern/src/routing/resourceLinks.tsindex 80e8ab629c..99699eea53 100644--- a/frontend-modern/src/routing/resourceLinks.ts+++ b/frontend-modern/src/routing/resourceLinks.ts@@ -9,6 +9,7 @@ import type { WorkloadGuest } from '@/types/workloads';export const WORKLOADS_QUERY_PARAMS = {type: 'type',+ platform: 'platform',runtime: 'runtime',context: 'context',namespace: 'namespace',@@ -85,6 +86,7 @@ const firstNonEmpty = (values: Array<string | undefined | null>): string | undeftype WorkloadsLinkOptions = {type?: string | null;+ platform?: string | null;runtime?: string | null;context?: string | null;namespace?: string | null;@@ -134,6 +136,7 @@ export const parseWorkloadsLinkSearch = (search: string) => {const params = new URLSearchParams(search);return {type: normalizeQueryValue(params.get(WORKLOADS_QUERY_PARAMS.type)),+ platform: normalizeSourcePlatformQueryValue(params.get(WORKLOADS_QUERY_PARAMS.platform)),runtime: normalizeQueryValue(params.get(WORKLOADS_QUERY_PARAMS.runtime)),context: normalizeQueryValue(params.get(WORKLOADS_QUERY_PARAMS.context)),namespace: normalizeQueryValue(params.get(WORKLOADS_QUERY_PARAMS.namespace)),@@ -145,12 +148,14 @@ export const parseWorkloadsLinkSearch = (search: string) => {export const buildWorkloadsPath = (options: WorkloadsLinkOptions = {}): string => {const params = new URLSearchParams();const type = normalizeWorkloadsType(options.type);+ const platform = normalizeSourcePlatformQueryValue(options.platform);const runtime = normalizeQueryValue(options.runtime);const context = normalizeQueryValue(options.context);const namespace = normalizeQueryValue(options.namespace);const agent = normalizeQueryValue(options.agent);const resource = normalizeQueryValue(options.resource);if (type) params.set(WORKLOADS_QUERY_PARAMS.type, type);+ if (platform) params.set(WORKLOADS_QUERY_PARAMS.platform, platform);if (runtime) params.set(WORKLOADS_QUERY_PARAMS.runtime, runtime);if (context) params.set(WORKLOADS_QUERY_PARAMS.context, context);if (namespace) params.set(WORKLOADS_QUERY_PARAMS.namespace, namespace);@@ -196,7 +201,10 @@ export const buildInfrastructureHrefForWorkload = (guest: WorkloadGuest): stringif (type === 'app-container') {const query = firstNonEmpty([guest.contextLabel, guest.node, guest.instance, guest.name]);- return buildInfrastructurePath({ source: 'docker', query });+ return buildInfrastructurePath({+ source: guest.platformType === 'truenas' ? 'truenas' : 'docker',+ query,+ });}if (type === 'pod') {diff --git a/tests/integration/tests/22-truenas-workloads-platform-filter.spec.ts b/tests/integration/tests/22-truenas-workloads-platform-filter.spec.tsnew file mode 100644index 0000000000..18ac30ee63--- /dev/null+++ b/tests/integration/tests/22-truenas-workloads-platform-filter.spec.ts@@ -0,0 +1,135 @@+import fs from 'node:fs';+import path from 'node:path';+import { fileURLToPath } from 'node:url';+import { test as base, expect } from '@playwright/test';+import { createAuthenticatedStorageState } from './helpers';++const __dirname = path.dirname(fileURLToPath(import.meta.url));++type WorkerFixtures = {+ authStorageStatePath: string;+};++const SCREENSHOT_PATH = '/tmp/truenas-workloads-platform-filter.png';++const test = base.extend<{}, WorkerFixtures>({+ storageState: async ({ authStorageStatePath }, use) => {+ await use(authStorageStatePath);+ },+ authStorageStatePath: [async ({ browser }, use, workerInfo) => {+ const storageStatePath = path.resolve(+ __dirname,+ '..',+ '..',+ 'tmp',+ 'playwright-auth',+ `truenas-workloads-platform-filter-${workerInfo.project.name}.json`,+ );+ fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });+ await createAuthenticatedStorageState(browser, storageStatePath);+ try {+ await use(storageStatePath);+ } finally {+ fs.rmSync(storageStatePath, { force: true });+ }+ }, { scope: 'worker' }],+});++test.describe('TrueNAS workloads platform filter', () => {+ test.setTimeout(180_000);++ test('keeps canonical platform scoping on the workloads route', async ({ page }) => {+ await page.route('**/api/resources**', async (route) => {+ const requestUrl = new URL(route.request().url());+ if (+ requestUrl.pathname !== '/api/resources' ||+ requestUrl.searchParams.get('type') !== 'vm,system-container,app-container,pod'+ ) {+ await route.continue();+ return;+ }++ await route.fulfill({+ status: 200,+ contentType: 'application/json',+ body: JSON.stringify({+ data: [+ {+ id: 'truenas-app-nextcloud',+ type: 'app-container',+ name: 'nextcloud',+ status: 'running',+ lastSeen: '2026-03-29T21:00:00Z',+ node: 'truenas-main',+ sources: ['truenas'],+ parentName: 'truenas-main',+ metrics: {+ cpu: { value: 12, percent: 12 },+ memory: { total: 8 * 1024 * 1024 * 1024, used: 2 * 1024 * 1024 * 1024 },+ disk: { total: 100 * 1024 * 1024 * 1024, used: 40 * 1024 * 1024 * 1024 },+ netIn: { value: 2048 },+ netOut: { value: 1024 },+ diskRead: { value: 512 },+ diskWrite: { value: 256 },+ },+ docker: {+ containerId: 'ix-nextcloud',+ hostname: 'truenas-main',+ imageName: 'nextcloud:29',+ runtime: 'docker',+ hostSourceId: 'truenas-main',+ },+ },+ {+ id: 'docker-app-grafana',+ type: 'app-container',+ name: 'grafana',+ status: 'running',+ lastSeen: '2026-03-29T21:00:00Z',+ node: 'docker-main',+ sources: ['docker'],+ parentName: 'docker-main',+ metrics: {+ cpu: { value: 8, percent: 8 },+ memory: { total: 4 * 1024 * 1024 * 1024, used: 1 * 1024 * 1024 * 1024 },+ disk: { total: 40 * 1024 * 1024 * 1024, used: 10 * 1024 * 1024 * 1024 },+ netIn: { value: 1024 },+ netOut: { value: 512 },+ diskRead: { value: 128 },+ diskWrite: { value: 64 },+ },+ docker: {+ containerId: 'docker-grafana',+ hostname: 'docker-main',+ imageName: 'grafana:11',+ runtime: 'docker',+ hostSourceId: 'docker-main',+ },+ },+ ],+ meta: {+ page: 1,+ limit: 200,+ total: 2,+ totalPages: 1,+ },+ }),+ });+ });++ await page.goto('/workloads?type=app-container&platform=truenas&agent=truenas-main', {+ waitUntil: 'domcontentloaded',+ });++ await page.waitForURL(/\/workloads\?type=app-container&platform=truenas&agent=.*truenas-main/);+ await expect(page.locator('#dashboard-type-filter')).toHaveValue('app-container');+ await expect(page.locator('#workloads-platform-filter')).toHaveValue('truenas');+ await expect(page.locator('#workloads-node-filter')).toHaveValue(/truenas-main/);++ const workloadTable = page.locator('table').first();+ await expect(workloadTable).toContainText('nextcloud');+ await expect(workloadTable).not.toContainText('grafana');++ await page.screenshot({ path: SCREENSHOT_PATH, fullPage: true });+ });+});