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
Avoid full-estate settings hydration
Richard Courtman1e805afc4b54
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.mdindex 87aca9bab8..20e2a943e2 100644--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md@@ -643,6 +643,11 @@ update, profile rollout, command reachability, or fleet-control authority.10. `frontend-modern/src/components/Settings/NodeModalSetupGuideSection.tsx` shared with `api-contracts`: the node setup guide section is both an agent lifecycle control surface and a shared API-backed install/setup contract boundary.11. `frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx` shared with `api-contracts`: the node setup status/footer section is both an agent lifecycle control surface and a shared API-backed install/setup contract boundary.12. `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts` shared with `api-contracts`: the direct-node infrastructure settings state hook is both an agent lifecycle control surface and a shared Proxmox node API contract boundary.+ Because the Settings shell retains this hook on every settings route, its+ unified-resource dependency must remain bounded to `type=agent` and gated+ by infrastructure-read authority. Estate-wide node and guest license+ counts come from the list response's canonical aggregations; this lifecycle+ state must not hydrate every workload merely to count them.13. `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts` shared with `api-contracts`: the infrastructure discovery runtime state hook is both an agent lifecycle control surface and a shared discovery/settings API contract boundary.14. `frontend-modern/src/components/Settings/useInfrastructureInstallState.tsx` shared with `api-contracts`: the infrastructure install state hook is both an agent fleet lifecycle control surface and an API token, lookup, and install transport contract boundary.15. `frontend-modern/src/components/Settings/useInfrastructureOperationsState.tsx` shared with `api-contracts`: the shared infrastructure operations state hook is both an agent fleet lifecycle control surface and an API token, lookup, assignment, and reporting/install contract boundary.diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.mdindex 2ae4194cd4..cb36bacc3d 100644--- a/docs/release-control/v6/internal/subsystems/api-contracts.md+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md@@ -1476,6 +1476,10 @@ payload shape change when the portal presents compact client rows.25. `frontend-modern/src/components/Settings/NodeModalStatusFooter.tsx` shared with `agent-lifecycle`: the node setup status/footer section is both an agent lifecycle control surface and a shared API-backed install/setup contract boundary.26. `frontend-modern/src/components/Settings/useAPITokenManagerState.ts` shared with `security-privacy`: the API token settings state hook is both a security/privacy control surface and a canonical API payload contract boundary.27. `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts` shared with `agent-lifecycle`: the direct-node infrastructure settings state hook is both an agent lifecycle control surface and a shared Proxmox node API contract boundary.+ Its retained settings-shell read uses an authority-gated `type=agent`+ unified-resource query for node status and the canonical response+ aggregations for estate counts. It must not restore an unfiltered+ all-resource read on unrelated Settings routes.28. `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts` shared with `agent-lifecycle`: the infrastructure discovery runtime state hook is both an agent lifecycle control surface and a shared discovery/settings API contract boundary.That same shared boundary also owns settings-route polling scope for discovery payloads: the `/api/discover` refresh loop and websocket-backed discovery status hydration may run only while the operator is on the canonical Infrastructure settings workspace at `/settings/infrastructure`, not on retired infrastructure sub-routes.Discovery refreshes and scan results are route-scoped state updates. If the@@ -2618,6 +2622,11 @@ a new API state machine, queue contract, or verification-accounting field.verification adapters, but they must remain read-only views of the canonicalaction audit and lifecycle trail rather than a second audit store.6. Route dedicated unified-resource timeline and facet-bundle reads through `frontend-modern/src/api/resources.ts`, `internal/api/resourceapi/resources.go`, and `internal/api/contract_test.go` together so the backend facet contract and the frontend client stay aligned on one timeline-first surface, while capability and relationship detail stays backend-owned for AI correlation and change detection.+ Compact aggregate consumers must read `GET /api/resources/stats` through+ `ResourceAPI.getStats()` rather than paging `/api/resources` and discarding+ every row. The stats client preserves the backend-owned total, type, status,+ source, and policy-posture contract while keeping aggregate-only settings+ surfaces independent from estate size.`/api/resources/{id}/timeline` and `/api/resources/{id}/facets` must keepresource timelines relationship-aware by opting into the canonical`ResourceChangeFilters.IncludeRelated` store path, so a resource timelinediff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex a785774f87..be04d370bb 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -1228,6 +1228,12 @@ not a replacement status card, CTA band, or page-local nested card.Settings selection helpers such as `ResourcePicker` must use the same`Button` primitive for select-all, clear, and chip remove actions instead ofrestoring footer-local action shells.+ The picker must also keep initial all-resource hydration distinct from a+ genuinely empty estate: while the shared resource source is loading it+ presents a status placeholder, and only renders its empty-state copy after+ hydration completes. Intentional all-resource consumers use the shared+ websocket-first/canonical-REST race rather than waiting for every REST page+ before their first usable snapshot.Reporting surfaces must use the same primitive for retry, generate, andexport actions rather than restoring large local CTA button shells.Self-hosted commercial plan, retry, activation, and clear-key actions followdiff --git a/docs/release-control/v6/internal/subsystems/security-privacy.md b/docs/release-control/v6/internal/subsystems/security-privacy.mdindex e2c89fe77e..ada0847c6b 100644--- a/docs/release-control/v6/internal/subsystems/security-privacy.md+++ b/docs/release-control/v6/internal/subsystems/security-privacy.md@@ -538,7 +538,7 @@ the `white_label` branding entitlement.`pkg/tlsutil/fingerprint.go` together so startup auth ingestion, liveauth-env reloads, hosted entitlement refresh origins, andpinned-fingerprint TLS clients keep one fail-closed security floor.-9. Change operator-facing Resource Privacy/Data Handling posture through `frontend-modern/src/components/Settings/DataHandlingPanel.tsx` and `frontend-modern/src/components/Settings/dataHandlingPanelModel.ts` together so resource classification, handling-boundary, redaction copy, and the route-backed/hidden-sidebar presentation stay governed as a trust surface.+9. Change operator-facing Resource Privacy/Data Handling posture through `frontend-modern/src/components/Settings/DataHandlingPanel.tsx` and `frontend-modern/src/components/Settings/dataHandlingPanelModel.ts` together so resource classification, handling-boundary, redaction copy, and the route-backed/hidden-sidebar presentation stay governed as a trust surface. The panel must consume the compact backend-owned policy posture through `frontend-modern/src/hooks/useResourceStats.ts` and `ResourceAPI.getStats()`; it must not hydrate and adapt every unified-resource row merely to display aggregate privacy counts.10. Change inside-guest runtime collection boundaries through `docs/AGENT_SECURITY.md`, `docs/UNIFIED_AGENT.md`, `cmd/pulse-agent/main.go`, `internal/api/router.go`, and `internal/config/config.go` together. Docker / Podman inventory inside a VM or LXC may come from a guest-local `pulse-agent` module or explicitly reported guest data; LXC Docker inventory may also be collected by a Proxmox host agent only through explicit server opt-in, with optional VMID allowlisting and a minimal summary command set that avoids `docker inspect`, environment, mount, file, command, and process collection. Local Unified Agent Docker / Podman disables must not be reversed by remote profile configuration, and self-test/update preflight that needs the live runtime token must pass it through a short-lived token file rather than argv. The `--enable-docker` help line is part of that operator privacy control, so it must remain "Enable Docker / Podman Agent module" instead of exposing internal collection-module wording. The `--enable-commands` help line and installer disclosure must identify Pulse command execution as disabled by default and required for Patrol actions or the explicit Proxmox LXC Docker inventory path, not as implicit guest access.Node-local LXC filesystem capacity is a distinct automatic host telemetryboundary, not inside-guest command authority. A PVE Unified Agent may usediff --git a/frontend-modern/browser-verification.json b/frontend-modern/browser-verification.jsonindex 1b9644a80c..6b315f28d4 100644--- a/frontend-modern/browser-verification.json+++ b/frontend-modern/browser-verification.json@@ -1,43 +1,34 @@{"version": 1,- "base_sha": "36dd5b9119971620a5cdd3cc791f4d555f71160e",- "verified_at": "2026-08-30T08:31:50Z",+ "base_sha": "87fda2a235a34bf62071458795237856ac16650d",+ "verified_at": "2026-08-30T08:55:33Z","result": "passed","changed_paths": [- "frontend-modern/src/features/docker/DockerPageSurface.tsx",- "frontend-modern/src/features/docker/dockerPageModel.ts",- "frontend-modern/src/features/kubernetes/KubernetesPageSurface.tsx",- "frontend-modern/src/features/kubernetes/kubernetesPageModel.ts",- "frontend-modern/src/features/truenas/TrueNASPageSurface.tsx",- "frontend-modern/src/features/truenas/truenasPageModel.ts",- "frontend-modern/src/features/vmware/VmwarePageSurface.tsx",- "frontend-modern/src/features/vmware/vmwarePageModel.ts",- "frontend-modern/src/hooks/useUnifiedResources.ts",- "frontend-modern/src/types/api.ts"+ "frontend-modern/src/api/resources.ts",+ "frontend-modern/src/components/Settings/DataHandlingPanel.tsx",+ "frontend-modern/src/components/Settings/ResourcePicker.tsx",+ "frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts",+ "frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts",+ "frontend-modern/src/hooks/useResourceStats.ts",+ "frontend-modern/src/hooks/useResources.ts"],"content_sha256": {- "frontend-modern/src/features/docker/DockerPageSurface.tsx": "9e3ae4cf49e50ce5870ddfed517057423ed00d4efdf6a3cbcd669497bda526b6",- "frontend-modern/src/features/docker/dockerPageModel.ts": "a6f64a80a91e0f75f0f13397c9eb25ee5c993e012c08da3fd43888d3d99ccdc3",- "frontend-modern/src/features/kubernetes/KubernetesPageSurface.tsx": "f464792ae1301cb7db93b904b9a544d046268cc3cabaa179f647aeb3fbf6a8f7",- "frontend-modern/src/features/kubernetes/kubernetesPageModel.ts": "3b79fb6f9eddc5d3b593fc78412c94310175bf7a15f41fa44e9c06319608111a",- "frontend-modern/src/features/truenas/TrueNASPageSurface.tsx": "db085a6496c5af4dae90bf7cb8583270e528e1de23e399088486706cafce36ff",- "frontend-modern/src/features/truenas/truenasPageModel.ts": "2e7bf5d00bd4570524faeac6bb27a4714364d0796a598801729d2e1a113c5d6f",- "frontend-modern/src/features/vmware/VmwarePageSurface.tsx": "40f325c9e2dc7f67d0db748475a9da0000fb75bfcccbb8cfeb4a16a0935eb7de",- "frontend-modern/src/features/vmware/vmwarePageModel.ts": "1b01b0655575d477a60aa030eeb2ec793a9404934959b0234e75f65b568187cc",- "frontend-modern/src/hooks/useUnifiedResources.ts": "44c4dcaa542bf0775c9c53f18769b28a1ef5ecba0cb5c62174b89cdf5416ab4b",- "frontend-modern/src/types/api.ts": "c4c830f7796a4dab8abad12cef96872581f2ac4e5ef5eb72840a3031db57069e"+ "frontend-modern/src/api/resources.ts": "08a29f4efc054188e378f5eecb94c2cad4884c8a20fc31f97c3242a72099cdde",+ "frontend-modern/src/components/Settings/DataHandlingPanel.tsx": "ce04993e9a017890a7098cf15ee518701d3ecbbbd6eac91520c0c7674a86c98c",+ "frontend-modern/src/components/Settings/ResourcePicker.tsx": "2e33b23cfd257222996a2adb9102b80f36ed26d0039c449c3111162ed7da13b7",+ "frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts": "f9fca9e1b66f7d2f020a52a0e873da7371f649c4f37c8a7df08e627b2a1e77f2",+ "frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts": "744ffef0c69a2113d12192698258e4296fd8a03fdf9a227bc9c0ab0ed250b5d7",+ "frontend-modern/src/hooks/useResourceStats.ts": "b3d4e3777096dd1933a2e2c53af822052ddddb4563a9ccd1bc4c16677d191ec6",+ "frontend-modern/src/hooks/useResources.ts": "142ee968fdfdeb1281feb6b04beee23c1556db42a118e47e8063b6f151d1c24a"},"routes": [- "/vmware/overview",- "/vmware/storage",- "/docker/images",- "/kubernetes/configuration",- "/truenas/vms"+ "/settings/security-data-handling",+ "/patrol"],"viewports": [{- "width": 1280,- "height": 720+ "width": 1440,+ "height": 900},{"width": 390,@@ -45,18 +36,16 @@}],"states": [- "vSphere Overview settled with 7 ESXi hosts and 18 virtual machines without rendering the false No vSphere VMs state",- "vSphere Datastores settled with 8 rows while retaining all evidence-gated VMware workflow tabs",- "Docker Images settled with 10 image rows while retaining Overview, Storage, Networks, and Swarm navigation",- "Kubernetes Configuration settled with 10 configuration and policy rows while retaining all Kubernetes workflows",- "TrueNAS VMs settled with 2 rows and did not preload recovery inventory",- "narrow vSphere Overview retained the complete tab strip, responsive host columns, VM table rows, and no false empty state"+ "Resource Privacy cold direct load settled with 1,855 governed resources and rendered the aggregate posture without a false empty state",+ "Resource Privacy desktop and narrow layouts retained the complete policy summary, posture cards, scrolling, and viewport fit without horizontal overflow",+ "Patrol Protection objective dialog opened the resource scope picker with 1,503 populated resources instead of an empty placeholder",+ "resource picker desktop and narrow layouts retained search, type filters, bounded list scrolling, selection state, dialog controls, and viewport fit"],"interactions": [- "loaded each provider workflow as a direct route against the exact isolated frontend and backend build",- "traced network requests and confirmed each sampled route issued only its declared resource-type query",- "confirmed VMware used a one-row activity evidence request on non-Activity routes instead of preloading the 100-row timeline",- "confirmed TrueNAS VMs issued no recovery request outside Protection",- "inspected the rendered desktop routes and a 390 by 844 vSphere screenshot for populated state, tab continuity, fit, and clipping"+ "loaded Resource Privacy as a cold direct route against the exact isolated frontend and backend build",+ "traced the cold Resource Privacy request set and confirmed only the compact /api/resources/stats read plus one type=agent settings-status page, with no unfiltered paginated resource hydration",+ "opened Patrol Protection, opened Add objective, expanded Limit to specific resources, searched for esxi-07.lab.local, and selected the matching resource",+ "dismissed the objective dialog and confirmed focus returned to Add objective",+ "inspected Resource Privacy and the expanded resource picker at 1440 by 900 and 390 by 844 for populated state, responsive fit, clipping, scrolling, and control availability"]}diff --git a/frontend-modern/src/api/__tests__/resources.test.ts b/frontend-modern/src/api/__tests__/resources.test.tsindex 7f4a75274d..2f0e3f2978 100644--- a/frontend-modern/src/api/__tests__/resources.test.ts+++ b/frontend-modern/src/api/__tests__/resources.test.ts@@ -11,6 +11,27 @@ describe('ResourceAPI', () => {vi.clearAllMocks();});+ it('fetches compact resource stats without hydrating list pages', async () => {+ const stats = {+ total: 1200,+ byType: { vm: 900, agent: 300 },+ byStatus: { running: 850, online: 300, stopped: 50 },+ bySource: { proxmox: 1200 },+ policyPosture: {+ totalResources: 1200,+ sensitivityCounts: { internal: 1200 },+ routingCounts: { 'cloud-summary': 1200 },+ redactionCounts: {},+ },+ };+ vi.mocked(apiFetchJSON).mockResolvedValueOnce(stats);++ await expect(ResourceAPI.getStats()).resolves.toEqual(stats);+ expect(apiFetchJSON).toHaveBeenCalledWith('/api/resources/stats', {+ cache: 'no-store',+ });+ });+it('fetches the resource history bundle from the facet endpoint', async () => {vi.mocked(apiFetchJSON).mockResolvedValueOnce({resourceId: 'vm:42',diff --git a/frontend-modern/src/api/resources.ts b/frontend-modern/src/api/resources.tsindex 6a96be1852..060923f538 100644--- a/frontend-modern/src/api/resources.ts+++ b/frontend-modern/src/api/resources.ts@@ -7,8 +7,17 @@ import type {ResourceChangeSourceType,ResourceFacetCounts,ResourceRelationship,+ ResourcePolicyPostureSummary,} from '@/types/resource';+export interface ResourceStatsResponse {+ total: number;+ byType: Record<string, number>;+ byStatus: Record<string, number>;+ bySource: Record<string, number>;+ policyPosture: ResourcePolicyPostureSummary;+}+export interface ResourceTimelineQueryOptions {since?: string | number | Date;limit?: number;@@ -65,6 +74,10 @@ const fetchFacet = async <T>(url: string): Promise<T> =>});export class ResourceAPI {+ static async getStats(): Promise<ResourceStatsResponse> {+ return fetchFacet<ResourceStatsResponse>('/api/resources/stats');+ }+static async getGlobalTimeline(options?: ResourceTimelineQueryOptions,): Promise<ResourceTimelineResponse> {diff --git a/frontend-modern/src/components/Settings/DataHandlingPanel.tsx b/frontend-modern/src/components/Settings/DataHandlingPanel.tsxindex af1a73b7e7..afdc65bca0 100644--- a/frontend-modern/src/components/Settings/DataHandlingPanel.tsx+++ b/frontend-modern/src/components/Settings/DataHandlingPanel.tsx@@ -6,7 +6,7 @@ import Info from 'lucide-solid/icons/info';import Lock from 'lucide-solid/icons/lock';import RefreshCw from 'lucide-solid/icons/refresh-cw';import ShieldCheck from 'lucide-solid/icons/shield-check';-import { useUnifiedResources } from '@/hooks/useUnifiedResources';+import { useResourceStats } from '@/hooks/useResourceStats';import { Button, ButtonLink } from '@/components/shared/Button';import SettingsPanel from '@/components/shared/SettingsPanel';import {@@ -143,7 +143,7 @@ const PostureMeter: Component<{ item: DataHandlingPostureItem }> = (props) => ();export const DataHandlingPanel: Component = () => {- const resources = useUnifiedResources({ query: '', cacheKey: 'all-resources' });+ const resources = useResourceStats();const model = createMemo(() => buildDataHandlingPanelModel(resources.policyPosture()));const errorMessage = createMemo(() => {const error = resources.error();diff --git a/frontend-modern/src/components/Settings/ResourcePicker.tsx b/frontend-modern/src/components/Settings/ResourcePicker.tsxindex aebe33ee97..a250dda1e1 100644--- a/frontend-modern/src/components/Settings/ResourcePicker.tsx+++ b/frontend-modern/src/components/Settings/ResourcePicker.tsx@@ -39,7 +39,7 @@ interface ResourcePickerProps {}export function ResourcePicker(props: ResourcePickerProps) {- const { resources } = useResources();+ const { resources, loading } = useResources();const [search, setSearch] = createSignal('');const [typeFilter, setTypeFilter] = createSignal<TypeFilter>('all');const [tagFilter, setTagFilter] = createSignal('');@@ -181,91 +181,125 @@ export function ResourcePicker(props: ResourcePickerProps) {{/* Resource list */}<div class="border border-border rounded-md overflow-hidden"><Show- when={reportableResources().length > 0}+ when={!loading() || reportableResources().length > 0}fallback={- <div class="p-8 text-center text-slate-400">- <p class="text-sm">{getResourcePickerEmptyState(false).title}</p>- <p class="text-xs mt-1 text-muted">- {getResourcePickerEmptyState(false).description}- </p>+ <div class="p-8 text-center text-sm text-muted" role="status">+ Loading resources…</div>}><Show- when={filteredResources().length > 0}+ when={reportableResources().length > 0}fallback={- <div class="p-6 text-center text-slate-400 text-sm">- {getResourcePickerEmptyState(true).title}+ <div class="p-8 text-center text-slate-400">+ <p class="text-sm">{getResourcePickerEmptyState(false).title}</p>+ <p class="text-xs mt-1 text-muted">+ {getResourcePickerEmptyState(false).description}+ </p></div>}>- <div class="max-h-[300px] overflow-y-auto">- <PlatformWindowedList- items={filteredResources}- estimatedItemHeight={56}- enableThreshold={16}- windowSize={20}- >- {(resource) => {- const badge = getResourceTypePresentation(resource.type) || {- label: resource.type,- badgeClasses: 'bg-slate-500 text-slate-400',- };- return (- <button- class={`w-full flex items-start sm:items-center gap-3 px-3 py-2 text-left transition-colors border-b border-border last:border-b-0 ${- isSelected(resource.id) ? 'bg-blue-600' : 'hover:bg-slate-800'- }`}- onClick={() => toggleResource(resource)}- >- {/* Checkbox */}- <div- class={`w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center ${- isSelected(resource.id)- ? 'bg-blue-600 border-blue-600'- : 'border-slate-600'+ <Show+ when={filteredResources().length > 0}+ fallback={+ <div class="p-6 text-center text-slate-400 text-sm">+ {getResourcePickerEmptyState(true).title}+ </div>+ }+ >+ <div class="max-h-[300px] overflow-y-auto">+ <PlatformWindowedList+ items={filteredResources}+ estimatedItemHeight={56}+ enableThreshold={16}+ windowSize={20}+ >+ {(resource) => {+ const badge = getResourceTypePresentation(resource.type) || {+ label: resource.type,+ badgeClasses: 'bg-slate-500 text-slate-400',+ };+ return (+ <button+ class={`w-full flex items-start sm:items-center gap-3 px-3 py-2 text-left transition-colors border-b border-border last:border-b-0 ${+ isSelected(resource.id) ? 'bg-blue-600' : 'hover:bg-slate-800'}`}+ onClick={() => toggleResource(resource)}>- <Show when={isSelected(resource.id)}>- <svg- class="w-3 h-3 text-white"- fill="none"- viewBox="0 0 24 24"- stroke="currentColor"- stroke-width="3"- >- <path- stroke-linecap="round"- stroke-linejoin="round"- d="M5 13l4 4L19 7"- />- </svg>- </Show>- </div>-- {/* Status dot */}- <StatusDot- variant={getSimpleStatusIndicator(resource.status).variant}- size="sm"- ariaHidden- />-- {/* Name and ID */}- <div class="flex-1 min-w-0">+ {/* Checkbox */}<div- class="text-sm text-white sm:truncate break-words"- title={getPreferredInfrastructureDisplayName(resource)}+ class={`w-4 h-4 rounded border flex-shrink-0 flex items-center justify-center ${+ isSelected(resource.id)+ ? 'bg-blue-600 border-blue-600'+ : 'border-slate-600'+ }`}>- {getPreferredInfrastructureDisplayName(resource)}+ <Show when={isSelected(resource.id)}>+ <svg+ class="w-3 h-3 text-white"+ fill="none"+ viewBox="0 0 24 24"+ stroke="currentColor"+ stroke-width="3"+ >+ <path+ stroke-linecap="round"+ stroke-linejoin="round"+ d="M5 13l4 4L19 7"+ />+ </svg>+ </Show></div>- <div class="text-xs text-muted sm:truncate break-all" title={resource.id}>- {resource.id}++ {/* Status dot */}+ <StatusDot+ variant={getSimpleStatusIndicator(resource.status).variant}+ size="sm"+ ariaHidden+ />++ {/* Name and ID */}+ <div class="flex-1 min-w-0">+ <div+ class="text-sm text-white sm:truncate break-words"+ title={getPreferredInfrastructureDisplayName(resource)}+ >+ {getPreferredInfrastructureDisplayName(resource)}+ </div>+ <div class="text-xs text-muted sm:truncate break-all" title={resource.id}>+ {resource.id}+ </div>+ <div class="mt-1 flex flex-wrap items-center gap-1 sm:hidden">+ <span class={`text-xs px-2 py-0.5 rounded-full ${badge.badgeClasses}`}>+ {badge.label}+ </span>+ <Show when={resource.tags && resource.tags.length > 0}>+ <For each={resource.tags?.slice(0, 2)}>+ {(tag) => (+ <span class="text-xs px-1.5 py-0.5 rounded bg-surface-hover text-slate-300">+ {tag}+ </span>+ )}+ </For>+ <Show when={(resource.tags?.length ?? 0) > 2}>+ <span class="text-xs text-muted">+ +{(resource.tags?.length ?? 0) - 2}+ </span>+ </Show>+ </Show>+ </div></div>- <div class="mt-1 flex flex-wrap items-center gap-1 sm:hidden">- <span class={`text-xs px-2 py-0.5 rounded-full ${badge.badgeClasses}`}>- {badge.label}- </span>- <Show when={resource.tags && resource.tags.length > 0}>++ {/* Type badge */}+ <span+ class={`hidden sm:inline-flex text-xs px-2 py-0.5 rounded-full flex-shrink-0 ${badge.badgeClasses}`}+ >+ {badge.label}+ </span>++ {/* Tags */}+ <Show when={resource.tags && resource.tags.length > 0}>+ <div class="hidden sm:flex gap-1 flex-shrink-0"><For each={resource.tags?.slice(0, 2)}>{(tag) => (<span class="text-xs px-1.5 py-0.5 rounded bg-surface-hover text-slate-300">@@ -278,39 +312,14 @@ export function ResourcePicker(props: ResourcePickerProps) {+{(resource.tags?.length ?? 0) - 2}</span></Show>- </Show>- </div>- </div>-- {/* Type badge */}- <span- class={`hidden sm:inline-flex text-xs px-2 py-0.5 rounded-full flex-shrink-0 ${badge.badgeClasses}`}- >- {badge.label}- </span>-- {/* Tags */}- <Show when={resource.tags && resource.tags.length > 0}>- <div class="hidden sm:flex gap-1 flex-shrink-0">- <For each={resource.tags?.slice(0, 2)}>- {(tag) => (- <span class="text-xs px-1.5 py-0.5 rounded bg-surface-hover text-slate-300">- {tag}- </span>- )}- </For>- <Show when={(resource.tags?.length ?? 0) > 2}>- <span class="text-xs text-muted">- +{(resource.tags?.length ?? 0) - 2}- </span>- </Show>- </div>- </Show>- </button>- );- }}- </PlatformWindowedList>- </div>+ </div>+ </Show>+ </button>+ );+ }}+ </PlatformWindowedList>+ </div>+ </Show></Show></Show></div>diff --git a/frontend-modern/src/components/Settings/__tests__/DataHandlingPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/DataHandlingPanel.test.tsxindex de77fe857b..91e163df84 100644--- a/frontend-modern/src/components/Settings/__tests__/DataHandlingPanel.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/DataHandlingPanel.test.tsx@@ -3,19 +3,19 @@ import { cleanup, render, screen } from '@solidjs/testing-library';import { Route, Router } from '@solidjs/router';import { DataHandlingPanel } from '../DataHandlingPanel';-const unifiedResourcesState = vi.hoisted(() => ({+const resourceStatsState = vi.hoisted(() => ({error: null as unknown,loading: false,policyPosture: null as unknown,refetch: vi.fn(),}));-vi.mock('@/hooks/useUnifiedResources', () => ({- useUnifiedResources: () => ({- error: () => unifiedResourcesState.error,- loading: () => unifiedResourcesState.loading,- policyPosture: () => unifiedResourcesState.policyPosture,- refetch: unifiedResourcesState.refetch,+vi.mock('@/hooks/useResourceStats', () => ({+ useResourceStats: () => ({+ error: () => resourceStatsState.error,+ loading: () => resourceStatsState.loading,+ policyPosture: () => resourceStatsState.policyPosture,+ refetch: resourceStatsState.refetch,}),}));@@ -28,15 +28,15 @@ const renderPanel = () =>describe('DataHandlingPanel', () => {beforeEach(() => {- unifiedResourcesState.error = null;- unifiedResourcesState.loading = false;- unifiedResourcesState.policyPosture = {+ resourceStatsState.error = null;+ resourceStatsState.loading = false;+ resourceStatsState.policyPosture = {totalResources: 0,sensitivityCounts: {},routingCounts: {},redactionCounts: {},};- unifiedResourcesState.refetch.mockReset();+ resourceStatsState.refetch.mockReset();});afterEach(() => {@@ -60,7 +60,7 @@ describe('DataHandlingPanel', () => {});it('shows policy posture metrics once resources exist', () => {- unifiedResourcesState.policyPosture = {+ resourceStatsState.policyPosture = {totalResources: 4,sensitivityCounts: {internal: 1,diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsxindex 66b59abf6e..a598e639b3 100644--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureOperationsModel.test.tsx@@ -372,6 +372,15 @@ describe('infrastructure operations model', () => {expect(useInfrastructureConfiguredNodesStateSource).not.toContain('...nodeData,');});+ it('keeps the retained settings state off the full-estate resource list', () => {+ expect(useInfrastructureConfiguredNodesStateSource).toContain("query: 'type=agent'");+ expect(useInfrastructureConfiguredNodesStateSource).toContain(+ "cacheKey: 'settings-configured-nodes'",+ );+ expect(useInfrastructureConfiguredNodesStateSource).toContain('aggregations()?.byType[type]');+ expect(useInfrastructureConfiguredNodesStateSource).not.toContain('useResources');+ });+it('delegates install-token scopes to the server mint endpoint', () => {// The server decides scopes from the command-execution choice at mint// time (#1586); the frontend must not compose install-token scope lists.diff --git a/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx b/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsxindex 739b5717ec..9b16a92e60 100644--- a/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx+++ b/frontend-modern/src/components/Settings/__tests__/ResourcePicker.test.tsx@@ -6,11 +6,13 @@ import resourcePickerSource from '../ResourcePicker.tsx?raw';import { ResourcePicker, type SelectedResource } from '../ResourcePicker';let mockResources: Resource[] = [];+let mockLoading = false;const showWarningMock = vi.fn();vi.mock('@/hooks/useResources', () => ({useResources: () => ({resources: () => mockResources,+ loading: () => mockLoading,}),}));@@ -68,6 +70,7 @@ const renderPickerWithOptions = (beforeEach(() => {showWarningMock.mockReset();mockResources = [];+ mockLoading = false;});afterEach(() => {@@ -80,6 +83,15 @@ describe('ResourcePicker', () => {expect(resourcePickerSource).toContain('estimatedItemHeight={56}');});+ it('keeps the initial hydration state distinct from a genuinely empty estate', () => {+ mockLoading = true;++ renderPicker();++ expect(screen.getByRole('status')).toHaveTextContent('Loading resources…');+ expect(screen.queryByText('No resources available')).not.toBeInTheDocument();+ });+it('renders reportable resources from useResources()', async () => {mockResources = [makeResource({diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.tsindex 977985cce8..496cc49732 100644--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts@@ -98,6 +98,7 @@ import reportingStateSource from '../useReportingPanelState.ts?raw';import ssoProvidersPanelSource from '../SSOProvidersPanel.tsx?raw';import ssoProvidersStateSource from '../useSSOProvidersState.ts?raw';import useInfrastructureInstallStateSource from '../useInfrastructureInstallState.tsx?raw';+import useInfrastructureConfiguredNodesStateSource from '../useInfrastructureConfiguredNodesState.ts?raw';import useInfrastructureSettingsStateSource from '../useInfrastructureSettingsState.ts?raw';import infrastructureOnboardingPresentationSource from '../../../utils/infrastructureOnboardingPresentation.ts?raw';import selfHostedBillingPresentationSource from '../selfHostedBillingPresentation.ts?raw';@@ -473,6 +474,24 @@ describe('settings architecture guardrails', () => {expect(dataHandlingPanelSource).toContain('Read-only resource privacy posture');expect(dataHandlingPanelSource).toContain('<PolicyScopeSummary />');expect(dataHandlingPanelSource).toContain('<EmptyPolicyPostureState />');+ expect(dataHandlingPanelSource).toContain('useResourceStats()');+ expect(dataHandlingPanelSource).not.toContain('useUnifiedResources');+ });++ it('keeps retained settings inventory scoped to configured agent nodes', () => {+ expect(useInfrastructureSettingsStateSource).toContain('canReadInfrastructure,');+ expect(useInfrastructureConfiguredNodesStateSource).toContain("query: 'type=agent'");+ expect(useInfrastructureConfiguredNodesStateSource).toContain(+ "cacheKey: 'settings-configured-nodes'",+ );+ expect(useInfrastructureConfiguredNodesStateSource).toContain(+ "initialHydration: 'prefer-ws-then-rest'",+ );+ expect(useInfrastructureConfiguredNodesStateSource).toContain('enabled: canReadInfrastructure');+ expect(useInfrastructureConfiguredNodesStateSource).toContain(+ 'configuredNodeResources.aggregations()?.byType[type]',+ );+ expect(useInfrastructureConfiguredNodesStateSource).not.toContain('useResources()');});it('keeps default self-hosted commercial copy opt-in from shared settings primitives', () => {diff --git a/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts b/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.tsindex eced6541fa..13b4118448 100644--- a/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts+++ b/frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts@@ -2,9 +2,10 @@ import { Accessor, Setter, createEffect, createMemo, createSignal, on } from 'soimport { notificationStore } from '@/stores/notifications';import { logger } from '@/utils/logger';import { NodesAPI } from '@/api/nodes';-import { useResources } from '@/hooks/useResources';+import { useUnifiedResources } from '@/hooks/useUnifiedResources';import { getPreferredConfiguredNodeLabel } from '@/utils/resourceIdentity';import type { Temperature } from '@/types/api';+import type { ResourceType } from '@/types/resource';import type {ClusterEndpointOverridePayload,ClusterNodeDisplayNameOverridePayload,@@ -23,17 +24,31 @@ import {} from '@/utils/infrastructureSettingsPresentation';interface UseInfrastructureConfiguredNodesStateParams {+ canReadInfrastructure: Accessor<boolean>;temperatureMonitoringEnabled: Accessor<boolean>;savingTemperatureSetting: Accessor<boolean>;setSavingTemperatureSetting: Setter<boolean>;}export const useInfrastructureConfiguredNodesState = ({+ canReadInfrastructure,temperatureMonitoringEnabled,savingTemperatureSetting,setSavingTemperatureSetting,}: UseInfrastructureConfiguredNodesStateParams) => {- const { byType } = useResources();+ // Settings.tsx retains this state owner across every settings route. Keep+ // its background inventory bounded to the agent rows needed for configured+ // node status; the response's global aggregation supplies license counts+ // without hydrating every guest, container, storage object, and network.+ const configuredNodeResources = useUnifiedResources({+ query: 'type=agent',+ cacheKey: 'settings-configured-nodes',+ initialHydration: 'prefer-ws-then-rest',+ enabled: canReadInfrastructure,+ });+ const agentResources = createMemo(() => configuredNodeResources.resources());+ const typeCount = (type: ResourceType) =>+ configuredNodeResources.aggregations()?.byType[type] ?? 0;const [nodes, setNodes] = createSignal<NodeConfigWithStatus[]>([]);const [showNodeModal, setShowNodeModal] = createSignal(false);const [editingNode, setEditingNode] = createSignal<NodeConfigWithStatus | null>(null);@@ -52,14 +67,14 @@ export const useInfrastructureConfiguredNodesState = ({const orgNodeUsage = createMemo(() =>- byType('agent').length +- byType('docker-host').length +- byType('k8s-cluster').length +- byType('pbs').length +- byType('pmg').length,+ typeCount('agent') ++ typeCount('docker-host') ++ typeCount('k8s-cluster') ++ typeCount('pbs') ++ typeCount('pmg'),);const orgGuestUsage = createMemo(- () => byType('vm').length + byType('system-container').length + byType('oci-container').length,+ () => typeCount('vm') + typeCount('system-container') + typeCount('oci-container'),);let pendingLoadNodesRetry: ReturnType<typeof setTimeout> | undefined;@@ -75,7 +90,7 @@ export const useInfrastructureConfiguredNodesState = ({try {clearLoadNodesRetry();const nodesList = await NodesAPI.getNodes();- const nodeResources = byType('agent');+ const nodeResources = agentResources();const nodesWithStatus = nodesList.map((node) => {const stateNode = matchConfiguredNodeToResource(node, nodeResources);const tempValue = stateNode?.temperature;@@ -343,34 +358,31 @@ export const useInfrastructureConfiguredNodesState = ({};createEffect(- on(- () => byType('agent'),- (nodeResources) => {- const currentNodes = nodes();- if (!nodeResources || nodeResources.length === 0 || currentNodes.length === 0) {- return;- }+ on(agentResources, (nodeResources) => {+ const currentNodes = nodes();+ if (!nodeResources || nodeResources.length === 0 || currentNodes.length === 0) {+ return;+ }- setNodes(- currentNodes.map((node) => {- const stateNode = matchConfiguredNodeToResource(node, nodeResources);- const tempValue = stateNode?.temperature;- if (typeof tempValue !== 'number' || tempValue <= 0) {- return node;- }-- const temperature: Temperature = {- cpuPackage: tempValue,- cpuMax: tempValue,- available: true,- hasCPU: true,- lastUpdate: new Date(stateNode!.lastSeen).toISOString(),- };- return { ...node, temperature };- }),- );- },- ),+ setNodes(+ currentNodes.map((node) => {+ const stateNode = matchConfiguredNodeToResource(node, nodeResources);+ const tempValue = stateNode?.temperature;+ if (typeof tempValue !== 'number' || tempValue <= 0) {+ return node;+ }++ const temperature: Temperature = {+ cpuPackage: tempValue,+ cpuMax: tempValue,+ available: true,+ hasCPU: true,+ lastUpdate: new Date(stateNode!.lastSeen).toISOString(),+ };+ return { ...node, temperature };+ }),+ );+ }),);return {diff --git a/frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts b/frontend-modern/src/components/Settings/useInfrastructureSettingsState.tsindex 74c1d04964..d346605f0c 100644--- a/frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts+++ b/frontend-modern/src/components/Settings/useInfrastructureSettingsState.ts@@ -70,6 +70,7 @@ export function useInfrastructureSettingsState({const [initialLoadComplete, setInitialLoadComplete] = createSignal(false);const configuredNodes = useInfrastructureConfiguredNodesState({+ canReadInfrastructure,temperatureMonitoringEnabled,savingTemperatureSetting,setSavingTemperatureSetting,diff --git a/frontend-modern/src/hooks/__tests__/useResources.test.ts b/frontend-modern/src/hooks/__tests__/useResources.test.tsindex bbf84ea332..90907cec94 100644--- a/frontend-modern/src/hooks/__tests__/useResources.test.ts+++ b/frontend-modern/src/hooks/__tests__/useResources.test.ts@@ -6,6 +6,7 @@*/import { describe, expect, it } from 'vitest';import type { Resource, ResourceStatus } from '@/types/resource';+import useResourcesSource from '../useResources.ts?raw';// Helper to create mock resources for testing conversion logicfunction createMockResource(overrides: Partial<Resource> = {}): Resource {@@ -27,6 +28,10 @@ function createMockResource(overrides: Partial<Resource> = {}): Resource {}describe('useResources - Resource Filtering Logic', () => {+ it('races the websocket snapshot with canonical REST hydration for all-resource consumers', () => {+ expect(useResourcesSource).toContain("initialHydration: 'prefer-ws-then-rest'");+ });+describe('byType filtering', () => {const resources: Resource[] = [createMockResource({ id: '1', type: 'vm' }),diff --git a/frontend-modern/src/hooks/useResourceStats.ts b/frontend-modern/src/hooks/useResourceStats.tsnew file mode 100644index 0000000000..995b51afbf--- /dev/null+++ b/frontend-modern/src/hooks/useResourceStats.ts@@ -0,0 +1,43 @@+import { createMemo } from 'solid-js';+import { ResourceAPI, type ResourceStatsResponse } from '@/api/resources';+import { createNonSuspendingQuery } from '@/hooks/createNonSuspendingQuery';+import type { ResourcePolicyPostureSummary } from '@/types/resource';++const EMPTY_POLICY_POSTURE: ResourcePolicyPostureSummary = {+ totalResources: 0,+ sensitivityCounts: {},+ routingCounts: {},+ redactionCounts: {},+};++const EMPTY_RESOURCE_STATS: ResourceStatsResponse = {+ total: 0,+ byType: {},+ byStatus: {},+ bySource: {},+ policyPosture: EMPTY_POLICY_POSTURE,+};++/**+ * Read the compact server-owned resource aggregation without downloading and+ * adapting every resource row. The retained query keeps route remounts fast+ * while the normal organization-switch boundary invalidates stale posture.+ */+export function useResourceStats() {+ const state = createNonSuspendingQuery<ResourceStatsResponse, string>({+ source: () => 'resource-stats',+ fetcher: () => ResourceAPI.getStats(),+ initialValue: EMPTY_RESOURCE_STATS,+ cacheKey: () => 'resource-stats',+ });+ const policyPosture = createMemo(() => state.value().policyPosture ?? EMPTY_POLICY_POSTURE);++ return {+ error: state.error,+ loading: state.loading,+ policyPosture,+ refetch: state.refetch,+ resolvedOnce: state.resolvedOnce,+ stats: state.value,+ };+}diff --git a/frontend-modern/src/hooks/useResources.ts b/frontend-modern/src/hooks/useResources.tsindex 4a5cf3bdd5..f36051187f 100644--- a/frontend-modern/src/hooks/useResources.ts+++ b/frontend-modern/src/hooks/useResources.ts@@ -83,6 +83,12 @@ export interface UseResourcesReturn {/** Whether resources are available */hasResources: Accessor<boolean>;++ /** Whether the initial canonical resource snapshot is still loading */+ loading: Accessor<boolean>;++ /** Latest canonical resource fetch error */+ error: Accessor<unknown>;}/**@@ -96,7 +102,11 @@ export function useResources(storeOverride?: ResourceStoreLike): UseResourcesRet// The `query: ''` fetches ALL resource types (no type filter).const unifiedHook = storeOverride? null- : useUnifiedResources({ query: '', cacheKey: 'all-resources' });+ : useUnifiedResources({+ query: '',+ cacheKey: 'all-resources',+ initialHydration: 'prefer-ws-then-rest',+ });// All resources from the unified source.const resources = createMemo<Resource[]>(() => {@@ -256,6 +266,8 @@ export function useResources(storeOverride?: ResourceStoreLike): UseResourcesRettopByCpu,topByMemory,hasResources,+ loading: unifiedHook?.loading ?? (() => false),+ error: unifiedHook?.error ?? (() => undefined),};}