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.

Collapse Infrastructure status to a single rolled-up signal

rcourtmanb746838b9702
diff --git a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
index 21065a973c..4bdf29411c 100644
--- a/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/InfrastructureWorkspace.test.tsx
@@ -923,13 +923,6 @@ describe('InfrastructureWorkspace', () => {
tone: 'warning',
},
];
- const remoteControlDisabledSignal: InfrastructureSystemMemberRow['fleetHighlights'][number] = {
- key: 'command-policy',
- label: 'Remote control disabled',
- detail: 'Commands are disabled by policy.',
- tone: 'info',
- };
-
connectionState.connections = [primaryConnection, dellyAgent, minipcAgent];
connectionState.rows = [
{
@@ -946,14 +939,7 @@ describe('InfrastructureWorkspace', () => {
lastActivityText: '1m ago',
...emptyFleetRow,
fleetSignals: passiveAgentConfigSignals,
- fleetHighlights: [
- {
- key: 'liveness',
- label: 'Fleet OK',
- detail: 'Visible fleet posture is healthy.',
- tone: 'ok',
- },
- ],
+ fleetHighlights: [],
enabled: true,
canEdit: true,
canPause: true,
@@ -974,7 +960,7 @@ describe('InfrastructureWorkspace', () => {
lastActivityText: '1m ago',
...emptyFleetMember,
fleetSignals: passiveAgentConfigSignals,
- fleetHighlights: [remoteControlDisabledSignal],
+ fleetHighlights: [],
primary: true,
agentConnection: dellyAgent,
},
@@ -990,7 +976,7 @@ describe('InfrastructureWorkspace', () => {
lastActivityText: '1m ago',
...emptyFleetMember,
fleetSignals: passiveAgentConfigSignals,
- fleetHighlights: [remoteControlDisabledSignal],
+ fleetHighlights: [],
primary: false,
agentConnection: minipcAgent,
},
@@ -1009,12 +995,12 @@ describe('InfrastructureWorkspace', () => {
'0 systems',
);
expect(screen.getByText('Cluster · 2 nodes')).toBeInTheDocument();
- expect(screen.getByText('Fleet OK')).toBeInTheDocument();
+ expect(screen.queryByText('Fleet OK')).toBeNull();
expect(screen.getByText('Primary node')).toBeInTheDocument();
expect(screen.getAllByText('Agent').length).toBeGreaterThan(0);
expect(screen.getByText('delly')).toBeInTheDocument();
expect(screen.getByText('minipc')).toBeInTheDocument();
- expect(screen.getAllByText('Remote control disabled')).toHaveLength(2);
+ expect(screen.queryByText('Remote control disabled')).toBeNull();
expect(screen.queryByText('Config pending')).toBeNull();
expect(screen.queryByText('Rollout pending')).toBeNull();
expect(screen.getAllByText('Host telemetry').length).toBeGreaterThan(0);
diff --git a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts
index a77a0f945e..06e7b022c4 100644
--- a/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/connectionsTableModel.test.ts
@@ -59,9 +59,7 @@ describe('visibleFleetGovernanceSignals', () => {
expect(rawSignals.map((signal) => signal.label)).toEqual(
expect.arrayContaining(['Config pending', 'Rollout pending', 'Remote control disabled']),
);
- expect(visibleFleetGovernanceSignals(rawSignals).map((signal) => signal.label)).toEqual([
- 'Remote control disabled',
- ]);
+ expect(visibleFleetGovernanceSignals(rawSignals).map((signal) => signal.label)).toEqual([]);
});
it('does not turn default unmanaged agent config into setup attention', () => {
@@ -99,9 +97,7 @@ describe('visibleFleetGovernanceSignals', () => {
expect(rawSignals.map((signal) => signal.label)).toEqual(
expect.arrayContaining(['No config drift', 'Rollout current', 'Remote control disabled']),
);
- expect(visibleFleetGovernanceSignals(rawSignals).map((signal) => signal.label)).toEqual([
- 'Remote control disabled',
- ]);
+ expect(visibleFleetGovernanceSignals(rawSignals).map((signal) => signal.label)).toEqual([]);
});
it('keeps actionable config and rollout warnings visible', () => {
@@ -138,7 +134,6 @@ describe('visibleFleetGovernanceSignals', () => {
expect(visibleFleetGovernanceSignals(rawSignals).map((signal) => signal.label)).toEqual([
'Config pending',
'Rollout pending',
- 'Remote control disabled',
]);
});
@@ -163,7 +158,7 @@ describe('visibleFleetGovernanceSignals', () => {
]);
});
- it('falls back to Fleet OK only when every warning was a passive handshake', () => {
+ it('returns no chips when every warning was a passive handshake', () => {
const signals: FleetGovernanceSignal[] = [
{
key: 'config-drift',
@@ -179,13 +174,7 @@ describe('visibleFleetGovernanceSignals', () => {
},
];
- expect(visibleFleetGovernanceSignals(signals)).toMatchObject([
- {
- key: 'liveness',
- label: 'Fleet OK',
- tone: 'ok',
- },
- ]);
+ expect(visibleFleetGovernanceSignals(signals)).toEqual([]);
});
it('hides rollout fallback copy when a passive config confirmation marks the handshake', () => {
@@ -219,8 +208,6 @@ describe('visibleFleetGovernanceSignals', () => {
}),
);
- expect(visibleFleetGovernanceSignals(rawSignals).map((signal) => signal.label)).toEqual([
- 'Remote control disabled',
- ]);
+ expect(visibleFleetGovernanceSignals(rawSignals).map((signal) => signal.label)).toEqual([]);
});
});
diff --git a/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts b/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts
index 25ec2b3317..ab9c88f67f 100644
--- a/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/useConnectionsLedger.test.ts
@@ -80,7 +80,6 @@ describe('useConnectionsLedger', () => {
expect(result.rows()[0].fleetHighlights.map((signal) => signal.label)).toEqual([
'Version behind',
'Update available',
- 'Remote control enabled',
]);
});
@@ -430,7 +429,6 @@ describe('useConnectionsLedger', () => {
'Version behind',
]);
expect(byID.get('pve:invalid')?.fleetHighlights.map((signal) => signal.label)).toEqual([
- 'Unauthorized',
'Credentials invalid',
'Rollout blocked',
]);
@@ -439,16 +437,16 @@ describe('useConnectionsLedger', () => {
]);
expect(
byID.get('agent:remote-disabled')?.fleetHighlights.map((signal) => signal.label),
- ).toEqual(['Remote control disabled']);
+ ).toEqual([]);
expect(
byID.get('agent:command-mismatch')?.fleetHighlights.map((signal) => signal.label),
).toEqual(['Command policy mismatch']);
expect(byID.get('agent:command-mismatch')?.fleetHighlights[0]?.tone).toBe('critical');
expect(byID.get('agent:config-pending')?.fleetHighlights.map((signal) => signal.label)).toEqual(
- ['Config pending', 'Remote control enabled'],
+ ['Config pending'],
);
expect(byID.get('agent:config-unknown')?.fleetHighlights.map((signal) => signal.label)).toEqual(
- ['Config unknown', 'Remote control enabled'],
+ ['Config unknown'],
);
});
@@ -616,7 +614,7 @@ describe('useConnectionsLedger', () => {
'agent:agent-delly',
'agent:agent-minipc',
]);
- expect(result.rows()[0].fleetHighlights.map((signal) => signal.label)).toEqual(['Fleet OK']);
+ expect(result.rows()[0].fleetHighlights).toEqual([]);
expect(result.rows()[0].members).toMatchObject([
{
id: 'node-delly',
@@ -627,7 +625,7 @@ describe('useConnectionsLedger', () => {
hostAliases: ['delly', '192.168.0.10'],
coverageLabels: ['Host telemetry'],
statusLabel: 'Active',
- fleetHighlights: [{ label: 'Remote control disabled' }],
+ fleetHighlights: [],
primary: true,
},
{
@@ -639,7 +637,7 @@ describe('useConnectionsLedger', () => {
hostAliases: ['minipc', '192.168.0.11'],
coverageLabels: ['Host telemetry'],
statusLabel: 'Active',
- fleetHighlights: [{ label: 'Remote control disabled' }],
+ fleetHighlights: [],
primary: false,
},
]);
diff --git a/frontend-modern/src/components/Settings/connectionsTableModel.ts b/frontend-modern/src/components/Settings/connectionsTableModel.ts
index 894bccdc98..3b3d50b74c 100644
--- a/frontend-modern/src/components/Settings/connectionsTableModel.ts
+++ b/frontend-modern/src/components/Settings/connectionsTableModel.ts
@@ -844,27 +844,36 @@ export const visibleFleetGovernanceSignals = (
signals: readonly FleetGovernanceSignal[],
): FleetGovernanceSignal[] => {
const hasPassiveAgentConfigConfirmation = signals.some(isPassiveAgentConfigConfirmationSignal);
- const visibleSignals = signals.filter(
+ // A row can flatten signals from multiple connections (e.g. a PVE primary
+ // and its paired agent). Treat liveness as attention if any contributor
+ // is non-OK, otherwise an active PVE primary masks a stale agent.
+ const livenessIsAttention = signals.some(
(signal) =>
- !isPassiveAgentConfigConfirmationSignal(signal) &&
- !isPassiveAgentRolloutConfirmationFallbackSignal(signal, hasPassiveAgentConfigConfirmation),
+ signal.key === 'liveness' && (signal.tone === 'warning' || signal.tone === 'critical'),
);
+ const visibleSignals = signals.filter((signal) => {
+ if (isPassiveAgentConfigConfirmationSignal(signal)) return false;
+ if (isPassiveAgentRolloutConfirmationFallbackSignal(signal, hasPassiveAgentConfigConfirmation))
+ return false;
+ // Liveness duplicates the row's status badge column; skip it here so a
+ // stale connection doesn't get "Stale" rendered twice.
+ if (signal.key === 'liveness') return false;
+ // Adapter health degrades automatically when an agent stops heartbeating.
+ // When liveness is already raising attention, "Adapter degraded" is the
+ // same root cause restated, not an independent reading.
+ if (signal.key === 'adapter' && livenessIsAttention) return false;
+ // Default-disabled remote control is the unconfigured state on every
+ // fresh agent. Surface only when policy is actively wrong
+ // (blocked/mismatched/pending/unknown). The Manage drawer is the right
+ // place to read informational policy state.
+ if (signal.key === 'command-policy' && signal.tone === 'info') return false;
+ return true;
+ });
const attention = visibleSignals.filter(
(signal) => signal.tone === 'critical' || signal.tone === 'warning',
);
const control = visibleSignals.filter((signal) => signal.tone === 'info');
- if (attention.length + control.length > 0) {
- return [...attention, ...control].slice(0, 3);
- }
- return [
- {
- key: 'liveness',
- label: 'Fleet OK',
- detail:
- 'Enrollment, liveness, adapter health, credentials, and rollout state have no current warnings.',
- tone: 'ok',
- },
- ];
+ return [...attention, ...control].slice(0, 3);
};
const isPassiveAgentConfigConfirmationSignal = (signal: FleetGovernanceSignal): boolean => {
diff --git a/frontend-modern/src/components/Settings/useConnectionsLedger.ts b/frontend-modern/src/components/Settings/useConnectionsLedger.ts
index 9cfbb01098..29e9caed1b 100644
--- a/frontend-modern/src/components/Settings/useConnectionsLedger.ts
+++ b/frontend-modern/src/components/Settings/useConnectionsLedger.ts
@@ -404,17 +404,26 @@ const systemToRow = (
const isCluster =
system.type === 'pve' && Boolean(system.clusterName?.trim()) && members.length > 0;
+ // Roll up the row's status across every component the system pulls in:
+ // the primary, any cluster members and their agents, and any cluster- or
+ // host-level attached agents. Without this, a row whose PVE API is healthy
+ // but whose paired agent is stale reads "Active" with no surfaced problem.
+ const memberAgents = rawMembers
+ .map((member) =>
+ member.agentConnectionId ? connectionsByID.get(member.agentConnectionId) : undefined,
+ )
+ .filter((connection): connection is Connection => Boolean(connection));
+ const attachedComponents = componentConnections.filter(
+ (connection) => connection.id !== primaryConnection.id,
+ );
+ const hasAttachments = memberAgents.length > 0 || attachedComponents.length > 0;
let rollup: ClusterRollup | undefined;
- if (isCluster) {
- const memberAgents = rawMembers
- .map((member) =>
- member.agentConnectionId ? connectionsByID.get(member.agentConnectionId) : undefined,
- )
- .filter((connection): connection is Connection => Boolean(connection));
+ if (isCluster || hasAttachments) {
const states: ConnectionState[] = [
primaryConnection.state,
...rawMembers.map((member) => member.state),
...memberAgents.map((connection) => connection.state),
+ ...attachedComponents.map((connection) => connection.state),
];
const worstState = states.reduce<ConnectionState>(
(acc, state) => moreSevereState(acc, state),
@@ -424,6 +433,7 @@ const systemToRow = (
primaryConnection.lastSeen,
...rawMembers.map((member) => member.lastSeen),
...memberAgents.map((connection) => connection.lastSeen),
+ ...attachedComponents.map((connection) => connection.lastSeen),
];
rollup = { state: worstState, lastSeen: oldestTimestamp(lastSeens) };
}