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.

Keep shared selector identity local

rcourtman8f6fddc2fba3
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index dd947f7935..9f3cffd297 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -263,6 +263,12 @@ resource-family counts, agent-backed node-summary projection, unified-node and
PBS-instance projection, and recovery backup-count derivation. Future
infrastructure-selector work should extend those owners instead of pushing
resource aggregation or selection lifecycle back into the shared shell.
+That shared selector projection must also preserve canonical local operator
+identity for agent-backed infrastructure labels. Governed or AI-safe resource
+summaries may inform policy/detail surfaces, but the selector's summary and
+drawer-facing agent labels must continue to use the same local instance
+identity boundary as the operator-facing infrastructure tables so multiple PBS,
+PMG, or other governed resources remain distinguishable.
The shared infrastructure details drawer now follows that same owner split.
`frontend-modern/src/components/shared/InfrastructureDetailsDrawer.tsx` stays
the render shell, `frontend-modern/src/components/shared/useInfrastructureDetailsDrawerState.ts`
diff --git a/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx b/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx
index bbb84347e0..bf52faa767 100644
--- a/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx
+++ b/frontend-modern/src/components/shared/__tests__/InfrastructureSelector.test.tsx
@@ -4,6 +4,8 @@ import infrastructureSelectorSource from '@/components/shared/InfrastructureSele
import infrastructureSelectorModelSource from '@/components/shared/infrastructureSelectorModel.ts?raw';
import infrastructureSelectorStateSource from '@/components/shared/useInfrastructureSelectorState.ts?raw';
import { InfrastructureSelector } from '@/components/shared/InfrastructureSelector';
+import { buildInfrastructureSelectorAgents } from '@/components/shared/infrastructureSelectorModel';
+import type { Resource } from '@/types/resource';
const infrastructureSummaryTableMock = vi.fn(
(props: { onNodeClick: (nodeId: string, nodeType: 'pve' | 'pbs') => void; selectedNode: string | null }) => (
@@ -109,4 +111,46 @@ describe('InfrastructureSelector', () => {
expect(onNodeSelect).toHaveBeenLastCalledWith(null, null);
await waitFor(() => expect(table).toHaveTextContent('none'));
});
+
+ it('keeps shared selector agent labels on canonical local infrastructure identity', () => {
+ const resources = [
+ {
+ id: 'pbs-sensitive',
+ type: 'pbs',
+ name: 'redacted-pbs',
+ displayName: 'PBS Main',
+ status: 'online',
+ platformId: 'pbs-main',
+ lastSeen: Date.now(),
+ policy: {
+ display: {
+ mode: 'governed',
+ summary: 'backup server resource; status online; sources pbs',
+ },
+ },
+ platformData: {
+ agent: {
+ hostname: 'pbs.internal',
+ memory: { total: 16, used: 8, free: 8, usage: 50 },
+ disks: [],
+ networkInterfaces: [],
+ raid: [],
+ },
+ },
+ agent: {
+ memory: { total: 16, used: 8, free: 8, usage: 50 },
+ disks: [],
+ networkInterfaces: [],
+ raid: [],
+ },
+ },
+ ] as Resource[];
+
+ expect(buildInfrastructureSelectorAgents(resources)).toEqual([
+ expect.objectContaining({
+ id: 'pbs-sensitive',
+ displayName: 'PBS Main',
+ }),
+ ]);
+ });
});
diff --git a/frontend-modern/src/components/shared/infrastructureSelectorModel.ts b/frontend-modern/src/components/shared/infrastructureSelectorModel.ts
index 2a296d60b8..9fcd3804fa 100644
--- a/frontend-modern/src/components/shared/infrastructureSelectorModel.ts
+++ b/frontend-modern/src/components/shared/infrastructureSelectorModel.ts
@@ -3,7 +3,7 @@ import type { Agent, Node } from '@/types/api';
import type { Resource } from '@/types/resource';
import { nodeFromResource, pbsInstanceFromResource } from '@/utils/resourceStateAdapters';
import {
- getPreferredResourceDisplayName,
+ getPreferredInfrastructureDisplayName,
getPreferredResourceHostname,
} from '@/utils/resourceIdentity';
import {
@@ -120,7 +120,7 @@ export function buildInfrastructureSelectorAgents(resources: Resource[]): Agent[
agentsById.set(hostId, {
id: hostId,
hostname,
- displayName: getPreferredResourceDisplayName(resource),
+ displayName: getPreferredInfrastructureDisplayName(resource),
platform: asString(agent.platform),
osName: asString(agent.osName),
osVersion: asString(agent.osVersion),