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.

Fix Proxmox PBS backup artifact surface

rcourtman7470b62a01b7
diff --git a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
index 816160c0c8..75ff2bd843 100644
--- a/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
+++ b/docs/release-control/v6/internal/subsystems/agent-lifecycle.md
@@ -179,6 +179,13 @@ impact previews, or cross-organization sharing only through the API and
unified-resource contracts; lifecycle code must not treat that share as an
agent install target, a command-agent authority, or a reason to widen setup
tokens.
+Source-specific backup artifact routes under shared `internal/api/`, including
+`/api/backups/pve` and `/api/backups/pbs`, are also read-only monitoring and
+storage/recovery evidence for lifecycle-adjacent surfaces. Lifecycle code may
+display those backup facts as connection or workload context, but it must not
+treat a backup artifact, datastore, namespace, owner, or verification record as
+an agent enrollment candidate, install target, setup-token scope, credential
+grant, or fleet-command authority.
Docker / Podman native inventory and Kubernetes native API inventory follow
that same lifecycle boundary. Images, volumes, networks, Swarm tasks,
Swarm nodes, Swarm secrets, Swarm configs, engine storage-usage buckets,
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index c677345747..14c0805413 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -83,6 +83,7 @@ product API routes free of maintainer commercial analytics.
49. `internal/cloudcp/portal/frontend/tsconfig.json`
50. `internal/cloudcp/portal/frontend_sync_test.go`
51. `internal/api/recovery_handlers.go`
+51a. `internal/api/pbs_backups.go`
52. `internal/api/config_setup_handlers.go`
53. `internal/api/demo_mode_commercial.go`
54. `internal/api/demo_mode_operations.go`
@@ -151,6 +152,15 @@ remains primary when a service is configured; mock fixtures may supplement or
stand in for that data only in mock mode, and they must not expose raw command
output or bypass the normal non-admin redaction path.
+Source-specific backup artifact routes are canonical API payload boundaries.
+`/api/backups/pve` owns Proxmox VE task, storage-archive, and guest-snapshot
+collections. `/api/backups/pbs` owns Proxmox Backup Server artifacts and must
+carry the PBS-authored `models.PBSBackup` fields, including datastore,
+namespace, backup type, VMID, backup time, size, protection, verification,
+files, owner, and comment. Recovery history may index those artifacts, but it
+must not be the only API path for PBS protection or verification state when a
+platform page needs source-native backup columns.
+
1. `frontend-modern/src/api/agentProfiles.ts` shared with `agent-lifecycle`: the agent profiles frontend client is both an agent lifecycle control surface and a canonical API payload contract boundary.
2. `frontend-modern/src/api/ai.ts` shared with `ai-runtime`: the AI frontend client is both an AI runtime control surface and a canonical API payload contract boundary.
3. `frontend-modern/src/api/nodes.ts` shared with `agent-lifecycle`: the shared Proxmox node client is both an agent lifecycle setup/install control surface and a canonical API payload contract boundary.
diff --git a/docs/release-control/v6/internal/subsystems/monitoring.md b/docs/release-control/v6/internal/subsystems/monitoring.md
index df23a300b7..cc14abc310 100644
--- a/docs/release-control/v6/internal/subsystems/monitoring.md
+++ b/docs/release-control/v6/internal/subsystems/monitoring.md
@@ -114,6 +114,12 @@ truth for live infrastructure data.
`Disabled=false` must remain the migration-safe default for existing
`nodes.json` content; the poller must never create a client or mark an
instance reachable when `Disabled` is true.
+ Source-specific backup snapshot accessors in `internal/monitoring/monitor.go`
+ are monitor-state read surfaces, not recovery-store projections. PVE backup
+ consumers read `PVEBackupsSnapshot()`, while PBS artifact consumers read
+ `PBSBackupsSnapshot()` so PBS size, protection, verification, file, owner,
+ datastore, and namespace facts remain the live PBS poller result carried on
+ `models.PBSBackup`.
12. Add or change agentless availability monitoring only through the
poll-provider path. `internal/monitoring/availability_poller.go` owns ICMP,
TCP, and HTTP probes, provider health, scheduler task construction, and
diff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.md
index 3602160eea..9da4744081 100644
--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md
+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md
@@ -78,6 +78,14 @@ storage/recovery-adjacent: optional PVE `/storage` grants must remain effective
for privilege-separated tokens by assigning the same `PVEDatastoreAdmin` role to
both the service user and the concrete token id.
+Proxmox platform backup surfaces may embed source-specific backup evidence, but
+the source of truth must stay explicit. PBS artifacts on the Proxmox Backups tab
+consume `/api/backups/pbs` and render PBS-authored size, protection,
+verification, namespace, owner, and file facts from `models.PBSBackup`. PVE
+snapshot, storage-archive, and task tables consume `/api/backups/pve` and must
+keep columns source-aware: columns that PVE cannot populate for the current data
+set are omitted rather than rendered as all-dash placeholders.
+
Storage/recovery auth-adjacent changes may consume SSO-authenticated sessions,
but they must not reinterpret SAML or multi-provider SSO availability as a
storage/recovery entitlement; that provider-route and license truth belongs to
diff --git a/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx
index 2106d3cdc7..8bd2db1e54 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxBackupsTable.tsx
@@ -1,6 +1,7 @@
import {
For,
Show,
+ createEffect,
createMemo,
createResource,
createSignal,
@@ -11,6 +12,7 @@ import {
import ArchiveIcon from 'lucide-solid/icons/archive';
import CameraIcon from 'lucide-solid/icons/camera';
import ActivityIcon from 'lucide-solid/icons/activity';
+import ServerIcon from 'lucide-solid/icons/server';
import ArrowDownIcon from 'lucide-solid/icons/arrow-down';
import ArrowUpIcon from 'lucide-solid/icons/arrow-up';
import ArrowUpDownIcon from 'lucide-solid/icons/arrow-up-down';
@@ -47,6 +49,9 @@ import {
import type {
BackupTask,
GuestSnapshot,
+ PBSBackup,
+ PBSBackupsPayload,
+ PBSBackupsResponse,
PVEBackupsPayload,
PVEBackupsResponse,
StorageBackup,
@@ -71,16 +76,16 @@ import {
} from './proxmoxBackupSummaryPresentation';
import { ProxmoxBackupsCoverageStrip } from './ProxmoxBackupsCoverageStrip';
-// Proxmox VE backups split into three meaningfully different surfaces:
+// Proxmox backups split into source-owned surfaces:
+// - PBS artifacts: deduplicated backup snapshots owned by Proxmox Backup
+// Server, including verification/protection state from PBS itself.
// - Snapshots: qm/pct snapshots taken on the host (no external storage)
// - vzdump files: backup archives written to a PVE storage (often a
// remote PBS or NFS share). Each is a discrete restorable artifact.
// - Recent tasks: the rolling backup-job execution log; this is what
// surfaces "did last night's backup actually run?"
-// PBS-resident backups (deduplicated server-side) get their own platform
-// page, so this table is explicitly the PVE backup story.
-type BackupTabId = 'snapshots' | 'archives' | 'tasks';
+type BackupTabId = 'pbs' | 'snapshots' | 'archives' | 'tasks';
interface BackupTabSpec {
id: BackupTabId;
@@ -91,6 +96,13 @@ interface BackupTabSpec {
}
const TABS: BackupTabSpec[] = [
+ {
+ id: 'pbs',
+ label: 'PBS artifacts',
+ icon: () => <ServerIcon class="h-4 w-4" aria-hidden="true" />,
+ emptyTitle: 'No PBS artifacts',
+ emptyDescription: 'Deduplicated backup snapshots from Proxmox Backup Server will appear here.',
+ },
{
id: 'snapshots',
label: 'Snapshots',
@@ -114,6 +126,10 @@ const TABS: BackupTabSpec[] = [
},
];
+function tabSpecFor(id: BackupTabId): BackupTabSpec {
+ return TABS.find((spec) => spec.id === id)!;
+}
+
// Replication colours the per-row status word to match its dot (emerald
// text for Healthy, red for Failed, etc.). Mirror that here so the
// Recent tasks STATUS column reads the same way — dot + same-tone word.
@@ -150,6 +166,20 @@ function guestLabel(type: string | undefined, vmid: number): string {
return `${kind} ${vmid}`;
}
+function pbsWorkloadLabel(backup: PBSBackup): string {
+ const t = (backup.backupType ?? '').toLowerCase();
+ if (t === 'ct') return `CT ${backup.vmid}`;
+ if (t === 'vm') return `VM ${backup.vmid}`;
+ if (t === 'host') return backup.vmid ? `Host ${backup.vmid}` : 'Host';
+ const kind = backup.backupType?.trim().toUpperCase() || 'Backup';
+ return backup.vmid ? `${kind} ${backup.vmid}` : kind;
+}
+
+function pbsRepositoryLabel(backup: PBSBackup): string {
+ const namespace = backup.namespace?.trim() || '(root)';
+ return `${backup.datastore || '—'} / ${namespace}`;
+}
+
function formatDuration(start: string | undefined, end: string | undefined): string {
if (!start || !end) return '—';
const startMs = new Date(start).getTime();
@@ -178,6 +208,15 @@ async function fetchPVEBackups(): Promise<PVEBackupsPayload> {
);
}
+async function fetchPBSBackups(): Promise<PBSBackupsPayload> {
+ const response = await apiFetch('/api/backups/pbs');
+ if (!response.ok) {
+ throw new Error(`Failed to load PBS backups (${response.status})`);
+ }
+ const payload = (await response.json()) as PBSBackupsResponse;
+ return payload?.data ?? { backups: [] };
+}
+
const statusDot = (className: string) => <span class={`h-2 w-2 rounded-full ${className}`} />;
const ARCHIVE_STATUS_FILTERS: FilterOption<'all' | 'protected' | 'verified' | 'unverified'>[] = [
@@ -187,6 +226,13 @@ const ARCHIVE_STATUS_FILTERS: FilterOption<'all' | 'protected' | 'verified' | 'u
{ value: 'unverified', label: 'Unverified', tone: 'warning', leading: statusDot('bg-amber-500') },
];
+const PBS_STATUS_FILTERS: FilterOption<'all' | 'protected' | 'verified' | 'unverified'>[] = [
+ { value: 'all', label: 'All' },
+ { value: 'protected', label: 'Protected', tone: 'info', leading: statusDot('bg-blue-500') },
+ { value: 'verified', label: 'Verified', tone: 'success', leading: statusDot('bg-emerald-500') },
+ { value: 'unverified', label: 'Unverified', tone: 'warning', leading: statusDot('bg-amber-500') },
+];
+
const TASK_STATUS_FILTERS: FilterOption<'all' | 'ok' | 'failed' | 'running'>[] = [
{ value: 'all', label: 'All' },
{ value: 'ok', label: 'OK', tone: 'success', leading: statusDot('bg-emerald-500') },
@@ -367,6 +413,16 @@ function cmpBool(a: boolean, b: boolean, direction: 'asc' | 'desc'): number {
// sysadmin-default question on a backup page. String columns default to
// `asc` (A→Z). Boolean columns default to `desc` so "true" sorts first.
+type PBSSortKey = 'workload' | 'repository' | 'created' | 'size' | 'protected' | 'verified';
+const PBS_SORT_DEFAULT_DIRECTION: Record<PBSSortKey, 'asc' | 'desc'> = {
+ workload: 'asc',
+ repository: 'asc',
+ created: 'desc',
+ size: 'desc',
+ protected: 'desc',
+ verified: 'desc',
+};
+
type SnapshotSortKey = 'guest' | 'node' | 'latest' | 'count' | 'size';
const SNAPSHOT_SORT_DEFAULT_DIRECTION: Record<SnapshotSortKey, 'asc' | 'desc'> = {
guest: 'asc',
@@ -410,10 +466,15 @@ const TASK_SORT_DEFAULT_DIRECTION: Record<TaskSortKey, 'asc' | 'desc'> = {
export const ProxmoxBackupsTable: Component<{
emptyIcon: JSX.Element;
+ hasPBS?: boolean;
}> = (props) => {
const [backups, { refetch }] = createResource<PVEBackupsPayload>(fetchPVEBackups);
- const [tab, setTab] = createSignal<BackupTabId>('snapshots');
+ const [pbsBackups, { refetch: refetchPBS }] = createResource<PBSBackupsPayload>(fetchPBSBackups);
+ const [tab, setTab] = createSignal<BackupTabId>(props.hasPBS ? 'pbs' : 'snapshots');
const [search, setSearch] = createSignal('');
+ const [pbsFilter, setPBSFilter] = createSignal<'all' | 'protected' | 'verified' | 'unverified'>(
+ 'all',
+ );
const [archiveFilter, setArchiveFilter] = createSignal<
'all' | 'protected' | 'verified' | 'unverified'
>('all');
@@ -421,9 +482,12 @@ export const ProxmoxBackupsTable: Component<{
const [snapshotFilter, setSnapshotFilter] = createSignal<SnapshotFilterValue>('all');
const [chartRange, setChartRange] = createSignal<BackupActivityRangeDays>(30);
const [selectedDateKey, setSelectedDateKey] = createSignal<string | null>(null);
+ const [pbsMetricMode, setPBSMetricMode] = createSignal<BackupActivityMetricMode>('count');
const [archiveMetricMode, setArchiveMetricMode] = createSignal<BackupActivityMetricMode>('count');
const [expandedGuests, setExpandedGuests] = createSignal<ReadonlySet<string>>(new Set<string>());
+ const [pbsSortKey, setPBSSortKey] = createSignal<PBSSortKey>('created');
+ const [pbsSortDirection, setPBSSortDirection] = createSignal<'asc' | 'desc'>('desc');
const [snapshotSortKey, setSnapshotSortKey] = createSignal<SnapshotSortKey>('latest');
const [snapshotSortDirection, setSnapshotSortDirection] = createSignal<'asc' | 'desc'>('desc');
const [archiveSortKey, setArchiveSortKey] = createSignal<ArchiveSortKey>('created');
@@ -431,6 +495,23 @@ export const ProxmoxBackupsTable: Component<{
const [taskSortKey, setTaskSortKey] = createSignal<TaskSortKey>('started');
const [taskSortDirection, setTaskSortDirection] = createSignal<'asc' | 'desc'>('desc');
+ const activeTabs = createMemo(() =>
+ props.hasPBS ? TABS : TABS.filter((spec) => spec.id !== 'pbs'),
+ );
+ createEffect(() => {
+ if (!activeTabs().some((spec) => spec.id === tab())) {
+ setTab(activeTabs()[0]?.id ?? 'snapshots');
+ }
+ });
+
+ const handlePBSSort = (key: PBSSortKey) => {
+ if (pbsSortKey() === key) {
+ setPBSSortDirection(pbsSortDirection() === 'asc' ? 'desc' : 'asc');
+ } else {
+ setPBSSortKey(key);
+ setPBSSortDirection(PBS_SORT_DEFAULT_DIRECTION[key]);
+ }
+ };
const handleSnapshotSort = (key: SnapshotSortKey) => {
if (snapshotSortKey() === key) {
setSnapshotSortDirection(snapshotSortDirection() === 'asc' ? 'desc' : 'asc');
@@ -465,6 +546,7 @@ export const ProxmoxBackupsTable: Component<{
return next;
});
+ const pbsArtifacts = createMemo<PBSBackup[]>(() => pbsBackups()?.backups ?? []);
const snapshots = createMemo<GuestSnapshot[]>(() => backups()?.guestSnapshots ?? []);
const archives = createMemo<StorageBackup[]>(() => backups()?.storageBackups ?? []);
const tasks = createMemo<BackupTask[]>(() => backups()?.backupTasks ?? []);
@@ -476,7 +558,32 @@ export const ProxmoxBackupsTable: Component<{
const snapshotCoverage = createMemo(() => buildSnapshotCoverageSummary(snapshots(), nowMs()));
const archiveCoverage = createMemo(() => buildArchiveCoverageSummary(archives(), nowMs()));
const taskOutcome = createMemo(() => buildTaskOutcomeSummary(tasks()));
+ const pbsCoverage = createMemo(() => {
+ const backups = pbsArtifacts();
+ const namespaces = new Set<string>();
+ let totalBytes = 0;
+ let protectedCount = 0;
+ let verifiedCount = 0;
+ for (const backup of backups) {
+ namespaces.add(pbsRepositoryLabel(backup));
+ if (typeof backup.size === 'number' && backup.size > 0) totalBytes += backup.size;
+ if (backup.protected) protectedCount += 1;
+ if (backup.verified) verifiedCount += 1;
+ }
+ return {
+ total: backups.length,
+ totalBytes,
+ protectedCount,
+ verifiedCount,
+ unverifiedCount: backups.length - verifiedCount,
+ namespaceCount: namespaces.size,
+ };
+ });
+ const pbsTimestampMs = (backup: PBSBackup): number | undefined => {
+ const ms = Date.parse(backup.backupTime ?? '');
+ return Number.isFinite(ms) ? ms : undefined;
+ };
const archiveTimestampMs = (arc: StorageBackup): number | undefined => {
const ms = Date.parse(arc.time ?? '');
return Number.isFinite(ms) ? ms : undefined;
@@ -529,6 +636,22 @@ export const ProxmoxBackupsTable: Component<{
const ARCHIVE_SEGMENT_KINDS: readonly BackupActivitySegmentKind[] = ['archive'];
const TASK_SEGMENT_KINDS: readonly BackupActivitySegmentKind[] = ['ok', 'failed', 'running'];
const SNAPSHOT_SEGMENT_KINDS: readonly BackupActivitySegmentKind[] = ['snapshot'];
+ const PBS_SEGMENT_KINDS: readonly BackupActivitySegmentKind[] = ['pbs'];
+
+ const pbsTimeline = createMemo(() =>
+ buildBackupActivityTimeline<PBSBackup>(
+ chartRange(),
+ pbsArtifacts(),
+ pbsTimestampMs,
+ () => 'pbs',
+ {
+ getValue:
+ pbsMetricMode() === 'volume'
+ ? (backup) => (backup.size > 0 ? backup.size : 0)
+ : undefined,
+ },
+ ),
+ );
const snapshotMatchesSearch = (snap: GuestSnapshot, term: string): boolean => {
if (!term) return true;
@@ -539,6 +662,61 @@ export const ProxmoxBackupsTable: Component<{
.includes(term);
};
+ const pbsMatchesSearch = (backup: PBSBackup, term: string): boolean => {
+ if (!term) return true;
+ return [
+ pbsWorkloadLabel(backup),
+ pbsRepositoryLabel(backup),
+ backup.instance,
+ backup.datastore,
+ backup.namespace,
+ backup.backupType,
+ backup.vmid,
+ backup.comment,
+ backup.owner,
+ ...(backup.files ?? []),
+ ]
+ .filter(Boolean)
+ .join(' ')
+ .toLowerCase()
+ .includes(term);
+ };
+
+ const filteredPBSBackups = createMemo(() => {
+ const term = search().trim().toLowerCase();
+ const filter = pbsFilter();
+ const dateKey = selectedDateKey();
+ const list = pbsArtifacts().filter((backup) => {
+ if (filter === 'protected' && !backup.protected) return false;
+ if (filter === 'verified' && !backup.verified) return false;
+ if (filter === 'unverified' && backup.verified) return false;
+ if (dateKey) {
+ const ms = pbsTimestampMs(backup);
+ if (ms === undefined || recoveryDateKeyFromTimestamp(ms) !== dateKey) return false;
+ }
+ return pbsMatchesSearch(backup, term);
+ });
+ const sortKey = pbsSortKey();
+ const direction = pbsSortDirection();
+ list.sort((a, b) => {
+ switch (sortKey) {
+ case 'workload':
+ return cmpString(pbsWorkloadLabel(a), pbsWorkloadLabel(b), direction);
+ case 'repository':
+ return cmpString(pbsRepositoryLabel(a), pbsRepositoryLabel(b), direction);
+ case 'created':
+ return cmpNumber(pbsTimestampMs(a), pbsTimestampMs(b), direction);
+ case 'size':
+ return cmpNumber(a.size, b.size, direction);
+ case 'protected':
+ return cmpBool(a.protected, b.protected, direction);
+ case 'verified':
+ return cmpBool(a.verified, b.verified, direction);
+ }
+ });
+ return list;
+ });
+
const filteredSnapshots = createMemo(() => {
const term = search().trim().toLowerCase();
const dateKey = selectedDateKey();
@@ -610,7 +788,8 @@ export const ProxmoxBackupsTable: Component<{
row.snapshots.push(snap);
row.count += 1;
if (snap.vmstate) row.withRamCount += 1;
- if (typeof snap.sizeBytes === 'number' && snap.sizeBytes > 0) row.totalBytes += snap.sizeBytes;
+ if (typeof snap.sizeBytes === 'number' && snap.sizeBytes > 0)
+ row.totalBytes += snap.sizeBytes;
const ms = snapshotTimestampMs(snap);
if (ms !== undefined && (row.newestMs === undefined || ms > row.newestMs)) {
row.newestMs = ms;
@@ -656,9 +835,7 @@ export const ProxmoxBackupsTable: Component<{
return ms > newest ? ms : newest;
}, undefined),
isStale: ((): boolean => {
- const newest = visibleSnapshots[0]
- ? snapshotTimestampMs(visibleSnapshots[0])
- : undefined;
+ const newest = visibleSnapshots[0] ? snapshotTimestampMs(visibleSnapshots[0]) : undefined;
if (newest === undefined) return true;
return now - newest > 30 * 24 * 60 * 60 * 1000;
})(),
@@ -778,8 +955,25 @@ export const ProxmoxBackupsTable: Component<{
return list;
});
+ const showSnapshotSizeColumn = createMemo(() =>
+ snapshots().some((snap) => typeof snap.sizeBytes === 'number' && snap.sizeBytes > 0),
+ );
+ const showSnapshotRAMColumn = createMemo(() => snapshots().some((snap) => snap.vmstate));
+ const snapshotColumnCount = createMemo(
+ () => 4 + (showSnapshotSizeColumn() ? 1 : 0) + (showSnapshotRAMColumn() ? 1 : 0),
+ );
+ const showArchivePBSColumns = createMemo(() =>
+ archives().some((arc) => arc.isPBS || arc.protected || arc.verified || !!arc.verification),
+ );
+ const showTaskSizeColumn = createMemo(() =>
+ tasks().some((task) => typeof task.size === 'number' && task.size > 0),
+ );
+ const showTaskErrorColumn = createMemo(() => tasks().some((task) => !!task.error?.trim()));
+
const totalForTab = createMemo<number>(() => {
switch (tab()) {
+ case 'pbs':
+ return pbsArtifacts().length;
case 'snapshots':
return snapshots().length;
case 'archives':
@@ -793,6 +987,8 @@ export const ProxmoxBackupsTable: Component<{
const visibleForTab = createMemo<number>(() => {
switch (tab()) {
+ case 'pbs':
+ return filteredPBSBackups().length;
case 'snapshots':
return filteredSnapshots().length;
case 'archives':
@@ -812,6 +1008,15 @@ export const ProxmoxBackupsTable: Component<{
computeMedianTaskDurationSeconds(filteredTasks()),
);
+ // The largest PBS artifact in the filtered set anchors the size bar.
+ const pbsSizeMaxBytes = createMemo(() => {
+ let max = 0;
+ for (const backup of filteredPBSBackups()) {
+ if (backup.size > max) max = backup.size;
+ }
+ return max;
+ });
+
// The largest archive in the filtered set anchors the size bar.
const archiveSizeMaxBytes = createMemo(() => {
let max = 0;
@@ -830,7 +1035,7 @@ export const ProxmoxBackupsTable: Component<{
<Card padding="lg">
<EmptyState
icon={props.emptyIcon}
- title="Could not load PVE backups"
+ title="Could not load Proxmox backup inventory"
description={(backups.error as Error | undefined)?.message ?? 'Refresh to retry.'}
actions={
<button
@@ -851,15 +1056,15 @@ export const ProxmoxBackupsTable: Component<{
<Card padding="lg">
<EmptyState
icon={props.emptyIcon}
- title="Loading PVE backups"
- description="Reading snapshots, archives and recent backup tasks."
+ title="Loading Proxmox backup inventory"
+ description="Reading PBS artifacts, PVE snapshots, archives and recent backup tasks."
/>
</Card>
}
>
<div class="space-y-3">
<div class="flex flex-wrap items-center gap-1 rounded-md border border-border bg-surface p-1">
- <For each={TABS}>
+ <For each={activeTabs()}>
{(spec) => (
<button
type="button"
@@ -874,17 +1079,66 @@ export const ProxmoxBackupsTable: Component<{
{spec.icon()}
<span>{spec.label}</span>
<span class="text-[10px] text-muted tabular-nums">
- {spec.id === 'snapshots'
- ? snapshots().length
- : spec.id === 'archives'
- ? archives().length
- : tasks().length}
+ {spec.id === 'pbs'
+ ? pbsArtifacts().length
+ : spec.id === 'snapshots'
+ ? snapshots().length
+ : spec.id === 'archives'
+ ? archives().length
+ : tasks().length}
</span>
</button>
)}
</For>
</div>
+ <Show when={tab() === 'pbs' && pbsArtifacts().length > 0}>
+ <BackupActivityChart
+ title={
+ pbsMetricMode() === 'volume' ? 'PBS backup volume per day' : 'PBS backups per day'
+ }
+ noun="artifact"
+ segmentKinds={PBS_SEGMENT_KINDS}
+ range={chartRange}
+ onRangeChange={setChartRange}
+ timeline={pbsTimeline}
+ selectedDateKey={selectedDateKey}
+ onToggleDay={toggleDay}
+ metricToggle={{ mode: pbsMetricMode, onChange: setPBSMetricMode }}
+ />
+ <ProxmoxBackupsCoverageStrip
+ title="PBS verification"
+ tail={
+ <span>
+ {pbsCoverage().total} artifacts · {formatBytes(pbsCoverage().totalBytes)} logical
+ <Show when={pbsCoverage().namespaceCount > 0}>
+ {' · '}
+ {pbsCoverage().namespaceCount} namespaces
+ </Show>
+ <Show when={pbsCoverage().protectedCount > 0}>
+ {' · '}
+ {pbsCoverage().protectedCount} protected
+ </Show>
+ </span>
+ }
+ segments={[
+ {
+ key: 'verified',
+ value: pbsCoverage().verifiedCount,
+ label: 'verified',
+ toneClass: 'bg-emerald-500',
+ },
+ {
+ key: 'unverified',
+ value: pbsCoverage().unverifiedCount,
+ label: 'unverified',
+ toneClass: 'bg-amber-500',
+ muted: pbsCoverage().unverifiedCount === 0,
+ },
+ ]}
+ />
+ </Show>
+
<Show when={tab() === 'snapshots' && snapshots().length > 0}>
<BackupActivityChart
title="Snapshots per day"
@@ -1039,14 +1293,24 @@ export const ProxmoxBackupsTable: Component<{
value={search}
onChange={setSearch}
placeholder={
- tab() === 'snapshots'
- ? 'Search snapshots, guests, nodes'
- : tab() === 'archives'
- ? 'Search archives, storages, nodes'
- : 'Search tasks, nodes, errors'
+ tab() === 'pbs'
+ ? 'Search PBS artifacts, namespaces, guests'
+ : tab() === 'snapshots'
+ ? 'Search snapshots, guests, nodes'
+ : tab() === 'archives'
+ ? 'Search archives, storages, nodes'
+ : 'Search tasks, nodes, errors'
}
/>
</div>
+ <Show when={tab() === 'pbs'}>
+ <FilterButtonGroup
+ variant="compact"
+ options={PBS_STATUS_FILTERS}
+ value={pbsFilter()}
+ onChange={setPBSFilter}
+ />
+ </Show>
<Show when={tab() === 'snapshots'}>
<FilterButtonGroup
variant="compact"
@@ -1055,7 +1319,7 @@ export const ProxmoxBackupsTable: Component<{
onChange={setSnapshotFilter}
/>
</Show>
- <Show when={tab() === 'archives'}>
+ <Show when={tab() === 'archives' && showArchivePBSColumns()}>
<FilterButtonGroup
variant="compact"
options={ARCHIVE_STATUS_FILTERS}
@@ -1095,12 +1359,21 @@ export const ProxmoxBackupsTable: Component<{
when={visibleForTab() !== totalForTab()}
fallback={
<>
- {totalForTab()} {tab() === 'archives' ? 'archives' : 'tasks'}
+ {totalForTab()}{' '}
+ {tab() === 'pbs'
+ ? 'PBS artifacts'
+ : tab() === 'archives'
+ ? 'archives'
+ : 'tasks'}
</>
}
>
{visibleForTab()} of {totalForTab()}{' '}
- {tab() === 'archives' ? 'archives' : 'tasks'}
+ {tab() === 'pbs'
+ ? 'PBS artifacts'
+ : tab() === 'archives'
+ ? 'archives'
+ : 'tasks'}
</Show>
}
>
@@ -1114,6 +1387,229 @@ export const ProxmoxBackupsTable: Component<{
</span>
</div>
+ <Show when={tab() === 'pbs'}>
+ <Show
+ when={!pbsBackups.error}
+ fallback={
+ <Card padding="lg">
+ <EmptyState
+ icon={props.emptyIcon}
+ title="Could not load PBS artifacts"
+ description={
+ (pbsBackups.error as Error | undefined)?.message ?? 'Refresh to retry.'
+ }
+ actions={
+ <button
+ type="button"
+ onClick={() => void refetchPBS()}
+ class="inline-flex min-h-10 items-center rounded-md border border-border px-3 py-2 text-sm font-medium hover:bg-surface-hover"
+ >
+ Refresh
+ </button>
+ }
+ />
+ </Card>
+ }
+ >
+ <Show
+ when={pbsBackups() !== undefined}
+ fallback={
+ <Card padding="lg">
+ <EmptyState
+ icon={props.emptyIcon}
+ title="Loading PBS artifacts"
+ description="Reading deduplicated backup snapshots from Proxmox Backup Server."
+ />
+ </Card>
+ }
+ >
+ <Show
+ when={filteredPBSBackups().length > 0}
+ fallback={
+ <Card padding="lg">
+ <EmptyState
+ icon={props.emptyIcon}
+ title={
+ pbsArtifacts().length === 0
+ ? tabSpecFor('pbs').emptyTitle
+ : 'No PBS artifacts match current filters'
+ }
+ description={
+ pbsArtifacts().length === 0
+ ? tabSpecFor('pbs').emptyDescription
+ : 'Adjust the search or status filter to see more PBS artifacts.'
+ }
+ />
+ </Card>
+ }
+ >
+ <TableCard class={PLATFORM_TABLE_CARD_CLASS}>
+ <Table class="min-w-[1050px] text-xs">
+ <TableHeader>
+ <TableRow class={PLATFORM_TABLE_HEADER_ROW_CLASS}>
+ <SortableHead
+ label="Workload"
+ sortKey="workload"
+ currentSort={pbsSortKey}
+ direction={pbsSortDirection}
+ onSort={handlePBSSort}
+ align="left"
+ headClass={getPlatformTableHeadClassForKind('name')}
+ />
+ <SortableHead
+ label="Repository"
+ sortKey="repository"
+ currentSort={pbsSortKey}
+ direction={pbsSortDirection}
+ onSort={handlePBSSort}
+ align="left"
+ headClass={getPlatformTableHeadClassForKind('text')}
+ />
+ <SortableHead
+ label="Created"
+ sortKey="created"
+ currentSort={pbsSortKey}
+ direction={pbsSortDirection}
+ onSort={handlePBSSort}
+ align="right"
+ headClass={getPlatformTableHeadClassForKind('numeric-value')}
+ />
+ <SortableHead
+ label="Size"
+ sortKey="size"
+ currentSort={pbsSortKey}
+ direction={pbsSortDirection}
+ onSort={handlePBSSort}
+ align="center"
+ headClass={getPlatformTableHeadClassForKind('metric-bar')}
+ />
+ <SortableHead
+ label="Verified"
+ sortKey="verified"
+ currentSort={pbsSortKey}
+ direction={pbsSortDirection}
+ onSort={handlePBSSort}
+ align="left"
+ headClass={getPlatformTableHeadClassForKind('text')}
+ />
+ <SortableHead
+ label="Protection"
+ sortKey="protected"
+ currentSort={pbsSortKey}
+ direction={pbsSortDirection}
+ onSort={handlePBSSort}
+ align="left"
+ headClass={getPlatformTableHeadClassForKind('text')}
+ />
+ <TableHead class={getPlatformTableHeadClassForKind('text')}>
+ Files
+ </TableHead>
+ </TableRow>
+ </TableHeader>
+ <TableBody class={PLATFORM_TABLE_BODY_CLASS}>
+ <For each={filteredPBSBackups()}>
+ {(backup) => (
+ <TableRow class="hover:bg-surface-hover">
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('name')} text-base-content`}
+ >
+ <div class="min-w-0">
+ <div class="font-semibold">{pbsWorkloadLabel(backup)}</div>
+ <div class="font-mono text-[10px] uppercase text-muted">
+ {backup.backupType || 'backup'}
+ </div>
+ </div>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ <div class="min-w-0">
+ <div class="font-mono text-[11px]">
+ {pbsRepositoryLabel(backup)}
+ </div>
+ <div
+ class="truncate text-[10px] text-muted"
+ title={backup.instance}
+ >
+ {backup.instance || '—'}
+ </div>
+ </div>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}
+ >
+ <Show
+ when={pbsTimestampMs(backup) !== undefined}
+ fallback={<span class="text-muted">—</span>}
+ >
+ {formatRelativeTime(backup.backupTime, { compact: true })}
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('metric-bar')} text-base-content`}
+ >
+ <RowMetricBar
+ valuePct={
+ pbsSizeMaxBytes() > 0
+ ? (backup.size / pbsSizeMaxBytes()) * 100
+ : 0
+ }
+ fillClass="bg-blue-500/40 dark:bg-blue-500/40"
+ label={formatBytes(backup.size)}
+ tooltip={`${formatBytes(backup.size)} (relative to largest PBS artifact in view)`}
+ />
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ <Show
+ when={backup.verified}
+ fallback={
+ <span class="text-amber-600 dark:text-amber-300">
+ Unverified
+ </span>
+ }
+ >
+ <span class="inline-flex items-center rounded-sm bg-emerald-100 px-1.5 py-0.5 text-[10px] font-semibold text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-200">
+ Verified
+ </span>
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ <Show
+ when={backup.protected}
+ fallback={<span class="text-muted">Unprotected</span>}
+ >
+ <span class="inline-flex items-center rounded-sm bg-blue-100 px-1.5 py-0.5 text-[10px] font-semibold text-blue-700 dark:bg-blue-900/40 dark:text-blue-200">
+ Protected
+ </span>
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ <span
+ class="inline-block max-w-[16rem] truncate"
+ title={(backup.files ?? []).join(', ')}
+ >
+ {(backup.files ?? []).length > 0
+ ? `${backup.files.length} files`
+ : '—'}
+ </span>
+ </TableCell>
+ </TableRow>
+ )}
+ </For>
+ </TableBody>
+ </Table>
+ </TableCard>
+ </Show>
+ </Show>
+ </Show>
+ </Show>
+
<Show when={tab() === 'snapshots'}>
<Show
when={filteredSnapshotGuests().length > 0}
@@ -1123,12 +1619,12 @@ export const ProxmoxBackupsTable: Component<{
icon={props.emptyIcon}
title={
snapshots().length === 0
- ? TABS[0].emptyTitle
+ ? tabSpecFor('snapshots').emptyTitle
: 'No snapshots match current filters'
}
description={
snapshots().length === 0
- ? TABS[0].emptyDescription
+ ? tabSpecFor('snapshots').emptyDescription
: 'Adjust the search or filters to see more snapshots.'
}
/>
@@ -1175,16 +1671,20 @@ export const ProxmoxBackupsTable: Component<{
align="right"
headClass={getPlatformTableHeadClassForKind('numeric-value')}
/>
- <SortableHead
- label="Total size"
- sortKey="size"
- currentSort={snapshotSortKey}
- direction={snapshotSortDirection}
- onSort={handleSnapshotSort}
- align="right"
- headClass={getPlatformTableHeadClassForKind('numeric-value')}
- />
- <TableHead class={getPlatformTableHeadClassForKind('text')}>RAM</TableHead>
+ <Show when={showSnapshotSizeColumn()}>
+ <SortableHead
+ label="Total size"
+ sortKey="size"
+ currentSort={snapshotSortKey}
+ direction={snapshotSortDirection}
+ onSort={handleSnapshotSort}
+ align="right"
+ headClass={getPlatformTableHeadClassForKind('numeric-value')}
+ />
+ </Show>
+ <Show when={showSnapshotRAMColumn()}>
+ <TableHead class={getPlatformTableHeadClassForKind('text')}>RAM</TableHead>
+ </Show>
</TableRow>
</TableHeader>
<TableBody class={PLATFORM_TABLE_BODY_CLASS}>
@@ -1231,7 +1731,9 @@ export const ProxmoxBackupsTable: Component<{
aria-hidden="true"
title={`Newest snapshot: ${rowAge.label}`}
/>
- <span>{formatRelativeTime(row.newestMs, { compact: true })}</span>
+ <span>
+ {formatRelativeTime(row.newestMs, { compact: true })}
+ </span>
</div>
</Show>
</TableCell>
@@ -1240,32 +1742,36 @@ export const ProxmoxBackupsTable: Component<{
>
{row.count}
</TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content tabular-nums`}
- >
- <Show
- when={row.totalBytes > 0}
- fallback={<span class="text-muted">—</span>}
+ <Show when={showSnapshotSizeColumn()}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content tabular-nums`}
>
- {formatBytes(row.totalBytes)}
- </Show>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- <Show
- when={row.withRamCount > 0}
- fallback={<span class="text-muted">—</span>}
+ <Show
+ when={row.totalBytes > 0}
+ fallback={<span class="text-muted">—</span>}
+ >
+ {formatBytes(row.totalBytes)}
+ </Show>
+ </TableCell>
+ </Show>
+ <Show when={showSnapshotRAMColumn()}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
>
- <span class="inline-flex items-center rounded-sm bg-violet-100 px-1.5 py-0.5 text-[10px] font-semibold text-violet-700 dark:bg-violet-900/40 dark:text-violet-200">
- {row.withRamCount} with RAM
- </span>
- </Show>
- </TableCell>
+ <Show
+ when={row.withRamCount > 0}
+ fallback={<span class="text-muted">—</span>}
+ >
+ <span class="inline-flex items-center rounded-sm bg-violet-100 px-1.5 py-0.5 text-[10px] font-semibold text-violet-700 dark:bg-violet-900/40 dark:text-violet-200">
+ {row.withRamCount} with RAM
+ </span>
+ </Show>
+ </TableCell>
+ </Show>
</TableRow>
<Show when={isExpanded()}>
<TableRow class="bg-surface-alt/40">
- <TableCell class="px-2 py-2" colspan={6}>
+ <TableCell class="px-2 py-2" colspan={snapshotColumnCount()}>
<div class="overflow-hidden">
<table class="w-full text-[11px]">
<thead>
@@ -1275,17 +1781,18 @@ export const ProxmoxBackupsTable: Component<{
<th class="px-2 py-0.5 text-right font-medium">
Captured
</th>
- <th class="px-2 py-0.5 text-right font-medium">Size</th>
- <th class="px-2 py-0.5 text-left font-medium">RAM</th>
+ <Show when={showSnapshotSizeColumn()}>
+ <th class="px-2 py-0.5 text-right font-medium">Size</th>
+ </Show>
+ <Show when={showSnapshotRAMColumn()}>
+ <th class="px-2 py-0.5 text-left font-medium">RAM</th>
+ </Show>
</tr>
</thead>
<tbody class="divide-y divide-border-subtle">
<For each={row.snapshots}>
{(snap) => {
- const age = classifySnapshotRowAge(
- snap.time,
- nowMs(),
- );
+ const age = classifySnapshotRowAge(snap.time, nowMs());
return (
<tr class="hover:bg-surface-hover">
<td class="px-2 py-1">
@@ -1318,24 +1825,28 @@ export const ProxmoxBackupsTable: Component<{
compact: true,
})}
</td>
- <td class="px-2 py-1 text-right tabular-nums text-base-content">
- <Show
- when={snap.sizeBytes && snap.sizeBytes > 0}
- fallback={<span class="text-muted">—</span>}
- >
- {formatBytes(snap.sizeBytes ?? 0)}
- </Show>
- </td>
- <td class="px-2 py-1">
- <Show
- when={snap.vmstate}
- fallback={<span class="text-muted">—</span>}
- >
- <span class="inline-flex items-center rounded-sm bg-violet-100 px-1.5 py-0.5 text-[10px] font-semibold text-violet-700 dark:bg-violet-900/40 dark:text-violet-200">
- with RAM
- </span>
- </Show>
- </td>
+ <Show when={showSnapshotSizeColumn()}>
+ <td class="px-2 py-1 text-right tabular-nums text-base-content">
+ <Show
+ when={snap.sizeBytes && snap.sizeBytes > 0}
+ fallback={<span class="text-muted">—</span>}
+ >
+ {formatBytes(snap.sizeBytes ?? 0)}
+ </Show>
+ </td>
+ </Show>
+ <Show when={showSnapshotRAMColumn()}>
+ <td class="px-2 py-1">
+ <Show
+ when={snap.vmstate}
+ fallback={<span class="text-muted">—</span>}
+ >
+ <span class="inline-flex items-center rounded-sm bg-violet-100 px-1.5 py-0.5 text-[10px] font-semibold text-violet-700 dark:bg-violet-900/40 dark:text-violet-200">
+ with RAM
+ </span>
+ </Show>
+ </td>
+ </Show>
</tr>
);
}}
@@ -1365,12 +1876,12 @@ export const ProxmoxBackupsTable: Component<{
icon={props.emptyIcon}
title={
archives().length === 0
- ? TABS[1].emptyTitle
+ ? tabSpecFor('archives').emptyTitle
: 'No archives match current filters'
}
description={
archives().length === 0
- ? TABS[1].emptyDescription
+ ? tabSpecFor('archives').emptyDescription
: 'Adjust the search or status filter to see more archives.'
}
/>
@@ -1444,24 +1955,26 @@ export const ProxmoxBackupsTable: Component<{
align="center"
headClass={getPlatformTableHeadClassForKind('metric-bar')}
/>
- <SortableHead
- label="Protection"
- sortKey="protected"
- currentSort={archiveSortKey}
- direction={archiveSortDirection}
- onSort={handleArchiveSort}
- align="left"
- headClass={getPlatformTableHeadClassForKind('text')}
- />
- <SortableHead
- label="Verified"
- sortKey="verified"
- currentSort={archiveSortKey}
- direction={archiveSortDirection}
- onSort={handleArchiveSort}
- align="left"
- headClass={getPlatformTableHeadClassForKind('text')}
- />
+ <Show when={showArchivePBSColumns()}>
+ <SortableHead
+ label="Protection"
+ sortKey="protected"
+ currentSort={archiveSortKey}
+ direction={archiveSortDirection}
+ onSort={handleArchiveSort}
+ align="left"
+ headClass={getPlatformTableHeadClassForKind('text')}
+ />
+ <SortableHead
+ label="Verified"
+ sortKey="verified"
+ currentSort={archiveSortKey}
+ direction={archiveSortDirection}
+ onSort={handleArchiveSort}
+ align="left"
+ headClass={getPlatformTableHeadClassForKind('text')}
+ />
+ </Show>
</TableRow>
</TableHeader>
<TableBody class={PLATFORM_TABLE_BODY_CLASS}>
@@ -1526,31 +2039,39 @@ export const ProxmoxBackupsTable: Component<{
tooltip={`${formatBytes(arc.size)} (relative to largest file in view)`}
/>
</TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- <Show when={arc.protected} fallback={<span class="text-muted">—</span>}>
- <span class="inline-flex items-center rounded-sm bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-700 dark:bg-amber-900/40 dark:text-amber-200">
- Protected
- </span>
- </Show>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- <Show
- when={arc.verified}
- fallback={
- <Show when={arc.isPBS} fallback={<span class="text-muted">—</span>}>
- <span class="text-muted">Pending</span>
- </Show>
- }
+ <Show when={showArchivePBSColumns()}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
>
- <span class="inline-flex items-center rounded-sm bg-emerald-100 px-1.5 py-0.5 text-[10px] font-semibold text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-200">
- Verified
- </span>
- </Show>
- </TableCell>
+ <Show
+ when={arc.protected}
+ fallback={<span class="text-muted">Unprotected</span>}
+ >
+ <span class="inline-flex items-center rounded-sm bg-amber-100 px-1.5 py-0.5 text-[10px] font-semibold text-amber-700 dark:bg-amber-900/40 dark:text-amber-200">
+ Protected
+ </span>
+ </Show>
+ </TableCell>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
+ >
+ <Show
+ when={arc.verified}
+ fallback={
+ <Show
+ when={arc.isPBS}
+ fallback={<span class="text-muted">n/a</span>}
+ >
+ <span class="text-muted">Pending</span>
+ </Show>
+ }
+ >
+ <span class="inline-flex items-center rounded-sm bg-emerald-100 px-1.5 py-0.5 text-[10px] font-semibold text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-200">
+ Verified
+ </span>
+ </Show>
+ </TableCell>
+ </Show>
</TableRow>
)}
</For>
@@ -1568,11 +2089,13 @@ export const ProxmoxBackupsTable: Component<{
<EmptyState
icon={props.emptyIcon}
title={
- tasks().length === 0 ? TABS[2].emptyTitle : 'No tasks match current filters'
+ tasks().length === 0
+ ? tabSpecFor('tasks').emptyTitle
+ : 'No tasks match current filters'
}
description={
tasks().length === 0
- ? TABS[2].emptyDescription
+ ? tabSpecFor('tasks').emptyDescription
: 'Adjust the search or status filter to see more tasks.'
}
/>
@@ -1628,16 +2151,22 @@ export const ProxmoxBackupsTable: Component<{
align="center"
headClass={getPlatformTableHeadClassForKind('metric-bar')}
/>
- <SortableHead
- label="Size"
- sortKey="size"
- currentSort={taskSortKey}
- direction={taskSortDirection}
- onSort={handleTaskSort}
- align="right"
- headClass={getPlatformTableHeadClassForKind('numeric-value')}
- />
- <TableHead class={getPlatformTableHeadClassForKind('text')}>Error</TableHead>
+ <Show when={showTaskSizeColumn()}>
+ <SortableHead
+ label="Size"
+ sortKey="size"
+ currentSort={taskSortKey}
+ direction={taskSortDirection}
+ onSort={handleTaskSort}
+ align="right"
+ headClass={getPlatformTableHeadClassForKind('numeric-value')}
+ />
+ </Show>
+ <Show when={showTaskErrorColumn()}>
+ <TableHead class={getPlatformTableHeadClassForKind('text')}>
+ Error
+ </TableHead>
+ </Show>
</TableRow>
</TableHeader>
<TableBody class={PLATFORM_TABLE_BODY_CLASS}>
@@ -1664,8 +2193,7 @@ export const ProxmoxBackupsTable: Component<{
if (!durationSec || baseline <= 0)
return 'bg-slate-500/30 dark:bg-slate-500/30';
const ratio = durationSec / baseline;
- if (ratio >= 1.5)
- return 'bg-metric-warning-bg dark:bg-metric-warning-bg';
+ if (ratio >= 1.5) return 'bg-metric-warning-bg dark:bg-metric-warning-bg';
return 'bg-metric-normal-bg dark:bg-metric-normal-bg';
};
return (
@@ -1712,31 +2240,35 @@ export const ProxmoxBackupsTable: Component<{
tooltip={`Duration ${formatDuration(task.startTime, task.endTime)} (median ${formatDurationFromSeconds(taskDurationBaselineSeconds())})`}
/>
</TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content tabular-nums`}
- >
- <Show
- when={task.size && task.size > 0}
- fallback={<span class="text-muted">—</span>}
+ <Show when={showTaskSizeColumn()}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content tabular-nums`}
>
- {formatBytes(task.size ?? 0)}
- </Show>
- </TableCell>
- <TableCell
- class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
- >
- <Show
- when={!!task.error?.trim()}
- fallback={<span class="text-muted">—</span>}
+ <Show
+ when={task.size && task.size > 0}
+ fallback={<span class="text-muted">—</span>}
+ >
+ {formatBytes(task.size ?? 0)}
+ </Show>
+ </TableCell>
+ </Show>
+ <Show when={showTaskErrorColumn()}>
+ <TableCell
+ class={`${getPlatformTableCellClassForKind('text')} text-base-content`}
>
- <span
- class="inline-block max-w-[18rem] truncate text-red-600 dark:text-red-300"
- title={task.error}
+ <Show
+ when={!!task.error?.trim()}
+ fallback={<span class="text-muted">—</span>}
>
- {task.error}
- </span>
- </Show>
- </TableCell>
+ <span
+ class="inline-block max-w-[18rem] truncate text-red-600 dark:text-red-300"
+ title={task.error}
+ >
+ {task.error}
+ </span>
+ </Show>
+ </TableCell>
+ </Show>
</TableRow>
);
}}
diff --git a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
index 2e2235dc72..8744c99833 100644
--- a/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
+++ b/frontend-modern/src/features/proxmox/ProxmoxPageSurface.tsx
@@ -164,7 +164,10 @@ export function ProxmoxPageSurface() {
/>
</Show>
<Show when={activeTab() === 'backups'}>
- <ProxmoxBackupsTable emptyIcon={<ProxmoxIcon class="h-6 w-6 text-slate-400" />} />
+ <ProxmoxBackupsTable
+ emptyIcon={<ProxmoxIcon class="h-6 w-6 text-slate-400" />}
+ hasPBS={model().pbs.length > 0}
+ />
</Show>
<Show when={activeTab() === 'ceph'}>
<ProxmoxCephTable
diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
new file mode 100644
index 0000000000..0a871c87ee
--- /dev/null
+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx
@@ -0,0 +1,141 @@
+import { cleanup, fireEvent, render, screen } from '@solidjs/testing-library';
+import { afterEach, describe, expect, it, vi } from 'vitest';
+
+import { ProxmoxBackupsTable } from '../ProxmoxBackupsTable';
+
+const apiFetchMock = vi.hoisted(() => vi.fn());
+
+vi.mock('@/utils/apiClient', () => ({
+ apiFetch: apiFetchMock,
+}));
+
+const jsonResponse = (payload: unknown) =>
+ new Response(JSON.stringify(payload), {
+ status: 200,
+ headers: { 'Content-Type': 'application/json' },
+ });
+
+const pvePayload = {
+ data: {
+ guestSnapshots: [
+ {
+ id: 'snap-112',
+ name: 'pre-upgrade',
+ node: 'pve-a',
+ instance: 'pve-a',
+ type: 'ct',
+ vmid: 112,
+ time: '2026-05-25T01:00:00Z',
+ vmstate: false,
+ },
+ ],
+ storageBackups: [
+ {
+ id: 'archive-112',
+ storage: 'local',
+ node: 'pve-a',
+ instance: 'pve-a',
+ type: 'ct',
+ vmid: 112,
+ time: '2026-05-25T02:00:00Z',
+ ctime: 1_769_390_400,
+ size: 1_048_576,
+ format: 'zst',
+ protected: false,
+ volid: 'local:backup/vzdump-lxc-112-2026_05_25-02_00_00.tar.zst',
+ isPBS: false,
+ verified: false,
+ },
+ ],
+ backupTasks: [
+ {
+ id: 'task-112',
+ node: 'pve-a',
+ instance: 'pve-a',
+ type: 'ct',
+ vmid: 112,
+ status: 'OK',
+ startTime: '2026-05-25T02:00:00Z',
+ endTime: '2026-05-25T02:05:00Z',
+ },
+ ],
+ },
+ meta: {
+ totalBackupTasks: 1,
+ totalStorageBackups: 1,
+ totalGuestSnapshots: 1,
+ },
+};
+
+const pbsPayload = {
+ data: {
+ backups: [
+ {
+ id: 'pbs-main/main/minipc/ct/112/2026-05-25T01:34:25Z',
+ instance: 'pbs-main',
+ datastore: 'main',
+ namespace: 'minipc',
+ backupType: 'ct',
+ vmid: '112',
+ backupTime: '2026-05-25T01:34:25Z',
+ size: 8_589_934_592,
+ protected: true,
+ verified: true,
+ files: ['index.json.blob', 'root.pxar.didx'],
+ owner: 'backup@pbs',
+ },
+ ],
+ },
+ meta: { totalBackups: 1 },
+};
+
+function mockBackupAPIs() {
+ apiFetchMock.mockImplementation((url: string) => {
+ if (url === '/api/backups/pbs') return Promise.resolve(jsonResponse(pbsPayload));
+ if (url === '/api/backups/pve') return Promise.resolve(jsonResponse(pvePayload));
+ return Promise.resolve(jsonResponse({}));
+ });
+}
+
+afterEach(() => {
+ cleanup();
+ apiFetchMock.mockReset();
+});
+
+describe('ProxmoxBackupsTable', () => {
+ it('shows PBS artifacts from the PBS backup endpoint when PBS is present', async () => {
+ mockBackupAPIs();
+
+ render(() => <ProxmoxBackupsTable emptyIcon={<span />} hasPBS />);
+
+ expect(await screen.findByText('CT 112')).toBeInTheDocument();
+ expect(screen.getByText('main / minipc')).toBeInTheDocument();
+ expect(screen.getByText('2 files')).toBeInTheDocument();
+ expect(screen.getAllByText('Verified').length).toBeGreaterThan(0);
+ expect(screen.getAllByText('Protected').length).toBeGreaterThan(0);
+ expect(apiFetchMock).toHaveBeenCalledWith('/api/backups/pbs');
+ expect(apiFetchMock).toHaveBeenCalledWith('/api/backups/pve');
+ });
+
+ it('omits PVE columns when the source cannot populate them', async () => {
+ mockBackupAPIs();
+
+ render(() => <ProxmoxBackupsTable emptyIcon={<span />} hasPBS={false} />);
+
+ expect(await screen.findByText('CT 112')).toBeInTheDocument();
+ expect(screen.queryByRole('columnheader', { name: /total size/i })).not.toBeInTheDocument();
+ expect(screen.queryByRole('columnheader', { name: /^ram$/i })).not.toBeInTheDocument();
+
+ await fireEvent.click(screen.getByRole('button', { name: /backup files/i }));
+ expect(
+ screen.getByText('local:backup/vzdump-lxc-112-2026_05_25-02_00_00.tar.zst'),
+ ).toBeInTheDocument();
+ expect(screen.queryByRole('columnheader', { name: /protection/i })).not.toBeInTheDocument();
+ expect(screen.queryByRole('columnheader', { name: /verified/i })).not.toBeInTheDocument();
+
+ await fireEvent.click(screen.getByRole('button', { name: /recent tasks/i }));
+ expect(screen.getAllByText('OK').length).toBeGreaterThan(0);
+ expect(screen.queryByRole('columnheader', { name: /^size$/i })).not.toBeInTheDocument();
+ expect(screen.queryByRole('columnheader', { name: /error/i })).not.toBeInTheDocument();
+ });
+});
diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
index 77c59e0376..58d0111d49 100644
--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupActivityPresentation.test.ts
@@ -50,7 +50,7 @@ describe('proxmoxBackupActivityPresentation', () => {
const point = {
key: '2026-05-20',
total: 4,
- counts: { archive: 0, ok: 3, failed: 1, running: 0, snapshot: 0 },
+ counts: { archive: 0, pbs: 0, ok: 3, failed: 1, running: 0, snapshot: 0 },
};
expect(getBackupActivityColumnAriaLabel('Wed 20 May', point.total, true, 'task')).toBe(
diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts b/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
index 3822354b39..ffe2757dc8 100644
--- a/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
+++ b/frontend-modern/src/features/proxmox/proxmoxBackupActivityPresentation.ts
@@ -17,7 +17,13 @@ export const BACKUP_ACTIVITY_RANGE_DAYS = [
// switches the chart from "how many files" to "how much space".)
export type BackupActivityMetricMode = 'count' | 'volume';
-export type BackupActivitySegmentKind = 'archive' | 'ok' | 'failed' | 'running' | 'snapshot';
+export type BackupActivitySegmentKind =
+ | 'archive'
+ | 'pbs'
+ | 'ok'
+ | 'failed'
+ | 'running'
+ | 'snapshot';
interface BackupActivitySegmentPresentation {
label: string;
@@ -31,6 +37,11 @@ const SEGMENT_PRESENTATION: Record<BackupActivitySegmentKind, BackupActivitySegm
segmentClassName: 'bg-blue-500',
swatchClassName: 'bg-blue-500',
},
+ pbs: {
+ label: 'PBS artifacts',
+ segmentClassName: 'bg-cyan-500',
+ swatchClassName: 'bg-cyan-500',
+ },
ok: {
label: 'OK',
segmentClassName: 'bg-emerald-500',
@@ -72,7 +83,7 @@ export interface BackupActivityTimeline {
}
function emptyCounts(): Record<BackupActivitySegmentKind, number> {
- return { archive: 0, ok: 0, failed: 0, running: 0, snapshot: 0 };
+ return { archive: 0, pbs: 0, ok: 0, failed: 0, running: 0, snapshot: 0 };
}
function startOfLocalDayMs(date: Date): number {
@@ -141,7 +152,7 @@ export interface BackupActivityTooltipRow {
muted: boolean;
}
-export type BackupActivityNoun = 'archive' | 'task' | 'snapshot';
+export type BackupActivityNoun = 'archive' | 'artifact' | 'task' | 'snapshot';
function formatActivityValue(value: number, mode: BackupActivityMetricMode): string {
if (mode === 'volume') return formatBytes(Math.max(0, value));
@@ -194,10 +205,7 @@ export function getBackupActivityColumnAriaLabel(
return selected ? `${dateLabel}: ${countLabel}, selected` : `${dateLabel}: ${countLabel}`;
}
-export function getBackupActivityAxisLabel(
- value: number,
- mode: BackupActivityMetricMode,
-): string {
+export function getBackupActivityAxisLabel(value: number, mode: BackupActivityMetricMode): string {
if (mode === 'volume') return formatBytes(Math.max(0, value));
return String(Math.max(0, Math.round(value)));
}
diff --git a/frontend-modern/src/types/api.ts b/frontend-modern/src/types/api.ts
index 06983585e2..c47da7032f 100644
--- a/frontend-modern/src/types/api.ts
+++ b/frontend-modern/src/types/api.ts
@@ -650,6 +650,34 @@ export interface GuestSnapshot {
sizeBytes?: number;
}
+export interface PBSBackup {
+ id: string;
+ instance: string;
+ datastore: string;
+ namespace: string;
+ backupType: string;
+ vmid: string;
+ backupTime: string;
+ size: number;
+ protected: boolean;
+ verified: boolean;
+ verificationRaw?: unknown;
+ comment?: string;
+ files: string[];
+ owner?: string;
+}
+
+export interface PBSBackupsPayload {
+ backups: PBSBackup[];
+}
+
+export interface PBSBackupsResponse {
+ data: PBSBackupsPayload;
+ meta: {
+ totalBackups: number;
+ };
+}
+
export interface PVEBackupsPayload {
backupTasks: BackupTask[];
storageBackups: StorageBackup[];
diff --git a/internal/api/pbs_backups.go b/internal/api/pbs_backups.go
new file mode 100644
index 0000000000..40474bd021
--- /dev/null
+++ b/internal/api/pbs_backups.go
@@ -0,0 +1,114 @@
+package api
+
+import (
+ "net/http"
+ "strings"
+
+ "github.com/rs/zerolog/log"
+
+ "github.com/rcourtman/pulse-go-rewrite/internal/config"
+ "github.com/rcourtman/pulse-go-rewrite/internal/models"
+ "github.com/rcourtman/pulse-go-rewrite/internal/utils"
+)
+
+// PBSBackupsResponse is the source-specific payload for
+// `GET /api/backups/pbs`. PBS backups are deduplicated server-side
+// recovery artifacts, so their protection and verification state lives
+// on the PBS snapshot model rather than on PVE's local vzdump file list.
+type PBSBackupsResponse struct {
+ Data PBSBackupsPayload `json:"data"`
+ Meta PBSBackupsMeta `json:"meta"`
+}
+
+type PBSBackupsPayload struct {
+ Backups []models.PBSBackup `json:"backups"`
+}
+
+type PBSBackupsMeta struct {
+ TotalBackups int `json:"totalBackups"`
+}
+
+func (r *Router) handleListPBSBackups(w http.ResponseWriter, req *http.Request) {
+ if req.Method != http.MethodGet {
+ writeErrorResponse(w, http.StatusMethodNotAllowed, "method_not_allowed",
+ "Only GET method is allowed", nil)
+ return
+ }
+
+ monitor := r.getTenantMonitor(req.Context())
+ if monitor == nil {
+ writeErrorResponse(w, http.StatusInternalServerError, "no_monitor",
+ "Monitor not available", nil)
+ return
+ }
+
+ backups := monitor.PBSBackupsSnapshot()
+ payload := PBSBackupsPayload{Backups: filterPBSBackups(backups, req)}
+
+ response := PBSBackupsResponse{
+ Data: payload,
+ Meta: PBSBackupsMeta{TotalBackups: len(payload.Backups)},
+ }
+
+ if err := utils.WriteJSONResponse(w, response); err != nil {
+ log.Error().Err(err).Msg("Failed to encode PBS backups response")
+ writeErrorResponse(w, http.StatusInternalServerError, "encoding_error",
+ "Failed to encode PBS backups", nil)
+ }
+}
+
+// filterPBSBackups narrows PBS recovery artifacts by optional query params:
+//
+// instance=<name> - only backups reported by a given PBS connection
+// datastore=<name> - only backups in a datastore
+// namespace=<name> - only backups in a namespace
+// type=<vm|ct|host> - only backups of a backup type
+// vmid=<id> - only backups for a guest id
+func filterPBSBackups(backups []models.PBSBackup, req *http.Request) []models.PBSBackup {
+ query := req.URL.Query()
+ instance := strings.TrimSpace(query.Get("instance"))
+ datastore := strings.TrimSpace(query.Get("datastore"))
+ namespace := strings.TrimSpace(query.Get("namespace"))
+ backupType := strings.TrimSpace(query.Get("type"))
+ vmid := strings.TrimSpace(query.Get("vmid"))
+
+ if instance == "" && datastore == "" && namespace == "" && backupType == "" && vmid == "" {
+ return normalizePBSBackups(backups)
+ }
+
+ out := make([]models.PBSBackup, 0, len(backups))
+ for _, backup := range backups {
+ if instance != "" && !strings.EqualFold(backup.Instance, instance) {
+ continue
+ }
+ if datastore != "" && !strings.EqualFold(backup.Datastore, datastore) {
+ continue
+ }
+ if namespace != "" && !strings.EqualFold(backup.Namespace, namespace) {
+ continue
+ }
+ if backupType != "" && !strings.EqualFold(backup.BackupType, backupType) {
+ continue
+ }
+ if vmid != "" && backup.VMID != vmid {
+ continue
+ }
+ out = append(out, backup.NormalizeCollections())
+ }
+ return out
+}
+
+func normalizePBSBackups(backups []models.PBSBackup) []models.PBSBackup {
+ if backups == nil {
+ return []models.PBSBackup{}
+ }
+ out := make([]models.PBSBackup, 0, len(backups))
+ for _, backup := range backups {
+ out = append(out, backup.NormalizeCollections())
+ }
+ return out
+}
+
+func (r *Router) registerPBSBackupsRoutes() {
+ r.mux.HandleFunc("/api/backups/pbs", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.handleListPBSBackups)))
+}
diff --git a/internal/api/pbs_backups_test.go b/internal/api/pbs_backups_test.go
new file mode 100644
index 0000000000..4d488526ab
--- /dev/null
+++ b/internal/api/pbs_backups_test.go
@@ -0,0 +1,107 @@
+package api
+
+import (
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+ "time"
+
+ "github.com/rcourtman/pulse-go-rewrite/internal/models"
+ "github.com/rcourtman/pulse-go-rewrite/internal/monitoring"
+)
+
+func TestHandleListPBSBackupsReturnsArtifacts(t *testing.T) {
+ state := models.NewState()
+ backupTime := time.Date(2026, 5, 25, 1, 34, 25, 0, time.UTC)
+ state.UpdatePBSBackups("pbs-main", []models.PBSBackup{
+ {
+ ID: "pbs-main/main/minipc/ct/112/2026-05-25T01:34:25Z",
+ Instance: "pbs-main",
+ Datastore: "main",
+ Namespace: "minipc",
+ BackupType: "ct",
+ VMID: "112",
+ BackupTime: backupTime,
+ Size: 8_589_934_592,
+ Protected: true,
+ Verified: true,
+ Files: []string{"index.json.blob", "root.pxar.didx"},
+ Owner: "backup@pbs",
+ },
+ {
+ ID: "pbs-main/main/delly/vm/101/2026-05-24T01:00:00Z",
+ Instance: "pbs-main",
+ Datastore: "main",
+ Namespace: "delly",
+ BackupType: "vm",
+ VMID: "101",
+ BackupTime: backupTime.Add(-24 * time.Hour),
+ Size: 2_147_483_648,
+ Verified: true,
+ Files: []string{"index.json.blob", "drive-scsi0.img.fidx"},
+ },
+ })
+
+ monitor := &monitoring.Monitor{}
+ setUnexportedField(t, monitor, "state", state)
+
+ router := &Router{monitor: monitor}
+ req := httptest.NewRequest(http.MethodGet, "/api/backups/pbs?namespace=minipc", nil)
+ rec := httptest.NewRecorder()
+
+ router.handleListPBSBackups(rec, req)
+
+ if rec.Code != http.StatusOK {
+ t.Fatalf("expected status %d, got %d: %s", http.StatusOK, rec.Code, rec.Body.String())
+ }
+
+ var response PBSBackupsResponse
+ if err := json.NewDecoder(rec.Body).Decode(&response); err != nil {
+ t.Fatalf("decode response: %v", err)
+ }
+
+ if response.Meta.TotalBackups != 1 {
+ t.Fatalf("expected one filtered backup, got %d", response.Meta.TotalBackups)
+ }
+ if len(response.Data.Backups) != 1 {
+ t.Fatalf("expected one backup row, got %d", len(response.Data.Backups))
+ }
+
+ got := response.Data.Backups[0]
+ if got.Namespace != "minipc" || got.VMID != "112" {
+ t.Fatalf("unexpected backup row: %+v", got)
+ }
+ if got.Size != 8_589_934_592 || !got.Protected || !got.Verified {
+ t.Fatalf("PBS artifact fields were not preserved: %+v", got)
+ }
+ if len(got.Files) != 2 {
+ t.Fatalf("expected normalized file list, got %#v", got.Files)
+ }
+}
+
+func TestHandleListPBSBackupsInitializesEmptyCollections(t *testing.T) {
+ monitor := &monitoring.Monitor{}
+ setUnexportedField(t, monitor, "state", models.NewState())
+
+ router := &Router{monitor: monitor}
+ req := httptest.NewRequest(http.MethodGet, "/api/backups/pbs", nil)
+ rec := httptest.NewRecorder()
+
+ router.handleListPBSBackups(rec, req)
+
+ if rec.Code != http.StatusOK {
+ t.Fatalf("expected status %d, got %d: %s", http.StatusOK, rec.Code, rec.Body.String())
+ }
+
+ var response PBSBackupsResponse
+ if err := json.NewDecoder(rec.Body).Decode(&response); err != nil {
+ t.Fatalf("decode response: %v", err)
+ }
+ if response.Data.Backups == nil {
+ t.Fatalf("expected empty PBS backups list to be encoded as []")
+ }
+ if response.Meta.TotalBackups != 0 {
+ t.Fatalf("expected zero backups, got %d", response.Meta.TotalBackups)
+ }
+}
diff --git a/internal/api/router_routes_monitoring.go b/internal/api/router_routes_monitoring.go
index ff876dce32..7d061dea2b 100644
--- a/internal/api/router_routes_monitoring.go
+++ b/internal/api/router_routes_monitoring.go
@@ -29,6 +29,7 @@ func (r *Router) registerMonitoringResourceRoutes(
r.mux.HandleFunc("/api/recovery/rollups", RequireAuth(r.config, RequireScope(config.ScopeMonitoringRead, r.recoveryHandlers.HandleListRollups)))
r.registerReplicationRoutes()
r.registerPVEBackupsRoutes()
+ r.registerPBSBackupsRoutes()
r.registerPMGRoutes()
// Unified resources API
diff --git a/internal/monitoring/canonical_guardrails_test.go b/internal/monitoring/canonical_guardrails_test.go
index fbad01d8bd..e393c7fbcc 100644
--- a/internal/monitoring/canonical_guardrails_test.go
+++ b/internal/monitoring/canonical_guardrails_test.go
@@ -160,6 +160,41 @@ func TestPVEBackupPermissionWarningsPreserveTokenACLRepair(t *testing.T) {
}
}
+func TestPBSBackupsSnapshotPreservesSourceArtifactFields(t *testing.T) {
+ state := models.NewState()
+ backupTime := time.Date(2026, 5, 25, 1, 34, 25, 0, time.UTC)
+ state.UpdatePBSBackups("pbs-main", []models.PBSBackup{{
+ ID: "pbs-main/main/minipc/ct/112/2026-05-25T01:34:25Z",
+ Instance: "pbs-main",
+ Datastore: "main",
+ Namespace: "minipc",
+ BackupType: "ct",
+ VMID: "112",
+ BackupTime: backupTime,
+ Size: 8_589_934_592,
+ Protected: true,
+ Verified: true,
+ Comment: "debian-go",
+ Files: []string{"index.json.blob", "root.pxar.didx"},
+ Owner: "backup@pbs",
+ }})
+ monitor := &Monitor{state: state}
+
+ got := monitor.PBSBackupsSnapshot()
+ if len(got) != 1 {
+ t.Fatalf("expected one PBS backup, got %d", len(got))
+ }
+ if got[0].Datastore != "main" || got[0].Namespace != "minipc" || got[0].VMID != "112" {
+ t.Fatalf("unexpected PBS artifact identity: %+v", got[0])
+ }
+ if got[0].Size != 8_589_934_592 || !got[0].Protected || !got[0].Verified {
+ t.Fatalf("PBS artifact source fields were not preserved: %+v", got[0])
+ }
+ if got[0].Owner != "backup@pbs" || len(got[0].Files) != 2 {
+ t.Fatalf("PBS artifact owner/files were not preserved: %+v", got[0])
+ }
+}
+
func TestGuestSnapshotPollingStaysBoundedConcurrent(t *testing.T) {
data, err := os.ReadFile("monitor_backups.go")
if err != nil {
diff --git a/internal/monitoring/monitor.go b/internal/monitoring/monitor.go
index e2dcea6415..0b83c2ba7c 100644
--- a/internal/monitoring/monitor.go
+++ b/internal/monitoring/monitor.go
@@ -3701,6 +3701,11 @@ func (m *Monitor) PVEBackupsSnapshot() models.PVEBackups {
return m.GetState().PVEBackups
}
+// PBSBackupsSnapshot returns the current PBS recovery artifacts.
+func (m *Monitor) PBSBackupsSnapshot() []models.PBSBackup {
+ return m.GetState().PBSBackups
+}
+
// BuildFrontendState returns the current state converted to frontend format.
// This replaces the GetState().ToFrontend() pattern in consumer code.
func (m *Monitor) BuildFrontendState() models.StateFrontend {
diff --git a/scripts/release_control/subsystem_lookup_test.py b/scripts/release_control/subsystem_lookup_test.py
index ed24bb9af0..bed0772814 100644
--- a/scripts/release_control/subsystem_lookup_test.py
+++ b/scripts/release_control/subsystem_lookup_test.py
@@ -3529,8 +3529,8 @@ class SubsystemLookupTest(unittest.TestCase):
{
"heading": "## Shared Boundaries",
"path": "internal/api/access_control_handlers.go",
- "line": 258,
- "heading_line": 111,
+ "line": 268,
+ "heading_line": 112,
}
],
)