Show Proxmox guests and scheduled backup status in device details
Rust development slice / linux (push) Failing after 14s

The host detail lists VMs and containers with linked inventory devices and
last successful backup, each vzdump job with its due time and result, an
overall 'all scheduled backups ran' answer and guests without a job. VM hosts
detected from a Proxmox guest list are labelled and the assignment form can
hand the decision back to automatic detection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 12:12:54 +01:00
co-authored by Claude Opus 5.5
parent 70977df577
commit ce356f0de7
6 changed files with 190 additions and 6 deletions
+21 -1
View File
@@ -386,10 +386,25 @@ test('shows real VM hosts and the Hetzner placeholder without adding a device',
lifecycle: 'current', status: 'online', recent_jobs: [], volumes: [] };
const vm = { ...base, hostname: 'Test-VM', asset_id: 'vm-asset', agent_id: 'vm-agent', device_type: 'virtual' };
const pve = { ...base, hostname: 'pve-01', asset_id: 'pve-asset', agent_id: 'pve-agent',
device_type: 'hypervisor', os: 'Proxmox VE' };
device_type: 'hypervisor', os: 'Proxmox VE', tenant_id: tenant,
proxmox: { quality: 'valid', error_code: null, observed_at: new Date().toISOString(), truncated: false,
data: { node: 'pve-01', cluster: null, version: '9.2.2', not_backed_up: [101],
guests: [
{ vmid: 100, name: 'Test-VM', kind: 'qemu', status: 'running', template: false, cpus: 2,
memory_bytes: 2 ** 31, disk_bytes: 2 ** 33, macs: ['bc:24:11:00:00:01'] },
{ vmid: 101, name: 'alpine-ct', kind: 'lxc', status: 'stopped', template: false, cpus: 1,
memory_bytes: 2 ** 27, disk_bytes: 2 ** 30, macs: [] }],
backup_jobs: [{ id: 'backup-nightly', enabled: true, schedule: '21:00', storage: 'local',
selection: 'vmid', covered_vmids: [100], last_expected_run: 1795118400, next_run: 1795204800 }],
backup_runs: [] },
backup_status: { all_scheduled_backups_ran: false, enabled_jobs: 1, problem_jobs: 1,
last_success_at: {}, jobs: [{ id: 'backup-nightly', status: 'missed',
guests: [{ vmid: 100, status: 'missed', last_success_at: null }] }] },
guest_devices: [{ vmid: 100, asset_id: 'vm-asset', agent_id: 'vm-agent', hostname: 'Test-VM', source: 'proxmox' }] } };
const placeholder = { kind: 'placeholder', provider: 'hetzner', hostname: 'Hetzner Cloud' };
let assigned = false;
const guest = () => ({ ...vm, assigned_hypervisor_asset_id: assigned ? pve.asset_id : null,
hypervisor_source: assigned ? 'manual' : null,
hypervisor: assigned ? { kind: 'device', hostname: pve.hostname, asset_id: pve.asset_id, agent_id: pve.agent_id } : placeholder });
const listing = (items: unknown[]) => ({ items, next_cursor: null, truncated: false,
completeness: 'complete', as_of: new Date().toISOString() });
@@ -445,6 +460,11 @@ test('shows real VM hosts and the Hetzner placeholder without adding a device',
await expect(vmRow).not.toContainText('Hetzner Cloud');
await hostLink.click();
await expect(page.getByRole('heading', { name: pve.hostname })).toBeVisible();
await expect(page.getByRole('heading', { name: 'Virtuelle Maschinen und Container' })).toBeVisible();
await expect(page.getByRole('row').filter({ hasText: 'alpine-ct' })).toContainText('Container');
await expect(page.getByRole('row').filter({ hasText: 'backup-nightly' })).toContainText('Verpasst');
await expect(page.getByText('Nicht alle geplanten Backups sind gelaufen.')).toBeVisible();
await expect(page.getByRole('link', { name: 'Test-VM' })).toBeVisible();
await page.getByRole('button', { name: 'Zur Geräteliste' }).click();
await page.getByRole('button', { name: vm.hostname }).click();
await page.getByText('Gerät verwalten', { exact: true }).click();