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 host backups out of guest coverage

rcourtmanc51f68817dd5
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
index 06d646e55d..cfba6a94d7 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupRecoveryModel.test.ts
@@ -173,6 +173,44 @@ describe('proxmoxBackupRecoveryModel', () => {
expect(orphan?.workload.label).toBe('CT 999');
});
+ it('keeps host and zero-id artifacts out of guest coverage and orphan counts', () => {
+ const model = buildProxmoxBackupRecoveryModel({
+ workloads: [],
+ pbsBackups: [
+ pbsBackup({
+ id: 'pbs-main/main/root/ct/0/2026-05-25T01:34:25Z',
+ namespace: 'root',
+ vmid: '0',
+ }),
+ pbsBackup({
+ id: 'pbs-main/main/root/host/mail-gateway/2026-05-25T01:34:25Z',
+ namespace: 'root',
+ backupType: 'host',
+ vmid: 'mail-gateway',
+ }),
+ ],
+ archives: [
+ archive({
+ id: 'host-archive-mail-gateway',
+ type: 'host',
+ vmid: 0,
+ instance: 'mail-gateway',
+ node: 'pmg-01',
+ }),
+ ],
+ snapshots: [],
+ tasks: [],
+ nowMs: Date.parse('2026-05-26T08:00:00Z'),
+ });
+
+ expect(model.recoverableArtifacts).toHaveLength(3);
+ expect(model.coverageRows).toHaveLength(0);
+ expect(model.coverageSummary.totalWorkloads).toBe(0);
+ expect(model.recoverableArtifacts.map((artifact) => artifact.workload.label)).toEqual(
+ expect.arrayContaining(['CT backup', 'Host mail-gateway']),
+ );
+ });
+
it('does not create phantom workload rows from aggregate vzdump jobs', () => {
const model = buildProxmoxBackupRecoveryModel({
workloads: [],
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
index 1a30547d5a..53ec326b5e 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupRecoveryModel.ts
@@ -135,9 +135,22 @@ function typeLabel(type: WorkloadReference['type']): string {
return 'Guest';
}
-function workloadFallbackLabel(type: WorkloadReference['type'], vmid: string): string {
+function workloadFallbackLabel(
+ type: WorkloadReference['type'],
+ vmid: string,
+ hints: readonly (string | undefined)[] = [],
+): string {
const label = typeLabel(type);
- return vmid ? `${label} ${vmid}` : label;
+ const cleanVmid = vmid.trim();
+ if (type === 'host') {
+ if (cleanVmid && !isZeroWorkloadId(cleanVmid)) return `${label} ${cleanVmid}`;
+ const hintLabel = hints
+ .map((hint) => hint?.trim())
+ .find((hint) => hint && normalizeKey(hint) !== 'root' && normalizeKey(hint) !== '(root)');
+ return hintLabel ? `${label} ${hintLabel}` : 'Host backup';
+ }
+ if (cleanVmid && !isZeroWorkloadId(cleanVmid)) return `${label} ${cleanVmid}`;
+ return type === 'unknown' ? label : `${label} backup`;
}
function resourceVmid(resource: Resource): string {
@@ -216,11 +229,19 @@ function fallbackWorkload(
type,
typeLabel: typeLabel(type),
vmid,
- label: workloadFallbackLabel(type, vmid),
+ label: workloadFallbackLabel(type, vmid, hints),
node: hints.find((hint) => !!hint?.trim()),
};
}
+function isCoverageWorkload(workload: WorkloadReference): boolean {
+ return (
+ (workload.type === 'vm' || workload.type === 'ct') &&
+ Boolean(workload.vmid.trim()) &&
+ !isZeroWorkloadId(workload.vmid)
+ );
+}
+
function resolveWorkload(
candidates: readonly WorkloadCandidate[],
type: WorkloadReference['type'],
@@ -396,6 +417,7 @@ export function buildProxmoxBackupRecoveryModel(
const artifacts: RecoverableArtifact[] = [];
const addArtifact = (artifact: RecoverableArtifact) => {
artifacts.push(artifact);
+ if (!isCoverageWorkload(artifact.workload)) return;
const row = ensureRow(artifact.workload);
row.artifacts.push(artifact);
if (artifact.sourceKind === 'pbs') row.pbsCount += 1;