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.

Surface availability probe evidence in infrastructure rows

rcourtman90fbafbc21f8
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 34c4e7ca47..dad9dba354 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -2808,3 +2808,9 @@ agentless endpoints must also stay on the shared settings form vocabulary:
presets may fill protocol, port, and path defaults, but display badges and
drawers still derive `Availability` and `Network Endpoint` labels from the
shared resource presentation helpers rather than from preset-local copy.
+Infrastructure rows for those same agentless endpoints must surface probe
+evidence directly in the row, not just as a green status dot or an
+`Availability` badge. The shared row presentation must expose the probe method,
+latest latency or failure result, and recent check timing from the canonical
+availability payload so operators can understand what was actually measured
+without opening the drawer.
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index fc521fe8cb..a7c65dd472 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -971,6 +971,13 @@ surplus width is redistributed across peer metric, source, uptime, and action
columns instead of being dumped into the first column and wasting operator
visible table density.
That hot-path contract now includes policy badge rendering on resource rows.
+Agentless availability evidence belongs on that same bounded row path.
+Infrastructure `network-endpoint` rows may replace otherwise empty host metric
+slots with compact probe method/result text and may add one compact resource
+subline for latency, failure, and recent check timing, but they must derive
+that text from the existing resource payload and shared presentation helper
+instead of adding a per-row fetch, extra hydration pass, or unbounded badge
+stack.
The infrastructure summary hot path is now explicit shared ownership too:
`InfrastructureSummary.tsx` stays a render shell,
`useInfrastructureSummaryState.ts` owns chart polling and cache lifecycle, and
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index 17347d74ff..c711cd6691 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -526,6 +526,12 @@ Frontend resource adapters must preserve that same availability identity on
both REST and realtime paths: a thin `network-endpoint` update with
availability data is still `platformType=availability`, `sourceType=api`, and
must not regress to a generic platform badge in infrastructure rows or drawers.
+Infrastructure row presentation must also consume that availability payload as
+operator evidence, not only as badge identity. `network-endpoint` rows should
+surface the probe method, latest latency or failure result, and recent check
+timing from either the top-level availability field or the live-state
+`platformData.availability` mirror, so REST and realtime paths answer what was
+measured without requiring the drawer.
That same frontend-owned compatibility boundary must remain intentionally
narrow. Shared resource adapters may admit explicit aliases such as `host`,
`truenas`, and `ceph`, and VMware detail mappers may project typed metadata
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
index a9700b1d3a..cd316a6073 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourceHostTableCard.tsx
@@ -38,6 +38,7 @@ import {
getResourcePolicyTableBadges,
shouldShowResourceAlternateName,
} from '@/utils/resourcePolicyPresentation';
+import { getAvailabilityProbePresentation } from '@/utils/availabilityProbePresentation';
import { ResourceDetailDrawer } from './ResourceDetailDrawer';
import { buildWorkloadsHref } from './workloadsLink';
import { ClusterDeployBanner } from './ClusterDeployBanner';
@@ -324,6 +325,9 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
const policyBadges = createMemo(() =>
getResourcePolicyTableBadges(resource.policy),
);
+ const availabilityProbe = createMemo(() =>
+ getAvailabilityProbePresentation(resource),
+ );
const workloadsHref = createMemo(() => buildWorkloadsHref(resource));
const resourceRowInteraction = createSummaryInteractiveRowPreviewHandlers({
onPreview: () => tableProps.onHoverChange?.(resource.id),
@@ -399,6 +403,18 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
counts={resource.facetCounts}
class="mt-0.5"
/>
+ <Show when={availabilityProbe()}>
+ {(probe) => (
+ <div class="mt-0.5 flex min-w-0 items-center">
+ <span
+ class={`min-w-0 truncate text-[9px] leading-tight ${probe().toneClassName}`}
+ title={probe().detailLabel}
+ >
+ {probe().rowLabel}
+ </span>
+ </div>
+ )}
+ </Show>
</div>
<Show when={workloadsHref()}>
{(href) => (
@@ -514,9 +530,30 @@ export const UnifiedResourceHostTableCard: Component<UnifiedResourceHostTableCar
<Show
when={resource.network}
fallback={
- <div class="text-center">
- <span class="text-xs text-slate-400">—</span>
- </div>
+ <Show
+ when={availabilityProbe()}
+ fallback={
+ <div class="text-center">
+ <span class="text-xs text-slate-400">—</span>
+ </div>
+ }
+ >
+ {(probe) => (
+ <div
+ class="mx-auto flex max-w-full flex-col items-center justify-center leading-tight"
+ title={probe().detailLabel}
+ >
+ <span class="max-w-full truncate text-[9px] tracking-normal text-muted">
+ {probe().methodLabel}
+ </span>
+ <span
+ class={`max-w-full truncate text-[11px] font-medium tabular-nums ${probe().toneClassName}`}
+ >
+ {probe().resultLabel}
+ </span>
+ </div>
+ )}
+ </Show>
}
>
<div
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
index 8025b36955..b17461f169 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
@@ -1,6 +1,6 @@
import { readFileSync } from 'node:fs';
import { join } from 'node:path';
-import { beforeEach, describe, expect, it, vi } from 'vitest';
+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { render, waitFor, within } from '@solidjs/testing-library';
import type { Resource } from '@/types/resource';
import { UnifiedResourceTable } from '@/components/Infrastructure/UnifiedResourceTable';
@@ -125,6 +125,10 @@ describe('UnifiedResourceTable performance contract', () => {
localStorage.clear();
});
+ afterEach(() => {
+ vi.restoreAllMocks();
+ });
+
describe('Fixture profile validation', () => {
for (const [profile, count] of Object.entries(PROFILES)) {
it(`builds profile ${profile} with stable size and type distribution`, () => {
@@ -217,6 +221,48 @@ describe('UnifiedResourceTable performance contract', () => {
expect(queryByText('Docker')).toBeNull();
});
+ it('surfaces availability probe evidence directly in network endpoint rows', async () => {
+ vi.spyOn(Date, 'now').mockReturnValue(new Date('2026-05-06T13:00:20Z').getTime());
+ const resources = [
+ makeResource(1, {
+ type: 'network-endpoint',
+ name: 'MQTT power meter',
+ displayName: 'MQTT power meter',
+ platformId: 'mock-availability-mqtt-meter',
+ platformType: 'availability',
+ sourceType: 'api',
+ status: 'online',
+ cpu: undefined,
+ memory: undefined,
+ disk: undefined,
+ platformData: {
+ sources: ['availability'],
+ availability: {
+ protocol: 'tcp',
+ port: 1883,
+ available: true,
+ latencyMillis: 7,
+ lastChecked: '2026-05-06T13:00:06Z',
+ },
+ },
+ }),
+ ];
+
+ const { getByText, getAllByText } = render(() => (
+ <UnifiedResourceTable
+ resources={resources}
+ expandedResourceId={null}
+ onExpandedResourceChange={vi.fn()}
+ groupingMode="flat"
+ />
+ ));
+
+ await waitFor(() => {
+ expect(getByText('TCP 1883 - 7 ms - checked 14s ago')).toBeInTheDocument();
+ });
+ expect(getAllByText('7 ms').length).toBeGreaterThanOrEqual(1);
+ });
+
it('adapts host columns from the measured table surface width instead of the window width', async () => {
const resources = [
makeResource(1, {
diff --git a/frontend-modern/src/utils/__tests__/availabilityProbePresentation.test.ts b/frontend-modern/src/utils/__tests__/availabilityProbePresentation.test.ts
new file mode 100644
index 0000000000..0d710a8ddd
--- /dev/null
+++ b/frontend-modern/src/utils/__tests__/availabilityProbePresentation.test.ts
@@ -0,0 +1,101 @@
+import { describe, expect, it, vi } from 'vitest';
+import type { Resource } from '@/types/resource';
+import {
+ getAvailabilityProbeMethodLabel,
+ getAvailabilityProbePresentation,
+} from '@/utils/availabilityProbePresentation';
+
+const makeAvailabilityResource = (overrides?: Partial<Resource>): Resource => ({
+ id: 'availability:mock-availability-mqtt-meter',
+ type: 'network-endpoint',
+ name: 'MQTT power meter',
+ displayName: 'MQTT power meter',
+ platformId: 'mock-availability-mqtt-meter',
+ platformType: 'availability',
+ sourceType: 'api',
+ status: 'online',
+ lastSeen: Date.now(),
+ availability: {
+ protocol: 'tcp',
+ port: 1883,
+ available: true,
+ latencyMillis: 7,
+ lastChecked: '2026-05-06T13:00:06Z',
+ },
+ platformData: { sources: ['availability'] },
+ ...overrides,
+});
+
+describe('availabilityProbePresentation', () => {
+ it('labels ICMP as ping so agentless rows explain the probe method plainly', () => {
+ expect(getAvailabilityProbeMethodLabel({ protocol: 'icmp' })).toBe('Ping');
+ });
+
+ it('builds compact row evidence for a successful TCP availability probe', () => {
+ vi.spyOn(Date, 'now').mockReturnValue(new Date('2026-05-06T13:00:20Z').getTime());
+
+ const presentation = getAvailabilityProbePresentation(makeAvailabilityResource());
+
+ expect(presentation).toMatchObject({
+ methodLabel: 'TCP 1883',
+ resultLabel: '7 ms',
+ rowLabel: 'TCP 1883 - 7 ms - checked 14s ago',
+ });
+ expect(presentation?.detailLabel).toContain('TCP 1883 - 7 ms');
+ expect(presentation?.toneClassName).toContain('emerald');
+ });
+
+ it('also reads availability evidence from platform data for live state rows', () => {
+ vi.spyOn(Date, 'now').mockReturnValue(new Date('2026-05-06T13:00:20Z').getTime());
+
+ const presentation = getAvailabilityProbePresentation(
+ makeAvailabilityResource({
+ availability: undefined,
+ platformData: {
+ sources: ['availability'],
+ availability: {
+ protocol: 'tcp',
+ port: 6053,
+ available: true,
+ latencyMillis: 11,
+ lastChecked: '2026-05-06T13:00:15Z',
+ },
+ },
+ }),
+ );
+
+ expect(presentation).toMatchObject({
+ methodLabel: 'TCP 6053',
+ resultLabel: '11 ms',
+ rowLabel: 'TCP 6053 - 11 ms - checked 5s ago',
+ });
+ });
+
+ it('keeps failure evidence visible without exposing a full error as the row label', () => {
+ vi.spyOn(Date, 'now').mockReturnValue(new Date('2026-05-06T13:00:20Z').getTime());
+
+ const presentation = getAvailabilityProbePresentation(
+ makeAvailabilityResource({
+ status: 'offline',
+ availability: {
+ protocol: 'icmp',
+ available: false,
+ lastChecked: '2026-05-06T13:00:09Z',
+ lastSuccess: '2026-05-06T12:51:20Z',
+ consecutiveFailures: 3,
+ failureThreshold: 2,
+ lastError: 'icmp probe timed out',
+ },
+ }),
+ );
+
+ expect(presentation).toMatchObject({
+ methodLabel: 'Ping',
+ resultLabel: 'timed out',
+ rowLabel: 'Ping - timed out - checked 11s ago',
+ });
+ expect(presentation?.detailLabel).toContain('3/2 failures');
+ expect(presentation?.detailLabel).toContain('icmp probe timed out');
+ expect(presentation?.toneClassName).toContain('red');
+ });
+});
diff --git a/frontend-modern/src/utils/availabilityProbePresentation.ts b/frontend-modern/src/utils/availabilityProbePresentation.ts
new file mode 100644
index 0000000000..90b150a2bd
--- /dev/null
+++ b/frontend-modern/src/utils/availabilityProbePresentation.ts
@@ -0,0 +1,138 @@
+import type { Resource, ResourceAvailabilityMeta } from '@/types/resource';
+import { formatRelativeTime } from '@/utils/format';
+
+export interface AvailabilityProbePresentation {
+ methodLabel: string;
+ resultLabel: string;
+ rowLabel: string;
+ detailLabel: string;
+ toneClassName: string;
+}
+
+type AvailabilityProbeResource = Pick<
+ Resource,
+ 'type' | 'platformType' | 'status' | 'availability' | 'platformData'
+>;
+
+const AVAILABILITY_PROBE_SUCCESS_CLASS = 'text-emerald-600 dark:text-emerald-300';
+const AVAILABILITY_PROBE_WARNING_CLASS = 'text-amber-600 dark:text-amber-300';
+const AVAILABILITY_PROBE_ERROR_CLASS = 'text-red-600 dark:text-red-300';
+const AVAILABILITY_PROBE_UNKNOWN_CLASS = 'text-muted';
+
+const normalizeAvailabilityProtocol = (protocol?: string | null): string =>
+ (protocol ?? '').trim().toLowerCase();
+
+export const getAvailabilityProbeMethodLabel = (
+ availability?: ResourceAvailabilityMeta | null,
+): string => {
+ const protocol = normalizeAvailabilityProtocol(availability?.protocol);
+ if (protocol === 'icmp') return 'Ping';
+ if (protocol === 'tcp') {
+ return availability?.port ? `TCP ${availability.port}` : 'TCP';
+ }
+ if (protocol === 'http' || protocol === 'https') {
+ const path = (availability?.path ?? '').trim();
+ return path ? `${protocol.toUpperCase()} ${path}` : protocol.toUpperCase();
+ }
+ return protocol ? protocol.toUpperCase() : 'Probe';
+};
+
+const getAvailabilityProbeFailureLabel = (availability: ResourceAvailabilityMeta): string => {
+ const lastError = (availability.lastError ?? '').trim();
+ const normalizedError = lastError.toLowerCase();
+ if (normalizedError.includes('timed out') || normalizedError.includes('timeout')) {
+ return 'timed out';
+ }
+ const httpStatus = lastError.match(/\b([45]\d{2})\b/);
+ if (httpStatus) {
+ return `HTTP ${httpStatus[1]}`;
+ }
+ return 'failed';
+};
+
+const getAvailabilityProbeResultLabel = (
+ resource: Pick<Resource, 'status'>,
+ availability: ResourceAvailabilityMeta,
+): string => {
+ const latency = availability.latencyMillis;
+ const normalizedStatus = (resource.status ?? '').trim().toLowerCase();
+ if (availability.available === false || ['offline', 'degraded'].includes(normalizedStatus)) {
+ return getAvailabilityProbeFailureLabel(availability);
+ }
+ if (typeof latency === 'number' && Number.isFinite(latency) && latency >= 0) {
+ return `${Math.round(latency)} ms`;
+ }
+ if (availability.available === true || normalizedStatus === 'online') {
+ return 'reachable';
+ }
+ return 'not checked';
+};
+
+const getAvailabilityProbeToneClassName = (
+ resource: Pick<Resource, 'status'>,
+ availability: ResourceAvailabilityMeta,
+): string => {
+ const normalizedStatus = (resource.status ?? '').trim().toLowerCase();
+ if (availability.available === false || normalizedStatus === 'offline') {
+ return AVAILABILITY_PROBE_ERROR_CLASS;
+ }
+ if (normalizedStatus === 'degraded') {
+ return AVAILABILITY_PROBE_WARNING_CLASS;
+ }
+ if (availability.available === true || normalizedStatus === 'online') {
+ return AVAILABILITY_PROBE_SUCCESS_CLASS;
+ }
+ return AVAILABILITY_PROBE_UNKNOWN_CLASS;
+};
+
+const getFailureCountLabel = (availability: ResourceAvailabilityMeta): string | null => {
+ const failures = availability.consecutiveFailures;
+ if (typeof failures !== 'number' || !Number.isFinite(failures) || failures <= 0) {
+ return null;
+ }
+ const threshold = availability.failureThreshold;
+ if (typeof threshold === 'number' && Number.isFinite(threshold) && threshold > 0) {
+ return `${failures}/${threshold} failures`;
+ }
+ return failures === 1 ? '1 failure' : `${failures} failures`;
+};
+
+export const getAvailabilityProbePresentation = (
+ resource: AvailabilityProbeResource,
+): AvailabilityProbePresentation | null => {
+ const platformAvailability = resource.platformData?.availability as
+ | ResourceAvailabilityMeta
+ | undefined;
+ const availability = resource.availability ?? platformAvailability;
+ if (
+ !availability ||
+ (resource.type !== 'network-endpoint' && resource.platformType !== 'availability')
+ ) {
+ return null;
+ }
+
+ const methodLabel = getAvailabilityProbeMethodLabel(availability);
+ const resultLabel = getAvailabilityProbeResultLabel(resource, availability);
+ const checked = formatRelativeTime(availability.lastChecked);
+ const failures = getFailureCountLabel(availability);
+ const detailParts = [`${methodLabel} - ${resultLabel}`];
+ if (checked) detailParts.push(`checked ${checked}`);
+ if (failures) detailParts.push(failures);
+ if (availability.lastSuccess && availability.available === false) {
+ const lastSuccess = formatRelativeTime(availability.lastSuccess);
+ if (lastSuccess) detailParts.push(`last success ${lastSuccess}`);
+ }
+ if (availability.lastError) detailParts.push(availability.lastError);
+
+ const rowLabel = checked
+ ? `${methodLabel} - ${resultLabel} - checked ${checked}`
+ : `${methodLabel} - ${resultLabel}`;
+
+ return {
+ methodLabel,
+ resultLabel,
+ rowLabel,
+ detailLabel: detailParts.join(' - '),
+ toneClassName: getAvailabilityProbeToneClassName(resource, availability),
+ };
+};