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.

feat: surface availability probe badge on workload rows

rcourtmancc1cbbf133c5
diff --git a/frontend-modern/src/components/Workloads/GuestRow.tsx b/frontend-modern/src/components/Workloads/GuestRow.tsx
index 7f1a4517bd..a2607775ac 100644
--- a/frontend-modern/src/components/Workloads/GuestRow.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRow.tsx
@@ -6,6 +6,7 @@ import { formatUptime, formatSpeed, getShortImageName } from '@/utils/format';
import { StackedDiskBar } from './StackedDiskBar';
import { StackedMemoryBar } from './StackedMemoryBar';
import {
+ AvailabilityProbeCell,
BackupIndicator,
BackupStatusCell,
InfoTooltipCell,
@@ -93,6 +94,7 @@ export function GuestRow(props: GuestRowProps) {
supportsBackup,
typeInfo,
workloadType,
+ availabilityPresentation,
} = useGuestRowState(props);
const cpuPercent = createMemo(() => (props.guest.cpu || 0) * 100);
@@ -223,6 +225,9 @@ export function GuestRow(props: GuestRowProps) {
<span class="tabular-nums">{props.nestedWorkloadContext?.count}</span>
</span>
</Show>
+ <Show when={availabilityPresentation()}>
+ {(ap) => <AvailabilityProbeCell presentation={ap()} />}
+ </Show>
</div>
</div>
@@ -617,22 +622,21 @@ export function GuestRow(props: GuestRowProps) {
</td>
</Show>
- {/* OS */}
+ {/* OS / System — availability probe protocol badge lives here per canonical platform table contract */}
<Show when={isColVisible('os')}>
<td class="px-1.5 sm:px-2 py-0.5 align-middle">
- <div class="flex justify-center">
+ <div class="flex items-center justify-center gap-1">
<Show
when={hasOsInfo()}
fallback={
<Show
when={ociImage()}
fallback={
- <span class="text-xs text-slate-400" aria-hidden="true">
- —
- </span>
+ <Show when={availabilityPresentation()}>
+ {(ap) => <AvailabilityProbeCell presentation={ap()} />}
+ </Show>
}
>
- {/* For OCI containers without guest agent, show image name in OS column */}
<span
class="text-xs text-cyan-600 dark:text-cyan-400 truncate max-w-[100px]"
title={`OCI Image: ${ociImage()}`}
@@ -648,6 +652,9 @@ export function GuestRow(props: GuestRowProps) {
agentVersion={agentVersion()}
/>
</Show>
+ <Show when={availabilityPresentation()}>
+ {(ap) => <AvailabilityProbeCell presentation={ap()} />}
+ </Show>
</div>
</td>
</Show>
diff --git a/frontend-modern/src/components/Workloads/GuestRowCells.tsx b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
index ab1c3b923b..f70287fac0 100644
--- a/frontend-modern/src/components/Workloads/GuestRowCells.tsx
+++ b/frontend-modern/src/components/Workloads/GuestRowCells.tsx
@@ -5,6 +5,7 @@ import { useTooltip } from '@/hooks/useTooltip';
import { useAlertsActivation } from '@/stores/alertsActivation';
import type { GuestNetworkInterface } from '@/types/api';
import { formatBytes, formatRelativeTime, getBackupInfo, type BackupInfo } from '@/utils/format';
+import type { AvailabilityProbePresentation } from '@/utils/availabilityProbePresentation';
import {
getWorkloadsGuestBackupStatusPresentation,
getWorkloadsGuestBackupTooltip,
@@ -404,4 +405,48 @@ function InfoTooltipCell(props: { value: string; tooltip: string; type: string }
);
}
-export { BackupIndicator, BackupStatusCell, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
+function AvailabilityProbeCell(props: {
+ presentation: AvailabilityProbePresentation;
+}) {
+ const tip = useTooltip();
+ const p = createMemo(() => props.presentation);
+
+ const protocolLabel = createMemo(() => {
+ const method = p().methodLabel;
+ const spaceIdx = method.indexOf(' ');
+ return spaceIdx > 0 ? method.slice(0, spaceIdx) : method;
+ });
+
+ return (
+ <>
+ <span
+ class={`inline-flex items-center gap-1 rounded px-1 py-0.5 text-[9px] font-semibold leading-none whitespace-nowrap ${p().toneClassName}`}
+ onMouseEnter={tip.onMouseEnter}
+ onMouseLeave={tip.onMouseLeave}
+ >
+ {protocolLabel()}
+ <span
+ class={`inline-block h-1.5 w-1.5 rounded-full ${
+ p().toneClassName.includes('emerald')
+ ? 'bg-emerald-500'
+ : p().toneClassName.includes('red')
+ ? 'bg-red-500'
+ : p().toneClassName.includes('amber')
+ ? 'bg-amber-500'
+ : 'bg-slate-400'
+ }`}
+ />
+ </span>
+ <TooltipPortal when={tip.show()} x={tip.pos().x} y={tip.pos().y}>
+ <div class="min-w-[140px] max-w-[260px]">
+ <div class="font-medium mb-1 text-slate-300 border-b border-border pb-1">
+ Availability Probe
+ </div>
+ <div class="py-0.5 text-xs text-base-content">{p().detailLabel}</div>
+ </div>
+ </TooltipPortal>
+ </>
+ );
+}
+
+export { AvailabilityProbeCell, BackupIndicator, BackupStatusCell, InfoTooltipCell, NetworkInfoCell, OSInfoCell };
diff --git a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
index 6027d3d2d4..648c22d19d 100644
--- a/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/WorkloadsSurface.performance.contract.test.tsx
@@ -1390,7 +1390,7 @@ describe('Workloads performance contract', () => {
expect(guestRowStateSource).not.toContain('rowStyle');
expect(guestRowStateSource).not.toContain('box-shadow');
expect(guestRowStateSource).toContain('getWorkloadTypeBadge');
- expect(guestRowCellsSource).toContain('export { BackupIndicator');
+ expect(guestRowCellsSource).toContain('export { AvailabilityProbeCell');
expect(guestRowCellsSource).toContain('function NetworkInfoCell(');
expect(guestRowCellsSource).toContain('function OSInfoCell(');
expect(guestRowCellsSource).toContain('useTooltip');
diff --git a/frontend-modern/src/components/Workloads/useGuestRowState.ts b/frontend-modern/src/components/Workloads/useGuestRowState.ts
index 807cf192ef..0ded8aea40 100644
--- a/frontend-modern/src/components/Workloads/useGuestRowState.ts
+++ b/frontend-modern/src/components/Workloads/useGuestRowState.ts
@@ -17,6 +17,7 @@ import {
resolveWorkloadType,
} from '@/utils/workloads';
import { getDiscoveryReadinessPresentation } from '@/utils/resourceDiscoveryReadiness';
+import { getAvailabilityProbePresentation } from '@/utils/availabilityProbePresentation';
import { getWorkloadTypeBadge } from '@/components/shared/workloadTypeBadges';
import {
@@ -275,6 +276,16 @@ export function useGuestRowState(props: GuestRowProps) {
isDockerManagedAppContainer(props.guest) ? getWorkloadDockerHostId(props.guest) : '',
);
+ const availabilityPresentation = createMemo(() =>
+ getAvailabilityProbePresentation({
+ type: props.guest.type as never,
+ platformType: (props.guest.platformType ?? '') as never,
+ status: props.guest.status as never,
+ availability: props.guest.availability,
+ platformData: { availability: props.guest.availability },
+ }),
+ );
+
return {
appContainerRuntimeBadge,
cpuAnomaly,
@@ -326,5 +337,6 @@ export function useGuestRowState(props: GuestRowProps) {
clusterName,
agentVersion,
rowClass,
+ availabilityPresentation,
};
}
diff --git a/frontend-modern/src/types/workloads.ts b/frontend-modern/src/types/workloads.ts
index 3a06b4b7e2..ee54bd6b4a 100644
--- a/frontend-modern/src/types/workloads.ts
+++ b/frontend-modern/src/types/workloads.ts
@@ -1,5 +1,9 @@
import type { VM, Container, DockerContainerUpdateStatus } from './api';
-import type { ResourceDiscoveryReadiness, ResourceDiscoveryTarget } from './resource';
+import type {
+ ResourceAvailabilityMeta,
+ ResourceDiscoveryReadiness,
+ ResourceDiscoveryTarget,
+} from './resource';
export type WorkloadType = 'vm' | 'system-container' | 'app-container' | 'pod';
export type WorkloadContainerViewMode = 'container' | 'system-container' | 'app-container';
@@ -47,4 +51,6 @@ export type WorkloadGuest = (VM | Container) & {
datacenterName?: string;
clusterName?: string;
};
+ /** Availability probe facet from the unified resource model. */
+ availability?: ResourceAvailabilityMeta;
};