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.

Govern agent lifecycle presentation helpers

rcourtmanfd894a576716
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 6dc6a3be99..19e2e019f6 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -76,6 +76,12 @@ management, and fleet control surfaces.
52. `frontend-modern/src/components/Settings/useInfrastructureConfiguredNodesState.ts`
53. `frontend-modern/src/components/Settings/useInfrastructureDiscoveryRuntimeState.ts`
54. `frontend-modern/src/utils/infrastructureSettingsPresentation.ts`
+55. `frontend-modern/src/utils/agentCapabilityPresentation.ts`
+56. `frontend-modern/src/utils/agentProfileSuggestionPresentation.ts`
+57. `frontend-modern/src/utils/configuredNodeCapabilityPresentation.ts`
+58. `frontend-modern/src/utils/configuredNodeStatusPresentation.ts`
+59. `frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts`
+60. `frontend-modern/src/utils/unifiedAgentStatusPresentation.ts`
## Shared Boundaries
@@ -254,6 +260,19 @@ error copy for discovery and configured-node actions through
`frontend-modern/src/utils/infrastructureSettingsPresentation.ts`, so direct
Proxmox settings mutations do not drift back to inline toast text inside the
runtime hooks.
+That same fleet lifecycle boundary now also owns the shared capability,
+status, and inventory presentation helpers that those settings surfaces reuse.
+`frontend-modern/src/utils/agentCapabilityPresentation.ts`,
+`frontend-modern/src/utils/agentProfileSuggestionPresentation.ts`,
+`frontend-modern/src/utils/configuredNodeCapabilityPresentation.ts`,
+`frontend-modern/src/utils/configuredNodeStatusPresentation.ts`,
+`frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts`, and
+`frontend-modern/src/utils/unifiedAgentStatusPresentation.ts` are the
+canonical owners for agent capability badges, profile suggestion formatting,
+configured-node capability/status badges, monitoring-stopped inventory copy,
+and unified-agent status labels. Lifecycle-adjacent settings and inventory
+surfaces should extend those helpers instead of reintroducing inline fleet
+semantics in panels, workspace models, or reporting hooks.
That same boundary now also assumes canonical resource payloads preserve
shared facet totals through `facetCounts`, so the resource list and detail
surfaces can keep row summaries aligned without re-inferring totals from
diff --git a/docs/release-control/v6/internal/subsystems/cloud-paid.md b/docs/release-control/v6/internal/subsystems/cloud-paid.md
index 9f9aca96b6..935b3a685a 100644
--- a/docs/release-control/v6/internal/subsystems/cloud-paid.md
+++ b/docs/release-control/v6/internal/subsystems/cloud-paid.md
@@ -207,6 +207,10 @@ That billing support surface must also remain readable while mixed-version
clients and servers roll forward: missing explanation payloads may degrade to a
safe generic explanation, but the monitored-system ledger must never fail the
page or hide counted systems because the nested support details are absent.
+That same monitored-system presentation boundary now also owns the customer-
+facing ledger loading and retry copy through
+`frontend-modern/src/utils/monitoredSystemPresentation.ts`, so commercial
+usage states do not leak back into lifecycle inventory helpers.
That same disclosure copy must stay professional and customer-facing. The
settings ledger may expose counting details and included collection paths, but
it must avoid informal debug-style labels or ad hoc wording that makes the
diff --git a/docs/release-control/v6/internal/subsystems/registry.json b/docs/release-control/v6/internal/subsystems/registry.json
index 50d26ddcf8..9ca2cab14f 100644
--- a/docs/release-control/v6/internal/subsystems/registry.json
+++ b/docs/release-control/v6/internal/subsystems/registry.json
@@ -568,9 +568,15 @@
"frontend-modern/src/components/Settings/useNodeModalState.ts",
"frontend-modern/src/components/Settings/useProxmoxDirectWorkspaceState.ts",
"frontend-modern/src/components/SetupWizard/SetupCompletionPanel.tsx",
+ "frontend-modern/src/utils/agentCapabilityPresentation.ts",
"frontend-modern/src/utils/agentInstallCommand.ts",
"frontend-modern/src/utils/agentProfilesPresentation.ts",
+ "frontend-modern/src/utils/agentProfileSuggestionPresentation.ts",
+ "frontend-modern/src/utils/configuredNodeCapabilityPresentation.ts",
+ "frontend-modern/src/utils/configuredNodeStatusPresentation.ts",
"frontend-modern/src/utils/infrastructureSettingsPresentation.ts",
+ "frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts",
+ "frontend-modern/src/utils/unifiedAgentStatusPresentation.ts",
"internal/api/agent_install_command_shared.go",
"internal/api/config_setup_handlers.go",
"internal/api/unified_agent.go",
@@ -827,6 +833,30 @@
"frontend-modern/src/utils/__tests__/frontendResourceTypeBoundaries.test.ts"
]
},
+ {
+ "id": "agent-lifecycle-presentation-helpers",
+ "label": "agent lifecycle presentation helper proof",
+ "match_prefixes": [],
+ "match_files": [
+ "frontend-modern/src/utils/agentCapabilityPresentation.ts",
+ "frontend-modern/src/utils/agentProfileSuggestionPresentation.ts",
+ "frontend-modern/src/utils/configuredNodeCapabilityPresentation.ts",
+ "frontend-modern/src/utils/configuredNodeStatusPresentation.ts",
+ "frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts",
+ "frontend-modern/src/utils/unifiedAgentStatusPresentation.ts"
+ ],
+ "allow_same_subsystem_tests": false,
+ "test_prefixes": [],
+ "exact_files": [
+ "frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts",
+ "frontend-modern/src/utils/__tests__/agentCapabilityPresentation.test.ts",
+ "frontend-modern/src/utils/__tests__/agentProfileSuggestionPresentation.test.ts",
+ "frontend-modern/src/utils/__tests__/configuredNodeCapabilityPresentation.test.ts",
+ "frontend-modern/src/utils/__tests__/configuredNodeStatusPresentation.test.ts",
+ "frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts",
+ "frontend-modern/src/utils/__tests__/unifiedAgentStatusPresentation.test.ts"
+ ]
+ },
{
"id": "direct-proxmox-presentation-helper",
"label": "direct Proxmox presentation helper proof",
diff --git a/frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx b/frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx
index ccd9e86bb5..d7b0a9d1bf 100644
--- a/frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx
+++ b/frontend-modern/src/components/Settings/MonitoredSystemLedgerPanel.tsx
@@ -13,15 +13,13 @@ import { formatRelativeTime } from '@/utils/format';
import { MonitoredSystemLedgerAPI } from '@/api/monitoredSystemLedger';
import type { MonitoredSystemLedgerEntry } from '@/api/monitoredSystemLedger';
import { getSimpleStatusIndicator } from '@/utils/status';
-import {
- getMonitoredSystemLedgerErrorState,
- getMonitoredSystemLedgerLoadingState,
-} from '@/utils/unifiedAgentInventoryPresentation';
import { PulseLogoIcon } from '@/components/icons/PulseLogoIcon';
import {
formatMonitoredSystemLatestIncludedSignalSentence,
formatMonitoredSystemSurfaceAttribution,
+ getMonitoredSystemLedgerErrorState,
getMonitoredSystemLedgerDescription,
+ getMonitoredSystemLedgerLoadingState,
getMonitoredSystemCountingDetailsToggleLabel,
getMonitoredSystemLedgerPresentation,
} from '@/utils/monitoredSystemPresentation';
diff --git a/frontend-modern/src/components/Settings/__tests__/MonitoredSystemLedgerPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/MonitoredSystemLedgerPanel.test.tsx
index ba8df40286..ac26681147 100644
--- a/frontend-modern/src/components/Settings/__tests__/MonitoredSystemLedgerPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/MonitoredSystemLedgerPanel.test.tsx
@@ -47,6 +47,14 @@ describe('MonitoredSystemLedgerPanel', () => {
getLedgerMock.mockReset();
});
+ it('shows monitored-system loading copy while the ledger request is pending', () => {
+ getLedgerMock.mockReturnValue(new Promise<MonitoredSystemLedgerResponse>(() => {}));
+
+ render(() => <MonitoredSystemLedgerPanel />);
+
+ expect(screen.getByText('Loading monitored system usage…')).toBeInTheDocument();
+ });
+
it('shows error message with Retry button when API fails', async () => {
getLedgerMock.mockRejectedValue(new Error('network error'));
diff --git a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
index 6d647b6a3b..ef165b149e 100644
--- a/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/monitoredSystemModelGuardrails.test.ts
@@ -370,10 +370,16 @@ describe('monitored-system model guardrails', () => {
expect(unifiedAgentInventoryPresentationSource).toContain(
'export function getMonitoringStoppedEmptyState',
);
- expect(unifiedAgentInventoryPresentationSource).toContain(
+ expect(unifiedAgentInventoryPresentationSource).not.toContain(
'export function getMonitoredSystemLedgerLoadingState',
);
- expect(unifiedAgentInventoryPresentationSource).toContain(
+ expect(unifiedAgentInventoryPresentationSource).not.toContain(
+ 'export function getMonitoredSystemLedgerErrorState',
+ );
+ expect(monitoredSystemPresentationSource).toContain(
+ 'export function getMonitoredSystemLedgerLoadingState',
+ );
+ expect(monitoredSystemPresentationSource).toContain(
'export function getMonitoredSystemLedgerErrorState',
);
expect(unifiedAgentInventoryPresentationSource).toContain(
diff --git a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
index 31a58902d0..45e8037685 100644
--- a/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/monitoredSystemPresentation.test.ts
@@ -13,6 +13,8 @@ import {
getMonitoredSystemDisclosureToggleLabel,
getMonitoredSystemExplanationFallbackSummary,
getMonitoredSystemLedgerDescription,
+ getMonitoredSystemLedgerErrorState,
+ getMonitoredSystemLedgerLoadingState,
getMonitoredSystemLedgerPresentation,
getMonitoredSystemLimitInstallCollectorsLabel,
getMonitoredSystemLimitLearnMoreLabel,
@@ -37,6 +39,14 @@ describe('monitoredSystemPresentation', () => {
tableNameLabel: 'Name',
tableStatusLabel: 'Status',
tableLatestIncludedSignalLabel: 'Latest Included Signal',
+ loadingState: {
+ text: 'Loading monitored system usage…',
+ },
+ errorState: {
+ title: 'Monitored system usage is temporarily unavailable.',
+ retryingLabel: 'Trying again…',
+ retryLabel: 'Try again',
+ },
countingDetailsCollapsedLabel: 'View counting details',
countingDetailsExpandedLabel: 'Hide counting details',
currentStatusHeading: 'Current status',
@@ -71,6 +81,14 @@ describe('monitoredSystemPresentation', () => {
expect(getMonitoredSystemLedgerDescription()).toBe(
'Review the monitored systems currently counted against your Pulse Pro plan limit.',
);
+ expect(getMonitoredSystemLedgerLoadingState()).toEqual({
+ text: 'Loading monitored system usage…',
+ });
+ expect(getMonitoredSystemLedgerErrorState()).toEqual({
+ title: 'Monitored system usage is temporarily unavailable.',
+ retryingLabel: 'Trying again…',
+ retryLabel: 'Try again',
+ });
expect(getMonitoredSystemCountingDetailsToggleLabel(false)).toBe('View counting details');
expect(getMonitoredSystemCountingDetailsToggleLabel(true)).toBe('Hide counting details');
expect(getMonitoredSystemExplanationFallbackSummary()).toBe(
diff --git a/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts b/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts
index 318f7c9697..99865a4aa9 100644
--- a/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts
+++ b/frontend-modern/src/utils/__tests__/unifiedAgentInventoryPresentation.test.ts
@@ -1,7 +1,5 @@
import { describe, expect, it } from 'vitest';
import {
- getMonitoredSystemLedgerErrorState,
- getMonitoredSystemLedgerLoadingState,
getUnifiedAgentAllowReconnectErrorMessage,
getUnifiedAgentAllowReconnectSuccessMessage,
getUnifiedAgentClipboardCopyErrorMessage,
@@ -42,17 +40,6 @@ describe('unifiedAgentInventoryPresentation', () => {
expect(getUnifiedAgentLastSeenLabel({ status: 'active' }, 'Monitoring stopped')).toBe('—');
});
- it('returns canonical monitored-system ledger loading and error copy', () => {
- expect(getMonitoredSystemLedgerLoadingState()).toEqual({
- text: 'Loading monitored system usage…',
- });
- expect(getMonitoredSystemLedgerErrorState()).toEqual({
- title: 'Monitored system usage is temporarily unavailable.',
- retryingLabel: 'Trying again…',
- retryLabel: 'Try again',
- });
- });
-
it('returns canonical unified-agent operational action copy', () => {
expect(getUnifiedAgentStopMonitoringUnavailableMessage()).toBe(
'No host identifiers are available to stop monitoring.',
diff --git a/frontend-modern/src/utils/monitoredSystemPresentation.ts b/frontend-modern/src/utils/monitoredSystemPresentation.ts
index 10881b7600..315f00a990 100644
--- a/frontend-modern/src/utils/monitoredSystemPresentation.ts
+++ b/frontend-modern/src/utils/monitoredSystemPresentation.ts
@@ -21,6 +21,14 @@ const MONITORED_SYSTEM_LEDGER_PRESENTATION = {
tableNameLabel: 'Name',
tableStatusLabel: 'Status',
tableLatestIncludedSignalLabel: 'Latest Included Signal',
+ loadingState: {
+ text: 'Loading monitored system usage…',
+ },
+ errorState: {
+ title: 'Monitored system usage is temporarily unavailable.',
+ retryingLabel: 'Trying again…',
+ retryLabel: 'Try again',
+ },
countingDetailsCollapsedLabel: 'View counting details',
countingDetailsExpandedLabel: 'Hide counting details',
currentStatusHeading: 'Current status',
@@ -75,6 +83,14 @@ export function getMonitoredSystemLedgerDescription(): string {
return MONITORED_SYSTEM_LEDGER_PRESENTATION.ledgerDescription;
}
+export function getMonitoredSystemLedgerLoadingState() {
+ return MONITORED_SYSTEM_LEDGER_PRESENTATION.loadingState;
+}
+
+export function getMonitoredSystemLedgerErrorState() {
+ return MONITORED_SYSTEM_LEDGER_PRESENTATION.errorState;
+}
+
export function getMonitoredSystemCountingDetailsToggleLabel(expanded: boolean): string {
return expanded
? MONITORED_SYSTEM_LEDGER_PRESENTATION.countingDetailsExpandedLabel
diff --git a/frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts b/frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts
index 266bb9cae2..984de0336e 100644
--- a/frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts
+++ b/frontend-modern/src/utils/unifiedAgentInventoryPresentation.ts
@@ -45,20 +45,6 @@ export function getMonitoringStoppedEmptyState(hasFilters: boolean): string {
: 'No infrastructure currently has monitoring stopped.';
}
-export function getMonitoredSystemLedgerLoadingState() {
- return {
- text: 'Loading monitored system usage…',
- } as const;
-}
-
-export function getMonitoredSystemLedgerErrorState() {
- return {
- title: 'Monitored system usage is temporarily unavailable.',
- retryingLabel: 'Trying again…',
- retryLabel: 'Try again',
- } as const;
-}
-
export function getUnifiedAgentStopMonitoringUnavailableMessage(): string {
return 'No host identifiers are available to stop monitoring.';
}