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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
style(web): format the PBS History integration
pulse-triage[bot]411f284fef91
diff --git a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsxindex 5c5250116d..06ba3c6f6b 100644--- a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx@@ -225,10 +225,12 @@ export function ProxmoxPageSurface() {const backupModel = createMemo(() =>buildModel(Array.from(- new Map([- ...normalizeSnapshot(overviewResources.resources()),- ...normalizeSnapshot(backupResources.resources()),- ].map((resource) => [resource.id, resource])).values(),+ new Map(+ [+ ...normalizeSnapshot(overviewResources.resources()),+ ...normalizeSnapshot(backupResources.resources()),+ ].map((resource) => [resource.id, resource]),+ ).values(),),),);diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.drawer.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.drawer.test.tsxindex 52ee4c9448..6efedf95e3 100644--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.drawer.test.tsx+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupServersTable.drawer.test.tsx@@ -96,89 +96,102 @@ describe('ProxmoxBackupServersTable details', () => {expect(screen.queryByTestId('pbs-resource-detail')).not.toBeInTheDocument();});- it.each(['agent', 'vm', 'system-container'] as const)('uses the uniquely correlated %s resource for host details and metrics history', (type) => {- const pbs = makePbsResource();- pbs.sources = ['pbs'];- pbs.agent = undefined;- pbs.metricsTarget = { resourceType: 'agent', resourceId: 'pbs-main' };- pbs.platformData = {- sources: ['pbs'],- pbs: { instanceId: 'pbs-main', hostname: 'pbs-main', datastoreCount: 1 },- };- const agent = {- id: 'agent-host-1',- type,- name: 'pbs-main.local',- displayName: 'PBS host',- platformId: 'agent-host-1',- platformType: 'proxmox-pbs',- sourceType: 'hybrid',- sources: ['agent', 'pbs'],- status: 'online',- lastSeen: pbs.lastSeen + 1_000,- agent: { agentId: 'agent-pbs-1', hostname: 'pbs-main.local', osName: 'Debian GNU/Linux' },- metricsTarget: { resourceType: type, resourceId: 'agent-pbs-1' },- platformData: {+ it.each(['agent', 'vm', 'system-container'] as const)(+ 'uses the uniquely correlated %s resource for host details and metrics history',+ (type) => {+ const pbs = makePbsResource();+ pbs.sources = ['pbs'];+ pbs.agent = undefined;+ pbs.metricsTarget = { resourceType: 'agent', resourceId: 'pbs-main' };+ pbs.platformData = {+ sources: ['pbs'],+ pbs: { instanceId: 'pbs-main', hostname: 'pbs-main', datastoreCount: 1 },+ };+ const agent = {+ id: 'agent-host-1',+ type,+ name: 'pbs-main.local',+ displayName: 'PBS host',+ platformId: 'agent-host-1',+ platformType: 'proxmox-pbs',+ sourceType: 'hybrid',sources: ['agent', 'pbs'],- agent: { agentId: 'agent-pbs-1', hostname: 'pbs-main.local' },- },- } as Resource;-- expect(agent.disk).toBeUndefined();- render(() => <ProxmoxBackupServersTable servers={[pbs, agent]} />);- fireEvent.click(screen.getByRole('button', { name: 'Expand details for pbs-main' }));-- const detail = screen.getByTestId('pbs-resource-detail');- expect(detail).toHaveAttribute('data-resource-id', 'pbs-1');- expect(detail).toHaveAttribute('data-agent-id', 'agent-pbs-1');- expect(detail).toHaveAttribute('data-metrics-resource-id', 'agent-pbs-1');- expect(detail).toHaveAttribute('data-metrics-resource-type', type);- });+ status: 'online',+ lastSeen: pbs.lastSeen + 1_000,+ agent: { agentId: 'agent-pbs-1', hostname: 'pbs-main.local', osName: 'Debian GNU/Linux' },+ metricsTarget: { resourceType: type, resourceId: 'agent-pbs-1' },+ platformData: {+ sources: ['agent', 'pbs'],+ agent: { agentId: 'agent-pbs-1', hostname: 'pbs-main.local' },+ },+ } as Resource;++ expect(agent.disk).toBeUndefined();+ render(() => <ProxmoxBackupServersTable servers={[pbs, agent]} />);+ fireEvent.click(screen.getByRole('button', { name: 'Expand details for pbs-main' }));++ const detail = screen.getByTestId('pbs-resource-detail');+ expect(detail).toHaveAttribute('data-resource-id', 'pbs-1');+ expect(detail).toHaveAttribute('data-agent-id', 'agent-pbs-1');+ expect(detail).toHaveAttribute('data-metrics-resource-id', 'agent-pbs-1');+ expect(detail).toHaveAttribute('data-metrics-resource-type', type);+ },+ );it('does not correlate a guest without host telemetry just by name', () => {const pbs = makePbsResource();pbs.metricsTarget = { resourceType: 'agent', resourceId: 'pbs-main' };- const guest = { ...pbs, id: 'vm-unrelated', type: 'vm',- agent: undefined, platformData: {}, pbs: undefined,- metricsTarget: { resourceType: 'vm', resourceId: 'unrelated' } } as Resource;+ const guest = {+ ...pbs,+ id: 'vm-unrelated',+ type: 'vm',+ agent: undefined,+ platformData: {},+ pbs: undefined,+ metricsTarget: { resourceType: 'vm', resourceId: 'unrelated' },+ } as Resource;render(() => <ProxmoxBackupServersTable servers={[pbs, guest]} />);fireEvent.click(screen.getByRole('button', { name: 'Expand details for pbs-main' }));- expect(screen.getByTestId('pbs-resource-detail')).toHaveAttribute(- 'data-metrics-resource-id', 'pbs-main',- );- });-- it.each(['agent', 'vm'] as const)('does not guess when an agent and %s share the PBS hostname', (type) => {- const pbs = makePbsResource();- pbs.sources = ['pbs'];- pbs.agent = undefined;- pbs.metricsTarget = { resourceType: 'agent', resourceId: 'pbs-main' };- const candidate = (id: string): Resource =>- ({- id,- type: id === 'agent-pbs-b' ? type : 'agent',- name: 'pbs-main.local',- displayName: id,- platformId: id,- platformType: 'proxmox-pbs',- sourceType: 'hybrid',- sources: ['agent', 'pbs'],- status: 'online',- lastSeen: pbs.lastSeen,- agent: { agentId: id, hostname: 'pbs-main.local' },- metricsTarget: { resourceType: 'agent', resourceId: id },- }) as Resource;-- render(() => (- <ProxmoxBackupServersTable- servers={[pbs, candidate('agent-pbs-a'), candidate('agent-pbs-b')]}- />- ));- fireEvent.click(screen.getByRole('button', { name: 'Expand details for pbs-main' }));-expect(screen.getByTestId('pbs-resource-detail')).toHaveAttribute('data-metrics-resource-id','pbs-main',);});++ it.each(['agent', 'vm'] as const)(+ 'does not guess when an agent and %s share the PBS hostname',+ (type) => {+ const pbs = makePbsResource();+ pbs.sources = ['pbs'];+ pbs.agent = undefined;+ pbs.metricsTarget = { resourceType: 'agent', resourceId: 'pbs-main' };+ const candidate = (id: string): Resource =>+ ({+ id,+ type: id === 'agent-pbs-b' ? type : 'agent',+ name: 'pbs-main.local',+ displayName: id,+ platformId: id,+ platformType: 'proxmox-pbs',+ sourceType: 'hybrid',+ sources: ['agent', 'pbs'],+ status: 'online',+ lastSeen: pbs.lastSeen,+ agent: { agentId: id, hostname: 'pbs-main.local' },+ metricsTarget: { resourceType: 'agent', resourceId: id },+ }) as Resource;++ render(() => (+ <ProxmoxBackupServersTable+ servers={[pbs, candidate('agent-pbs-a'), candidate('agent-pbs-b')]}+ />+ ));+ fireEvent.click(screen.getByRole('button', { name: 'Expand details for pbs-main' }));++ expect(screen.getByTestId('pbs-resource-detail')).toHaveAttribute(+ 'data-metrics-resource-id',+ 'pbs-main',+ );+ },+ );});diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsxindex d1a8352f4c..4eb7701e7d 100644--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxPageSurface.contract.test.tsx@@ -412,11 +412,19 @@ describe('ProxmoxPageSurface contract', () => {it('reuses guests and hydrates standalone PBS telemetry without duplicate candidates', () => {mockPathname.mockReturnValue('/proxmox/backups');- const guest = makeResource({ id: 'vm-100', type: 'vm', proxmox: { vmid: 100 },- agent: { agentId: 'guest-agent', hostname: 'pbs-vm' } });- const agent = makeResource({ id: 'pbs-agent', type: 'agent',- platformType: 'proxmox-pbs', sources: ['pbs', 'agent'],- metricsTarget: { resourceType: 'agent', resourceId: 'pbs-agent' } });+ const guest = makeResource({+ id: 'vm-100',+ type: 'vm',+ proxmox: { vmid: 100 },+ agent: { agentId: 'guest-agent', hostname: 'pbs-vm' },+ });+ const agent = makeResource({+ id: 'pbs-agent',+ type: 'agent',+ platformType: 'proxmox-pbs',+ sources: ['pbs', 'agent'],+ metricsTarget: { resourceType: 'agent', resourceId: 'pbs-agent' },+ });const server = makeResource({id: 'pbs-1',type: 'pbs',