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.

Polish Machines disk telemetry display

rcourtmand19d27e915ee
diff --git a/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx b/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
index 4cb135caa6..e550f069a0 100644
--- a/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
+++ b/frontend-modern/src/components/Workloads/__tests__/StackedDiskBar.test.tsx
@@ -251,6 +251,7 @@ describe('StackedDiskBar', () => {
render(() => <StackedDiskBar disks={[disk1, disk2]} mode="aggregate" />);
expect(screen.queryByText('[2]')).not.toBeInTheDocument();
expect(screen.queryByText('(2)')).not.toBeInTheDocument();
+ expect(screen.queryByText('2 disks')).not.toBeInTheDocument();
});
it('uses total usage as the default aggregate summary', () => {
@@ -287,7 +288,11 @@ describe('StackedDiskBar', () => {
));
const bar = getSingleBarFill(container);
expect(screen.getByText('92%')).toBeInTheDocument();
- expect(screen.getByText('(2)')).toHaveAttribute('title', '2 disks');
+ expect(screen.getByText('max')).toHaveAttribute('title', 'Highest usage: /var 92%');
+ expect(screen.getByText('2 disks')).toHaveAttribute(
+ 'title',
+ '2 operational disks in breakdown',
+ );
expect(bar).toHaveAttribute('width', '92');
expect(bar?.getAttribute('fill')).toContain('239, 68, 68');
});
diff --git a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts b/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
index 6bc8e1c9cf..7ee62c40a9 100644
--- a/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
+++ b/frontend-modern/src/components/Workloads/stackedDiskBarModel.ts
@@ -179,10 +179,7 @@ function buildTooltipContent(
},
): StackedDiskTooltipItem[] {
const useUsageColors =
- options.aggregateMode ||
- options.inlineDiskMode ||
- options.miniMode ||
- options.verticalBarsMode;
+ options.aggregateMode || options.inlineDiskMode || options.miniMode || options.verticalBarsMode;
if (disks.length > 0) {
return disks.map((disk, index) => {
const percentValue = getDiskUsagePercent(disk);
@@ -247,10 +244,7 @@ export function buildStackedDiskBarPresentation(
const explicitStackedMode = props.mode === 'stacked';
const verticalBarsMode = props.mode === 'vertical-bars' && hasDisks;
const inlineDiskMode =
- (miniMode || hasMultipleDisks) &&
- !aggregateMode &&
- !explicitStackedMode &&
- !verticalBarsMode;
+ (miniMode || hasMultipleDisks) && !aggregateMode && !explicitStackedMode && !verticalBarsMode;
const useStackedSegments = hasMultipleDisks && explicitStackedMode;
const inlineDiskSlotWidth = disks.length > 0 ? containerWidth / disks.length : 0;
const totalCapacity = hasDisks
@@ -271,28 +265,34 @@ export function buildStackedDiskBarPresentation(
aggregateMode && hasMultipleDisks && summaryStrategy === 'max' && maxInfo !== null;
const displayPercentValue = useMaxSummary && maxInfo ? maxInfo.percent : overallPercent;
const barPercent = Math.min(displayPercentValue, 100);
- const maxLabelShort = maxInfo ? `max ${formatPercent(maxInfo.percent)}` : '';
- const maxLabelFull = maxInfo ? `Max ${formatPercent(maxInfo.percent)} (${maxInfo.label})` : '';
+ const maxLabelShort = maxInfo
+ ? useMaxSummary
+ ? 'max'
+ : `max ${formatPercent(maxInfo.percent)}`
+ : '';
+ const maxLabelFull = maxInfo
+ ? `Highest usage: ${maxInfo.label} ${formatPercent(maxInfo.percent)}`
+ : '';
const displayLabel = formatPercent(displayPercentValue);
- const displaySublabel = useMaxSummary && maxInfo
- ? maxInfo.label
- : `${formatBytes(totalUsed)}/${formatBytes(totalCapacity)}`;
- const diskCountLabel = hasMultipleDisks ? `(${disks.length})` : '';
- const diskCountTitle = hasMultipleDisks ? `${disks.length} disks` : '';
+ const displaySublabel =
+ useMaxSummary && maxInfo ? '' : `${formatBytes(totalUsed)}/${formatBytes(totalCapacity)}`;
+ const diskCountLabel = hasMultipleDisks ? `${disks.length} disks` : '';
+ const diskCountTitle = hasMultipleDisks ? `${disks.length} operational disks in breakdown` : '';
const showDiskCount = Boolean(props.showDiskCount && hasMultipleDisks);
const showMaxLabel =
- aggregateMode &&
- hasMultipleDisks &&
- !useMaxSummary &&
- maxLabelShort.length > 0 &&
- containerWidth >= estimateTextWidth(`${displayLabel} ${maxLabelShort}`);
+ useMaxSummary ||
+ (aggregateMode &&
+ hasMultipleDisks &&
+ maxLabelShort.length > 0 &&
+ containerWidth >= estimateTextWidth(`${displayLabel} ${maxLabelShort}`));
const showSublabel =
+ displaySublabel.length > 0 &&
containerWidth >=
- estimateTextWidth(
- `${displayLabel}${showMaxLabel ? ` ${maxLabelShort}` : ''} (${displaySublabel})${
- showDiskCount ? ` ${diskCountLabel}` : ''
- }`,
- );
+ estimateTextWidth(
+ `${displayLabel}${showMaxLabel ? ` ${maxLabelShort}` : ''} (${displaySublabel})${
+ showDiskCount ? ` ${diskCountLabel}` : ''
+ }`,
+ );
const barColor =
aggregateMode && hasMultipleDisks && maxInfo
? getMetricColorRgba(maxInfo.percent, 'disk', props.thresholds)
diff --git a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
index fa3a0cb479..6e7edf4728 100644
--- a/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
+++ b/frontend-modern/src/features/standalone/AgentsMachinesTable.tsx
@@ -33,6 +33,11 @@ import {
import { TableCard } from '@/components/shared/TableCard';
import { TableCardHeader } from '@/components/shared/TableCardHeader';
import { TooltipPortal } from '@/components/shared/TooltipPortal';
+import {
+ compareAgentVersions,
+ formatAgentVersionDisplay,
+ hostAgentVersion,
+} from '@/features/platformPage/agentVersion';
import {
PlatformResourceDetailTableRow,
createPlatformResourceDetailState,
@@ -122,10 +127,19 @@ const formatLastSeen = (value: number | string | Date | undefined): string => {
return `${Math.floor(hours / 24)}d`;
};
-const metricFallback = () => (
+type MetricFallbackReason = {
+ label: string;
+ title: string;
+};
+
+const metricFallback = (reason?: MetricFallbackReason) => (
<div class="flex justify-center">
- <span class="text-xs text-muted" aria-hidden="true">
- —
+ <span
+ class={reason ? 'text-[9px] font-medium text-muted' : 'text-xs text-muted'}
+ title={reason?.title}
+ aria-label={reason?.title ?? 'No telemetry data'}
+ >
+ {reason?.label ?? '—'}
</span>
</div>
);
@@ -953,6 +967,28 @@ const titleCase = (value: string): string =>
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
.join(' ');
+const SYSTEM_NAME_OVERRIDES = new Map<string, string>([
+ ['darwin', 'macOS'],
+ ['freebsd', 'FreeBSD'],
+ ['linux', 'Linux'],
+ ['mac os', 'macOS'],
+ ['macos', 'macOS'],
+ ['microsoft windows', 'Windows'],
+ ['unraid', 'Unraid'],
+ ['win32', 'Windows'],
+ ['windows', 'Windows'],
+]);
+
+const systemNameForDisplay = (value: string, titleCaseFallback = false): string => {
+ const trimmed = value.trim();
+ if (!trimmed) return '';
+
+ const normalized = trimmed.toLowerCase().replace(/[_-]+/g, ' ').replace(/\s+/g, ' ');
+ return (
+ SYSTEM_NAME_OVERRIDES.get(normalized) ?? (titleCaseFallback ? titleCase(trimmed) : trimmed)
+ );
+};
+
const normalizedIdentityToken = (value: string | undefined): string =>
(value ?? '').trim().toLowerCase();
@@ -992,16 +1028,37 @@ 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(
+ if (osName && osVersion) return `${systemNameForDisplay(osName)} ${osVersion}`;
+ if (osName) return systemNameForDisplay(osName);
+ return systemNameForDisplay(
asTrimmedString(machine.agent?.platform) || asTrimmedString(machine.technology) || 'Agent',
+ true,
);
};
const agentVersionFor = (machine: Resource): string =>
isAgentlessMachine(machine) ? 'Agentless' : asTrimmedString(machine.agent?.agentVersion) || '—';
+const outdatedAgentTelemetryFallbackFor = (
+ machine: Resource,
+ targetAgentVersion: string | null | undefined,
+): MetricFallbackReason | undefined => {
+ if (isAgentlessMachine(machine)) return undefined;
+
+ const agentVersion = hostAgentVersion(machine);
+ const comparison = compareAgentVersions(agentVersion, targetAgentVersion);
+ if (comparison === null || comparison >= 0) return undefined;
+
+ const current = formatAgentVersionDisplay(agentVersion) || agentVersion || 'this version';
+ const target = formatAgentVersionDisplay(targetAgentVersion) || targetAgentVersion;
+ return {
+ label: 'old agent',
+ title: target
+ ? `Update this agent from ${current} to ${target} for full machine telemetry.`
+ : `Update this agent from ${current} for full machine telemetry.`,
+ };
+};
+
const filterAgentMachineResources = (
resources: Resource[],
search: string,
@@ -1161,6 +1218,7 @@ export const AgentsMachinesTable: Component<{
emptyIcon: JSX.Element;
emptyTitle: string;
emptyDescription: string;
+ targetAgentVersion?: string | null;
}> = (props) => {
const [locallyRemovedResourceIds, setLocallyRemovedResourceIds] = createSignal<
Record<string, boolean>
@@ -1436,6 +1494,10 @@ export const AgentsMachinesTable: Component<{
const agentVersion = () => agentVersionFor(machine);
const indicator = () => getSimpleStatusIndicator(machine.status);
const canRenderMetrics = () => indicator().variant !== 'danger';
+ const telemetryFallback = () =>
+ canRenderMetrics()
+ ? outdatedAgentTelemetryFallbackFor(machine, props.targetAgentVersion)
+ : undefined;
const metricsKey = () => buildMetricKeyForUnifiedResource(machine);
const cpuPercent = () => getAgentMachineCpuPercent(machine);
const cpuCores = () => cpuCoresFor(machine);
@@ -1576,7 +1638,7 @@ export const AgentsMachinesTable: Component<{
>
<Show
when={canRenderMetrics() && cpuPercent() !== undefined}
- fallback={metricFallback()}
+ fallback={metricFallback(telemetryFallback())}
>
<EnhancedCPUBar
usage={cpuPercent() ?? 0}
@@ -1591,7 +1653,7 @@ export const AgentsMachinesTable: Component<{
>
<Show
when={canRenderMetrics() && hasMemoryMetric()}
- fallback={metricFallback()}
+ fallback={metricFallback(telemetryFallback())}
>
<StackedMemoryBar
used={memoryUsed()}
@@ -1609,7 +1671,7 @@ export const AgentsMachinesTable: Component<{
>
<Show
when={canRenderMetrics() && hasDiskMetric()}
- fallback={metricFallback()}
+ fallback={metricFallback(telemetryFallback())}
>
<StackedDiskBar
mode={(disks()?.length ?? 0) > 1 ? 'aggregate' : undefined}
@@ -1626,7 +1688,7 @@ export const AgentsMachinesTable: Component<{
>
<Show
when={canRenderMetrics() && networkTotal() !== undefined}
- fallback={metricFallback()}
+ fallback={metricFallback(telemetryFallback())}
>
<AgentMachineNetworkCell
network={machine.network}
@@ -1642,7 +1704,7 @@ export const AgentsMachinesTable: Component<{
>
<Show
when={canRenderMetrics() && diskIOTotal() !== undefined}
- fallback={metricFallback()}
+ fallback={metricFallback(telemetryFallback())}
>
<AgentMachineDiskIOCell
diskIO={machine.diskIO}
diff --git a/frontend-modern/src/features/standalone/StandalonePageSurface.tsx b/frontend-modern/src/features/standalone/StandalonePageSurface.tsx
index 281167df9a..340ef6567a 100644
--- a/frontend-modern/src/features/standalone/StandalonePageSurface.tsx
+++ b/frontend-modern/src/features/standalone/StandalonePageSurface.tsx
@@ -197,6 +197,7 @@ export function StandalonePageSurface() {
emptyIcon={machineIcon()}
emptyTitle="No machines"
emptyDescription="Install Pulse Agent on Linux, macOS, Windows, or Unraid systems for full CPU, memory, disk, and network telemetry."
+ targetAgentVersion={updateStore.versionInfo()?.version}
/>
</Show>
</div>
diff --git a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
index cd8ef578df..4159fade88 100644
--- a/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
+++ b/frontend-modern/src/features/standalone/__tests__/AgentsMachinesTable.test.tsx
@@ -208,6 +208,67 @@ describe('AgentsMachinesTable', () => {
expect(screen.getByText('richard-mac-mini.local | 192.168.0.98')).toBeInTheDocument();
});
+ it('normalizes canonical OS labels from platform fallback values', () => {
+ render(() => (
+ <AgentsMachinesTable
+ resources={[
+ resource({
+ id: 'mac-mini',
+ name: 'Mac Mini',
+ agent: {
+ agentVersion: '6.0.0',
+ platform: 'macos',
+ },
+ }),
+ resource({
+ id: 'linux-server',
+ name: 'Linux Server',
+ agent: {
+ agentVersion: '6.0.0',
+ osName: 'Proxmox VE',
+ osVersion: '8.3.3',
+ },
+ }),
+ ]}
+ emptyIcon={emptyIcon}
+ emptyTitle="No machines"
+ emptyDescription="Install Pulse Agent."
+ />
+ ));
+
+ expect(screen.getAllByText('macOS').length).toBeGreaterThanOrEqual(1);
+ expect(screen.getAllByText('Proxmox VE 8.3.3').length).toBeGreaterThanOrEqual(1);
+ });
+
+ it('explains missing telemetry when the agent version is behind the server', () => {
+ render(() => (
+ <AgentsMachinesTable
+ resources={[
+ resource({
+ id: 'old-agent',
+ name: 'Old Agent',
+ cpu: { current: 3 },
+ agent: {
+ agentVersion: 'v6.0.0-rc.5',
+ platform: 'macos',
+ },
+ }),
+ ]}
+ targetAgentVersion="v6.0.0-rc.6"
+ emptyIcon={emptyIcon}
+ emptyTitle="No machines"
+ emptyDescription="Install Pulse Agent."
+ />
+ ));
+
+ expect(screen.getAllByText('old agent').length).toBeGreaterThanOrEqual(2);
+ expect(
+ screen.getAllByTitle(
+ 'Update this agent from v6.0.0-rc.5 to v6.0.0-rc.6 for full machine telemetry.',
+ ).length,
+ ).toBeGreaterThanOrEqual(2);
+ });
+
it('searches machine-native fields and exposes host-style search affordances', async () => {
render(() => (
<AgentsMachinesTable