import { ChevronRight, Circle } from 'lucide-react'; import { StatusCard } from './StatusCard.jsx'; export function Dashboard({ health, jobs, loading, onManage, vms }) { const activeJobs = jobs.filter((job) => ['queued', 'running'].includes(job.status)); const runningVms = vms.filter((vm) => vm.status === 'Running'); const lastSuccess = jobs.find((job) => job.status === 'success'); return (

VM Backup Status

{healthSummary(health)}
{vms.map((vm) => ( ))} {!vms.length ? ( ) : null}
VM Incus Last Job Active Job Actions
{vm.name} {vm.status || 'Unknown'} {vm.lastJobStatus || 'None'} {vm.activeJob ? (
{vm.activeJob.currentStep} {Math.round(vm.activeJob.progress?.percent || 0)}%
) : 'Idle'}
No VMs loaded.
); } function formatTime(value) { if (!value) return 'None'; return new Intl.DateTimeFormat(undefined, { dateStyle: 'short', timeStyle: 'short' }).format(new Date(value)); } function healthSummary(health) { if (!health) return 'Health loading'; if (health.ok) return 'All checks ok'; return Object.entries(health.checks || {}) .filter(([, value]) => value !== 'ok') .map(([key]) => key) .join(', ') || 'Health degraded'; }