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
Rebuild TrueNAS overview around native app API data
rcourtman2202f366747b
diff --git a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.mdindex 954d8a341c..935a32d867 100644--- a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md+++ b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md@@ -494,8 +494,10 @@ declared floor.TrueNAS is API-first. The unified agent may augment a TrueNAS system later,but it is not required for bootstrap or baseline support. TrueNAS mustproject into the canonical `agent`, `app-container`, `storage`,- `physical-disk`, and recovery contracts instead of reopening a parallel- TrueNAS product model.+ `physical-disk`, and recovery contracts. TrueNAS app rows may carry a+ TrueNAS-native app facet sourced from `app.query` / `active_workloads` so+ the platform page can render API-native app facts without turning Docker+ labels into the TrueNAS product model.2. Onboarding path:Supported now through the shared platform-connections flow and`/api/truenas/connections`. Operators can add, test, edit, retest, and@@ -512,9 +514,11 @@ declared floor.separate `truenas-system` surface or provider-local infrastructure model.4. Workloads:Supported now for TrueNAS apps projected as canonical `app-container`- workloads with shared workload navigation, metrics, and related links. Out- of scope: a separate TrueNAS app runtime model or provider-local workload- page/control surface.+ workloads with shared workload navigation, metrics, and related links. The+ TrueNAS platform overview renders those apps through the TrueNAS API-native+ app facet first, using Docker metadata only as runtime compatibility+ fallback. Out of scope: a parallel provider-local workload control plane+ that bypasses the canonical resource/action contracts.5. Storage and disk health:Supported now for pools, datasets, and physical disks projected into theshared storage and disk contracts, including SMART/disk-state risk, livediff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.mdindex 8a5fb4ac6d..94a4b576b8 100644--- a/docs/release-control/v6/internal/subsystems/monitoring.md+++ b/docs/release-control/v6/internal/subsystems/monitoring.md@@ -102,11 +102,20 @@ truth for live infrastructure data.guest-local host agent, and must keep the command set to minimal read-onlyDocker summary and aggregate stats collection.15. Add or change mock-mode Discovery context through the canonical mock- fixture graph. Mock Discovery records must be derived from the same authored- state graph as mock nodes, guests, Docker hosts, containers, and Kubernetes- workloads, then exposed through API-owned Discovery handlers. Monitoring- must not create a second frontend-only fixture path for service versions,- config paths, bind mounts, ports, or suggested URLs.+ fixture graph. Mock Discovery records must be derived from the same authored+ state graph as mock nodes, guests, Docker hosts, containers, and Kubernetes+ workloads, then exposed through API-owned Discovery handlers. Monitoring+ must not create a second frontend-only fixture path for service versions,+ config paths, bind mounts, ports, or suggested URLs.+16. Add or change TrueNAS supplemental inventory only through the native+ TrueNAS provider path and unified-resource projection. TrueNAS apps are+ API-owned application records: the provider may preserve Docker-compatible+ runtime metadata for shared container tooling, but it must also publish the+ native app identity, state, version, update availability, workload+ containers, ports, images, volumes, networks, and stat collection metadata+ through `TrueNASData.App` on the canonical `app-container` resource.+ Monitoring must not rebuild a second Docker-only TrueNAS app inventory or+ make the Docker fallback the source of truth for the TrueNAS platform page.## Forbidden Paths@@ -141,6 +150,11 @@ truth for live infrastructure data.ports, and aggregate `docker stats` counters, but it must not run`docker inspect` or collect guest environment values, mount sources, files,container commands, or process details.+8. Keep TrueNAS app inventory native to the TrueNAS API projection. The+ monitoring/provider boundary may expose Docker-compatible fields for+ cross-runtime tooling, but platform-page app rows, source identity, and+ update posture must be carried by the TrueNAS app facet published into+ unified resources.## Current Statediff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex bf2899c854..ff76b9b869 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -144,6 +144,12 @@ services, including mock-mode config/data/log path examples. That context isread-only evidence: it must not become a storage/recovery-owned command path,secret source, restore entitlement, or frontend-only fixture separate from thecanonical `/api/discovery` payload.+Storage and recovery may also consume unified-resource TrueNAS app metadata as+read-only workload context when explaining appliance-owned storage or protected+items. `TrueNASData.App` remains unified-resource/platform truth sourced from+the TrueNAS API; storage/recovery must not reinterpret app containers, volumes,+or update posture as storage ownership, restore entitlement, or a separate+Docker-only inventory path.1. Add or change recovery-point persistence, rollups, or series derivation through `internal/recovery/`2. Add or change recovery page UX through `frontend-modern/src/components/Recovery/` and keep canonical route/query/filter state ownership in `frontend-modern/src/features/recovery/useRecoverySurfaceState.ts`diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 931fd73570..6ecdd05e13 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -191,6 +191,16 @@ reintroduce false Swarm capability surfaces.`resourceVersion`, `policyVersion`, or `planHash` drift as`action_plan_drift`, and record/publish a failed audit instead of leavingexecutor adapters to make stale-approval decisions.+ TrueNAS app inventory enters the model as native `TrueNASData.App`+ metadata on canonical `app-container` resources. The facet is sourced from+ the TrueNAS API app inventory (`app.query` plus active workload/stat+ details where available), preserves app id/name/state/version/update+ signals, containers, ports, images, volumes, networks, and app stat+ collection metadata, and is cloned and merged by unified resources before+ transport. Docker metadata may still ride beside the app as compatibility+ runtime evidence, but the TrueNAS platform overview and other+ TrueNAS-native consumers must read the native facet first instead of+ treating TrueNAS apps as generic Docker rows.2. Add typed accessors and views in `internal/unifiedresources/views.go`3. Add source ingestion/adaptation in the adapter layer onlyFrontend resource platform contracts in@@ -1038,6 +1048,16 @@ interactive-series filtering, focused-resource naming, and active-seriesresolution so the infrastructure summary stays page-scoped while stillhighlighting the same canonical resource IDs used by the unified-resourcetable and route state.+TrueNAS application resources now carry the same shared source boundary.+`internal/truenas/provider.go` projects native app API records into+`TrueNASData.App`, while `internal/unifiedresources/types.go`,+`internal/unifiedresources/clone.go`, `internal/unifiedresources/registry.go`,+`frontend-modern/src/types/resource.ts`, and+`frontend-modern/src/hooks/useUnifiedResources.ts` must preserve that facet+across backend clone/merge and frontend transport. The owning resource remains+the canonical `app-container`; the TrueNAS facet explains the platform-native+app shape, and Docker metadata remains secondary runtime compatibility rather+than the source of truth for the TrueNAS overview.That same infrastructure focus boundary now also owns deliberate drawer reveal.When an infrastructure row opens inline detail on the same route, the page musttag that detail with the canonical active resource ID. Direct row toggles thatdiff --git a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.tsindex fbbd628876..d2de66c545 100644--- a/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts+++ b/frontend-modern/src/features/platformPage/__tests__/platformOverviewLayout.guardrails.test.ts@@ -155,9 +155,11 @@ describe('platform overview layout guardrails', () => {expect(kubernetesPageSurfaceSource).toContain('<KubernetesNodesTable');expect(kubernetesPageSurfaceSource).toContain('<KubernetesDeploymentsTable');expect(truenasPageSurfaceSource).toContain('<TrueNASSystemsTable');+ expect(truenasPageSurfaceSource).toContain('<TrueNASAppsTable');expect(truenasPageSurfaceSource).toContain('<StorageSurface');expect(truenasPageSurfaceSource).toContain('suppressNodeFilter');expect(truenasPageSurfaceSource).not.toContain('forcedView="pools"');+ expect(truenasPageSurfaceSource).not.toContain('<WorkloadsSurface');expect(truenasPageSurfaceSource).not.toContain('<TrueNASDisksTable');expect(vmwarePageSurfaceSource).toContain('<VsphereHostsTable');expect(vmwarePageSurfaceSource).toContain('<WorkloadsSurface');diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsxindex a6306d9638..2439123ea4 100644--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx@@ -2,13 +2,18 @@ import { A } from '@solidjs/router';import TriangleAlertIcon from 'lucide-solid/icons/triangle-alert';import { For, Show, createMemo, createSignal, type Component, type JSX } from 'solid-js';import { EmptyState } from '@/components/shared/EmptyState';-import { FilterButtonGroup, type FilterOption } from '@/components/shared/FilterButtonGroup';+import {+ FilterButtonGroup,+ type FilterOption as PlatformTableFilterOption,+} from '@/components/shared/FilterButtonGroup';import { SearchInput } from '@/components/shared/SearchInput';import { TableCard } from '@/components/shared/TableCard';import { UnifiedResourceTable } from '@/components/Infrastructure/UnifiedResourceTable';import type { Resource, ResourceStatus } from '@/types/resource';import { getPlatformColumnAlign, type PlatformTableColumnKind } from './columnAlignment';+export type { PlatformTableFilterOption };+export type PlatformTabSpec<TabId extends string> = {id: TabId;label: string;@@ -134,19 +139,21 @@ export type PlatformResourceStatusFilter = 'all' | 'online' | 'degraded' | 'offlconst statusDot = (className: string) => <span class={`h-2 w-2 rounded-full ${className}`} />;-export const PLATFORM_STATUS_FILTER_OPTIONS: FilterOption<PlatformResourceStatusFilter>[] = [- { value: 'all', label: 'All' },- { value: 'online', label: 'Online', tone: 'success', leading: statusDot('bg-emerald-500') },- { value: 'degraded', label: 'Degraded', tone: 'warning', leading: statusDot('bg-amber-500') },- { value: 'offline', label: 'Offline', tone: 'danger', leading: statusDot('bg-red-500') },-];+export const PLATFORM_STATUS_FILTER_OPTIONS: PlatformTableFilterOption<PlatformResourceStatusFilter>[] =+ [+ { value: 'all', label: 'All' },+ { value: 'online', label: 'Online', tone: 'success', leading: statusDot('bg-emerald-500') },+ { value: 'degraded', label: 'Degraded', tone: 'warning', leading: statusDot('bg-amber-500') },+ { value: 'offline', label: 'Offline', tone: 'danger', leading: statusDot('bg-red-500') },+ ];-export const PLATFORM_HEALTH_FILTER_OPTIONS: FilterOption<PlatformResourceStatusFilter>[] = [- { value: 'all', label: 'All' },- { value: 'online', label: 'Healthy', tone: 'success', leading: statusDot('bg-emerald-500') },- { value: 'degraded', label: 'Degraded', tone: 'warning', leading: statusDot('bg-amber-500') },- { value: 'offline', label: 'Offline', tone: 'danger', leading: statusDot('bg-red-500') },-];+export const PLATFORM_HEALTH_FILTER_OPTIONS: PlatformTableFilterOption<PlatformResourceStatusFilter>[] =+ [+ { value: 'all', label: 'All' },+ { value: 'online', label: 'Healthy', tone: 'success', leading: statusDot('bg-emerald-500') },+ { value: 'degraded', label: 'Degraded', tone: 'warning', leading: statusDot('bg-amber-500') },+ { value: 'offline', label: 'Offline', tone: 'danger', leading: statusDot('bg-red-500') },+ ];const ONLINE_STATUSES = new Set<ResourceStatus>(['online', 'running']);const OFFLINE_STATUSES = new Set<ResourceStatus>(['offline', 'stopped']);@@ -276,7 +283,7 @@ export function PlatformTableToolbar<T extends string | number>(props: {searchPlaceholder: string;status: T;onStatusChange: (value: T) => void;- statusOptions: FilterOption<T>[];+ statusOptions: PlatformTableFilterOption<T>[];visible: number;total: number;rowNoun: string;diff --git a/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsxindex 51c1b5e63b..69ff8e08d8 100644--- a/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxCephTable.tsx@@ -9,7 +9,6 @@ import {} from 'solid-js';import { Card } from '@/components/shared/Card';import { EmptyState } from '@/components/shared/EmptyState';-import type { FilterOption } from '@/components/shared/FilterButtonGroup';import { StatusDot } from '@/components/shared/StatusDot';import type { StatusIndicatorVariant } from '@/utils/status';import { TableCard } from '@/components/shared/TableCard';@@ -30,6 +29,7 @@ import {PlatformTableToolbar,getPlatformTableCellClassForKind,getPlatformTableHeadClassForKind,+ type PlatformTableFilterOption,} from '@/features/platformPage/sharedPlatformPage';import type { Resource, ResourceCephServiceMeta } from '@/types/resource';import { ProxmoxCephClusterDrawer } from './ProxmoxCephClusterDrawer';@@ -49,7 +49,7 @@ type CephStatusFilter = 'all' | 'healthy' | 'warning' | 'critical';const statusDot = (className: string) => <span class={`h-2 w-2 rounded-full ${className}`} />;-const STATUS_FILTER_OPTIONS: FilterOption<CephStatusFilter>[] = [+const STATUS_FILTER_OPTIONS: PlatformTableFilterOption<CephStatusFilter>[] = [{ value: 'all', label: 'All' },{ value: 'healthy', label: 'Healthy', tone: 'success', leading: statusDot('bg-emerald-500') },{ value: 'warning', label: 'Warning', tone: 'warning', leading: statusDot('bg-amber-500') },diff --git a/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsxindex 63bcf451da..41679838bb 100644--- a/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxReplicationTable.tsx@@ -23,7 +23,6 @@ import {} from '@/components/shared/Table';import { apiFetch } from '@/utils/apiClient';import { formatRelativeTime } from '@/utils/format';-import type { FilterOption } from '@/components/shared/FilterButtonGroup';import {PLATFORM_TABLE_BODY_CLASS,PLATFORM_TABLE_CARD_CLASS,@@ -31,6 +30,7 @@ import {PlatformTableToolbar,getPlatformTableCellClassForKind,getPlatformTableHeadClassForKind,+ type PlatformTableFilterOption,} from '@/features/platformPage/sharedPlatformPage';import type { ReplicationJob, ReplicationJobsResponse } from '@/types/api';@@ -45,7 +45,7 @@ type ReplicationStatusFilter = 'all' | 'healthy' | 'failed' | 'pending' | 'disabconst statusDot = (className: string) => <span class={`h-2 w-2 rounded-full ${className}`} />;-const STATUS_FILTER_OPTIONS: FilterOption<ReplicationStatusFilter>[] = [+const STATUS_FILTER_OPTIONS: PlatformTableFilterOption<ReplicationStatusFilter>[] = [{ value: 'all', label: 'All' },{ value: 'healthy', label: 'Healthy', tone: 'success', leading: statusDot('bg-emerald-500') },{ value: 'failed', label: 'Failed', tone: 'danger', leading: statusDot('bg-red-500') },diff --git a/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsxnew file mode 100644index 0000000000..0a0a03bf23--- /dev/null+++ b/frontend-modern/src/features/truenas/TrueNASAppsTable.tsx@@ -0,0 +1,400 @@+import { For, Show, createMemo, type Component, type JSX } from 'solid-js';+import { StatusDot } from '@/components/shared/StatusDot';+import { ResponsiveMetricCell } from '@/components/shared/responsive';+import { TableCard } from '@/components/shared/TableCard';+import { TableCardHeader } from '@/components/shared/TableCardHeader';+import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';+import {+ Table,+ TableBody,+ TableCell,+ TableHead,+ TableHeader,+ TableRow,+} from '@/components/shared/Table';+import { getShortImageName } from '@/utils/format';+import { getSimpleStatusIndicator } from '@/utils/status';+import { asTrimmedString } from '@/utils/stringUtils';+import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';+import {+ PLATFORM_TABLE_BODY_CLASS,+ PLATFORM_TABLE_CARD_CLASS,+ PLATFORM_TABLE_HEADER_ROW_CLASS,+ PlatformTableEmptyState,+ PlatformTableToolbar,+ createPlatformTableFilterState,+ getPlatformTableCellClassForKind,+ getPlatformTableHeadClassForKind,+ type PlatformTableFilterOption,+} from '@/features/platformPage/sharedPlatformPage';+import {+ PlatformResourceDetailTableRow,+ createPlatformResourceDetailState,+ createPlatformResourceLabelResolver,+ getPlatformResourceDetailRowClass,+} from '@/features/platformPage/PlatformResourceDetailTableRow';+import type {+ Resource,+ ResourceTrueNASAppMeta,+ ResourceTrueNASAppPort,+ ResourceTrueNASAppVolume,+} from '@/types/resource';+import { filterTrueNASApps, type TrueNASAppStatusFilter } from './truenasPageModel';++const TRUENAS_APP_STATUS_OPTIONS: PlatformTableFilterOption<TrueNASAppStatusFilter>[] = [+ { value: 'all', label: 'All' },+ { value: 'running', label: 'Running', tone: 'success' },+ { value: 'attention', label: 'Attention', tone: 'warning' },+ { value: 'stopped', label: 'Stopped', tone: 'danger' },+];++const metricFallback = () => (+ <div class="flex justify-center">+ <span class="text-xs text-muted" aria-hidden="true">+ -+ </span>+ </div>+);++const finiteMetric = (value: number | undefined): number | undefined =>+ typeof value === 'number' && Number.isFinite(value) ? value : undefined;++const titleCase = (value: string | undefined): string => {+ const normalized = asTrimmedString(value);+ if (!normalized) return 'Unknown';+ return normalized.charAt(0).toUpperCase() + normalized.slice(1).toLowerCase();+};++const appMeta = (resource: Resource): ResourceTrueNASAppMeta | undefined => resource.truenas?.app;++const appVersionLabel = (app: ResourceTrueNASAppMeta | undefined): string => {+ const human = asTrimmedString(app?.humanVersion);+ const version = asTrimmedString(app?.version);+ if (human && version && human !== version) return `${human} / ${version}`;+ return human || version || '-';+};++const appContainerCount = (app: ResourceTrueNASAppMeta | undefined): number => {+ const explicit = app?.containerCount;+ if (typeof explicit === 'number' && Number.isFinite(explicit)) return explicit;+ return app?.containers?.length ?? 0;+};++const plural = (count: number, singular: string): string =>+ `${count} ${count === 1 ? singular : `${singular}s`}`;++const formatHostPort = (port: ResourceTrueNASAppPort): string => {+ const protocol = (asTrimmedString(port.protocol) ?? '').toLowerCase() || 'tcp';+ const target = typeof port.containerPort === 'number' ? String(port.containerPort) : '';+ const targetLabel = target ? `${target}/${protocol}` : protocol;+ const hostPorts = port.hostPorts ?? [];+ if (hostPorts.length === 0) return targetLabel;+ return hostPorts+ .map((hostPort) => {+ const published = typeof hostPort.hostPort === 'number' ? String(hostPort.hostPort) : '';+ const hostIp = asTrimmedString(hostPort.hostIp);+ const source = [hostIp, published].filter(Boolean).join(':');+ return source ? `${source}->${targetLabel}` : targetLabel;+ })+ .join(', ');+};++const formatPorts = (app: ResourceTrueNASAppMeta | undefined): { label: string; title: string } => {+ const ports = app?.usedPorts ?? [];+ const labels = ports.map(formatHostPort).filter(Boolean);+ if (labels.length === 0) return { label: '-', title: '' };+ const visible = labels.slice(0, 2);+ const suffix = labels.length > visible.length ? ` +${labels.length - visible.length}` : '';+ return { label: `${visible.join(', ')}${suffix}`, title: labels.join(', ') };+};++const shortImage = (image: string): string => getShortImageName(image) || image;++const formatImages = (+ app: ResourceTrueNASAppMeta | undefined,+): { label: string; title: string } => {+ const images = app?.images?.filter((image) => asTrimmedString(image)) ?? [];+ if (images.length === 0) return { label: '-', title: '' };+ const labels = images.map(shortImage);+ const visible = labels.slice(0, 2);+ const suffix = labels.length > visible.length ? ` +${labels.length - visible.length}` : '';+ return { label: `${visible.join(', ')}${suffix}`, title: images.join(', ') };+};++const volumeLabel = (volume: ResourceTrueNASAppVolume): string => {+ const source = asTrimmedString(volume.source);+ const destination = asTrimmedString(volume.destination);+ if (source && destination) return `${source}->${destination}`;+ return source || destination || '';+};++const formatVolumes = (+ app: ResourceTrueNASAppMeta | undefined,+): { label: string; title: string } => {+ const volumes = app?.volumes ?? [];+ if (volumes.length === 0) return { label: '-', title: '' };+ return {+ label: plural(volumes.length, 'volume'),+ title: volumes.map(volumeLabel).filter(Boolean).join(', '),+ };+};++const UpdatePills: Component<{ app: ResourceTrueNASAppMeta | undefined }> = (props) => {+ const hasAppUpdate = () => props.app?.upgradeAvailable === true;+ const hasImageUpdate = () => props.app?.imageUpdatesAvailable === true;+ return (+ <div class="flex justify-center gap-1">+ <Show+ when={hasAppUpdate() || hasImageUpdate()}+ fallback={+ <span class="rounded border border-border px-1.5 py-0.5 text-[10px] font-medium text-muted">+ Current+ </span>+ }+ >+ <Show when={hasAppUpdate()}>+ <span class="rounded border border-amber-300/50 bg-amber-500/10 px-1.5 py-0.5 text-[10px] font-medium text-amber-700 dark:text-amber-300">+ App+ </span>+ </Show>+ <Show when={hasImageUpdate()}>+ <span class="rounded border border-blue-300/50 bg-blue-500/10 px-1.5 py-0.5 text-[10px] font-medium text-blue-700 dark:text-blue-300">+ Image+ </span>+ </Show>+ </Show>+ </div>+ );+};++export const TrueNASAppsTable: Component<{+ apps: Resource[];+ scope: Resource[];+ emptyIcon: JSX.Element;+ emptyTitle: string;+ emptyDescription: string;+ showToolbar?: boolean;+}> = (props) => {+ const tableState = createPlatformTableFilterState({+ resources: () => props.apps,+ initialStatus: 'all' as TrueNASAppStatusFilter,+ filter: filterTrueNASApps,+ });+ const drawer = createPlatformResourceDetailState({ idPrefix: 'truenas-app-drawer' });+ const resolveResourceLabel = createPlatformResourceLabelResolver(() => props.scope);++ return (+ <Show+ when={props.apps.length > 0}+ fallback={+ <PlatformTableEmptyState+ icon={props.emptyIcon}+ title={props.emptyTitle}+ description={props.emptyDescription}+ />+ }+ >+ <div class="space-y-3">+ <Show when={props.showToolbar !== false}>+ <PlatformTableToolbar+ search={tableState.search}+ onSearchChange={tableState.setSearch}+ searchPlaceholder="Search TrueNAS apps"+ status={tableState.status()}+ onStatusChange={tableState.setStatus}+ statusOptions={TRUENAS_APP_STATUS_OPTIONS}+ visible={tableState.visible()}+ total={tableState.total()}+ rowNoun="apps"+ />+ </Show>++ <Show+ when={tableState.filtered().length > 0}+ fallback={+ <PlatformTableEmptyState+ icon={props.emptyIcon}+ title="No apps match current filters"+ description="Adjust the search or status filter to see more TrueNAS apps."+ />+ }+ >+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>+ <TableCardHeader title="Apps" />+ <Table class="min-w-full table-fixed text-xs md:min-w-[1280px]">+ <TableHeader>+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>+ <TableHead class={`${getPlatformTableHeadClassForKind('name')} md:w-[16%]`}>+ App+ </TableHead>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[10%]`}+ >+ Version+ </TableHead>+ <TableHead class={`${getPlatformTableHeadClassForKind('metric-bar')} md:w-[10%]`}>+ CPU+ </TableHead>+ <TableHead class={`${getPlatformTableHeadClassForKind('metric-bar')} md:w-[12%]`}>+ Memory+ </TableHead>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden sm:table-cell md:w-[9%]`}+ >+ Containers+ </TableHead>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[16%]`}+ >+ Ports+ </TableHead>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('text')} hidden lg:table-cell md:w-[13%]`}+ >+ Images+ </TableHead>+ <TableHead+ class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden xl:table-cell md:w-[7%]`}+ >+ Volumes+ </TableHead>+ <TableHead class={`${getPlatformTableHeadClassForKind('badge')} md:w-[7%]`}>+ Updates+ </TableHead>+ </TableRow>+ </TableHeader>+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>+ <For each={tableState.filtered()}>+ {(resource) => {+ const app = () => appMeta(resource);+ const name = () =>+ asTrimmedString(app()?.name) ||+ asTrimmedString(resource.displayName) ||+ asTrimmedString(resource.name) ||+ resource.id;+ const indicator = () => getSimpleStatusIndicator(resource.status);+ const metricsKey = () => buildMetricKeyForUnifiedResource(resource);+ const cpuPercent = () => finiteMetric(resource.cpu?.current);+ const memoryTotal = () => finiteMetric(resource.memory?.total) ?? 0;+ const memoryUsed = () => finiteMetric(resource.memory?.used) ?? 0;+ const memoryPercentOnly = () =>+ memoryTotal() > 0 ? undefined : finiteMetric(resource.memory?.current);+ const hasMemoryMetric = () =>+ memoryTotal() > 0 || memoryPercentOnly() !== undefined;+ const canRenderMetrics = () => indicator().variant !== 'muted';+ const ports = createMemo(() => formatPorts(app()));+ const images = createMemo(() => formatImages(app()));+ const volumes = createMemo(() => formatVolumes(app()));+ const detailRowId = () => drawer.detailRowId(resource);+ const isExpanded = () => drawer.isExpanded(resource);+ return (+ <>+ <TableRow+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}+ aria-controls={isExpanded() ? detailRowId() : undefined}+ aria-expanded={isExpanded() ? 'true' : 'false'}+ data-truenas-app-row={resource.id}+ onClick={() => drawer.toggle(resource)}+ onKeyDown={drawer.handleActivationKey(resource)}+ tabIndex={0}+ >+ <TableCell class={getPlatformTableCellClassForKind('name')}>+ <div class="flex min-w-0 items-center gap-2">+ <StatusDot+ size="sm"+ variant={indicator().variant}+ title={indicator().label}+ />+ <div class="min-w-0">+ <div class="truncate font-medium text-base-content" title={name()}>+ {name()}+ </div>+ <div class="truncate text-[10px] text-muted">+ {titleCase(app()?.state)} on {resource.parentName || 'TrueNAS'}+ <Show when={app()?.customApp}> - Custom</Show>+ </div>+ </div>+ </div>+ </TableCell>+ <TableCell+ class={`${getPlatformTableCellClassForKind('text')} hidden md:table-cell`}+ >+ <span class="block truncate" title={appVersionLabel(app())}>+ {appVersionLabel(app())}+ </span>+ </TableCell>+ <TableCell class={getPlatformTableCellClassForKind('metric-bar')}>+ <Show when={cpuPercent() !== undefined} fallback={metricFallback()}>+ <ResponsiveMetricCell+ value={cpuPercent()!}+ type="cpu"+ resourceId={metricsKey()}+ isRunning={canRenderMetrics()}+ fallback={metricFallback()}+ />+ </Show>+ </TableCell>+ <TableCell class={getPlatformTableCellClassForKind('metric-bar')}>+ <Show when={hasMemoryMetric()} fallback={metricFallback()}>+ <StackedMemoryBar+ used={memoryUsed()}+ total={memoryTotal()}+ percentOnly={memoryPercentOnly()}+ />+ </Show>+ </TableCell>+ <TableCell+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden sm:table-cell tabular-nums`}+ >+ {appContainerCount(app()) || '-'}+ </TableCell>+ <TableCell+ class={`${getPlatformTableCellClassForKind('text')} hidden md:table-cell`}+ >+ <span+ class="block truncate font-mono text-[11px]"+ title={ports().title}+ >+ {ports().label}+ </span>+ </TableCell>+ <TableCell+ class={`${getPlatformTableCellClassForKind('text')} hidden lg:table-cell`}+ >+ <span class="block truncate" title={images().title}>+ {images().label}+ </span>+ </TableCell>+ <TableCell+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden xl:table-cell`}+ >+ <span class="block truncate" title={volumes().title}>+ {volumes().label}+ </span>+ </TableCell>+ <TableCell class={getPlatformTableCellClassForKind('badge')}>+ <UpdatePills app={app()} />+ </TableCell>+ </TableRow>+ <PlatformResourceDetailTableRow+ resource={resource}+ open={isExpanded()}+ detailRowId={detailRowId()}+ colSpan={9}+ resolveResourceLabel={resolveResourceLabel}+ onClose={() => drawer.close(resource)}+ />+ </>+ );+ }}+ </For>+ </TableBody>+ </Table>+ </TableCard>+ </Show>+ </div>+ </Show>+ );+};++export default TrueNASAppsTable;diff --git a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsxindex a352b4b997..62e17bae3f 100644--- a/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx+++ b/frontend-modern/src/features/truenas/TrueNASPageSurface.tsx@@ -2,22 +2,14 @@ import { useLocation } from '@solidjs/router';import DatabaseIcon from 'lucide-solid/icons/database';import { Show, createMemo, type Accessor } from 'solid-js';import StorageSurface from '@/components/Storage/Storage';-import { WorkloadsFilter } from '@/components/Workloads/WorkloadsFilter';-import { WorkloadsSurface } from '@/components/Workloads/WorkloadsSurface';-import { useWorkloadsState } from '@/components/Workloads/useWorkloadsState';-import type { WorkloadsStatusOption } from '@/components/Workloads/workloadsFilterModel';import { useUnifiedResources } from '@/hooks/useUnifiedResources';-import { resourceMatchesSearch } from '@/utils/resourceSearchMatch';import {PlatformErrorState,PlatformSectionTabs,PlatformTableEmptyState,PlatformTableLoadingState,} from '@/features/platformPage/sharedPlatformPage';-import {- APP_CONTAINER_COLUMN_LABEL_OVERRIDES,- buildAppContainerDefaultHiddenColumnIds,-} from '@/features/platformPage/appContainerColumns';+import { TrueNASAppsTable } from './TrueNASAppsTable';import { TrueNASSystemsTable } from './TrueNASSystemsTable';import {TRUENAS_TAB_SPECS,@@ -34,12 +26,6 @@ import {const TRUENAS_RESOURCE_QUERY = 'type=agent,app-container,storage,physical_disk';const TRUENAS_PLATFORM_FILTER = 'truenas';const VALID_TABS = new Set<TrueNASPageTabId>(TRUENAS_TAB_SPECS.map((tab) => tab.id));-const TRUENAS_APP_STATUS_OPTIONS: readonly WorkloadsStatusOption[] = [- { value: 'all', label: 'All' },- { value: 'running', label: 'Running' },- { value: 'degraded', label: 'Attention' },- { value: 'stopped', label: 'Stopped' },-];const truenasIcon = () => <DatabaseIcon class="h-6 w-6 text-slate-400" />;@@ -120,81 +106,10 @@ interface TrueNASOverviewProps {}function TrueNASOverview(props: TrueNASOverviewProps) {- const truenasAppDefaultHiddenColumns = createMemo(() =>- buildAppContainerDefaultHiddenColumnIds(props.model().apps),- );- const workloadsState = useWorkloadsState({- vms: [],- containers: [],- nodes: [],- useWorkloads: true,- embedded: true,- tableOnly: true,- forcedPlatform: TRUENAS_PLATFORM_FILTER,- forcedViewMode: 'app-container',- showFilterToolbar: true,- suppressPlatformFilter: true,- allowEmbeddedScopeFilters: true,- columnVisibilityStorageScope: 'truenas-app-containers',- additionalDefaultHiddenColumnIds: truenasAppDefaultHiddenColumns(),- columnLabelOverrides: APP_CONTAINER_COLUMN_LABEL_OVERRIDES,- compactGroupHeaders: true,- });- const showSharedFilterToolbar = createMemo(- () =>- props.model().apps.length > 0 &&- workloadsState.surfaceConnected() &&- workloadsState.surfaceInitialDataReceived() &&- workloadsState.allGuests().length > 0,- );- const filteredSystems = createMemo(() => {- const term = workloadsState.search().trim();- if (!term) return props.model().systems;- return props.model().systems.filter((system) => resourceMatchesSearch(system, term));- });-return (<div class="space-y-4">- <Show when={showSharedFilterToolbar()}>- <div data-summary-clear-ignore>- <WorkloadsFilter- search={workloadsState.search}- setSearch={workloadsState.setSearch}- viewMode={workloadsState.viewMode}- setViewMode={workloadsState.setViewMode}- statusMode={workloadsState.statusMode}- setStatusMode={workloadsState.setStatusMode}- groupingMode={workloadsState.groupingMode}- setGroupingMode={workloadsState.setGroupingMode}- setSortKey={workloadsState.setSortKey}- setSortDirection={workloadsState.setSortDirection}- onBeforeAutoFocus={workloadsState.handleBeforeAutoFocus}- ariaLabel="TrueNAS app filters"- searchPlaceholder="Search TrueNAS apps by name, image, namespace, or system"- searchEmptyMessage="Recent TrueNAS app searches appear here."- statusOptions={TRUENAS_APP_STATUS_OPTIONS}- columnVisibility={workloadsState.workloadsFilterColumnVisibility()}- containerRuntimeFilter={workloadsState.containerRuntimeFilterConfig()}- hostFilter={undefined}- namespaceFilter={undefined}- platformFilter={undefined}- suppressTypeFilter- metricDisplayMode={workloadsState.workloadMetricDisplayMode}- setMetricDisplayMode={workloadsState.setWorkloadMetricDisplayMode}- metricHistoryRange={workloadsState.workloadMetricHistoryRange}- setMetricHistoryRange={workloadsState.setWorkloadMetricHistoryRange}- forcedPlatform={TRUENAS_PLATFORM_FILTER}- pinnedSelectionActive={() =>- Boolean(- workloadsState.selectedGuestId() || workloadsState.focusedSummaryWorkloadGroupId(),- )- }- onClearPinnedSelection={workloadsState.clearPinnedSummaryScope}- />- </div>- </Show><TrueNASSystemsTable- systems={filteredSystems()}+ systems={props.model().systems}scope={props.model().resources}emptyIcon={truenasIcon()}emptyTitle="No TrueNAS systems"@@ -202,17 +117,12 @@ function TrueNASOverview(props: TrueNASOverviewProps) {showToolbar={false}/><Show when={props.model().apps.length > 0}>- <WorkloadsSurface- state={workloadsState}- vms={[]}- containers={[]}- nodes={[]}- useWorkloads- embedded- tableOnly- forcedPlatform={TRUENAS_PLATFORM_FILTER}- forcedViewMode="app-container"- compactGroupHeaders+ <TrueNASAppsTable+ apps={props.model().apps}+ scope={props.model().resources}+ emptyIcon={truenasIcon()}+ emptyTitle="No TrueNAS apps"+ emptyDescription="Apps appear here once the TrueNAS API reports app.query inventory."/></Show></div>diff --git a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.tsindex 36a6584182..8042b49fa6 100644--- a/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts+++ b/frontend-modern/src/features/truenas/__tests__/truenasPageModel.test.ts@@ -1,6 +1,11 @@import { describe, expect, it } from 'vitest';import type { Resource } from '@/types/resource';-import { TRUENAS_TAB_SPECS, buildTrueNASPageModel } from '../truenasPageModel';+import {+ TRUENAS_TAB_SPECS,+ buildTrueNASPageModel,+ filterTrueNASApps,+ mapTrueNASAppStatus,+} from '../truenasPageModel';const makeResource = (resource: Partial<Resource> & Pick<Resource, 'id' | 'type'>): Resource => ({name: resource.id,@@ -34,4 +39,52 @@ describe('truenasPageModel', () => {['truenas-app', 'truenas-disk', 'truenas-pool', 'truenas-system'].sort(),);});++ it('filters apps using native TrueNAS app.query metadata', () => {+ const nextcloud = makeResource({+ id: 'app-nextcloud',+ type: 'app-container',+ parentName: 'truenas-main',+ truenas: {+ hostname: 'truenas-main',+ app: {+ id: 'nextcloud',+ name: 'Nextcloud',+ state: 'RUNNING',+ humanVersion: '29.0.7',+ images: ['docker.io/library/nextcloud:29.0.7'],+ usedPorts: [+ {+ containerPort: 443,+ protocol: 'tcp',+ hostPorts: [{ hostPort: 30443, hostIp: '0.0.0.0' }],+ },+ ],+ volumes: [{ source: '/mnt/tank/apps/nextcloud', destination: '/var/www/html' }],+ },+ },+ });+ const adguard = makeResource({+ id: 'app-adguard',+ type: 'app-container',+ status: 'offline',+ truenas: {+ app: {+ id: 'adguard',+ name: 'AdGuard Home',+ state: 'STOPPED',+ images: ['docker.io/adguard/adguardhome:v0.107'],+ },+ },+ });++ expect(mapTrueNASAppStatus(nextcloud)).toBe('running');+ expect(mapTrueNASAppStatus(adguard)).toBe('stopped');+ expect(filterTrueNASApps([nextcloud, adguard], '30443', 'all').map((r) => r.id)).toEqual([+ 'app-nextcloud',+ ]);+ expect(+ filterTrueNASApps([nextcloud, adguard], 'adguardhome', 'stopped').map((r) => r.id),+ ).toEqual(['app-adguard']);+ });});diff --git a/frontend-modern/src/features/truenas/truenasPageModel.ts b/frontend-modern/src/features/truenas/truenasPageModel.tsindex df8613e361..3ba6ec7819 100644--- a/frontend-modern/src/features/truenas/truenasPageModel.ts+++ b/frontend-modern/src/features/truenas/truenasPageModel.ts@@ -2,6 +2,7 @@ import { resolveResourcePlatformType } from '@/utils/sourcePlatforms';import type { Resource, ResourceType } from '@/types/resource';export type TrueNASPageTabId = 'overview' | 'storage';+export type TrueNASAppStatusFilter = 'all' | 'running' | 'attention' | 'stopped';export type TrueNASTabSpec = {id: TrueNASPageTabId;@@ -49,3 +50,92 @@ export function buildTrueNASPageModel(resources: Resource[]): TrueNASPageModel {apps,};}++const normalize = (value: unknown): string =>+ typeof value === 'string' ? value.trim().toLowerCase() : '';++export function mapTrueNASAppStatus(resource: Resource): Exclude<TrueNASAppStatusFilter, 'all'> {+ const state = normalize(resource.truenas?.app?.state);+ if (state === 'running') return 'running';+ if (state === 'stopped') return 'stopped';+ if (state === 'crashed' || state === 'deploying' || state === 'stopping') return 'attention';++ if (resource.status === 'online' || resource.status === 'running') return 'running';+ if (resource.status === 'offline' || resource.status === 'stopped') return 'stopped';+ if (resource.status === 'degraded' || resource.status === 'paused') return 'attention';+ return 'attention';+}++const portSearchTokens = (resource: Resource): string[] => {+ const app = resource.truenas?.app;+ const tokens: string[] = [];+ for (const port of app?.usedPorts ?? []) {+ if (typeof port.containerPort === 'number') tokens.push(String(port.containerPort));+ if (port.protocol) tokens.push(port.protocol);+ for (const hostPort of port.hostPorts ?? []) {+ if (typeof hostPort.hostPort === 'number') tokens.push(String(hostPort.hostPort));+ if (hostPort.hostIp) tokens.push(hostPort.hostIp);+ }+ }+ for (const port of resource.docker?.ports ?? []) {+ if (typeof port.publicPort === 'number') tokens.push(String(port.publicPort));+ if (typeof port.privatePort === 'number') tokens.push(String(port.privatePort));+ if (port.protocol) tokens.push(port.protocol);+ if (port.ip) tokens.push(port.ip);+ }+ return tokens;+};++const appSearchHaystack = (resource: Resource): string => {+ const app = resource.truenas?.app;+ return [+ resource.name,+ resource.displayName,+ resource.id,+ resource.parentName,+ resource.platformId,+ resource.platformType,+ resource.docker?.runtime,+ resource.docker?.image,+ resource.truenas?.hostname,+ app?.id,+ app?.name,+ app?.state,+ app?.version,+ app?.humanVersion,+ app?.notes,+ ...(app?.usedHostIps ?? []),+ ...(app?.images ?? []),+ ...(app?.containers?.flatMap((container) => [+ container.id,+ container.serviceName,+ container.image,+ container.state,+ ]) ?? []),+ ...(app?.volumes?.flatMap((volume) => [+ volume.source,+ volume.destination,+ volume.mode,+ volume.type,+ ]) ?? []),+ ...(app?.networks?.flatMap((network) => [network.id, network.name]) ?? []),+ ...portSearchTokens(resource),+ ...(resource.tags ?? []),+ ]+ .filter((value): value is string => typeof value === 'string' && value.trim().length > 0)+ .join(' ')+ .toLowerCase();+};++export function filterTrueNASApps(+ apps: Resource[],+ search: string,+ status: TrueNASAppStatusFilter,+): Resource[] {+ const needle = normalize(search);+ return apps.filter((app) => {+ if (status !== 'all' && mapTrueNASAppStatus(app) !== status) return false;+ if (!needle) return true;+ return appSearchHaystack(app).includes(needle);+ });+}diff --git a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.tsindex 1c6e4bb6ea..2e463ae43a 100644--- a/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts+++ b/frontend-modern/src/hooks/__tests__/useUnifiedResources.test.ts@@ -297,9 +297,7 @@ describe('useUnifiedResources', () => {expect(result!.resources()[0].agent?.storagePostureSummary).toBe('Unraid array is running without parity protection',);- expect(result!.resources()[0].agent?.unraid?.risk?.reasons?.[0]?.code).toBe(- 'unraid_no_parity',- );+ expect(result!.resources()[0].agent?.unraid?.risk?.reasons?.[0]?.code).toBe('unraid_no_parity');expect(result!.resources()[0].storage?.postureSummary).toBe('Unraid array is running without parity protection',);@@ -476,6 +474,17 @@ describe('useUnifiedResources', () => {sources: ['truenas'],truenas: {hostname: 'truenas-main',+ app: {+ id: 'nextcloud',+ state: 'RUNNING',+ usedPorts: [+ {+ containerPort: 443,+ protocol: 'tcp',+ hostPorts: [{ hostPort: 30443, hostIp: '0.0.0.0' }],+ },+ ],+ },},docker: {containerId: 'nextcloud',@@ -493,23 +502,29 @@ describe('useUnifiedResources', () => {});await waitForValue(- () => Boolean(result!.resources().find((resource) => resource.id === 'docker-container-frigate-141')),+ () =>+ Boolean(+ result!.resources().find((resource) => resource.id === 'docker-container-frigate-141'),+ ),true,);- const dockerResource = result!.resources().find(- (resource) => resource.id === 'docker-container-frigate-141',- );- const truenasResource = result!.resources().find(- (resource) => resource.id === 'truenas-app-nextcloud',- );+ const dockerResource = result!+ .resources()+ .find((resource) => resource.id === 'docker-container-frigate-141');+ const truenasResource = result!+ .resources()+ .find((resource) => resource.id === 'truenas-app-nextcloud');expect(dockerResource?.platformScopes).toEqual(['proxmox-pve', 'docker']);+ expect(dockerResource?.docker?.containerId).toBe('frigate');expect((dockerResource?.platformData as Record<string, unknown>)?.platformScopes).toEqual(['proxmox-pve','docker',]);expect(truenasResource?.platformScopes).toEqual(['truenas']);+ expect(truenasResource?.truenas?.hostname).toBe('truenas-main');+ expect(truenasResource?.truenas?.app?.usedPorts?.[0]?.hostPorts?.[0]?.hostPort).toBe(30443);dispose();});diff --git a/frontend-modern/src/hooks/useUnifiedResources.ts b/frontend-modern/src/hooks/useUnifiedResources.tsindex 7a044a7de3..904f9ae8f7 100644--- a/frontend-modern/src/hooks/useUnifiedResources.ts+++ b/frontend-modern/src/hooks/useUnifiedResources.ts@@ -13,6 +13,7 @@ import type {ResourceChange,ResourceFacetCounts,ResourceDiscoveryTarget,+ ResourceDockerMeta,ResourceMetricsTarget,ResourceAvailabilityMeta,ResourcePBSMeta,@@ -20,6 +21,7 @@ import type {ResourceStatus,ResourceStorageMeta,ResourceStorageRisk,+ ResourceTrueNASMeta,ResourceType,ResourceVMwareMeta,} from '@/types/resource';@@ -211,24 +213,8 @@ type APIResource = {tokenHint?: string;tokenLastUsedAt?: number;};- docker?: {- hostSourceId?: string;- hostname?: string;- temperature?: number;- runtime?: string;- runtimeVersion?: string;- dockerVersion?: string;- os?: string;- kernelVersion?: string;- architecture?: string;- agentVersion?: string;- uptimeSeconds?: number;- swarm?: unknown;- containerCount?: number;- updatesAvailableCount?: number;- updatesLastCheckedAt?: string;- command?: Record<string, unknown>;- };+ docker?: ResourceDockerMeta;+ truenas?: ResourceTrueNASMeta;pbs?: {instanceId?: string;hostname?: string;@@ -677,6 +663,8 @@ const toResource = (v2: APIResource): Resource => {incidentAction: v2.incidentAction,agent: v2.agent,kubernetes: v2.kubernetes,+ docker: v2.docker as ResourceDockerMeta | undefined,+ truenas: v2.truenas as ResourceTrueNASMeta | undefined,vmware: v2.vmware as ResourceVMwareMeta | undefined,pbs: v2.pbs as ResourcePBSMeta | undefined,availability: v2.availability as ResourceAvailabilityMeta | undefined,@@ -746,6 +734,7 @@ const toResource = (v2: APIResource): Resource => {proxmox: v2.proxmox,agent: v2.agent,docker: v2.docker,+ truenas: v2.truenas,pbs: v2.pbs,storage: v2.storage,pmg: v2.pmg,diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.tsindex 27bf2bcca4..fd94a6662d 100644--- a/frontend-modern/src/types/resource.ts+++ b/frontend-modern/src/types/resource.ts@@ -533,7 +533,11 @@ export interface ResourceProxmoxMeta {export interface ResourceDockerMeta {serviceId?: string;hostSourceId?: string;+ containerId?: string;hostname?: string;+ displayName?: string;+ customDisplayName?: string;+ machineId?: string;temperature?: number;runtime?: string;runtimeVersion?: string;@@ -548,6 +552,25 @@ export interface ResourceDockerMeta {updatesLastCheckedAt?: string;command?: Record<string, unknown>;image?: string;+ containerState?: string;+ ports?: Array<{+ privatePort?: number;+ publicPort?: number;+ protocol?: string;+ ip?: string;+ }>;+ mounts?: Array<{+ type?: string;+ source?: string;+ destination?: string;+ mode?: string;+ rw?: boolean;+ }>;+ networks?: Array<{+ name?: string;+ ipv4?: string;+ ipv6?: string;+ }>;mode?: string;desiredTasks?: number;runningTasks?: number;@@ -570,6 +593,78 @@ export interface ResourceDockerMeta {};}+export interface ResourceTrueNASAppHostPort {+ hostPort?: number;+ hostIp?: string;+}++export interface ResourceTrueNASAppPort {+ containerPort?: number;+ protocol?: string;+ hostPorts?: ResourceTrueNASAppHostPort[];+}++export interface ResourceTrueNASAppVolume {+ source?: string;+ destination?: string;+ mode?: string;+ type?: string;+}++export interface ResourceTrueNASAppContainer {+ id?: string;+ serviceName?: string;+ image?: string;+ state?: string;+ portConfig?: ResourceTrueNASAppPort[];+ volumeMounts?: ResourceTrueNASAppVolume[];+}++export interface ResourceTrueNASAppNetwork {+ id?: string;+ name?: string;+ labels?: Record<string, string>;+}++export interface ResourceTrueNASAppStats {+ intervalSeconds?: number;+ collectedAt?: string;+}++export interface ResourceTrueNASAppMeta {+ id?: string;+ name?: string;+ state?: string;+ version?: string;+ humanVersion?: string;+ customApp?: boolean;+ upgradeAvailable?: boolean;+ imageUpdatesAvailable?: boolean;+ notes?: string;+ containerCount?: number;+ usedHostIps?: string[];+ usedPorts?: ResourceTrueNASAppPort[];+ containers?: ResourceTrueNASAppContainer[];+ volumes?: ResourceTrueNASAppVolume[];+ images?: string[];+ networks?: ResourceTrueNASAppNetwork[];+ stats?: ResourceTrueNASAppStats;+}++export interface ResourceTrueNASMeta {+ hostname?: string;+ version?: string;+ uptimeSeconds?: number;+ storageRisk?: ResourceStorageRisk;+ storageRiskSummary?: string;+ storagePostureSummary?: string;+ protectionReduced?: boolean;+ protectionSummary?: string;+ rebuildInProgress?: boolean;+ rebuildSummary?: string;+ app?: ResourceTrueNASAppMeta;+}+export interface ResourceKubernetesMetricCapabilities {nodeCpuMemory?: boolean;nodeTelemetry?: boolean;@@ -784,6 +879,7 @@ export interface Resource {agent?: ResourceAgentMeta;kubernetes?: ResourceKubernetesMeta;docker?: ResourceDockerMeta;+ truenas?: ResourceTrueNASMeta;pmg?: ResourcePMGMeta;vmware?: ResourceVMwareMeta;proxmox?: ResourceProxmoxMeta;diff --git a/internal/truenas/contract_test.go b/internal/truenas/contract_test.goindex 48dce77db3..13adebf1bd 100644--- a/internal/truenas/contract_test.go+++ b/internal/truenas/contract_test.go@@ -141,6 +141,21 @@ func TestRegistryIngestRecordsTreatsTrueNASAsGenericDataSource(t *testing.T) {if app.Docker.Runtime != "docker" {t.Fatalf("expected app runtime docker, got %q", app.Docker.Runtime)}+ if app.TrueNAS == nil || app.TrueNAS.App == nil {+ t.Fatal("expected native TrueNAS app metadata on TrueNAS app resource")+ }+ if app.TrueNAS.App.ID != "nextcloud" || app.TrueNAS.App.State != "RUNNING" {+ t.Fatalf("unexpected native TrueNAS app identity/state: %+v", app.TrueNAS.App)+ }+ if app.TrueNAS.App.HumanVersion != "29.0.7" || !app.TrueNAS.App.UpgradeAvailable || !app.TrueNAS.App.ImageUpdatesAvailable {+ t.Fatalf("unexpected native TrueNAS app version/update metadata: %+v", app.TrueNAS.App)+ }+ if app.TrueNAS.App.ContainerCount != 2 || len(app.TrueNAS.App.Containers) != 2 {+ t.Fatalf("expected native TrueNAS app container inventory, got %+v", app.TrueNAS.App)+ }+ if len(app.TrueNAS.App.UsedPorts) != 1 || len(app.TrueNAS.App.UsedPorts[0].HostPorts) != 1 || app.TrueNAS.App.UsedPorts[0].HostPorts[0].HostPort != 30443 {+ t.Fatalf("unexpected native TrueNAS app ports: %+v", app.TrueNAS.App.UsedPorts)+ }if app.Status != unifiedresources.StatusOnline {t.Fatalf("expected Nextcloud status online, got %q", app.Status)}diff --git a/internal/truenas/provider.go b/internal/truenas/provider.goindex e6b5280bb2..ed60a19a16 100644--- a/internal/truenas/provider.go+++ b/internal/truenas/provider.go@@ -617,14 +617,18 @@ func truenasRecordsFromSnapshot(snapshot *FixtureSnapshot, now func() time.Time)SourceID: appSourceID(app.ID),ParentSourceID: systemSourceID,Resource: unifiedresources.Resource{- Type: unifiedresources.ResourceTypeAppContainer,- Technology: "docker",- Name: appDisplayName(app),- Status: statusFromApp(app),- LastSeen: collectedAt,- UpdatedAt: collectedAt,- Metrics: metrics,- Docker: dockerMeta,+ Type: unifiedresources.ResourceTypeAppContainer,+ Technology: "docker",+ Name: appDisplayName(app),+ Status: statusFromApp(app),+ LastSeen: collectedAt,+ UpdatedAt: collectedAt,+ Metrics: metrics,+ Docker: dockerMeta,+ TrueNAS: &unifiedresources.TrueNASData{+ Hostname: strings.TrimSpace(snapshot.System.Hostname),+ App: trueNASAppDataFromApp(app),+ },Capabilities: truenasAppCapabilities(),Tags: appTags(app),},@@ -1322,6 +1326,168 @@ func primaryAppImage(app App) string {return ""}+func trueNASAppDataFromApp(app App) *unifiedresources.TrueNASApp {+ containerCount := app.ContainerCount+ if containerCount == 0 && len(app.Containers) > 0 {+ containerCount = len(app.Containers)+ }+ data := &unifiedresources.TrueNASApp{+ ID: strings.TrimSpace(app.ID),+ Name: strings.TrimSpace(app.Name),+ State: strings.TrimSpace(app.State),+ Version: strings.TrimSpace(app.Version),+ HumanVersion: strings.TrimSpace(app.HumanVersion),+ CustomApp: app.CustomApp,+ UpgradeAvailable: app.UpgradeAvailable,+ ImageUpdatesAvailable: app.ImageUpdatesAvailable,+ Notes: strings.TrimSpace(app.Notes),+ ContainerCount: containerCount,+ UsedHostIPs: dedupeStrings(app.UsedHostIPs),+ UsedPorts: trueNASAppPortsFromAppPorts(app.UsedPorts),+ Containers: trueNASAppContainersFromAppContainers(app.Containers),+ Volumes: trueNASAppVolumesFromAppVolumes(app.Volumes),+ Images: dedupeStrings(app.Images),+ Networks: trueNASAppNetworksFromAppNetworks(app.Networks),+ }+ if app.Stats != nil {+ data.Stats = &unifiedresources.TrueNASAppStats{+ IntervalSeconds: app.Stats.IntervalSeconds,+ CollectedAt: app.Stats.CollectedAt,+ }+ }+ return data+}++func trueNASAppPortsFromAppPorts(ports []AppPort) []unifiedresources.TrueNASAppPort {+ if len(ports) == 0 {+ return nil+ }+ out := make([]unifiedresources.TrueNASAppPort, 0, len(ports))+ for _, port := range ports {+ if port.ContainerPort == 0 && len(port.HostPorts) == 0 {+ continue+ }+ out = append(out, unifiedresources.TrueNASAppPort{+ ContainerPort: port.ContainerPort,+ Protocol: strings.ToLower(strings.TrimSpace(port.Protocol)),+ HostPorts: trueNASAppHostPortsFromAppHostPorts(port.HostPorts),+ })+ }+ if len(out) == 0 {+ return nil+ }+ return out+}++func trueNASAppHostPortsFromAppHostPorts(hostPorts []AppHostPort) []unifiedresources.TrueNASAppHostPort {+ if len(hostPorts) == 0 {+ return nil+ }+ out := make([]unifiedresources.TrueNASAppHostPort, 0, len(hostPorts))+ for _, hostPort := range hostPorts {+ if hostPort.HostPort == 0 && strings.TrimSpace(hostPort.HostIP) == "" {+ continue+ }+ out = append(out, unifiedresources.TrueNASAppHostPort{+ HostPort: hostPort.HostPort,+ HostIP: strings.TrimSpace(hostPort.HostIP),+ })+ }+ if len(out) == 0 {+ return nil+ }+ return out+}++func trueNASAppContainersFromAppContainers(containers []AppContainer) []unifiedresources.TrueNASAppContainer {+ if len(containers) == 0 {+ return nil+ }+ out := make([]unifiedresources.TrueNASAppContainer, 0, len(containers))+ for _, container := range containers {+ if strings.TrimSpace(container.ID) == "" && strings.TrimSpace(container.ServiceName) == "" {+ continue+ }+ out = append(out, unifiedresources.TrueNASAppContainer{+ ID: strings.TrimSpace(container.ID),+ ServiceName: strings.TrimSpace(container.ServiceName),+ Image: strings.TrimSpace(container.Image),+ State: strings.TrimSpace(container.State),+ PortConfig: trueNASAppPortsFromAppPorts(container.PortConfig),+ VolumeMounts: trueNASAppVolumesFromAppVolumes(container.VolumeMounts),+ })+ }+ if len(out) == 0 {+ return nil+ }+ return out+}++func trueNASAppVolumesFromAppVolumes(volumes []AppVolume) []unifiedresources.TrueNASAppVolume {+ if len(volumes) == 0 {+ return nil+ }+ out := make([]unifiedresources.TrueNASAppVolume, 0, len(volumes))+ for _, volume := range volumes {+ source := strings.TrimSpace(volume.Source)+ destination := strings.TrimSpace(volume.Destination)+ if source == "" && destination == "" {+ continue+ }+ out = append(out, unifiedresources.TrueNASAppVolume{+ Source: source,+ Destination: destination,+ Mode: strings.TrimSpace(volume.Mode),+ Type: strings.TrimSpace(volume.Type),+ })+ }+ if len(out) == 0 {+ return nil+ }+ return out+}++func trueNASAppNetworksFromAppNetworks(networks []AppNetwork) []unifiedresources.TrueNASAppNetwork {+ if len(networks) == 0 {+ return nil+ }+ out := make([]unifiedresources.TrueNASAppNetwork, 0, len(networks))+ for _, network := range networks {+ id := strings.TrimSpace(network.ID)+ name := strings.TrimSpace(network.Name)+ if id == "" && name == "" {+ continue+ }+ out = append(out, unifiedresources.TrueNASAppNetwork{+ ID: id,+ Name: name,+ Labels: copyStringLabels(network.Labels),+ })+ }+ if len(out) == 0 {+ return nil+ }+ return out+}++func copyStringLabels(labels map[string]string) map[string]string {+ if len(labels) == 0 {+ return nil+ }+ out := make(map[string]string, len(labels))+ for key, value := range labels {+ key = strings.TrimSpace(key)+ if key == "" {+ continue+ }+ out[key] = strings.TrimSpace(value)+ }+ if len(out) == 0 {+ return nil+ }+ return out+}+func appContainerState(app App) string {if len(app.Containers) > 0 {state := strings.ToLower(strings.TrimSpace(app.Containers[0].State))diff --git a/internal/truenas/provider_test.go b/internal/truenas/provider_test.goindex ee3b31c036..81a267175b 100644--- a/internal/truenas/provider_test.go+++ b/internal/truenas/provider_test.go@@ -707,6 +707,21 @@ func TestRecordsIncludeTrueNASAppsAsCanonicalWorkloads(t *testing.T) {if nextcloud.Resource.Docker.Runtime != "docker" {t.Fatalf("expected Nextcloud runtime docker, got %q", nextcloud.Resource.Docker.Runtime)}+ if nextcloud.Resource.TrueNAS == nil || nextcloud.Resource.TrueNAS.App == nil {+ t.Fatal("expected Nextcloud native TrueNAS app metadata")+ }+ if nextcloud.Resource.TrueNAS.App.ID != "nextcloud" || nextcloud.Resource.TrueNAS.App.Name != "Nextcloud" {+ t.Fatalf("unexpected Nextcloud native app identity: %+v", nextcloud.Resource.TrueNAS.App)+ }+ if nextcloud.Resource.TrueNAS.App.ContainerCount != 2 || len(nextcloud.Resource.TrueNAS.App.Containers) != 2 {+ t.Fatalf("expected Nextcloud native app containers, got %+v", nextcloud.Resource.TrueNAS.App)+ }+ if len(nextcloud.Resource.TrueNAS.App.Images) != 2 {+ t.Fatalf("expected Nextcloud native app images, got %+v", nextcloud.Resource.TrueNAS.App.Images)+ }+ if len(nextcloud.Resource.TrueNAS.App.Volumes) != 2 {+ t.Fatalf("expected Nextcloud native app volumes, got %+v", nextcloud.Resource.TrueNAS.App.Volumes)+ }if len(nextcloud.Resource.Docker.Ports) != 1 || nextcloud.Resource.Docker.Ports[0].PublicPort != 30443 {t.Fatalf("unexpected Nextcloud published ports: %+v", nextcloud.Resource.Docker.Ports)}diff --git a/internal/unifiedresources/canonical_identity_test.go b/internal/unifiedresources/canonical_identity_test.goindex d222b0817c..6e4217d3b2 100644--- a/internal/unifiedresources/canonical_identity_test.go+++ b/internal/unifiedresources/canonical_identity_test.go@@ -513,3 +513,59 @@ func TestRefreshCanonicalIdentityIgnoresVMwarePlacementDetailAliases(t *testing.}}}++func TestRefreshCanonicalIdentityPreservesTrueNASAppContainerIdentity(t *testing.T) {+ resource := Resource{+ ID: "truenas-app-nextcloud",+ Type: ResourceTypeAppContainer,+ Name: "Nextcloud",+ TrueNAS: &TrueNASData{+ Hostname: "truenas-a.local",+ App: &TrueNASApp{+ ID: "nextcloud",+ Name: "Nextcloud",+ },+ },+ MetricsTarget: &MetricsTarget{+ ResourceType: string(ResourceTypeAppContainer),+ ResourceID: "nextcloud",+ },+ }++ if got := ContractResourceType(resource); got != ResourceTypeAppContainer {+ t.Fatalf("ContractResourceType = %q, want %q", got, ResourceTypeAppContainer)+ }++ RefreshCanonicalIdentity(&resource)++ if resource.Canonical == nil {+ t.Fatalf("expected canonical identity")+ }+ if got := resource.Canonical.DisplayName; got != "Nextcloud" {+ t.Fatalf("displayName = %q, want Nextcloud", got)+ }+ if got := resource.Canonical.Hostname; got != "truenas-a.local" {+ t.Fatalf("hostname = %q, want truenas-a.local", got)+ }+ if got := resource.Canonical.PlatformID; got != "truenas-a.local" {+ t.Fatalf("platformId = %q, want truenas-a.local", got)+ }+ if got := resource.Canonical.PrimaryID; got != "app-container:nextcloud" {+ t.Fatalf("primaryId = %q, want app-container:nextcloud", got)+ }++ wantAliases := []string{+ "app-container:nextcloud",+ "nextcloud",+ "truenas-a.local",+ "truenas-app-nextcloud",+ }+ if len(resource.Canonical.Aliases) != len(wantAliases) {+ t.Fatalf("aliases len = %d, want %d (%v)", len(resource.Canonical.Aliases), len(wantAliases), resource.Canonical.Aliases)+ }+ for i, want := range wantAliases {+ if got := resource.Canonical.Aliases[i]; got != want {+ t.Fatalf("alias[%d] = %q, want %q", i, got, want)+ }+ }+}diff --git a/internal/unifiedresources/clone.go b/internal/unifiedresources/clone.goindex a2184619a4..f440d35900 100644--- a/internal/unifiedresources/clone.go+++ b/internal/unifiedresources/clone.go@@ -357,9 +357,65 @@ func cloneTrueNASData(in *TrueNASData) *TrueNASData {}out := *inout.StorageRisk = cloneStorageRisk(in.StorageRisk)+ out.App = cloneTrueNASApp(in.App)return &out}+func cloneTrueNASApp(in *TrueNASApp) *TrueNASApp {+ if in == nil {+ return nil+ }+ out := *in+ out.UsedHostIPs = append([]string(nil), in.UsedHostIPs...)+ out.UsedPorts = cloneTrueNASAppPorts(in.UsedPorts)+ out.Containers = cloneTrueNASAppContainers(in.Containers)+ out.Volumes = append([]TrueNASAppVolume(nil), in.Volumes...)+ out.Images = append([]string(nil), in.Images...)+ out.Networks = cloneTrueNASAppNetworks(in.Networks)+ if in.Stats != nil {+ stats := *in.Stats+ out.Stats = &stats+ }+ return &out+}++func cloneTrueNASAppPorts(in []TrueNASAppPort) []TrueNASAppPort {+ if len(in) == 0 {+ return nil+ }+ out := make([]TrueNASAppPort, len(in))+ for i := range in {+ out[i] = in[i]+ out[i].HostPorts = append([]TrueNASAppHostPort(nil), in[i].HostPorts...)+ }+ return out+}++func cloneTrueNASAppContainers(in []TrueNASAppContainer) []TrueNASAppContainer {+ if len(in) == 0 {+ return nil+ }+ out := make([]TrueNASAppContainer, len(in))+ for i := range in {+ out[i] = in[i]+ out[i].PortConfig = cloneTrueNASAppPorts(in[i].PortConfig)+ out[i].VolumeMounts = append([]TrueNASAppVolume(nil), in[i].VolumeMounts...)+ }+ return out+}++func cloneTrueNASAppNetworks(in []TrueNASAppNetwork) []TrueNASAppNetwork {+ if len(in) == 0 {+ return nil+ }+ out := make([]TrueNASAppNetwork, len(in))+ for i := range in {+ out[i] = in[i]+ out[i].Labels = cloneStringMap(in[i].Labels)+ }+ return out+}+func cloneCPUInfo(in *CPUInfo) *CPUInfo {if in == nil {return nildiff --git a/internal/unifiedresources/registry.go b/internal/unifiedresources/registry.goindex 586fe79b71..05c6c9d7ef 100644--- a/internal/unifiedresources/registry.go+++ b/internal/unifiedresources/registry.go@@ -1519,10 +1519,10 @@ func mergeProxmoxData(existing *ProxmoxData, incoming *ProxmoxData) *ProxmoxDatafunc mergeTrueNASData(existing *TrueNASData, incoming *TrueNASData) *TrueNASData {if existing == nil {- return incoming+ return cloneTrueNASData(incoming)}if incoming == nil {- return existing+ return cloneTrueNASData(existing)}merged := *existing@@ -1556,6 +1556,9 @@ func mergeTrueNASData(existing *TrueNASData, incoming *TrueNASData) *TrueNASDataif incoming.RebuildSummary != "" {merged.RebuildSummary = incoming.RebuildSummary}+ if incoming.App != nil {+ merged.App = cloneTrueNASApp(incoming.App)+ }return &merged}diff --git a/internal/unifiedresources/registry_merge_policy_test.go b/internal/unifiedresources/registry_merge_policy_test.goindex cf1126620f..8490ffc186 100644--- a/internal/unifiedresources/registry_merge_policy_test.go+++ b/internal/unifiedresources/registry_merge_policy_test.go@@ -124,6 +124,90 @@ func TestHostnameIPDoesNotAutoMerge(t *testing.T) {}}+func TestMergeTrueNASDataPreservesNativeAppFacetAsClone(t *testing.T) {+ existing := &TrueNASData{+ Hostname: "truenas-a.local",+ Version: "25.04.1",+ App: &TrueNASApp{+ ID: "old-app",+ Name: "Old App",+ },+ }+ incoming := &TrueNASData{+ Hostname: "truenas-b.local",+ App: &TrueNASApp{+ ID: "nextcloud",+ Name: "Nextcloud",+ State: "RUNNING",+ Images: []string{"nextcloud:stable"},+ Volumes: []TrueNASAppVolume{{Source: "ix-apps/nextcloud", Destination: "/data"}},+ Networks: []TrueNASAppNetwork{{Name: "ix-nextcloud", Labels: map[string]string{"app": "nextcloud"}}},+ UsedPorts: []TrueNASAppPort{+ {+ ContainerPort: 8080,+ Protocol: "tcp",+ HostPorts: []TrueNASAppHostPort{{HostIP: "0.0.0.0", HostPort: 30080}},+ },+ },+ Containers: []TrueNASAppContainer{+ {+ ID: "container-1",+ ServiceName: "web",+ Image: "nextcloud:stable",+ PortConfig: []TrueNASAppPort{+ {+ ContainerPort: 8080,+ Protocol: "tcp",+ HostPorts: []TrueNASAppHostPort{{HostIP: "0.0.0.0", HostPort: 30080}},+ },+ },+ VolumeMounts: []TrueNASAppVolume{{Source: "ix-apps/nextcloud", Destination: "/data"}},+ },+ },+ },+ }++ merged := mergeTrueNASData(existing, incoming)+ if merged == nil || merged.App == nil {+ t.Fatalf("expected merged TrueNAS app facet")+ }+ if got := merged.Hostname; got != "truenas-b.local" {+ t.Fatalf("hostname = %q, want incoming hostname", got)+ }+ if got := merged.Version; got != "25.04.1" {+ t.Fatalf("version = %q, want existing version preserved", got)+ }+ if got := merged.App.ID; got != "nextcloud" {+ t.Fatalf("app id = %q, want nextcloud", got)+ }++ incoming.App.Images[0] = "mutated:latest"+ incoming.App.Volumes[0].Source = "mutated"+ incoming.App.Networks[0].Labels["app"] = "mutated"+ incoming.App.UsedPorts[0].HostPorts[0].HostPort = 39999+ incoming.App.Containers[0].PortConfig[0].HostPorts[0].HostPort = 39999+ incoming.App.Containers[0].VolumeMounts[0].Source = "mutated"++ if got := merged.App.Images[0]; got != "nextcloud:stable" {+ t.Fatalf("merged app image mutated through incoming slice: %q", got)+ }+ if got := merged.App.Volumes[0].Source; got != "ix-apps/nextcloud" {+ t.Fatalf("merged app volume mutated through incoming slice: %q", got)+ }+ if got := merged.App.Networks[0].Labels["app"]; got != "nextcloud" {+ t.Fatalf("merged app network labels mutated through incoming map: %q", got)+ }+ if got := merged.App.UsedPorts[0].HostPorts[0].HostPort; got != 30080 {+ t.Fatalf("merged app host port mutated through incoming slice: %d", got)+ }+ if got := merged.App.Containers[0].PortConfig[0].HostPorts[0].HostPort; got != 30080 {+ t.Fatalf("merged app container port config mutated through incoming slice: %d", got)+ }+ if got := merged.App.Containers[0].VolumeMounts[0].Source; got != "ix-apps/nextcloud" {+ t.Fatalf("merged app container volume mount mutated through incoming slice: %q", got)+ }+}+func containsDataSource(sources []DataSource, want DataSource) bool {for _, source := range sources {if source == want {diff --git a/internal/unifiedresources/types.go b/internal/unifiedresources/types.goindex da7b905dda..1a6f74581b 100644--- a/internal/unifiedresources/types.go+++ b/internal/unifiedresources/types.go@@ -1027,7 +1027,7 @@ type VMwareData struct {SnapshotCount int `json:"snapshotCount,omitempty"`}-// TrueNASData contains TrueNAS-specific metadata for system host resources.+// TrueNASData contains TrueNAS-specific metadata for TrueNAS resources.type TrueNASData struct {Hostname string `json:"hostname,omitempty"`Version string `json:"version,omitempty"`@@ -1039,6 +1039,73 @@ type TrueNASData struct {ProtectionSummary string `json:"protectionSummary,omitempty"`RebuildInProgress bool `json:"rebuildInProgress,omitempty"`RebuildSummary string `json:"rebuildSummary,omitempty"`+ App *TrueNASApp `json:"app,omitempty"`+}++// TrueNASApp contains app.query / active_workloads data for one TrueNAS app.+type TrueNASApp struct {+ ID string `json:"id,omitempty"`+ Name string `json:"name,omitempty"`+ State string `json:"state,omitempty"`+ Version string `json:"version,omitempty"`+ HumanVersion string `json:"humanVersion,omitempty"`+ CustomApp bool `json:"customApp,omitempty"`+ UpgradeAvailable bool `json:"upgradeAvailable,omitempty"`+ ImageUpdatesAvailable bool `json:"imageUpdatesAvailable,omitempty"`+ Notes string `json:"notes,omitempty"`+ ContainerCount int `json:"containerCount,omitempty"`+ UsedHostIPs []string `json:"usedHostIps,omitempty"`+ UsedPorts []TrueNASAppPort `json:"usedPorts,omitempty"`+ Containers []TrueNASAppContainer `json:"containers,omitempty"`+ Volumes []TrueNASAppVolume `json:"volumes,omitempty"`+ Images []string `json:"images,omitempty"`+ Networks []TrueNASAppNetwork `json:"networks,omitempty"`+ Stats *TrueNASAppStats `json:"stats,omitempty"`+}++// TrueNASAppStats contains app.stats telemetry metadata that is not already+// normalized into top-level Resource metrics.+type TrueNASAppStats struct {+ IntervalSeconds int `json:"intervalSeconds,omitempty"`+ CollectedAt time.Time `json:"collectedAt,omitempty"`+}++// TrueNASAppPort describes a TrueNAS app published port entry.+type TrueNASAppPort struct {+ ContainerPort int `json:"containerPort,omitempty"`+ Protocol string `json:"protocol,omitempty"`+ HostPorts []TrueNASAppHostPort `json:"hostPorts,omitempty"`+}++// TrueNASAppHostPort describes a host binding for a TrueNAS app port.+type TrueNASAppHostPort struct {+ HostPort int `json:"hostPort,omitempty"`+ HostIP string `json:"hostIp,omitempty"`+}++// TrueNASAppContainer describes a runtime container inside a TrueNAS app.+type TrueNASAppContainer struct {+ ID string `json:"id,omitempty"`+ ServiceName string `json:"serviceName,omitempty"`+ Image string `json:"image,omitempty"`+ State string `json:"state,omitempty"`+ PortConfig []TrueNASAppPort `json:"portConfig,omitempty"`+ VolumeMounts []TrueNASAppVolume `json:"volumeMounts,omitempty"`+}++// TrueNASAppVolume describes a TrueNAS app volume or bind mount.+type TrueNASAppVolume struct {+ Source string `json:"source,omitempty"`+ Destination string `json:"destination,omitempty"`+ Mode string `json:"mode,omitempty"`+ Type string `json:"type,omitempty"`+}++// TrueNASAppNetwork describes a network attached to a TrueNAS app workload.+type TrueNASAppNetwork struct {+ ID string `json:"id,omitempty"`+ Name string `json:"name,omitempty"`+ Labels map[string]string `json:"labels,omitempty"`}// AvailabilityData contains agentless endpoint probe metadata for a resource.