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.

Align Agents page with platform machine tables

rcourtman78d124a3925c
diff --git a/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md b/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md
index 61dd415a0b..e164e64725 100644
--- a/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md
+++ b/docs/release-control/v6/internal/PLATFORM_SUPPORT_MODEL.md
@@ -162,10 +162,13 @@ Current agent-backed primary platforms:
The authenticated shell may label the `agent` destination as `Agents`. That
surface is the Pulse-managed host platform, not a generic mixed-systems bucket:
-navigation and rows must be gated to canonical `platformType="agent"` host
-resources, while Proxmox, VMware, TrueNAS, Kubernetes, and runtime-lens
-resources remain owned by their respective platform contracts and may cross-link
-to related agent facets.
+navigation and rows must be gated to agent-primary `type="agent"` machine
+resources with no stronger platform owner. A Proxmox, VMware, TrueNAS, or
+Kubernetes host that also has the Pulse agent installed remains owned by that
+platform page; the agent contributes health, temperature, SMART, command, and
+check-in facets there instead of creating a second operational row in Agents.
+Standalone Mac, Windows, Linux, Unraid, and other bare-agent machines remain
+Agents-page members.
Current agent-backed runtime lenses:
diff --git a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
index 7bffb4bfd4..aab6a69162 100644
--- a/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
+++ b/docs/release-control/v6/internal/SOURCE_OF_TRUTH.md
@@ -143,8 +143,11 @@ rather than becoming its own top-level platform.
The `agent` platform is the first-class Pulse-managed host surface and may be
presented in the authenticated shell as `Agents`; it is not a generic
mixed-systems page, and membership must stay gated to canonical
-`platformType="agent"` host resources rather than provider-owned nodes,
-workloads, or unknown resources.
+Pulse-agent-primary `type="agent"` machine resources without a stronger
+platform owner. Source-less legacy state may fall back to
+`platformType="agent"`, but Proxmox, vSphere, TrueNAS, Kubernetes, and other
+provider-owned host rows remain on their owning platform pages even when a
+Pulse agent reports supplemental telemetry such as temperature or SMART data.
The same model also sets the current posture for platform breadth: `truenas`
is at the declared support floor summarized below, and `vmware-vsphere` is the
current admitted strategic next-platform direction while its support claim
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 53a93e14bb..5e5a035950 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -1023,7 +1023,11 @@ not a replacement status card, CTA band, or page-local nested card.
and keyboard shortcut must all route through `buildAgentsPath()` and the
`PrimaryInfrastructureNavId` evidence gate; they must not create a generic
Hosts, Nodes, Other, or mixed-systems bucket, and they must not include
- provider-owned platform nodes that are not canonical agent resources.
+ provider-owned platform nodes that are not canonical agent resources. The
+ Agents page is a platform page, not a legacy Infrastructure page: it must
+ use the shared platform tab, toolbar, table-card, and kind-aligned column
+ primitives, and it must not reintroduce the old top-of-page
+ InfrastructureSummary chart strip.
## Forbidden Paths
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 08c112818c..1f4716c56c 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -118,6 +118,7 @@ cross-source deduplication.
94. `internal/unifiedresources/storage_consumers.go`
95. `frontend-modern/src/features/agents/agentsPageModel.ts`
96. `frontend-modern/src/features/agents/AgentsPageSurface.tsx`
+97. `frontend-modern/src/features/agents/AgentsMachinesTable.tsx`
## Shared Boundaries
@@ -519,12 +520,15 @@ AI-only summary payloads, or page-local heuristics.
derive every internal link from those builders so the canonical resource
URL vocabulary stays single-sourced; ad hoc string concatenation of
platform routes inside feature directories is not permitted.
- The `Agents` route is the canonical browser projection of unified-resource
- agent rows: membership must require `resource.type === "agent"` and a
- normalized `platformType === "agent"`. Provider-owned nodes from Proxmox,
- VMware, TrueNAS, Kubernetes, or runtime lenses may link to related agent
- facets, but they must not become Agents-page members through hostname,
- source, or incidental agent metadata alone.
+ The `Agents` route is the canonical browser projection of Pulse-managed
+ unified-resource agent rows: membership must require
+ `resource.type === "agent"`, canonical Pulse-agent source evidence from
+ resource sources or source status, and no stronger provider-owner evidence
+ from Proxmox, VMware, TrueNAS, or Kubernetes. Source-less legacy snapshots
+ may fall back to a normalized `platformType === "agent"`, but
+ provider-owned nodes must not become Agents-page members through hostname,
+ `agent` platform scope, or agent telemetry alone; those facts surface as
+ facets on the owning provider page.
The default tab for each platform path must point at a sub-tab whose
canonical unified-resource projection actually populates. The
canonical TrueNAS adapter (`internal/truenas/provider.go::
diff --git a/frontend-modern/src/features/agents/AgentsMachinesTable.tsx b/frontend-modern/src/features/agents/AgentsMachinesTable.tsx
new file mode 100644
index 0000000000..053b168a32
--- /dev/null
+++ b/frontend-modern/src/features/agents/AgentsMachinesTable.tsx
@@ -0,0 +1,379 @@
+import { For, Show, type Component, type JSX } from 'solid-js';
+import { ResourceDetailDrawer } from '@/components/Infrastructure/ResourceDetailDrawer';
+import { StackedDiskBar } from '@/components/Workloads/StackedDiskBar';
+import { StackedMemoryBar } from '@/components/Workloads/StackedMemoryBar';
+import { ResponsiveMetricCell } from '@/components/shared/responsive';
+import { StatusDot } from '@/components/shared/StatusDot';
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableHeader,
+ TableRow,
+} from '@/components/shared/Table';
+import { TableCard } from '@/components/shared/TableCard';
+import { TableCardHeader } from '@/components/shared/TableCardHeader';
+import {
+ createPlatformResourceDetailState,
+ getPlatformResourceDetailRowClass,
+} from '@/features/platformPage/PlatformResourceDetailTableRow';
+import {
+ PLATFORM_HEALTH_FILTER_OPTIONS,
+ PLATFORM_TABLE_BODY_CLASS,
+ PLATFORM_TABLE_CARD_CLASS,
+ PLATFORM_TABLE_HEADER_ROW_CLASS,
+ PlatformTableEmptyState,
+ PlatformTableToolbar,
+ createPlatformTableFilterState,
+ filterPlatformResources,
+ getPlatformTableCellClassForKind,
+ getPlatformTableHeadClassForKind,
+ type PlatformResourceStatusFilter,
+} from '@/features/platformPage/sharedPlatformPage';
+import type { Disk } from '@/types/api';
+import type { Resource } from '@/types/resource';
+import { normalizeDiskArray } from '@/utils/format';
+import { buildMetricKeyForUnifiedResource } from '@/utils/metricsKeys';
+import { getSimpleStatusIndicator } from '@/utils/status';
+import { asTrimmedString } from '@/utils/stringUtils';
+
+const formatUptime = (seconds: number | undefined): string => {
+ if (!seconds || seconds <= 0) return '—';
+ const days = Math.floor(seconds / 86_400);
+ if (days > 0) return `${days}d`;
+ const hours = Math.floor(seconds / 3_600);
+ if (hours > 0) return `${hours}h`;
+ const mins = Math.floor(seconds / 60);
+ return `${mins}m`;
+};
+
+const formatTemperature = (celsius: number | undefined): JSX.Element => {
+ if (typeof celsius !== 'number' || !Number.isFinite(celsius) || celsius <= 0) {
+ return <span class="text-muted">—</span>;
+ }
+ return <span class="tabular-nums">{Math.round(celsius)}°C</span>;
+};
+
+const formatLastSeen = (value: number | undefined): string => {
+ if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) return '—';
+ const ageSeconds = Math.max(0, Math.floor((Date.now() - value) / 1000));
+ if (ageSeconds < 60) return 'now';
+ const minutes = Math.floor(ageSeconds / 60);
+ if (minutes < 60) return `${minutes}m`;
+ const hours = Math.floor(minutes / 60);
+ if (hours < 48) return `${hours}h`;
+ return `${Math.floor(hours / 24)}d`;
+};
+
+const metricFallback = () => (
+ <div class="flex justify-center">
+ <span class="text-xs text-muted" aria-hidden="true">
+ —
+ </span>
+ </div>
+);
+
+const finiteMetric = (value: number | undefined): number | undefined =>
+ typeof value === 'number' && Number.isFinite(value) ? value : undefined;
+
+const percentFromMetric = (metric: Resource['cpu'] | undefined): number | undefined =>
+ finiteMetric(metric?.current);
+
+const memoryTotalFor = (machine: Resource): number =>
+ finiteMetric(machine.memory?.total) ?? finiteMetric(machine.agent?.memory?.total) ?? 0;
+
+const memoryUsedFor = (machine: Resource): number =>
+ finiteMetric(machine.memory?.used) ?? finiteMetric(machine.agent?.memory?.used) ?? 0;
+
+const memoryPercentOnlyFor = (machine: Resource): number | undefined => {
+ if (memoryTotalFor(machine) > 0) return undefined;
+ return finiteMetric(machine.memory?.current) ?? finiteMetric(machine.agent?.memory?.usage);
+};
+
+const aggregateDiskFor = (machine: Resource): Disk | undefined => {
+ if (!machine.disk) return undefined;
+ const total = finiteMetric(machine.disk.total) ?? 0;
+ const used = finiteMetric(machine.disk.used) ?? 0;
+ const free = finiteMetric(machine.disk.free) ?? (total > 0 ? Math.max(0, total - used) : 0);
+ const usage =
+ total > 0 && used > 0 ? (used / total) * 100 : (finiteMetric(machine.disk.current) ?? 0);
+ if (total <= 0 && usage <= 0) return undefined;
+ return { total, used, free, usage };
+};
+
+const titleCase = (value: string): string =>
+ value
+ .split(/[\s_-]+/)
+ .filter(Boolean)
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
+ .join(' ');
+
+const systemLabelFor = (machine: Resource): string => {
+ const osName = asTrimmedString(machine.agent?.osName);
+ const osVersion = asTrimmedString(machine.agent?.osVersion);
+ if (osName && osVersion) return `${osName} ${osVersion}`;
+ if (osName) return osName;
+ return titleCase(asTrimmedString(machine.agent?.platform) || asTrimmedString(machine.technology) || 'Agent');
+};
+
+export const AgentsMachinesTable: Component<{
+ resources: Resource[];
+ emptyIcon: JSX.Element;
+ emptyTitle: string;
+ emptyDescription: string;
+}> = (props) => {
+ const tableState = createPlatformTableFilterState({
+ resources: () => props.resources,
+ initialStatus: 'all' as PlatformResourceStatusFilter,
+ filter: filterPlatformResources,
+ });
+ const drawer = createPlatformResourceDetailState({ idPrefix: 'agents-machine-drawer' });
+ const detailColspan = 9;
+
+ return (
+ <Show
+ when={props.resources.length > 0}
+ fallback={
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title={props.emptyTitle}
+ description={props.emptyDescription}
+ />
+ }
+ >
+ <div class="space-y-3">
+ <PlatformTableToolbar
+ search={tableState.search}
+ onSearchChange={tableState.setSearch}
+ searchPlaceholder="Search agent machines"
+ status={tableState.status()}
+ onStatusChange={tableState.setStatus}
+ statusOptions={PLATFORM_HEALTH_FILTER_OPTIONS}
+ visible={tableState.visible()}
+ total={tableState.total()}
+ rowNoun="machines"
+ />
+
+ <Show
+ when={tableState.filtered().length > 0}
+ fallback={
+ <PlatformTableEmptyState
+ icon={props.emptyIcon}
+ title="No machines match current filters"
+ description="Adjust the search or status filter to see more agent-primary machines."
+ />
+ }
+ >
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <TableCardHeader title="Machines" />
+ <Table class="min-w-full table-fixed text-xs md:min-w-[1120px]">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('name')} w-[40%] md:w-[19%]`}
+ >
+ Machine
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[14%]`}
+ >
+ System
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('text')} hidden md:table-cell md:w-[8%]`}
+ >
+ Agent
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('metric-bar')} w-[20%] md:w-[12%]`}
+ >
+ CPU
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('metric-bar')} w-[20%] md:w-[12%]`}
+ >
+ <span class="md:hidden">Mem</span>
+ <span class="hidden md:inline">Memory</span>
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('metric-bar')} w-[20%] md:w-[12%]`}
+ >
+ Disk
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden md:table-cell md:w-[7%]`}
+ >
+ Uptime
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden md:table-cell md:w-[7%]`}
+ >
+ Temp
+ </TableHead>
+ <TableHead
+ class={`${getPlatformTableHeadClassForKind('numeric-value')} hidden lg:table-cell lg:w-[9%]`}
+ >
+ Last seen
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
+ <For each={tableState.filtered()}>
+ {(machine) => {
+ const name = () => asTrimmedString(machine.name) || machine.id;
+ const hostname = () =>
+ asTrimmedString(machine.agent?.hostname) ||
+ asTrimmedString(machine.identity?.hostname);
+ const systemLabel = () => systemLabelFor(machine);
+ const agentVersion = () => asTrimmedString(machine.agent?.agentVersion) || '—';
+ const indicator = () => getSimpleStatusIndicator(machine.status);
+ const canRenderMetrics = () => indicator().variant !== 'danger';
+ const metricsKey = () => buildMetricKeyForUnifiedResource(machine);
+ const cpuPercent = () => percentFromMetric(machine.cpu);
+ const memoryUsed = () => memoryUsedFor(machine);
+ const memoryTotal = () => memoryTotalFor(machine);
+ const memoryPercentOnly = () => memoryPercentOnlyFor(machine);
+ const hasMemoryMetric = () =>
+ memoryTotal() > 0 || memoryPercentOnly() !== undefined;
+ const aggregateDisk = () => aggregateDiskFor(machine);
+ const disks = () => normalizeDiskArray(machine.agent?.disks);
+ const hasDiskMetric = () =>
+ aggregateDisk() !== undefined || (disks()?.length ?? 0) > 0;
+ const isExpanded = () => drawer.isExpanded(machine);
+ const detailRowId = () => drawer.detailRowId(machine);
+
+ return (
+ <>
+ <TableRow
+ class={`${getPlatformResourceDetailRowClass(isExpanded())} text-[11px] sm:text-xs`}
+ aria-controls={isExpanded() ? detailRowId() : undefined}
+ aria-expanded={isExpanded() ? 'true' : 'false'}
+ data-agents-machine-row={machine.id}
+ onClick={() => drawer.toggle(machine)}
+ onKeyDown={drawer.handleActivationKey(machine)}
+ tabIndex={0}
+ >
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('name')} w-[40%] md:w-auto`}
+ >
+ <div class="flex min-w-0 items-center gap-2">
+ <StatusDot
+ size="sm"
+ variant={indicator().variant}
+ title={machine.status || 'unknown'}
+ ariaHidden
+ />
+ <span class="truncate font-semibold text-base-content" title={name()}>
+ {name()}
+ </span>
+ </div>
+ <span
+ class="mt-0.5 block truncate pl-5 text-[9px] text-muted sm:text-[10px] md:hidden"
+ title={hostname() || systemLabel()}
+ >
+ {hostname() || systemLabel()}
+ </span>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} hidden text-base-content md:table-cell`}
+ >
+ <span class="truncate" title={systemLabel()}>
+ {systemLabel()}
+ </span>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} hidden font-mono text-[11px] text-base-content md:table-cell`}
+ >
+ {agentVersion()}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('metric-bar')} w-[20%] md:w-auto`}
+ >
+ <ResponsiveMetricCell
+ class="w-full"
+ value={cpuPercent() ?? 0}
+ type="cpu"
+ resourceId={metricsKey()}
+ isRunning={canRenderMetrics() && cpuPercent() !== undefined}
+ showMobile={false}
+ />
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('metric-bar')} w-[20%] md:w-auto`}
+ >
+ <Show
+ when={canRenderMetrics() && hasMemoryMetric()}
+ fallback={metricFallback()}
+ >
+ <StackedMemoryBar
+ used={memoryUsed()}
+ total={memoryTotal()}
+ percentOnly={memoryPercentOnly()}
+ />
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('metric-bar')} w-[20%] md:w-auto`}
+ >
+ <Show
+ when={canRenderMetrics() && hasDiskMetric()}
+ fallback={metricFallback()}
+ >
+ <StackedDiskBar
+ mode={(disks()?.length ?? 0) > 1 ? 'vertical-bars' : undefined}
+ disks={disks()}
+ aggregateDisk={aggregateDisk()}
+ />
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content md:table-cell`}
+ >
+ {formatUptime(machine.uptime ?? machine.agent?.uptimeSeconds)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content md:table-cell`}
+ >
+ {formatTemperature(machine.temperature)}
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} hidden text-base-content lg:table-cell`}
+ >
+ {formatLastSeen(machine.lastSeen)}
+ </TableCell>
+ </TableRow>
+ <Show when={isExpanded()}>
+ <TableRow data-inline-agent-machine-detail-for={machine.id}>
+ <TableCell
+ id={detailRowId()}
+ colspan={detailColspan}
+ class="border-b border-border bg-surface-alt p-0"
+ >
+ <div
+ class="px-2 py-3 sm:px-4 sm:py-4"
+ onClick={(event) => event.stopPropagation()}
+ >
+ <ResourceDetailDrawer
+ resource={machine}
+ presentation="table-row"
+ onClose={() => drawer.close(machine)}
+ />
+ </div>
+ </TableCell>
+ </TableRow>
+ </Show>
+ </>
+ );
+ }}
+ </For>
+ </TableBody>
+ </Table>
+ </TableCard>
+ </Show>
+ </div>
+ </Show>
+ );
+};
+
+export default AgentsMachinesTable;
diff --git a/frontend-modern/src/features/agents/AgentsPageSurface.tsx b/frontend-modern/src/features/agents/AgentsPageSurface.tsx
index 653006a9aa..8390a873b5 100644
--- a/frontend-modern/src/features/agents/AgentsPageSurface.tsx
+++ b/frontend-modern/src/features/agents/AgentsPageSurface.tsx
@@ -2,31 +2,16 @@ import { Show, createEffect, createMemo, createSignal } from 'solid-js';
import { useNavigate } from '@solidjs/router';
import ServerIcon from 'lucide-solid/icons/server';
import SettingsIcon from 'lucide-solid/icons/settings';
-import type { TimeRange } from '@/api/charts';
import { buildInfrastructureOnboardingPath } from '@/components/Settings/infrastructureWorkspaceModel';
-import { UnifiedResourceTable } from '@/components/Infrastructure/UnifiedResourceTable';
-import { InfrastructureSummary } from '@/components/Infrastructure/InfrastructureSummary';
-import { Card } from '@/components/shared/Card';
-import { EmptyState } from '@/components/shared/EmptyState';
-import { FilterBar, type FilterDef } from '@/components/shared/FilterBar';
-import { ChartVisibilityToggleButton } from '@/components/shared/FilterToolbar';
-import { GroupedTableModeSegmentedControl } from '@/components/shared/GroupedTableModeSegmentedControl';
-import { StickySummarySection } from '@/components/shared/StickySummarySection';
import {
PlatformErrorState,
PlatformSectionTabs,
PlatformTableEmptyState,
PlatformTableLoadingState,
} from '@/features/platformPage/sharedPlatformPage';
-import { useBreakpoint } from '@/hooks/useBreakpoint';
-import { usePersistentSignal } from '@/hooks/usePersistentSignal';
import { useUnifiedResources } from '@/hooks/useUnifiedResources';
-import { STORAGE_KEYS } from '@/utils/localStorage';
-import type { SummaryChartHoverSync } from '@/components/shared/contextualFocus';
-import { isSummaryTimeRange } from '@/components/shared/summaryTimeRange';
-import { buildAgentsPageFilterModel, buildAgentsPageModel } from './agentsPageModel';
-
-type AgentsGroupingMode = 'grouped' | 'flat';
+import { AgentsMachinesTable } from './AgentsMachinesTable';
+import { buildAgentsPageModel } from './agentsPageModel';
const AGENTS_RESOURCE_QUERY = 'type=agent';
const AGENTS_TAB_SPECS = [{ id: 'overview', label: 'Overview', path: '/agents/overview' }] as const;
@@ -35,7 +20,6 @@ const agentsIcon = () => <ServerIcon class="h-6 w-6 text-slate-400" />;
export function AgentsPageSurface() {
const navigate = useNavigate();
- const { isMobile } = useBreakpoint();
const { resources, loading, error, refetch } = useUnifiedResources({
query: AGENTS_RESOURCE_QUERY,
cacheKey: 'agents-workspace',
@@ -43,33 +27,8 @@ export function AgentsPageSurface() {
});
const [initialLoadComplete, setInitialLoadComplete] = createSignal(false);
- const [selectedStatus, setSelectedStatus] = createSignal('');
- const [searchQuery, setSearchQuery] = createSignal('');
- const [expandedResourceId, setExpandedResourceId] = createSignal<string | null>(null);
- const [hoveredResourceId, setHoveredResourceId] = createSignal<string | null>(null);
- const [chartHoverSync, setChartHoverSync] = createSignal<SummaryChartHoverSync | null>(null);
- const [summaryRange, setSummaryRange] = usePersistentSignal<TimeRange>(
- STORAGE_KEYS.AGENTS_SUMMARY_RANGE,
- '1h',
- {
- deserialize: (raw) => (isSummaryTimeRange(raw) ? raw : '1h'),
- },
- );
- const [summaryCollapsed, setSummaryCollapsed] = usePersistentSignal<boolean>(
- STORAGE_KEYS.AGENTS_SUMMARY_COLLAPSED,
- false,
- { deserialize: (raw) => raw === 'true' },
- );
- const [groupingMode, setGroupingMode] = usePersistentSignal<AgentsGroupingMode>(
- 'agentsGroupingMode',
- 'grouped',
- { deserialize: (raw) => (raw === 'grouped' || raw === 'flat' ? raw : 'grouped') },
- );
const model = createMemo(() => buildAgentsPageModel(resources()));
- const filterModel = createMemo(() =>
- buildAgentsPageFilterModel(model().resources, selectedStatus(), searchQuery()),
- );
const showLoading = createMemo(
() => loading() && !initialLoadComplete() && model().resources.length === 0,
);
@@ -77,11 +36,6 @@ export function AgentsPageSurface() {
() => initialLoadComplete() && !error() && model().resources.length === 0,
);
- const clearFilters = () => {
- setSelectedStatus('');
- setSearchQuery('');
- };
-
createEffect(() => {
if (!loading() && !initialLoadComplete()) {
setInitialLoadComplete(true);
@@ -131,97 +85,12 @@ export function AgentsPageSurface() {
/>
}
>
- <div class="space-y-4">
- <Show when={!summaryCollapsed()}>
- <StickySummarySection>
- <InfrastructureSummary
- resources={filterModel().filteredResources}
- timeRange={summaryRange()}
- onTimeRangeChange={setSummaryRange}
- hoveredResourceId={hoveredResourceId()}
- focusedResourceId={expandedResourceId()}
- chartHoverSync={chartHoverSync()}
- onChartHoverSyncChange={setChartHoverSync}
- />
- </StickySummarySection>
- </Show>
-
- <FilterBar
- isMobile={isMobile}
- savedViewsKey="agents"
- search={{
- value: searchQuery,
- setValue: setSearchQuery,
- placeholder: 'Search agents, hostnames, IPs, or tags...',
- historyKey: STORAGE_KEYS.AGENTS_SEARCH_HISTORY,
- emptyMessage: 'Recent agent searches appear here.',
- }}
- filters={
- [
- {
- id: 'status',
- label: 'Status',
- group: 'status',
- value: selectedStatus,
- setValue: setSelectedStatus,
- defaultValue: '',
- options: () => [
- { value: '', label: 'All' },
- ...filterModel().statusOptions.map((status) => ({
- value: status.key,
- label: status.label,
- })),
- ],
- },
- ] as FilterDef[]
- }
- viewOptionsTrailing={
- <>
- <GroupedTableModeSegmentedControl
- value={groupingMode()}
- onChange={(value) => setGroupingMode(value as AgentsGroupingMode)}
- />
- <ChartVisibilityToggleButton
- collapsed={summaryCollapsed()}
- onToggle={() => setSummaryCollapsed((collapsed) => !collapsed)}
- />
- </>
- }
- />
-
- <Show
- when={filterModel().hasFilteredResources}
- fallback={
- <Card class="p-6">
- <EmptyState
- icon={agentsIcon()}
- title="No agents match these filters"
- description="Adjust the search or status filter to see more Pulse Agent machines."
- actions={
- <Show when={filterModel().hasActiveFilters}>
- <button
- type="button"
- onClick={clearFilters}
- class="inline-flex items-center gap-2 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-base-content shadow-sm hover:bg-slate-50"
- >
- Clear filters
- </button>
- </Show>
- }
- />
- </Card>
- }
- >
- <UnifiedResourceTable
- resources={filterModel().filteredResources}
- expandedResourceId={expandedResourceId()}
- onExpandedResourceChange={setExpandedResourceId}
- hoveredResourceId={hoveredResourceId()}
- onHoverChange={setHoveredResourceId}
- groupingMode={groupingMode()}
- />
- </Show>
- </div>
+ <AgentsMachinesTable
+ resources={model().resources}
+ emptyIcon={agentsIcon()}
+ emptyTitle="No Pulse Agent machines"
+ emptyDescription="Install the Pulse Agent on Linux, macOS, Windows, Unraid, or another host to populate this platform page."
+ />
</Show>
</Show>
</Show>
diff --git a/frontend-modern/src/features/agents/__tests__/agentsPageModel.test.ts b/frontend-modern/src/features/agents/__tests__/agentsPageModel.test.ts
index d263a918b6..17287f9e29 100644
--- a/frontend-modern/src/features/agents/__tests__/agentsPageModel.test.ts
+++ b/frontend-modern/src/features/agents/__tests__/agentsPageModel.test.ts
@@ -17,15 +17,51 @@ const resource = (overrides: Partial<Resource>): Resource =>
}) as Resource;
describe('agentsPageModel', () => {
- it('strictly projects only canonical agent platform resources', () => {
+ it('projects agent-primary machine resources without admitting provider-owned host rows', () => {
const model = buildAgentsPageModel([
- resource({ id: 'mac-mini', platformType: 'agent', type: 'agent' }),
- resource({ id: 'pve-node', platformType: 'proxmox-pve', type: 'agent' }),
- resource({ id: 'k8s-pod', platformType: 'agent', type: 'pod' }),
- resource({ id: 'docker-host', platformType: 'docker', type: 'docker-host' }),
+ resource({ id: 'mac-mini', platformType: 'agent', type: 'agent', sources: ['agent'] }),
+ resource({
+ id: 'linux-docker-host',
+ platformType: 'agent',
+ platformScopes: ['agent', 'docker'],
+ type: 'agent',
+ sourceType: 'hybrid',
+ sources: ['agent', 'docker'],
+ }),
+ resource({
+ id: 'pve-node',
+ platformType: 'proxmox-pve',
+ type: 'agent',
+ sourceType: 'hybrid',
+ sources: ['proxmox', 'agent'],
+ }),
+ resource({
+ id: 'esxi-host',
+ platformType: 'vmware-vsphere',
+ platformScopes: ['agent', 'vmware-vsphere'],
+ type: 'agent',
+ sourceType: 'api',
+ sources: ['vmware'],
+ agent: { agentId: 'vc-host-101', platform: 'vmware-vsphere' },
+ }),
+ resource({ id: 'k8s-pod', platformType: 'agent', type: 'pod', sources: ['agent'] }),
+ resource({
+ id: 'docker-host',
+ platformType: 'docker',
+ type: 'docker-host',
+ sources: ['agent'],
+ }),
+ ]);
+
+ expect(model.resources.map((item) => item.id)).toEqual(['mac-mini', 'linux-docker-host']);
+ });
+
+ it('keeps legacy source-less agent platform rows visible', () => {
+ const model = buildAgentsPageModel([
+ resource({ id: 'legacy-agent', platformType: 'agent', type: 'agent', sources: undefined }),
]);
- expect(model.resources.map((item) => item.id)).toEqual(['mac-mini']);
+ expect(model.resources.map((item) => item.id)).toEqual(['legacy-agent']);
});
it('filters agent resources by status and local identity search', () => {
diff --git a/frontend-modern/src/features/agents/agentsPageModel.ts b/frontend-modern/src/features/agents/agentsPageModel.ts
index 259e2199e5..08d526a628 100644
--- a/frontend-modern/src/features/agents/agentsPageModel.ts
+++ b/frontend-modern/src/features/agents/agentsPageModel.ts
@@ -5,7 +5,7 @@ import {
filterResources,
tokenizeSearch,
} from '@/components/Infrastructure/infrastructureSelectors';
-import { normalizeSourcePlatformKey } from '@/utils/sourcePlatforms';
+import { isPulseAgentPlatformResource } from '@/utils/agentResources';
export interface AgentsPageModel {
resources: Resource[];
@@ -20,7 +20,7 @@ export interface AgentsPageFilterModel {
}
export const isAgentsPageResource = (resource: Resource): boolean =>
- resource.type === 'agent' && normalizeSourcePlatformKey(resource.platformType) === 'agent';
+ isPulseAgentPlatformResource(resource);
export function buildAgentsPageModel(resources: readonly Resource[]): AgentsPageModel {
return {
diff --git a/frontend-modern/src/features/infrastructureNavigation/__tests__/infrastructureNavigationModel.test.ts b/frontend-modern/src/features/infrastructureNavigation/__tests__/infrastructureNavigationModel.test.ts
index e5806592a5..afc77cdcee 100644
--- a/frontend-modern/src/features/infrastructureNavigation/__tests__/infrastructureNavigationModel.test.ts
+++ b/frontend-modern/src/features/infrastructureNavigation/__tests__/infrastructureNavigationModel.test.ts
@@ -131,6 +131,45 @@ describe('infrastructureNavigationModel', () => {
).toBe(false);
});
+ it('shows Agents for agent-primary machine source evidence', () => {
+ expect(
+ buildPrimaryInfrastructureNavigationVisibility([
+ resource({
+ id: 'mac-mini-1',
+ type: 'agent',
+ platformType: 'agent',
+ sourceType: 'agent',
+ sources: ['agent'],
+ platformScopes: ['agent'],
+ }),
+ ]).agents,
+ ).toBe(true);
+ });
+
+ it('does not show Agents for provider-owned host rows even when the agent source is present', () => {
+ expect(
+ buildPrimaryInfrastructureNavigationVisibility([
+ resource({
+ id: 'pve-node-1',
+ type: 'agent',
+ platformType: 'proxmox-pve',
+ sourceType: 'hybrid',
+ sources: ['proxmox', 'agent'],
+ platformScopes: ['agent', 'proxmox-pve'],
+ }),
+ resource({
+ id: 'esxi-host-1',
+ type: 'agent',
+ platformType: 'vmware-vsphere',
+ sourceType: 'api',
+ sources: ['vmware'],
+ platformScopes: ['agent', 'vmware-vsphere'],
+ agent: { agentId: 'vc-host-101', platform: 'vmware-vsphere' },
+ }),
+ ]).agents,
+ ).toBe(false);
+ });
+
it('selects the first visible platform using the canonical primary navigation order', () => {
expect(
selectFirstVisiblePrimaryInfrastructureNavigationId({
diff --git a/frontend-modern/src/features/infrastructureNavigation/infrastructureNavigationModel.ts b/frontend-modern/src/features/infrastructureNavigation/infrastructureNavigationModel.ts
index 340b402ad0..3f2a021668 100644
--- a/frontend-modern/src/features/infrastructureNavigation/infrastructureNavigationModel.ts
+++ b/frontend-modern/src/features/infrastructureNavigation/infrastructureNavigationModel.ts
@@ -1,5 +1,6 @@
import type { Accessor } from 'solid-js';
import type { Resource, ResourceType } from '@/types/resource';
+import { isPulseAgentPlatformResource } from '@/utils/agentResources';
import {
ADMITTED_PLATFORM_IDS,
SUPPORTED_PLATFORM_IDS,
@@ -58,9 +59,6 @@ const KUBERNETES_RESOURCE_TYPES = new Set<ResourceType>([
]);
const DOCKER_RESOURCE_TYPES = new Set<ResourceType>(['docker-host', 'docker-service']);
-const isPrimaryAgentPlatformResource = (resource: Resource): boolean =>
- resource.type === 'agent' && normalizeSourcePlatformKey(resource.platformType) === 'agent';
-
const asRecord = (value: unknown): Record<string, unknown> | null =>
typeof value === 'object' && value !== null ? (value as Record<string, unknown>) : null;
@@ -163,7 +161,7 @@ export function buildPrimaryInfrastructureNavigationVisibility(
): InfrastructureNavigationVisibility {
const presentNavigableScopes = buildNavigableResourceInfrastructureScopeSet(resources);
return {
- agents: resources.some(isPrimaryAgentPlatformResource),
+ agents: resources.some(isPulseAgentPlatformResource),
proxmox: PRIMARY_INFRASTRUCTURE_NAV_SCOPE_IDS.proxmox.some((id) =>
presentNavigableScopes.has(id),
),
diff --git a/frontend-modern/src/utils/__tests__/agentResources.test.ts b/frontend-modern/src/utils/__tests__/agentResources.test.ts
index 043742df2a..44d2ba7c35 100644
--- a/frontend-modern/src/utils/__tests__/agentResources.test.ts
+++ b/frontend-modern/src/utils/__tests__/agentResources.test.ts
@@ -10,8 +10,10 @@ import {
getPreferredResourceClusterName,
hasDockerWorkloadsScope,
hasAgentFacet,
+ hasPulseAgentSourceEvidence,
isAgentFacetInfrastructureResource,
isAgentProfileAssignableResource,
+ isPulseAgentPlatformResource,
isTrueNASSystemResource,
} from '@/utils/agentResources';
@@ -366,4 +368,104 @@ describe('agentResources', () => {
),
).toBe(false);
});
+
+ it('admits only agent-primary machines to the Agents platform page', () => {
+ expect(
+ isPulseAgentPlatformResource(
+ makeResource({
+ type: 'agent',
+ platformType: 'agent',
+ sourceType: 'agent',
+ sources: ['agent'],
+ platformScopes: ['agent'],
+ }),
+ ),
+ ).toBe(true);
+
+ expect(
+ isPulseAgentPlatformResource(
+ makeResource({
+ type: 'agent',
+ platformType: 'agent',
+ sourceType: 'hybrid',
+ sources: ['agent', 'docker'],
+ platformScopes: ['agent', 'docker'],
+ }),
+ ),
+ ).toBe(true);
+
+ expect(
+ isPulseAgentPlatformResource(
+ makeResource({
+ type: 'agent',
+ platformType: 'proxmox-pve',
+ sourceType: 'hybrid',
+ sources: ['proxmox', 'agent'],
+ platformScopes: ['agent', 'proxmox-pve'],
+ }),
+ ),
+ ).toBe(false);
+
+ expect(
+ isPulseAgentPlatformResource(
+ makeResource({
+ type: 'agent',
+ platformType: 'vmware-vsphere',
+ sourceType: 'api',
+ sources: ['vmware'],
+ platformScopes: ['agent', 'vmware-vsphere'],
+ agent: { agentId: 'vc-host-101', platform: 'vmware-vsphere' },
+ }),
+ ),
+ ).toBe(false);
+
+ expect(
+ isPulseAgentPlatformResource(
+ makeResource({
+ type: 'pod',
+ platformType: 'agent',
+ sourceType: 'agent',
+ sources: ['agent'],
+ }),
+ ),
+ ).toBe(false);
+ });
+
+ it('keeps legacy source-less agent platform rows visible without admitting provider evidence', () => {
+ expect(
+ hasPulseAgentSourceEvidence(
+ makeResource({
+ type: 'agent',
+ platformType: 'agent',
+ sourceType: 'agent',
+ sources: undefined,
+ }),
+ ),
+ ).toBe(true);
+
+ expect(
+ isPulseAgentPlatformResource(
+ makeResource({
+ type: 'agent',
+ platformType: 'agent',
+ sourceType: 'api',
+ sources: undefined,
+ }),
+ ),
+ ).toBe(true);
+
+ expect(
+ isPulseAgentPlatformResource(
+ makeResource({
+ type: 'agent',
+ platformType: 'agent',
+ sourceType: 'agent',
+ sources: undefined,
+ platformData: {
+ sourceStatus: { kubernetes: { status: 'online' } },
+ },
+ }),
+ ),
+ ).toBe(false);
+ });
});
diff --git a/frontend-modern/src/utils/agentResources.ts b/frontend-modern/src/utils/agentResources.ts
index d33be1c95a..b4ce14d40f 100644
--- a/frontend-modern/src/utils/agentResources.ts
+++ b/frontend-modern/src/utils/agentResources.ts
@@ -15,6 +15,14 @@ const AGENT_PROFILE_ASSIGNABLE_TYPES = new Set<ResourceType>([
'pmg',
'k8s-cluster',
]);
+const AGENT_PROVIDER_OWNER_PLATFORM_IDS = new Set<string>([
+ 'proxmox-pve',
+ 'proxmox-pbs',
+ 'proxmox-pmg',
+ 'kubernetes',
+ 'truenas',
+ 'vmware-vsphere',
+]);
const asRecord = (value: unknown): Record<string, unknown> | undefined =>
value && typeof value === 'object' ? (value as Record<string, unknown>) : undefined;
@@ -58,12 +66,72 @@ type ResourceClusterNameLike = KubernetesContextLike & {
export const getPlatformDataRecord = (resource: Resource): Record<string, unknown> | undefined =>
resource.platformData ? (resource.platformData as Record<string, unknown>) : undefined;
-const hasPlatformSource = (resource: Resource, source: string): boolean => {
- const sources = getPlatformDataRecord(resource)?.sources;
- if (!Array.isArray(sources)) return false;
- return sources.some((value) => normalizeSourcePlatformKey(value) === source);
+const hasSourceListPlatform = (values: unknown, source: string): boolean => {
+ if (!Array.isArray(values)) return false;
+ return values.some(
+ (value) => typeof value === 'string' && normalizeSourcePlatformKey(value) === source,
+ );
+};
+
+const getSourceStatusRecord = (resource: Resource): Record<string, unknown> | undefined =>
+ asRecord(getPlatformDataRecord(resource)?.sourceStatus);
+
+const hasSourceStatusPlatform = (resource: Resource, source: string): boolean => {
+ const sourceStatus = getSourceStatusRecord(resource);
+ if (!sourceStatus) return false;
+ return Object.keys(sourceStatus).some((value) => normalizeSourcePlatformKey(value) === source);
+};
+
+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,
+ );
};
+const hasPlatformSource = (resource: Resource, source: string): boolean =>
+ hasSourceListPlatform(resource.sources, source) ||
+ hasSourceListPlatform(getPlatformDataRecord(resource)?.sources, source);
+
+const hasProviderOwnerPlatformEvidence = (resource: Resource): boolean => {
+ const platformData = getPlatformDataRecord(resource);
+ const candidates: unknown[] = [
+ resource.platformType,
+ ...(Array.isArray(resource.platformScopes) ? resource.platformScopes : []),
+ ...(Array.isArray(platformData?.platformScopes) ? platformData.platformScopes : []),
+ ...(Array.isArray(resource.sources) ? resource.sources : []),
+ ...(Array.isArray(platformData?.sources) ? platformData.sources : []),
+ ...Object.keys(getSourceStatusRecord(resource) || {}),
+ ];
+
+ return candidates.some((value) => {
+ if (typeof value !== 'string') return false;
+ const normalized = normalizeSourcePlatformKey(value);
+ return normalized ? AGENT_PROVIDER_OWNER_PLATFORM_IDS.has(normalized) : false;
+ });
+};
+
+export const hasPulseAgentSourceEvidence = (resource: Resource): boolean => {
+ if (hasPlatformSource(resource, 'agent') || hasSourceStatusPlatform(resource, 'agent')) {
+ return true;
+ }
+
+ if (hasExplicitSourceEvidence(resource)) {
+ return false;
+ }
+
+ return resource.sourceType === 'agent' || resource.sourceType === 'hybrid';
+};
+
+export const isPulseAgentPlatformResource = (resource: Resource): boolean =>
+ resource.type === 'agent' &&
+ !hasProviderOwnerPlatformEvidence(resource) &&
+ (hasPulseAgentSourceEvidence(resource) ||
+ (!hasExplicitSourceEvidence(resource) &&
+ normalizeSourcePlatformKey(resource.platformType) === 'agent'));
+
export const getPlatformAgentRecord = (resource: Resource): Record<string, unknown> | undefined =>
asRecord(getPlatformDataRecord(resource)?.agent);
diff --git a/internal/mock/generator.go b/internal/mock/generator.go
index 7233a2038a..15ad09f122 100644
--- a/internal/mock/generator.go
+++ b/internal/mock/generator.go
@@ -2533,6 +2533,14 @@ func ensureMockNodeHostLinks(data *models.StateSnapshot) {
now := time.Now()
+ hostsByLinkedNodeID := make(map[string]int, len(data.Hosts))
+ for i := range data.Hosts {
+ linkedNodeID := strings.TrimSpace(data.Hosts[i].LinkedNodeID)
+ if linkedNodeID != "" {
+ hostsByLinkedNodeID[linkedNodeID] = i
+ }
+ }
+
for i := range data.Hosts {
host := &data.Hosts[i]
host.LinkedNodeID = ""
@@ -2559,19 +2567,21 @@ func ensureMockNodeHostLinks(data *models.StateSnapshot) {
}
}
+ nextHostIndex := len(data.Hosts)
for i := range data.Nodes {
node := &data.Nodes[i]
- hostID := ""
- if i < len(data.Hosts) {
- hostID = data.Hosts[i].ID
- }
- linkedHost := buildMockLinkedHostFromNode(*node, hostID, i, now)
- if i < len(data.Hosts) {
- data.Hosts[i] = linkedHost
+ hostIndex, exists := hostsByLinkedNodeID[node.ID]
+ if exists && hostIndex >= 0 && hostIndex < len(data.Hosts) {
+ linkedHost := buildMockLinkedHostFromNode(*node, data.Hosts[hostIndex].ID, hostIndex, now)
+ data.Hosts[hostIndex] = linkedHost
+ node.LinkedAgentID = linkedHost.ID
} else {
+ linkedHost := buildMockLinkedHostFromNode(*node, "", nextHostIndex, now)
data.Hosts = append(data.Hosts, linkedHost)
+ hostsByLinkedNodeID[node.ID] = len(data.Hosts) - 1
+ nextHostIndex++
+ node.LinkedAgentID = linkedHost.ID
}
- node.LinkedAgentID = linkedHost.ID
}
}
diff --git a/internal/mock/generator_test.go b/internal/mock/generator_test.go
index 9da5b00b30..2e4c8d4cbc 100644
--- a/internal/mock/generator_test.go
+++ b/internal/mock/generator_test.go
@@ -97,14 +97,12 @@ func TestBuildFixtureStateIncludesSwarmServices(t *testing.T) {
func TestBuildFixtureStateIncludesHostAgents(t *testing.T) {
cfg := DefaultConfig
cfg.GenericHostCount = 5
+ cfg.K8sClusterCount = 0
cfg.RandomMetrics = false
data := buildFixtureState(cfg)
- expectedMin := cfg.GenericHostCount
- if cfg.NodeCount > expectedMin {
- expectedMin = cfg.NodeCount
- }
+ expectedMin := cfg.GenericHostCount + cfg.NodeCount
if len(data.Hosts) < expectedMin {
t.Fatalf("expected at least %d host agents, got %d", expectedMin, len(data.Hosts))
}
@@ -122,6 +120,33 @@ func TestBuildFixtureStateIncludesHostAgents(t *testing.T) {
}
}
+func TestBuildFixtureStatePreservesStandaloneHostAgentsWhenLinkingNodes(t *testing.T) {
+ cfg := DefaultConfig
+ cfg.NodeCount = 3
+ cfg.GenericHostCount = 4
+ cfg.K8sClusterCount = 0
+ cfg.RandomMetrics = false
+
+ data := buildFixtureState(cfg)
+
+ standalone := 0
+ proxmoxLinked := 0
+ for _, host := range data.Hosts {
+ if host.LinkedNodeID != "" {
+ proxmoxLinked++
+ } else {
+ standalone++
+ }
+ }
+
+ if standalone != cfg.GenericHostCount {
+ t.Fatalf("expected %d standalone agent hosts, got %d", cfg.GenericHostCount, standalone)
+ }
+ if proxmoxLinked != cfg.NodeCount {
+ t.Fatalf("expected %d Proxmox-linked agent hosts, got %d", cfg.NodeCount, proxmoxLinked)
+ }
+}
+
func TestGenerateVMStoppedPreservesConfiguredCapacity(t *testing.T) {
cfg := DefaultConfig
cfg.StoppedPercent = 1