Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

Improve platform frontend coherence

rcourtmancce58ceb19c0
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 9d502180b5..51f5ebc135 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -335,8 +335,11 @@ Namespace, ConfigMap, Secret, and ServiceAccount-specific columns. Kubernetes
Node inventory must also be reachable through a dedicated native tab, not only
the overview stack, while retaining the shared `PlatformSectionTabs` shell.
Primary app-shell navigation consumes unified-resources-owned resource evidence:
-empty compatibility facets such as `docker: {}` do not admit runtime-lens tabs
-on their own.
+empty or generic compatibility facets do not admit runtime-lens tabs on their
+own, and cached resource evidence must not render primary platform navigation
+before the first authoritative resource snapshot resolves. A platform that is
+not admitted stays reachable by direct setup URL, but does not occupy primary
+navigation with an empty page.
Feature-owned Docker / Podman action controls may render backend
`actionReadiness` disabled reasons, but the shared primitive layer owns only the
button/table affordance shell; it must not invent action availability, command
@@ -391,7 +394,9 @@ Docker empty-state guidance on platform pages follows the same shared platform
primitive boundary: it may use the route-specific Docker / Podman vocabulary,
but it must distinguish standalone Docker host installation from the Proxmox
LXC Docker host-side inventory path without adding page-local installer command
-assembly or token handling.
+assembly or token handling. The empty state must provide a direct action into
+the Docker-specific Infrastructure add flow rather than leaving the operator at
+a descriptive dead end.
Docker / Podman inventory follows that same primitive boundary while the
unified-resource owner supplies API-object-specific container, image, volume,
network, Swarm node, task, secret, and config columns through dedicated native
@@ -3147,6 +3152,10 @@ status summary directly above that shared table frame. The consumer owns the
already-loaded resource counts, freshness-aware attention ordering, and
settings action; the shared primitive boundary still forbids a second fetch,
detached proof strip, decorative chart, or locally recreated table frame.
+The shared platform toolbar owns count grammar and canonical status-route
+normalization: one visible row uses the singular form, and legacy provider
+status values such as `running` or `stopped` normalize into the page's shared
+health filter rather than leaking provider vocabulary between platform routes.
Platform table empty states follow the same registry-backed ownership.
`PlatformTableEmptyState` owns the repeated table-card empty-state shell for
Docker, Kubernetes, Proxmox, Standalone, TrueNAS, vSphere, and future platform
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index dada776f1a..a005a51c3c 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -475,10 +475,15 @@ has no rows for the current setup. Signals outside unified-resource inventory,
such as TrueNAS recovery protection points or vSphere activity timeline rows,
must be treated as explicit tab evidence rather than permanent navigation.
Primary platform navigation is also resource-evidence gated: runtime lenses such
-as Docker / Podman must be admitted from explicit source scopes, Docker host or
-service resource types, or non-empty Docker runtime metadata. Empty compatibility
-facets such as `docker: {}` on a plain machine agent are not Docker inventory and
-must not create a transient Docker tab during hydration.
+as Docker / Podman must be admitted from explicit Docker source scopes, Docker
+host or service resource types, or concrete runtime identity/inventory evidence
+such as a runtime/version or a positive object count. Generic host metadata,
+zero-count compatibility projections, and empty facets such as `docker: {}` on a
+plain machine agent are not Docker inventory and must not create a transient or
+empty Docker tab during hydration. Navigation admission and the corresponding
+platform page model must consume the same evidence contract. A direct route to
+an absent platform may show its setup action, but the primary navigation must
+stay limited to platform pages that can render admitted inventory.
Kubernetes configuration and policy inventory are unified-resource consumer
boundaries: the `/kubernetes/configuration` workflow tab must render Namespace,
diff --git a/frontend-modern/src/App.tsx b/frontend-modern/src/App.tsx
index c5c3bd95a1..9e825c1ea2 100644
--- a/frontend-modern/src/App.tsx
+++ b/frontend-modern/src/App.tsx
@@ -65,6 +65,7 @@ import {
import { DarkModeContext, WebSocketContext, useWebSocket } from '@/contexts/appRuntime';
import {
buildPrimaryPlatformNavigationVisibility,
+ createEmptyPlatformNavigationVisibility,
selectFirstVisiblePrimaryPlatformNavigationId,
type PlatformNavigationVisibility,
type PrimaryPlatformNavId,
@@ -78,7 +79,9 @@ function isPublicRoutePath(pathname: string): boolean {
function isWorkspaceEntryRoutePath(pathname: string): boolean {
const normalizedPath = pathname.replace(/\/+$/, '') || '/';
- return normalizedPath === '/' || normalizedPath === '/login' || normalizedPath === '/infrastructure';
+ return (
+ normalizedPath === '/' || normalizedPath === '/login' || normalizedPath === '/infrastructure'
+ );
}
const AlertsPage = lazy(() =>
@@ -254,13 +257,15 @@ function App() {
const navigate = useNavigate();
const location = useLocation();
const isPublicRoute = createMemo(() => isPublicRoutePath(location.pathname));
- const platformNavigationVisibility = createMemo(() =>
- buildPrimaryPlatformNavigationVisibility(runtime.state().resources || []),
- );
const platformNavigationResolved = createMemo(() => {
const store = runtime.enhancedStore();
return Boolean(store?.initialDataReceived?.());
});
+ const platformNavigationVisibility = createMemo(() =>
+ platformNavigationResolved()
+ ? buildPrimaryPlatformNavigationVisibility(runtime.state().resources || [])
+ : createEmptyPlatformNavigationVisibility(),
+ );
const hasSettingsAccess = createMemo(() => {
const scopes = runtime.securityStatus()?.tokenScopes;
return (
@@ -283,12 +288,9 @@ function App() {
if (runtime.isLoading() || runtime.needsAuth() || isPublicRoute()) return;
if (!isWorkspaceEntryRoutePath(location.pathname)) return;
if (!platformNavigationResolved()) return;
- navigate(
- getDefaultWorkspaceRoute(platformNavigationVisibility(), hasSettingsAccess()),
- {
- replace: true,
- },
- );
+ navigate(getDefaultWorkspaceRoute(platformNavigationVisibility(), hasSettingsAccess()), {
+ replace: true,
+ });
});
createEffect(() => {
@@ -480,6 +482,7 @@ function App() {
proxyAuthInfo={runtime.proxyAuthInfo}
handleLogout={runtime.handleLogout}
state={runtime.state}
+ platformVisibility={platformNavigationVisibility}
tokenScopes={() => runtime.securityStatus()?.tokenScopes}
organizations={runtime.organizations}
activeOrgID={runtime.activeOrgID}
@@ -487,9 +490,7 @@ function App() {
showOrgSwitcher={runtime.showOrgSwitcher}
onSwitchOrg={runtime.handleOrgSwitch}
>
- <RouteErrorBoundary>
- {props.children}
- </RouteErrorBoundary>
+ <RouteErrorBoundary>{props.children}</RouteErrorBoundary>
</AppLayout>
</div>
{/* AI Panel - slides in from right, pushes content.
diff --git a/frontend-modern/src/AppLayout.tsx b/frontend-modern/src/AppLayout.tsx
index 8739edb159..c070a23c3c 100644
--- a/frontend-modern/src/AppLayout.tsx
+++ b/frontend-modern/src/AppLayout.tsx
@@ -16,6 +16,7 @@ import {
buildPrimaryPlatformNavigationVisibility,
primaryPlatformNavigationIsVisible,
selectFirstVisiblePrimaryPlatformNavigationId,
+ type PlatformNavigationVisibility,
type PrimaryPlatformNavId,
} from '@/features/platformNavigation/platformNavigationModel';
import { dialogStackHasBlockingDialog } from '@/components/shared/useDialogState';
@@ -93,10 +94,7 @@ function currentPrimaryRoute(pathname: string, search: string, hash: string): st
return `${pathname}${search}${hash}`;
}
-function resolvePrimaryNavigationRoute(
- tab: PrimaryTab,
- routeMemory: PrimaryRouteMemory,
-): string {
+function resolvePrimaryNavigationRoute(tab: PrimaryTab, routeMemory: PrimaryRouteMemory): string {
if (!tab.enabled) {
return tab.settingsRoute;
}
@@ -134,6 +132,7 @@ export interface AppLayoutProps {
proxyAuthInfo: () => { username?: string; logoutURL?: string } | null;
handleLogout: () => void;
state: () => State;
+ platformVisibility?: () => PlatformNavigationVisibility;
tokenScopes: () => string[] | undefined;
organizations: () => Organization[];
activeOrgID: () => string;
@@ -290,8 +289,10 @@ export function AppLayout(props: AppLayoutProps) {
setKioskMode(!kioskMode());
};
- const platformNavigationVisibility = createMemo(() =>
- buildPrimaryPlatformNavigationVisibility(props.state().resources || []),
+ const platformNavigationVisibility = createMemo(
+ () =>
+ props.platformVisibility?.() ??
+ buildPrimaryPlatformNavigationVisibility(props.state().resources || []),
);
const primaryInfrastructureRouteById: Record<PrimaryPlatformNavId, string> = {
proxmox: ROOT_PROXMOX_PATH,
diff --git a/frontend-modern/src/__tests__/App.architecture.test.ts b/frontend-modern/src/__tests__/App.architecture.test.ts
index 949d1892e6..5c7e4768ee 100644
--- a/frontend-modern/src/__tests__/App.architecture.test.ts
+++ b/frontend-modern/src/__tests__/App.architecture.test.ts
@@ -144,9 +144,9 @@ describe('App architecture', () => {
expect(appSource).toContain('<Route path="/" component={RuntimeHomePage} />');
expect(appSource).toContain('<Route path="/infrastructure" component={RuntimeHomePage} />');
expect(appSource).toContain('function isWorkspaceEntryRoutePath(pathname: string): boolean');
- expect(appSource).toContain(
- "return normalizedPath === '/' || normalizedPath === '/login' || normalizedPath === '/infrastructure';",
- );
+ expect(appSource).toContain("normalizedPath === '/'");
+ expect(appSource).toContain("normalizedPath === '/login'");
+ expect(appSource).toContain("normalizedPath === '/infrastructure'");
expect(appSource).toContain(
'<Route path={`${ROOT_PATROL_PATH}/*`} component={AIIntelligencePage} />',
);
diff --git a/frontend-modern/src/__tests__/AppLayout.test.tsx b/frontend-modern/src/__tests__/AppLayout.test.tsx
index b4611000a6..5b8c1ab090 100644
--- a/frontend-modern/src/__tests__/AppLayout.test.tsx
+++ b/frontend-modern/src/__tests__/AppLayout.test.tsx
@@ -4,6 +4,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import type { State } from '@/types/api';
import type { Resource } from '@/types/resource';
import { AppLayout, resetPrimaryNavigationRouteMemory } from '@/AppLayout';
+import type { PlatformNavigationVisibility } from '@/features/platformNavigation/platformNavigationModel';
import { aiChatStore } from '@/stores/aiChat';
HTMLElement.prototype.scrollIntoView = vi.fn();
@@ -54,7 +55,11 @@ describe('AppLayout navigation icons', () => {
...overrides,
}) as Resource;
- const renderLayout = (resources: Resource[] = [], initialPath = '/settings/infrastructure') => {
+ const renderLayout = (
+ resources: Resource[] = [],
+ initialPath = '/settings/infrastructure',
+ platformVisibility?: PlatformNavigationVisibility,
+ ) => {
window.history.replaceState({}, '', initialPath);
const RouteStateProbe = () => {
const navigate = useNavigate();
@@ -94,6 +99,7 @@ describe('AppLayout navigation icons', () => {
resources,
}) as unknown as State
}
+ platformVisibility={platformVisibility ? () => platformVisibility : undefined}
tokenScopes={() => ['settings:read']}
organizations={() => []}
activeOrgID={() => 'default'}
@@ -225,6 +231,26 @@ describe('AppLayout navigation icons', () => {
).toBeTruthy();
});
+ it('does not expose cached platform evidence before navigation admission resolves', () => {
+ renderLayout(
+ [makeResource({ id: 'docker-1', type: 'docker-host', platformType: 'docker' })],
+ '/settings/infrastructure',
+ {
+ proxmox: false,
+ docker: false,
+ kubernetes: false,
+ truenas: false,
+ vmware: false,
+ standalone: false,
+ },
+ );
+
+ const desktopNav = screen.getByRole('tablist', { name: 'Primary navigation' });
+ const infrastructureGroup = desktopNav.querySelector('[aria-label="Infrastructure"]');
+ expect(infrastructureGroup).toBeTruthy();
+ expect(within(infrastructureGroup as HTMLElement).queryByRole('tab')).toBeNull();
+ });
+
it('restores the previous Proxmox route state when returning from another platform tab', async () => {
renderLayout(platformResources(), '/proxmox/overview?status=running');
diff --git a/frontend-modern/src/components/Discovery/DiscoveryTab.tsx b/frontend-modern/src/components/Discovery/DiscoveryTab.tsx
index a6b961213e..a3c0fc5bbc 100644
--- a/frontend-modern/src/components/Discovery/DiscoveryTab.tsx
+++ b/frontend-modern/src/components/Discovery/DiscoveryTab.tsx
@@ -23,13 +23,14 @@ import {
getDiscoverySuggestedURLCodeClass,
getDiscoverySuggestedURLHeadingClass,
getDiscoverySuggestedURLTextClass,
+ getDiscoveryServiceContextSettingsTarget,
} from '@/utils/discoveryPresentation';
import { DiscoveryProvenanceMarker } from '@/components/shared/DiscoveryProvenanceMarker';
import {
DISCOVERY_ANALYSIS_EXPLANATION,
DISCOVERY_ANALYSIS_REASONING_LABEL,
} from '@/utils/resourceAnalysisPresentation';
-import { CopyValueButton } from '@/components/shared/Button';
+import { ButtonLink, CopyValueButton } from '@/components/shared/Button';
import { CopyableCodeRow } from '@/components/shared/CopyableCodeRow';
import { InfoCardFrame } from '@/components/shared/InfoCardFrame';
import { useDiscoveryTabState } from './useDiscoveryTabState';
@@ -128,6 +129,7 @@ export const DiscoveryTab: Component<DiscoveryTabProps> = (props) => {
});
const commandSettingsTarget = getDiscoveryCommandSettingsTarget();
const apiAccessSettingsTarget = getDiscoveryApiAccessSettingsTarget();
+ const serviceContextSettingsTarget = getDiscoveryServiceContextSettingsTarget();
const showManualRunAction = () => props.showManualRunAction === true;
const manualRunSummary = createMemo(() => {
if (discovery.loading) return 'Checking saved discovery state';
@@ -148,9 +150,16 @@ export const DiscoveryTab: Component<DiscoveryTabProps> = (props) => {
<div class="text-xs text-amber-800 dark:text-amber-200">
<p class="mb-1 font-medium">Service Context Disabled</p>
<p class="text-amber-700 dark:text-amber-300">
- Enable service context in Settings -&gt; Pulse Intelligence -&gt; Service Context
- before using this tab.
+ Enable service context to inspect what is running on this resource.
</p>
+ <ButtonLink
+ href={serviceContextSettingsTarget.href}
+ variant="secondary"
+ size="sm"
+ class="mt-2"
+ >
+ {serviceContextSettingsTarget.label}
+ </ButtonLink>
</div>
</div>
</div>
diff --git a/frontend-modern/src/components/Discovery/__tests__/DiscoveryTab.test.tsx b/frontend-modern/src/components/Discovery/__tests__/DiscoveryTab.test.tsx
index 3f9a4f97d4..6bb2597fda 100644
--- a/frontend-modern/src/components/Discovery/__tests__/DiscoveryTab.test.tsx
+++ b/frontend-modern/src/components/Discovery/__tests__/DiscoveryTab.test.tsx
@@ -20,6 +20,18 @@ vi.mock('@/utils/clipboard', () => ({
copyToClipboard: vi.fn(async () => true),
}));
+vi.mock('@/components/shared/Button', async (importOriginal) => {
+ const actual = await importOriginal<typeof import('@/components/shared/Button')>();
+ return {
+ ...actual,
+ ButtonLink: (props: { href: string; children: unknown; class?: string }) => (
+ <a href={props.href} class={props.class}>
+ {props.children as never}
+ </a>
+ ),
+ };
+});
+
vi.mock('@/api/ai', () => ({
AIAPI: {
getSettings: vi.fn(async () => ({ discovery_enabled: true })),
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
index 79c07a6f07..fcb9d0ca30 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
@@ -136,8 +136,8 @@ const HostDetailsDisclosure: Component<{
summary={props.drawer.hostDetailSummary()}
expanded={props.drawer.showHostDetails()}
onToggle={() => props.drawer.setShowHostDetails((value) => !value)}
- showLabel={`Show ${noun()}`}
- hideLabel={`Hide ${noun()}`}
+ showLabel={isPulseAgentPlatformResource(props.resource) ? 'Show details' : `Show ${noun()}`}
+ hideLabel={isPulseAgentPlatformResource(props.resource) ? 'Hide details' : `Hide ${noun()}`}
class={props.class}
contentClass={
props.contentClass ??
@@ -358,20 +358,53 @@ export const ResourceDetailDrawerOverviewTab: Component<ResourceDetailDrawerOver
</Show>
<Show
- when={compactTableRow()}
+ when={isPulseAgentPlatformResource(resource)}
fallback={
- <ResourceSummaryCards
- resource={resource}
- drawer={drawer}
- showPlatformId={showPlatformId}
- />
+ <Show
+ when={compactTableRow()}
+ fallback={
+ <ResourceSummaryCards
+ resource={resource}
+ drawer={drawer}
+ showPlatformId={showPlatformId}
+ />
+ }
+ >
+ <InlineResourceSummaryTables
+ resource={resource}
+ drawer={drawer}
+ showPlatformId={showPlatformId}
+ />
+ </Show>
}
>
- <InlineResourceSummaryTables
- resource={resource}
- drawer={drawer}
- showPlatformId={showPlatformId}
- />
+ <details
+ data-testid="resource-technical-details"
+ class="rounded border border-border bg-surface px-3 py-2"
+ >
+ <summary class="cursor-pointer list-none text-[11px] font-medium text-base-content">
+ Technical details
+ <span class="ml-2 font-normal text-muted">State, identity, and source IDs</span>
+ </summary>
+ <div class="mt-3 border-t border-border pt-3">
+ <Show
+ when={compactTableRow()}
+ fallback={
+ <ResourceSummaryCards
+ resource={resource}
+ drawer={drawer}
+ showPlatformId={showPlatformId}
+ />
+ }
+ >
+ <InlineResourceSummaryTables
+ resource={resource}
+ drawer={drawer}
+ showPlatformId={showPlatformId}
+ />
+ </Show>
+ </div>
+ </details>
</Show>
<div data-testid="resource-secondary-sections" class="space-y-3">
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.discovery.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.discovery.test.ts
index b51f3deb08..1653d7c129 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.discovery.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.discovery.test.ts
@@ -360,15 +360,12 @@ describe('toDiscoveryConfig', () => {
describe('resource drawer discovery promotion', () => {
it('points disabled discovery readiness at Pulse Intelligence service context settings', () => {
expect(discoveryTabSource).toContain('Service Context Disabled');
- expect(discoveryTabSource).toContain(
- 'Settings -&gt; Pulse Intelligence -&gt; Service Context',
- );
+ expect(discoveryTabSource).toContain('getDiscoveryServiceContextSettingsTarget');
+ expect(discoveryTabSource).toContain('serviceContextSettingsTarget.label');
expect(discoveryTabStateSource).toContain(
'Service context is disabled in Settings -> Pulse Intelligence -> Service Context.',
);
- expect(discoveryReadinessSource).toContain(
- 'Settings -> Pulse Intelligence -> Service Context',
- );
+ expect(discoveryReadinessSource).toContain('Settings -> Pulse Intelligence -> Service Context');
});
it('does not treat command-only diagnostic records as meaningful resource context', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
index 48bbc6caa7..5116de80a7 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.identity-runtime.test.tsx
@@ -361,7 +361,7 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
expect(queryByText('Hardware')).toBeNull();
expect(queryByText('Network')).toBeNull();
- fireEvent.click(getByRole('button', { name: 'Show machine' }));
+ fireEvent.click(getByRole('button', { name: 'Show details' }));
await waitFor(() => {
expect(getByText('Hardware')).toBeInTheDocument();
@@ -854,8 +854,10 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
});
const inlineRender = render(() => <ResourceDetailDrawer resource={inlineResource} />);
- expect(inlineRender.getByText('Aliases')).toBeInTheDocument();
- expect(inlineRender.container.querySelector('details')).toBeNull();
+ const inlineAliases = inlineRender.getByText('Aliases');
+ expect(inlineAliases).toBeInTheDocument();
+ expect(inlineAliases.closest('summary')).toBeNull();
+ expect(inlineRender.container.querySelectorAll('details')).toHaveLength(1);
expect(inlineRender.getByText('agent-inline-1')).toBeInTheDocument();
expect(inlineRender.getAllByText('inline-host.local').length).toBeGreaterThan(0);
@@ -883,8 +885,9 @@ describe('ResourceDetailDrawer runtime and identity cards', () => {
});
const overflowRender = render(() => <ResourceDetailDrawer resource={overflowResource} />);
- expect(overflowRender.getByText('Aliases')).toBeInTheDocument();
- expect(overflowRender.container.querySelector('details')).toBeTruthy();
+ const overflowAliases = overflowRender.getByText('Aliases');
+ expect(overflowAliases).toBeInTheDocument();
+ expect(overflowAliases.closest('summary')).toBeTruthy();
});
it('surfaces policy governance details and the safe summary', () => {
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.machine-history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.machine-history.test.tsx
index 46bdebfc64..0bad6ab8ba 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.machine-history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.machine-history.test.tsx
@@ -188,9 +188,9 @@ describe('ResourceDetailDrawer machine metrics history', () => {
const machineSection = screen.getByTestId('resource-host-details-section');
expect(within(machineSection).getByText('Machine')).toBeInTheDocument();
expect(
- within(machineSection).getByRole('button', { name: 'Hide machine' }),
+ within(machineSection).getByRole('button', { name: 'Hide details' }),
).toBeInTheDocument();
- expect(within(machineSection).queryByRole('button', { name: 'Show machine' })).toBeNull();
+ expect(within(machineSection).queryByRole('button', { name: 'Show details' })).toBeNull();
expect(within(machineSection).getByText('richard-mac-mini.local')).toBeInTheDocument();
expect(within(machineSection).getByText('Network')).toBeInTheDocument();
expect(within(machineSection).getByText('192.168.0.42')).toBeInTheDocument();
diff --git a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
index e28091a25a..ddce5f52eb 100644
--- a/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
+++ b/frontend-modern/src/components/shared/SharedPrimitives.guardrails.test.ts
@@ -5203,6 +5203,13 @@ describe('shared primitive guardrails', () => {
}
});
+ it('keeps platform count grammar and route status normalization shared', () => {
+ expect(sharedPlatformPageSource).toContain('export const getPlatformResourceCountNoun');
+ expect(sharedPlatformPageSource).toContain(
+ 'export const normalizePlatformResourceStatusFilter',
+ );
+ });
+
it('keeps platform table empty states on the shared shell template', () => {
const registry = JSON.parse(sharedTemplateRegistrySource) as {
patternGuards: Array<{
diff --git a/frontend-modern/src/features/docker/DockerPageSurface.tsx b/frontend-modern/src/features/docker/DockerPageSurface.tsx
index 727adb8acd..22150aba5d 100644
--- a/frontend-modern/src/features/docker/DockerPageSurface.tsx
+++ b/frontend-modern/src/features/docker/DockerPageSurface.tsx
@@ -1,5 +1,7 @@
import { useLocation, useSearchParams } from '@solidjs/router';
import { Show, createMemo, createSignal } from 'solid-js';
+import BoxIcon from 'lucide-solid/icons/box';
+import { ButtonLink } from '@/components/shared/Button';
import { getPlatformIcon } from '@/features/platformPage/platformIcon';
import { useUnifiedResources } from '@/hooks/useUnifiedResources';
import {
@@ -40,7 +42,10 @@ import {
} from '@/features/platformPage/agentVersion';
import { PlatformOutdatedAgentNotice } from '@/features/platformPage/PlatformOutdatedAgentNotice';
import { updateStore } from '@/stores/updates';
-import { buildInfrastructureAgentUpdatesPath } from '@/components/Settings/infrastructureWorkspaceModel';
+import {
+ buildInfrastructureAgentUpdatesPath,
+ buildInfrastructureOnboardingPath,
+} from '@/components/Settings/infrastructureWorkspaceModel';
import { DOCKER_QUERY_PARAMS } from '@/routing/resourceLinks';
import { asTrimmedString } from '@/utils/stringUtils';
import type { Resource } from '@/types/resource';
@@ -121,7 +126,18 @@ export function DockerPageSurface() {
<PlatformTableEmptyState
icon={dockerIcon()}
title="No Docker or Podman hosts"
- description="Install the Pulse agent on a Docker or Podman host. For Docker inside Proxmox LXCs, install the agent on the Proxmox node with command execution enabled, then enable Proxmox guest Docker inventory on the Pulse server."
+ description="Connect a runtime host with the Pulse agent, or enable guest Docker inventory for a Proxmox LXC."
+ actions={
+ <ButtonLink
+ href={buildInfrastructureOnboardingPath('docker')}
+ variant="primary"
+ size="sm"
+ class="gap-2"
+ >
+ <BoxIcon class="h-3.5 w-3.5" aria-hidden="true" />
+ Set up Docker or Podman
+ </ButtonLink>
+ }
/>
}
>
diff --git a/frontend-modern/src/features/docker/__tests__/DockerPageSurface.test.tsx b/frontend-modern/src/features/docker/__tests__/DockerPageSurface.test.tsx
index 1f7f951c31..a8ed3f04ea 100644
--- a/frontend-modern/src/features/docker/__tests__/DockerPageSurface.test.tsx
+++ b/frontend-modern/src/features/docker/__tests__/DockerPageSurface.test.tsx
@@ -78,6 +78,11 @@ vi.mock('@/stores/updates', () => ({
}));
vi.mock('@solidjs/router', () => ({
+ A: (props: { href: string; children: unknown; class?: string }) => (
+ <a href={props.href} class={props.class}>
+ {props.children as never}
+ </a>
+ ),
useLocation: () => ({
get pathname() {
return mocks.pathname;
@@ -118,9 +123,10 @@ vi.mock('@/features/platformPage/sharedPlatformPage', async () => {
data-tabs={props.tabs.map((tab) => tab.id).join(',')}
/>
),
- PlatformTableEmptyState: (props: { title: string; description: string }) => (
+ PlatformTableEmptyState: (props: { title: string; description: string; actions?: unknown }) => (
<div data-testid="platform-table-empty-state" data-title={props.title}>
{props.description}
+ {props.actions as never}
</div>
),
};
@@ -230,7 +236,7 @@ afterEach(() => {
});
describe('DockerPageSurface', () => {
- it('explains the direct host and Proxmox LXC Docker install paths when empty', () => {
+ it('offers direct Docker or Podman onboarding when empty', () => {
mocks.useUnifiedResources.mockReturnValue({
error: () => null,
loading: () => false,
@@ -242,10 +248,9 @@ describe('DockerPageSurface', () => {
const emptyState = screen.getByTestId('platform-table-empty-state');
expect(emptyState).toHaveAttribute('data-title', 'No Docker or Podman hosts');
- expect(emptyState).toHaveTextContent('Install the Pulse agent on a Docker or Podman host');
- expect(emptyState).toHaveTextContent('Docker inside Proxmox LXCs');
- expect(emptyState).toHaveTextContent('command execution enabled');
- expect(emptyState).toHaveTextContent('Proxmox guest Docker inventory');
+ expect(emptyState).toHaveTextContent('Connect a runtime host with the Pulse agent');
+ expect(emptyState).toHaveTextContent('enable guest Docker inventory for a Proxmox LXC');
+ expect(emptyState).toHaveTextContent('Set up Docker or Podman');
});
it('keeps overview focused on runtime hosts plus primary container workloads', () => {
diff --git a/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts b/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts
index d70730e834..e634dbdcf1 100644
--- a/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts
+++ b/frontend-modern/src/features/docker/__tests__/dockerPageModel.test.ts
@@ -87,6 +87,21 @@ describe('dockerPageModel', () => {
);
});
+ it('admits an agent-scoped runtime host when its Docker facet has runtime evidence', () => {
+ const model = buildDockerPageModel([
+ makeResource({
+ id: 'tower',
+ type: 'agent',
+ platformType: 'agent',
+ platformScopes: ['agent'],
+ platformData: { docker: { runtime: 'docker' } },
+ }),
+ ]);
+
+ expect(model.hosts.map((resource) => resource.id)).toEqual(['tower']);
+ expect(model.resources.map((resource) => resource.id)).toEqual(['tower']);
+ });
+
it('declares operator workflow tabs for Docker runtime inventory', () => {
expect(DOCKER_TAB_SPECS.map((tab) => tab.id)).toEqual([
'overview',
diff --git a/frontend-modern/src/features/docker/dockerPageModel.ts b/frontend-modern/src/features/docker/dockerPageModel.ts
index c40fdcb76d..44a5aa58ce 100644
--- a/frontend-modern/src/features/docker/dockerPageModel.ts
+++ b/frontend-modern/src/features/docker/dockerPageModel.ts
@@ -11,6 +11,7 @@ import {
getInfrastructureSystemIdentityBadges,
type ResourceBadge,
} from '@/utils/resourceBadgePresentation';
+import { hasDockerRuntimeHostEvidence } from '@/utils/agentResources';
const DOCKER_HOST_TYPES = new Set<ResourceType>(['agent', 'docker-host']);
const DOCKER_CONTAINER_TYPES = new Set<ResourceType>(['app-container']);
@@ -65,6 +66,10 @@ export const resolveDockerPageTabId = (segment: string | undefined): DockerPageT
const isDockerPlatform = (resource: Resource): boolean =>
resolveResourcePlatformType(resource) === 'docker';
+const isDockerRuntimeHost = (resource: Resource): boolean =>
+ DOCKER_HOST_TYPES.has(resource.type) &&
+ (isDockerPlatform(resource) || hasDockerRuntimeHostEvidence(resource));
+
// `containerState` reasons that mean the container will not stay up on its
// own. Distinct from `exited` with exit code 0, which is just a stopped
// container, and from `restarting`, which is in-flight.
@@ -799,6 +804,7 @@ export function buildDockerPageModel(resources: Resource[]): DockerPageModel {
const dockerResources = resources.filter(
(resource) =>
isDockerPlatform(resource) ||
+ isDockerRuntimeHost(resource) ||
DOCKER_CONTAINER_TYPES.has(resource.type) ||
DOCKER_SERVICE_TYPES.has(resource.type) ||
DOCKER_IMAGE_TYPES.has(resource.type) ||
@@ -810,9 +816,7 @@ export function buildDockerPageModel(resources: Resource[]): DockerPageModel {
DOCKER_TASK_TYPES.has(resource.type),
);
- const hosts = dockerResources.filter(
- (resource) => DOCKER_HOST_TYPES.has(resource.type) && isDockerPlatform(resource),
- );
+ const hosts = dockerResources.filter(isDockerRuntimeHost);
const containers = dockerResources
.filter((resource) => DOCKER_CONTAINER_TYPES.has(resource.type) && isDockerPlatform(resource))
.sort(compareDockerContainers);
diff --git a/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.test.ts b/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.test.ts
index 48e7edc0f0..3fe91e2d81 100644
--- a/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.test.ts
+++ b/frontend-modern/src/features/platformNavigation/__tests__/platformNavigationModel.test.ts
@@ -94,6 +94,17 @@ describe('platformNavigationModel', () => {
expect(visibility.standalone).toBe(true);
});
+ it('does not admit Docker from generic host metadata without runtime identity', () => {
+ const tower = resource({
+ id: 'tower',
+ platformType: 'agent',
+ type: 'agent',
+ platformData: { docker: { hostname: 'tower', os: 'linux', containerCount: 0 } },
+ });
+
+ expect(buildPrimaryPlatformNavigationVisibility([tower]).docker).toBe(false);
+ });
+
it('does not infer Docker from TrueNAS-scoped app metadata', () => {
const truenasApp = resource({
id: 'truenas-app',
diff --git a/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts b/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
index 760d3daca0..59f089ef3a 100644
--- a/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
+++ b/frontend-modern/src/features/platformNavigation/platformNavigationModel.ts
@@ -1,6 +1,6 @@
import type { Accessor } from 'solid-js';
import type { Resource, ResourceType } from '@/types/resource';
-import { hasDockerFacetEvidence, isPulseAgentPlatformResource } from '@/utils/agentResources';
+import { hasDockerRuntimeHostEvidence, isPulseAgentPlatformResource } from '@/utils/agentResources';
import {
ADMITTED_PLATFORM_IDS,
SUPPORTED_PLATFORM_IDS,
@@ -91,14 +91,8 @@ const collectExplicitPlatformScopeEvidence = (
return [...ids];
};
-const addDirectDockerRuntimeEvidence = (
- ids: Set<string>,
- resource: Resource,
- platformData: Record<string, unknown> | null,
-): void => {
+const addDirectDockerRuntimeEvidence = (ids: Set<string>, resource: Resource): void => {
const resolvedPlatformType = resolveResourcePlatformType(resource);
- const hasDockerMetadata =
- hasDockerFacetEvidence(resource.docker) || hasDockerFacetEvidence(platformData?.docker);
if (normalizeSourcePlatformKey(resource.platformType) === 'docker') {
ids.add('docker');
return;
@@ -111,7 +105,7 @@ const addDirectDockerRuntimeEvidence = (
ids.add('docker');
return;
}
- if (ids.has('agent') && hasDockerMetadata) {
+ if (ids.has('agent') && hasDockerRuntimeHostEvidence(resource)) {
ids.add('docker');
}
};
@@ -120,7 +114,7 @@ export function collectResourcePlatformEvidence(resource: Resource): string[] {
const platformData = asRecord(resource.platformData);
const ids = new Set<string>(collectExplicitPlatformScopeEvidence(resource, platformData));
if (ids.size > 0) {
- addDirectDockerRuntimeEvidence(ids, resource, platformData);
+ addDirectDockerRuntimeEvidence(ids, resource);
return [...ids];
}
@@ -148,11 +142,7 @@ export function collectResourcePlatformEvidence(resource: Resource): string[] {
if (resource.kubernetes || asRecord(platformData?.kubernetes)) {
ids.add('kubernetes');
}
- if (
- hasDockerFacetEvidence(resource.docker) ||
- hasDockerFacetEvidence(platformData?.docker) ||
- DOCKER_RESOURCE_TYPES.has(resource.type)
- ) {
+ if (hasDockerRuntimeHostEvidence(resource) || DOCKER_RESOURCE_TYPES.has(resource.type)) {
ids.add('docker');
}
if (KUBERNETES_RESOURCE_TYPES.has(resource.type)) {
diff --git a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
index 7b8f7262b1..5ee2b9f003 100644
--- a/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
+++ b/frontend-modern/src/features/platformPage/__tests__/sharedPlatformPage.test.ts
@@ -26,13 +26,42 @@ import {
filterPlatformResources,
formatPlatformTableTextValue,
getPlatformTableFiniteMetric,
+ getPlatformResourceCountNoun,
getPlatformTableWeightedColumnWidthStyle,
+ normalizePlatformResourceStatusFilter,
summarizePlatformTableValues,
type PlatformResourceStatusFilter,
} from '../sharedPlatformPage';
afterEach(cleanup);
+describe('getPlatformResourceCountNoun', () => {
+ it('uses singular platform nouns for one visible total', () => {
+ expect(getPlatformResourceCountNoun('machines', 1)).toBe('machine');
+ expect(getPlatformResourceCountNoun('config resources', 1)).toBe('config resource');
+ expect(getPlatformResourceCountNoun('VMs', 1)).toBe('VM');
+ });
+
+ it('keeps plural platform nouns for every other count', () => {
+ expect(getPlatformResourceCountNoun('machines', 0)).toBe('machines');
+ expect(getPlatformResourceCountNoun('machines', 2)).toBe('machines');
+ });
+});
+
+describe('normalizePlatformResourceStatusFilter', () => {
+ it('normalizes route-specific legacy status vocabulary', () => {
+ expect(normalizePlatformResourceStatusFilter('running')).toBe('online');
+ expect(normalizePlatformResourceStatusFilter('healthy')).toBe('online');
+ expect(normalizePlatformResourceStatusFilter('warning')).toBe('degraded');
+ expect(normalizePlatformResourceStatusFilter('stopped')).toBe('offline');
+ });
+
+ it('falls back to the unfiltered state for unknown route values', () => {
+ expect(normalizePlatformResourceStatusFilter('unknown-value')).toBe('all');
+ expect(normalizePlatformResourceStatusFilter(undefined)).toBe('all');
+ });
+});
+
const makeResource = (
partial: Partial<Resource> & Pick<Resource, 'id' | 'type' | 'status'>,
): Resource => ({
diff --git a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
index b627f0922e..5e98a677fd 100644
--- a/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
+++ b/frontend-modern/src/features/platformPage/sharedPlatformPage.tsx
@@ -607,6 +607,17 @@ const ONLINE_STATUSES = new Set<string>(['online', 'running']);
const OFFLINE_STATUSES = new Set<string>(['offline', 'stopped']);
const DEGRADED_STATUSES = new Set<string>(['degraded', 'warning', 'paused']);
+export const normalizePlatformResourceStatusFilter = (
+ value: string | string[] | null | undefined,
+): PlatformResourceStatusFilter => {
+ const normalized = (Array.isArray(value) ? value[0] : value)?.trim().toLowerCase();
+ if (!normalized || normalized === 'all') return 'all';
+ if (ONLINE_STATUSES.has(normalized) || normalized === 'healthy') return 'online';
+ if (DEGRADED_STATUSES.has(normalized) || normalized === 'attention') return 'degraded';
+ if (OFFLINE_STATUSES.has(normalized)) return 'offline';
+ return 'all';
+};
+
const mapResourceStatusToTriad = (
status: string | undefined,
): Exclude<PlatformResourceStatusFilter, 'all'> | 'unknown' => {
@@ -752,22 +763,35 @@ export const PlatformTableResetFiltersButton: Component<{
// Compact operator-facing counter shown at the right of the toolbar so
// users can read total / matching at a glance, mirroring v5's dense
// dashboard counters without spawning a card grid.
+export const getPlatformResourceCountNoun = (rowNoun: string, count: number): string => {
+ if (count !== 1) return rowNoun;
+ const words = rowNoun.split(' ');
+ const last = words.at(-1) ?? rowNoun;
+ if (last.length > 1 && last.toLowerCase().endsWith('s')) {
+ words[words.length - 1] = last.slice(0, -1);
+ }
+ return words.join(' ');
+};
+
const PlatformResourceCounter: Component<{ visible: number; total: number; rowNoun: string }> = (
props,
-) => (
- <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
- <Show
- when={props.visible !== props.total}
- fallback={
- <>
- {props.total} {props.rowNoun}
- </>
- }
- >
- {props.visible} of {props.total} {props.rowNoun}
- </Show>
- </span>
-);
+) => {
+ const totalNoun = () => getPlatformResourceCountNoun(props.rowNoun, props.total);
+ return (
+ <span class="ml-auto whitespace-nowrap text-xs font-medium text-muted">
+ <Show
+ when={props.visible !== props.total}
+ fallback={
+ <>
+ {props.total} {totalNoun()}
+ </>
+ }
+ >
+ {props.visible} of {props.total} {totalNoun()}
+ </Show>
+ </span>
+ );
+};
export function PlatformTableToolbar<T extends string | number>(props: {
search: () => string;
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
index 9ad5071868..d14a6894c1 100644
--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
@@ -69,6 +69,7 @@ import {
getRaidStateVariant,
} from '@/utils/raidPresentation';
import { asTrimmedString } from '@/utils/stringUtils';
+import { getPreferredResourceIP } from '@/utils/resourceIdentity';
import {
RESOURCE_METADATA_CHANGED_EVENT,
type ResourceMetadataChangedDetail,
@@ -1156,6 +1157,8 @@ export const AgentsMachinesTable: Component<{
emptyTitle: string;
emptyDescription: string;
targetAgentVersion?: string | null;
+ externalStatus?: () => PlatformResourceStatusFilter;
+ onExternalStatusChange?: (value: PlatformResourceStatusFilter) => void;
}> = (props) => {
const [locallyRemovedResourceIds, setLocallyRemovedResourceIds] = createSignal<
Record<string, boolean>
@@ -1167,6 +1170,8 @@ export const AgentsMachinesTable: Component<{
resources: visibleMachineResources,
initialStatus: 'all' as PlatformResourceStatusFilter,
filter: filterAgentMachineResources,
+ externalStatus: props.externalStatus,
+ onExternalStatusChange: props.onExternalStatusChange,
});
const alertsActivation = useAlertsActivation();
const [sortKey, setSortKey] = createSignal<AgentMachineSortKey>('name');
@@ -1476,7 +1481,8 @@ export const AgentsMachinesTable: Component<{
const networkInterfaces = () => getAgentMachineNetworkInterfaceDetails(machine);
const diskIOTotal = () => getAgentMachineDiskIOTotal(machine);
const diskIODetails = () => getAgentMachineDiskIODetails(machine);
- const primaryIp = () => getAgentMachinePrimaryIp(machine);
+ const primaryIp = () =>
+ getPreferredResourceIP(machine) ?? getAgentMachinePrimaryIp(machine);
const lastSeenValue = () =>
isAgentlessMachine(machine)
? availabilityFor(machine)?.lastChecked
@@ -1492,7 +1498,13 @@ export const AgentsMachinesTable: Component<{
!columnVisibility.isColumnVisible('ip'),
!columnVisibility.isColumnVisible('lastSeen'),
);
- const ipValues = () => getAgentMachineIpValues(machine);
+ const ipValues = () => {
+ const preferred = getPreferredResourceIP(machine);
+ const values = getAgentMachineIpValues(machine);
+ return preferred
+ ? [preferred, ...values.filter((value) => value !== preferred)]
+ : values;
+ };
const raidArrays = () => getAgentMachineRaidArrayDetails(machine);
const raidSummary = () => getAgentMachineRaidSummary(machine);
const temperature = () => getAgentMachineTemperatureCelsius(machine);
diff --git a/frontend-modern/src/features/standalone/StandalonePageSurface.tsx b/frontend-modern/src/features/standalone/StandalonePageSurface.tsx
index 03e1508f4f..8ecdb0194a 100644
--- a/frontend-modern/src/features/standalone/StandalonePageSurface.tsx
+++ b/frontend-modern/src/features/standalone/StandalonePageSurface.tsx
@@ -1,5 +1,5 @@
import { Show, createEffect, createMemo, createSignal, type Component, type JSX } from 'solid-js';
-import { useLocation, useNavigate } from '@solidjs/router';
+import { useLocation, useNavigate, useSearchParams } from '@solidjs/router';
import ActivityIcon from 'lucide-solid/icons/activity';
import CircleAlertIcon from 'lucide-solid/icons/circle-alert';
import ServerIcon from 'lucide-solid/icons/server';
@@ -21,6 +21,8 @@ import {
PlatformSectionTabs,
PlatformTableEmptyState,
PlatformTableLoadingState,
+ normalizePlatformResourceStatusFilter,
+ type PlatformResourceStatusFilter,
} from '@/features/platformPage/sharedPlatformPage';
import { useUnifiedResources } from '@/hooks/useUnifiedResources';
import { STANDALONE_PATH, buildStandalonePath } from '@/routing/resourceLinks';
@@ -118,6 +120,7 @@ const resolveStandaloneTab = (pathname: string): StandaloneTabId =>
export function StandalonePageSurface() {
const location = useLocation();
const navigate = useNavigate();
+ const [searchParams, setSearchParams] = useSearchParams();
const { resources, loading, error, refetch } = useUnifiedResources({
query: STANDALONE_RESOURCE_QUERY,
cacheKey: 'standalone-workspace',
@@ -128,6 +131,12 @@ export function StandalonePageSurface() {
const model = createMemo(() => buildStandalonePageModel(resources()));
const activeTab = createMemo(() => resolveStandaloneTab(location.pathname));
+ const machineStatusFilter = createMemo(() =>
+ normalizePlatformResourceStatusFilter(searchParams.status),
+ );
+ const setMachineStatusFilter = (status: PlatformResourceStatusFilter) => {
+ setSearchParams({ status: status === 'all' ? null : status }, { replace: true });
+ };
const machinePosture = createMemo(() => buildStandalonePostureSummary(model().machines));
const availabilityPosture = createMemo(() =>
buildStandalonePostureSummary(model().availabilityChecks),
@@ -331,6 +340,8 @@ export function StandalonePageSurface() {
emptyTitle="No machines"
emptyDescription="Install Pulse Agent on Linux, macOS, Windows, or Unraid systems for full CPU, memory, disk, and network telemetry."
targetAgentVersion={agentUpdateTargetVersion()}
+ externalStatus={machineStatusFilter}
+ onExternalStatusChange={setMachineStatusFilter}
/>
</Show>
</div>
diff --git a/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx b/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx
index b1c4d71036..3fb6b8ee5c 100644
--- a/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx
+++ b/frontend-modern/src/features/standalone/__tests__/StandalonePageSurface.test.tsx
@@ -6,12 +6,18 @@ import { StandalonePageSurface } from '../StandalonePageSurface';
const mocks = vi.hoisted(() => ({
pathname: '/standalone/machines',
+ searchParams: {} as Record<string, string>,
+ setSearchParams: vi.fn(),
navigate: vi.fn(),
useUnifiedResources: vi.fn(),
versionInfo: vi.fn(),
- AgentsMachinesTable: vi.fn((props: { resources: Resource[] }) => (
- <div data-testid="agents-machines-table" data-resource-count={props.resources.length} />
- )),
+ AgentsMachinesTable: vi.fn(
+ (props: {
+ resources: Resource[];
+ externalStatus?: () => string;
+ onExternalStatusChange?: (value: string) => void;
+ }) => <div data-testid="agents-machines-table" data-resource-count={props.resources.length} />,
+ ),
AvailabilityChecksTable: vi.fn((props: { resources: Resource[] }) => (
<div data-testid="availability-checks-table" data-resource-count={props.resources.length} />
)),
@@ -37,6 +43,7 @@ vi.mock('@solidjs/router', async () => {
},
}),
useNavigate: () => mocks.navigate,
+ useSearchParams: () => [mocks.searchParams, mocks.setSearchParams],
A: (props: { href: string; children: JSX.Element }) => (
<a href={props.href}>{props.children}</a>
),
@@ -51,26 +58,32 @@ vi.mock('../AvailabilityChecksTable', () => ({
AvailabilityChecksTable: mocks.AvailabilityChecksTable,
}));
-vi.mock('@/features/platformPage/sharedPlatformPage', () => ({
- PlatformErrorState: () => <div data-testid="platform-error-state" />,
- PlatformSectionTabs: (props: {
- active: string;
- tabs: Array<{ id: string; label: string; path: string }>;
- }) => (
- <div
- data-testid="standalone-section-tabs"
- data-active={props.active}
- data-tabs={props.tabs.map((tab) => tab.id).join(',')}
- />
- ),
- PlatformTableEmptyState: (props: { title: string; actions?: JSX.Element }) => (
- <div data-testid="platform-table-empty-state">
- <span>{props.title}</span>
- {props.actions}
- </div>
- ),
- PlatformTableLoadingState: () => <div data-testid="platform-table-loading-state" />,
-}));
+vi.mock('@/features/platformPage/sharedPlatformPage', async () => {
+ const actual = await vi.importActual<typeof import('@/features/platformPage/sharedPlatformPage')>(
+ '@/features/platformPage/sharedPlatformPage',
+ );
+ return {
+ ...actual,
+ PlatformErrorState: () => <div data-testid="platform-error-state" />,
+ PlatformSectionTabs: (props: {
+ active: string;
+ tabs: Array<{ id: string; label: string; path: string }>;
+ }) => (
+ <div
+ data-testid="standalone-section-tabs"
+ data-active={props.active}
+ data-tabs={props.tabs.map((tab) => tab.id).join(',')}
+ />
+ ),
+ PlatformTableEmptyState: (props: { title: string; actions?: JSX.Element }) => (
+ <div data-testid="platform-table-empty-state">
+ <span>{props.title}</span>
+ {props.actions}
+ </div>
+ ),
+ PlatformTableLoadingState: () => <div data-testid="platform-table-loading-state" />,
+ };
+});
const resource = (overrides: Partial<Resource>): Resource =>
({
@@ -88,6 +101,8 @@ const resource = (overrides: Partial<Resource>): Resource =>
beforeEach(() => {
mocks.pathname = '/standalone/machines';
+ mocks.searchParams = {};
+ mocks.setSearchParams.mockClear();
mocks.navigate.mockClear();
mocks.versionInfo.mockReturnValue(null);
mocks.useUnifiedResources.mockReturnValue({
@@ -120,6 +135,16 @@ afterEach(() => {
});
describe('StandalonePageSurface', () => {
+ it('normalizes legacy machine status links into route-owned filter state', () => {
+ mocks.searchParams = { status: 'running' };
+ render(() => <StandalonePageSurface />);
+
+ const props = mocks.AgentsMachinesTable.mock.calls.at(-1)?.[0];
+ expect(props?.externalStatus?.()).toBe('online');
+ props?.onExternalStatusChange?.('offline');
+ expect(mocks.setSearchParams).toHaveBeenCalledWith({ status: 'offline' }, { replace: true });
+ });
+
it('keeps overview focused on Pulse Agent machines only', () => {
render(() => <StandalonePageSurface />);
diff --git a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
index 0e85fd30fc..3363fa0978 100644
--- a/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
+++ b/frontend-modern/src/routing/__tests__/resourceLinks.test.ts
@@ -29,6 +29,7 @@ import {
PULSE_MCP_TOKEN_SETUP_PATH,
PULSE_INTELLIGENCE_AGENT_TOKEN_PRESET,
SETTINGS_PULSE_INTELLIGENCE_ASSISTANT_PATH,
+ SETTINGS_PULSE_INTELLIGENCE_DISCOVERY_PATH,
SETTINGS_PULSE_INTELLIGENCE_PATH,
isExternalAgentSetupHash,
PROXMOX_DEFAULT_TAB,
@@ -132,6 +133,9 @@ describe('resource link routing contract', () => {
expect(SETTINGS_PULSE_INTELLIGENCE_ASSISTANT_PATH).toBe(
'/settings/pulse-intelligence/assistant',
);
+ expect(SETTINGS_PULSE_INTELLIGENCE_DISCOVERY_PATH).toBe(
+ '/settings/pulse-intelligence/discovery',
+ );
expect(EXTERNAL_AGENT_SETUP_ANCHOR).toBe('external-agent-setup');
expect(EXTERNAL_AGENT_SETUP_PATH).toBe(
'/settings/pulse-intelligence/assistant#external-agent-setup',
diff --git a/frontend-modern/src/routing/resourceLinks.ts b/frontend-modern/src/routing/resourceLinks.ts
index 3623eaca40..008a482c82 100644
--- a/frontend-modern/src/routing/resourceLinks.ts
+++ b/frontend-modern/src/routing/resourceLinks.ts
@@ -43,6 +43,7 @@ export const PATROL_OPERATIONS_LOOP_PATH = PATROL_CONTROL_PATH;
export const SETTINGS_API_ACCESS_PATH = '/settings/security/api';
export const SETTINGS_PULSE_INTELLIGENCE_PATH = '/settings/pulse-intelligence';
export const SETTINGS_PULSE_INTELLIGENCE_ASSISTANT_PATH = `${SETTINGS_PULSE_INTELLIGENCE_PATH}/assistant`;
+export const SETTINGS_PULSE_INTELLIGENCE_DISCOVERY_PATH = `${SETTINGS_PULSE_INTELLIGENCE_PATH}/discovery`;
export const API_TOKEN_CREATE_ANCHOR = 'api-token-create';
export const API_TOKEN_PRESET_QUERY_PARAM = 'tokenPreset';
export const PULSE_INTELLIGENCE_AGENT_TOKEN_PRESET = 'pulse-intelligence-agent';
diff --git a/frontend-modern/src/utils/__tests__/discoveryPresentation.test.ts b/frontend-modern/src/utils/__tests__/discoveryPresentation.test.ts
index e9e3752a25..c71b2eb5d3 100644
--- a/frontend-modern/src/utils/__tests__/discoveryPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/discoveryPresentation.test.ts
@@ -10,6 +10,7 @@ import {
getDiscoveryProvenanceIconClass,
getDiscoveryProvenanceLabel,
getDiscoveryProvenanceTitle,
+ getDiscoveryServiceContextSettingsTarget,
getNetworkDiscoveryModePresentation,
getDiscoveryNotesEmptyState,
getDiscoveryObservedSourceLabel,
@@ -104,6 +105,10 @@ describe('discoveryPresentation', () => {
href: '/settings/security/api',
label: 'Settings → API Access',
});
+ expect(getDiscoveryServiceContextSettingsTarget()).toEqual({
+ href: '/settings/pulse-intelligence/discovery',
+ label: 'Open Service Context settings',
+ });
expect(getDiscoveryNoConnectedAgentMessage(false)).toBe(
'Commands not enabled. Enable Pulse commands from Settings → Infrastructure for this agent.',
);
@@ -236,7 +241,16 @@ describe('discoveryPresentation', () => {
service_type: 'grafana',
confidence: 0.9,
ports: [{ port: 3000, protocol: 'tcp', process: 'grafana', address: '0.0.0.0' }],
- facts: [{ category: 'service', key: 'status', value: 'running', source: 'systemd', confidence: 1, discovered_at: '2026-06-01T00:00:00Z' }],
+ facts: [
+ {
+ category: 'service',
+ key: 'status',
+ value: 'running',
+ source: 'systemd',
+ confidence: 1,
+ discovered_at: '2026-06-01T00:00:00Z',
+ },
+ ],
config_paths: [],
data_paths: [],
log_paths: [],
diff --git a/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts b/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts
index f5da208e28..906e18ab24 100644
--- a/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts
+++ b/frontend-modern/src/utils/__tests__/resourceIdentity.test.ts
@@ -372,7 +372,9 @@ describe('resourceIdentity', () => {
} as unknown as Agent;
expect(getInfrastructureMetadataId(node, agent)).toBe('agent-discovery');
- expect(getInfrastructureDiscoveryHostname({ name: 'pve1' }, agent)).toBe('canonical-host.local');
+ expect(getInfrastructureDiscoveryHostname({ name: 'pve1' }, agent)).toBe(
+ 'canonical-host.local',
+ );
});
it('resolves configured node labels with display-first precedence', () => {
@@ -558,12 +560,20 @@ describe('resourceIdentity', () => {
});
it('resolves canonical cluster names for Kubernetes RBAC inventory rows', () => {
- for (const type of ['k8s-role', 'k8s-cluster-role', 'k8s-role-binding', 'k8s-cluster-role-binding'] as const) {
+ for (const type of [
+ 'k8s-role',
+ 'k8s-cluster-role',
+ 'k8s-role-binding',
+ 'k8s-cluster-role-binding',
+ ] as const) {
expect(
getPreferredResourceClusterName(
makeResource({
type,
- name: type === 'k8s-role' || type === 'k8s-role-binding' ? 'api-runtime' : 'platform-monitoring',
+ name:
+ type === 'k8s-role' || type === 'k8s-role-binding'
+ ? 'api-runtime'
+ : 'platform-monitoring',
kubernetes: { clusterName: 'prod-eu', context: 'prod-eu-context' },
}),
),
@@ -579,7 +589,12 @@ describe('resourceIdentity', () => {
it('prefers RFC 1918 private IPv4 over Tailscale and IPv6', () => {
const resource = makeResource({
identity: {
- ips: ['100.109.215.65', 'fd7a:115c:a1e0::f35:d741', 'fe80::1bf2:7ef4:cd4b:8d71', '192.168.0.2'],
+ ips: [
+ '100.109.215.65',
+ 'fd7a:115c:a1e0::f35:d741',
+ 'fe80::1bf2:7ef4:cd4b:8d71',
+ '192.168.0.2',
+ ],
},
});
expect(getPreferredResourceIP(resource)).toBe('192.168.0.2');
@@ -591,6 +606,21 @@ describe('resourceIdentity', () => {
});
expect(getPreferredResourceIP(resource)).toBe('100.64.0.1');
});
+
+ it('prefers a host interface over Docker bridges, tunnels, and link-local addresses', () => {
+ const resource = makeResource({
+ identity: { ips: ['fe80::1', '172.18.0.1', '192.168.0.113'] },
+ agent: {
+ networkInterfaces: [
+ { name: 'docker0', addresses: ['172.18.0.1/16'] },
+ { name: 'tailscale0', addresses: ['100.109.215.65/32'] },
+ { name: 'eth0', addresses: ['fe80::1/64', '192.168.0.113/24'] },
+ ],
+ },
+ });
+
+ expect(getPreferredResourceIP(resource)).toBe('192.168.0.113');
+ });
});
describe('resolveGuestUrlWithIdentity', () => {
diff --git a/frontend-modern/src/utils/agentResources.ts b/frontend-modern/src/utils/agentResources.ts
index 2b85082616..61cbfcc310 100644
--- a/frontend-modern/src/utils/agentResources.ts
+++ b/frontend-modern/src/utils/agentResources.ts
@@ -43,6 +43,32 @@ export const hasDockerFacetEvidence = (value: unknown): boolean => {
return Boolean(docker && hasMeaningfulFacetValue(docker));
};
+const DOCKER_RUNTIME_IDENTITY_FIELDS = ['runtime', 'runtimeVersion', 'dockerVersion'] as const;
+const DOCKER_RUNTIME_INVENTORY_COUNT_FIELDS = [
+ 'containerCount',
+ 'imageCount',
+ 'volumeCount',
+ 'networkCount',
+ 'nodeCount',
+ 'secretCount',
+ 'configCount',
+] as const;
+
+export const hasDockerRuntimeHostEvidence = (resource: Resource): boolean => {
+ if (resource.type === 'docker-host') return true;
+ if (resource.type !== 'agent') return false;
+ const platformData = getPlatformDataRecord(resource);
+ const docker = asRecord(resource.docker) ?? asRecord(platformData?.docker);
+ if (!docker) return false;
+ if (DOCKER_RUNTIME_IDENTITY_FIELDS.some((field) => Boolean(asTrimmedString(docker[field])))) {
+ return true;
+ }
+ return DOCKER_RUNTIME_INVENTORY_COUNT_FIELDS.some((field) => {
+ const value = docker[field];
+ return typeof value === 'number' && Number.isFinite(value) && value > 0;
+ });
+};
+
type KubernetesContextLike = {
clusterId?: string | null;
name?: string | null;
@@ -102,8 +128,8 @@ const hasExplicitSourceEvidence = (resource: Resource): boolean => {
const platformData = getPlatformDataRecord(resource);
return Boolean(
resource.sources?.length ||
- (Array.isArray(platformData?.sources) && platformData.sources.length > 0) ||
- Object.keys(getSourceStatusRecord(resource) || {}).length > 0,
+ (Array.isArray(platformData?.sources) && platformData.sources.length > 0) ||
+ Object.keys(getSourceStatusRecord(resource) || {}).length > 0,
);
};
@@ -272,9 +298,9 @@ export const hasAgentFacet = (resource: Resource): boolean => {
const discoveryTarget = resource.discoveryTarget;
return Boolean(
resource.agent ||
- getPlatformAgentRecord(resource) ||
- getExplicitAgentIdFromResource(resource) ||
- (isAgentDiscoveryResourceType(discoveryTarget?.resourceType) && discoveryTarget?.agentId),
+ getPlatformAgentRecord(resource) ||
+ getExplicitAgentIdFromResource(resource) ||
+ (isAgentDiscoveryResourceType(discoveryTarget?.resourceType) && discoveryTarget?.agentId),
);
};
diff --git a/frontend-modern/src/utils/discoveryPresentation.ts b/frontend-modern/src/utils/discoveryPresentation.ts
index b7a9b569cd..8446aea215 100644
--- a/frontend-modern/src/utils/discoveryPresentation.ts
+++ b/frontend-modern/src/utils/discoveryPresentation.ts
@@ -1,8 +1,13 @@
-import type { AvailabilityProbeSuggestion, DiscoveryFact, ResourceDiscovery } from '@/types/discovery';
+import type {
+ AvailabilityProbeSuggestion,
+ DiscoveryFact,
+ ResourceDiscovery,
+} from '@/types/discovery';
import {
getInfrastructureSettingsLocationLabel,
getInfrastructureSettingsTarget,
} from '@/utils/infrastructureSettingsPresentation';
+import { SETTINGS_PULSE_INTELLIGENCE_DISCOVERY_PATH } from '@/routing/resourceLinks';
export interface DiscoveryIdentifiedSummary {
serviceName: string;
@@ -113,14 +118,14 @@ export function hasMeaningfulDiscoveryContext(
return Boolean(
isMeaningfulDiscoveryText(discovery.service_name) ||
- isMeaningfulDiscoveryText(discovery.service_type) ||
- isMeaningfulDiscoveryText(discovery.service_version) ||
- isMeaningfulDiscoveryText(discovery.category) ||
- portCount > 0 ||
- hasFacts ||
- hasPaths ||
- hasSuggestedUrl ||
- hasSuggestedProbe,
+ isMeaningfulDiscoveryText(discovery.service_type) ||
+ isMeaningfulDiscoveryText(discovery.service_version) ||
+ isMeaningfulDiscoveryText(discovery.category) ||
+ portCount > 0 ||
+ hasFacts ||
+ hasPaths ||
+ hasSuggestedUrl ||
+ hasSuggestedProbe,
);
}
@@ -315,6 +320,13 @@ export function getDiscoveryApiAccessSettingsTarget() {
} as const;
}
+export function getDiscoveryServiceContextSettingsTarget() {
+ return {
+ href: SETTINGS_PULSE_INTELLIGENCE_DISCOVERY_PATH,
+ label: 'Open Service Context settings',
+ } as const;
+}
+
export function getDiscoveryNoConnectedAgentMessage(commandsEnabled?: boolean): string {
const infrastructureSettings = getInfrastructureSettingsLocationLabel();
diff --git a/frontend-modern/src/utils/resourceIdentity.ts b/frontend-modern/src/utils/resourceIdentity.ts
index e7de713e61..3472d81a75 100644
--- a/frontend-modern/src/utils/resourceIdentity.ts
+++ b/frontend-modern/src/utils/resourceIdentity.ts
@@ -365,23 +365,94 @@ export const getPreferredInfrastructureDisplayName = (resource: Resource): strin
const IPV4_PATTERN = /^\d{1,3}(\.\d{1,3}){3}$/;
-const isRfc1918Private = (ip: string): boolean => {
+const normalizeIPAddress = (value: string): string => {
+ const trimmed = value.trim().replace(/^\[|\]$/g, '');
+ if (!trimmed) return '';
+ const withoutPrefix = trimmed.split('/', 1)[0] ?? '';
+ return withoutPrefix.split('%', 1)[0] ?? '';
+};
+
+const isValidIPv4 = (ip: string): boolean => {
if (!IPV4_PATTERN.test(ip)) return false;
+ return ip.split('.').every((part) => {
+ const value = Number(part);
+ return Number.isInteger(value) && value >= 0 && value <= 255;
+ });
+};
+
+const isRfc1918Private = (ip: string): boolean => {
+ if (!isValidIPv4(ip)) return false;
const [a, b] = ip.split('.').map(Number);
return a === 10 || (a === 172 && b >= 16 && b <= 31) || (a === 192 && b === 168);
};
+const isCarrierGradeNat = (ip: string): boolean => {
+ if (!isValidIPv4(ip)) return false;
+ const [a, b] = ip.split('.').map(Number);
+ return a === 100 && b >= 64 && b <= 127;
+};
+
+const isUnusableIPAddress = (ip: string): boolean => {
+ const normalized = ip.toLowerCase();
+ if (isValidIPv4(ip)) {
+ const [a, b] = ip.split('.').map(Number);
+ return a === 0 || a === 127 || a >= 224 || (a === 169 && b === 254);
+ }
+ return (
+ normalized === '::' ||
+ normalized === '::1' ||
+ normalized.startsWith('fe80:') ||
+ normalized.startsWith('ff')
+ );
+};
+
+const isVirtualNetworkInterface = (name: string): boolean =>
+ /^(?:lo|docker\d*|br-[0-9a-f]+|virbr\d*|veth|cni|flannel|cali|podman|tailscale|zt|wg|tun|tap|utun)/i.test(
+ name.trim(),
+ );
+
+const addressPreference = (ip: string): number => {
+ if (isUnusableIPAddress(ip)) return 100;
+ if (isRfc1918Private(ip)) return 0;
+ if (isValidIPv4(ip)) return isCarrierGradeNat(ip) ? 30 : 10;
+ return ip.includes(':') ? 20 : 90;
+};
+
+type AddressCandidate = {
+ ip: string;
+ score: number;
+ order: number;
+};
+
/**
- * Pick the best LAN IPv4 from a resource's identity, preferring RFC 1918
- * private addresses over Tailscale (100.64/10) or IPv6.
+ * Pick the address that most likely represents the machine on its operator-facing
+ * network. Physical-interface addresses outrank container bridges and tunnels;
+ * routable IPv4 outranks link-local and IPv6 fallback addresses.
*/
export const getPreferredResourceIP = (resource: Resource): string | undefined => {
- const ips = resource.identity?.ips ?? [];
- if (ips.length === 0) return undefined;
- const lanIp = ips.find((ip) => isRfc1918Private(ip));
- if (lanIp) return lanIp;
- const ipv4 = ips.find((ip) => IPV4_PATTERN.test(ip));
- return ipv4;
+ const candidates: AddressCandidate[] = [];
+ let order = 0;
+ for (const networkInterface of resource.agent?.networkInterfaces ?? []) {
+ const interfacePenalty = isVirtualNetworkInterface(networkInterface.name) ? 50 : 0;
+ for (const value of networkInterface.addresses ?? []) {
+ const ip = normalizeIPAddress(value);
+ if (!ip) continue;
+ candidates.push({ ip, score: addressPreference(ip) + interfacePenalty, order: order++ });
+ }
+ }
+ for (const value of resource.identity?.ips ?? []) {
+ const ip = normalizeIPAddress(value);
+ if (!ip) continue;
+ candidates.push({ ip, score: addressPreference(ip) + 25, order: order++ });
+ }
+
+ return candidates
+ .filter(
+ (candidate, index) =>
+ candidates.findIndex((other) => other.ip.toLowerCase() === candidate.ip.toLowerCase()) ===
+ index,
+ )
+ .sort((left, right) => left.score - right.score || left.order - right.order)[0]?.ip;
};
/**