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
Show PBS job results on each Backup server datastore
rcourtman926136f1529a
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.mdindex 764d9fc27b..0a0101e71b 100644--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md@@ -9601,6 +9601,17 @@ muted, and leave the parent cells empty, so one parent never reads as severalidentical ones. The rows must already be grouped; the Backups "Backup server"table follows this through `BackupServerRow.continuesServer`.+### A narrow table folds a dropped column's problem into one it keeps++When a responsive table drops a column at phone width, a problem that column+would have shown must not vanish into the row's drawer. It takes the closest+kept cell that answers the same question, in that column's tone, and only+while it outranks what the cell normally says. The Backups "Backup server"+table drops Jobs below 520px, so a reachable server's failed or late datastore+job ("Sync failed") replaces State on that row, while an unreachable server+keeps its connection state. The wording stays short enough to fit whole+("late" rather than "overdue"), because a truncated warning is not read.+### Fixed-layout tables give free width to the column that variesIn a fixed-layout table whose columns change with the container, columnsdiff --git a/docs/release-control/v6/internal/subsystems/storage-recovery.md b/docs/release-control/v6/internal/subsystems/storage-recovery.mdindex d6248b729a..7091449bd8 100644--- a/docs/release-control/v6/internal/subsystems/storage-recovery.md+++ b/docs/release-control/v6/internal/subsystems/storage-recovery.md@@ -1748,6 +1748,23 @@ follows the scroll position, so a later row is only ever mounted without itsfirst row once that first row has scrolled out of view. Capacity evidence isunchanged: an offline server's later datastore still reads Unavailable.+### Each PBS datastore says whether its jobs last succeeded (1 November 2026)++The Backup server table answers "is my PBS OK?" with the datastore's+housekeeping as well as its fill. Each datastore row shows the worst result of+its GC, prune, verify and sync jobs in a few words ("Sync failed", "Verify+late", "OK"), from `summarizeDatastoreJobs` in `proxmoxBackupServerJobs.ts`.+The verdict is the backend's: it reads `JobHealthEvidence` posture and reason+from `pbsJobHealthPosture` and never re-derives health from raw task status.+Only jobs bound to that datastore and enabled count; backup jobs stay with+Coverage, which already answers them per guest. The newest run of a repeated+job id speaks for it. A family whose server-wide read failed (evidence with no+store) leaves every datastore's result for that family unknown, never OK, and+a datastore with no reported jobs shows a dash rather than OK. The row's drawer+lists every job's result. The phone layout has no Jobs column, so a reachable+server's failed or late job takes the State cell there; an unreachable server+keeps its connection state, the larger problem.+### TrueNAS connection probes do not settle recovery inventoryA successful settings probe reads system information only, on a separate client.diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.mdindex 8fb56d73b2..7ac130597a 100644--- a/docs/release-control/v6/internal/subsystems/unified-resources.md+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md@@ -963,6 +963,14 @@ carries the server's host readings and resource snapshot, and the model testpins the readings on every row while the flag is true only for a server'slater datastore rows.+`BackupServerRow.jobs` reads the PBS resource's existing `jobHealthEvidence`+(the backend's per-job posture and reason) and binds each job to a datastore+row only by its `store` field. It adds no resource field, identity or+correlation: an Agent-merged server keeps the PBS service's evidence, and a+store-less read failure marks the family unknown on every datastore rather+than borrowing another row's result. `backupServerJobResults.test.tsx` and+`proxmoxBackupServerJobs.test.ts` cover the mounted column and the model.+### Guest disk freshness presentationExisting workload disk evidence retains its source reason through the row,diff --git a/frontend-modern/browser-verification/3bb0c646b85743e7.json b/frontend-modern/browser-verification/3bb0c646b85743e7.jsonnew file mode 100644index 0000000000..60eb731ef4--- /dev/null+++ b/frontend-modern/browser-verification/3bb0c646b85743e7.json@@ -0,0 +1,48 @@+{+ "version": 1,+ "base_sha": "5cbcb053308675c0422b0bc52e8419e566e8a3f5",+ "verified_at": "2026-11-01T17:20:00Z",+ "result": "passed",+ "changed_paths": [+ "frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx",+ "frontend-modern/src/features/proxmox/proxmoxBackupServerJobs.ts",+ "frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts"+ ],+ "content_sha256": {+ "frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx": "d8322bf4bda7f3519cac1056e679da98eeeb5e262e78201f4a875a50a041123b",+ "frontend-modern/src/features/proxmox/proxmoxBackupServerJobs.ts": "73bfee53f7f102472d65eee2fdef1007f7aa0561d34930f051282b5a08739c8c",+ "frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts": "249eb67996f722d3d8efe03a150712bb72e04c103047ff67e2e80d7ded69da20"+ },+ "routes": [+ "/proxmox/backups/date"+ ],+ "viewports": [+ {+ "width": 1440,+ "height": 1000+ },+ {+ "width": 1000,+ "height": 900+ },+ {+ "width": 760,+ "height": 1000+ },+ {+ "width": 375,+ "height": 812+ }+ ],+ "states": [+ "mock rig PBS servers backup-vault (two datastores) and dr-vault, dark theme",+ "job verdicts injected into the /api/resources response: failed sync on one datastore, late prune plus not-run verify on another, all OK on the third",+ "full, expanded, basic and compact Backup server layouts"+ ],+ "interactions": [+ "signed in and opened Backups at 1440x1000, 1000x900, 760x1000 and 375x812",+ "read every Jobs cell and the phone State cells: Sync failed, OK, Prune late",+ "measured row heights (32-33px, one line) and checked no Jobs or State text is clipped at any width",+ "opened the failed datastore's drawer on the phone and read its Jobs line: Sync failed, Verify OK"+ ]+}diff --git a/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx b/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsxindex d597cbbe62..1d25613e8e 100644--- a/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx+++ b/frontend-modern/src/features/proxmox/ProxmoxBackupServersTable.tsx@@ -40,13 +40,22 @@ import {getBackupServerLayoutForContainer,type BackupServerColumnId,} from './proxmoxBackupsTablePresentation';+import {+ describeDatastoreJobs,+ summarizeDatastoreJobs,+ type DatastoreJobState,+ type DatastoreJobSummary,+} from './proxmoxBackupServerJobs';// "Backup servers" answers the two questions the coverage table can't: is my// PBS reachable, and is its datastore about to fill? Datastore fill is the// headline backup risk — a full datastore silently fails every future backup —// so it lives here on the Backups page, not buried on the platform Storage tab-// where the rows read as generic "PVE" storage. One row per datastore, labelled-// by its server; a server with no datastore data still gets a reachability row.+// where the rows read as generic "PVE" storage. Each datastore row also says+// whether its GC, prune, verify and sync jobs last succeeded, because a failed+// sync or verify leaves backups that exist but cannot be relied on. One row+// per datastore, labelled by its server; a server with no datastore data still+// gets a reachability row.// PBS hosts left the v5 nodes table in the v6 IA, so this is where their health// lives. Host status, version, CPU, memory and uptime show once, on the server's// first datastore row; its later rows keep the server name (muted), toggle and@@ -67,6 +76,8 @@ interface BackupServerRow {memoryReading?: MemoryObservationPresentation | null;uptimeSeconds?: number;datastore?: ResourcePBSDatastore;+ // The worst backend-judged GC, prune, verify or sync result for this store.+ jobs: DatastoreJobSummary;backupCount: number;// A later datastore row of the server on the row above: host cells stay empty.continuesServer: boolean;@@ -145,6 +156,16 @@ function usageVariant(pct: number | undefined): StatusIndicatorVariant {return 'success';}+function jobToneClass(state: DatastoreJobState): string {+ if (state === 'critical') return 'text-red-600 dark:text-red-300';+ if (state === 'warning') return 'text-amber-600 dark:text-amber-300';+ if (state === 'ok') return 'text-base-content';+ return 'text-muted';+}++const jobDetailTone = (state: DatastoreJobState): DetailValueTone | undefined =>+ state === 'critical' ? 'danger' : state === 'warning' ? 'warning' : undefined;+function usageToneClass(pct: number | undefined): string {if (pct === undefined) return 'text-muted';if (pct >= 90) return 'text-red-600 dark:text-red-300';@@ -203,6 +224,12 @@ function BackupServerDatastoreContext(props: {layout: 'stacked',tone: capacityTone(),},+ {+ label: 'Jobs',+ value: describeDatastoreJobs(props.row.jobs),+ layout: 'stacked',+ tone: jobDetailTone(props.row.jobs.state),+ },{ label: 'Backup entries', value: inventoryText(), layout: 'stacked' },],footerContent: (@@ -498,6 +525,7 @@ export function buildBackupServerRows(key: server.id,...host,resource: resourceSnapshot(),+ jobs: summarizeDatastoreJobs(server.pbs?.jobHealthEvidence, undefined),backupCount: 0,continuesServer: false,});@@ -513,6 +541,7 @@ export function buildBackupServerRows(// not alias its datastore object: a reordered snapshot reconciles that// array by position and would overwrite this row's datastore identity.datastore: { ...datastore },+ jobs: summarizeDatastoreJobs(server.pbs?.jobHealthEvidence, datastore.name),backupCount: countFor(server, datastore.name),});}@@ -542,6 +571,13 @@ export function ProxmoxBackupServersTable(props: {const detail = createPlatformResourceDetailState({ idPrefix: 'proxmox-backup-server-detail' });const columnVisible = (column: BackupServerColumnId) =>visibleColumns().some((candidate) => candidate.id === column);+ // The phone layout has no Jobs column. A reachable server whose datastore+ // job failed or is overdue is not "OK", so State names the job instead;+ // an unreachable server keeps its connection state, the bigger problem.+ const showJobProblemAsState = (row: BackupServerRow) =>+ !columnVisible('jobs') &&+ row.online &&+ (row.jobs.state === 'critical' || row.jobs.state === 'warning');return (<Show when={rows().length > 0}>@@ -596,6 +632,9 @@ export function ProxmoxBackupServersTable(props: {<TableHead class={`${getPlatformTableHeadClassForKind('numeric-value')}`}>Used</TableHead>+ <Show when={columnVisible('jobs')}>+ <TableHead class={getPlatformTableHeadClassForKind('text')}>Jobs</TableHead>+ </Show><Show when={columnVisible('backups')}><TableHeadclass={`${getPlatformTableHeadClassForKind('numeric-value')}`}@@ -667,23 +706,36 @@ export function ProxmoxBackupServersTable(props: {</div></TableCell><TableCell class={getPlatformTableCellClassForKind('text')}>- <Show when={!row.continuesServer}>- <div class="flex items-center gap-2">- <Show when={layoutMode() !== 'compact'}>- <StatusDot- size="sm"- variant={row.online ? 'success' : 'danger'}- title={row.connectionLabel}- ariaHidden- />- </Show>+ <Show+ when={!showJobProblemAsState(row)}+ fallback={<span- class="truncate text-[11px] text-base-content"- title={row.connectionLabel}+ class={`block truncate text-[11px] ${jobToneClass(row.jobs.state)}`}+ title={describeDatastoreJobs(row.jobs)}+ data-backup-server-jobs={row.jobs.state}>- {row.connectionLabel}+ {row.jobs.label}</span>- </div>+ }+ >+ <Show when={!row.continuesServer}>+ <div class="flex items-center gap-2">+ <Show when={layoutMode() !== 'compact'}>+ <StatusDot+ size="sm"+ variant={row.online ? 'success' : 'danger'}+ title={row.connectionLabel}+ ariaHidden+ />+ </Show>+ <span+ class="truncate text-[11px] text-base-content"+ title={row.connectionLabel}+ >+ {row.connectionLabel}+ </span>+ </div>+ </Show></Show></TableCell><Show when={columnVisible('version')}>@@ -831,6 +883,15 @@ export function ProxmoxBackupServersTable(props: {)}</Show></TableCell>+ <Show when={columnVisible('jobs')}>+ <TableCell+ class={`${getPlatformTableCellClassForKind('text')} truncate text-[11px] ${jobToneClass(row.jobs.state)}`}+ title={describeDatastoreJobs(row.jobs)}+ data-backup-server-jobs={row.jobs.state}+ >+ {row.jobs.label}+ </TableCell>+ </Show><Show when={columnVisible('backups')}><TableCellclass={`${getPlatformTableCellClassForKind('numeric-value')} text-base-content`}diff --git a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsxindex e16f57b95b..5a0673cd73 100644--- a/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx+++ b/frontend-modern/src/features/proxmox/__tests__/ProxmoxBackupsTable.test.tsx@@ -3451,24 +3451,25 @@ describe('PBS inventory state column', () => {]}backups={[]}backupInventoryState={state()}- layoutWidth={() => 520}+ layoutWidth={() => 720}/>));const table = container.querySelector('table')!;const countColumn = table.querySelector<HTMLElement>('col[data-proxmox-backups-column="backups"]',)!;+ // Server, status, CPU, memory, datastore, used, jobs, then the count.const cells = table.querySelector('tbody tr')!.querySelectorAll('td');- expect(countColumn.style.width).toBe('15.5%');- expect(cells[4]).toHaveTextContent(/^Loading$/);+ expect(countColumn.style.width).toBe('12%');+ expect(cells[7]).toHaveTextContent(/^Loading$/);setState('unavailable');- expect(cells[4]).toHaveTextContent(/^Unavailable$/);+ expect(cells[7]).toHaveTextContent(/^Unavailable$/);expect(cells[1]).toHaveTextContent('Healthy');- expect(cells[3]).toHaveTextContent('40.0%');- expect(cells[3]).toHaveTextContent('400 B / 1000 B');+ expect(cells[5]).toHaveTextContent('40.0%');+ expect(cells[5]).toHaveTextContent('400 B / 1000 B');setState('available');- expect(cells[4]).toHaveTextContent(/^0$/);- expect(countColumn.style.width).toBe('15.5%');+ expect(cells[7]).toHaveTextContent(/^0$/);+ expect(countColumn.style.width).toBe('12%');});});diff --git a/frontend-modern/src/features/proxmox/__tests__/backupServerJobResults.test.tsx b/frontend-modern/src/features/proxmox/__tests__/backupServerJobResults.test.tsxnew file mode 100644index 0000000000..0d3f51c313--- /dev/null+++ b/frontend-modern/src/features/proxmox/__tests__/backupServerJobResults.test.tsx@@ -0,0 +1,96 @@+import { cleanup, render } from '@solidjs/testing-library';+import { afterEach, describe, expect, it, vi } from 'vitest';++import type { PBSJobHealthEvidence } from '@/types/api';+import type { Resource } from '@/types/resource';++import { ProxmoxBackupServersTable } from '../ProxmoxBackupServersTable';++vi.mock('@/components/Infrastructure/ResourceDetailDrawer', () => ({+ ResourceDetailDrawer: () => <div>Existing owner detail</div>,+}));++const job = (+ id: string,+ family: string,+ store: string,+ posture: string,+ postureReason: string,+): PBSJobHealthEvidence => ({+ id,+ family,+ store,+ enabled: true,+ confidence: 'config-last-run',+ posture,+ postureReason,+});++const server = (connectionHealth = 'healthy'): Resource => ({+ id: 'resource-vault',+ name: 'vault',+ displayName: 'vault',+ type: 'pbs',+ status: 'online',+ lastSeen: 1_793_300_000_000,+ platformId: 'proxmox-pbs',+ platformType: 'proxmox-pbs',+ sourceType: 'api',+ pbs: {+ instanceId: 'pbs-vault',+ connectionHealth,+ datastores: [+ { name: 'local', total: 1000, used: 400 },+ { name: 'offsite', total: 1000, used: 400 },+ ],+ jobHealthEvidence: [+ job('garbage:local', 'garbage', 'local', 'healthy', 'last-run-success'),+ job('s-offsite', 'sync', 'offsite', 'critical', 'last-run-failed'),+ job('v-offsite', 'verify', 'offsite', 'warning', 'job-overdue'),+ ],+ },+});++const jobCells = (container: HTMLElement) =>+ [...container.querySelectorAll('[data-backup-server-jobs]')].map((cell) => [+ cell.getAttribute('data-backup-server-jobs'),+ cell.textContent?.trim(),+ ]);++afterEach(cleanup);++describe('Backup server job results', () => {+ it('names the worst job per datastore in its own column once there is room', () => {+ const { container } = render(() => (+ <ProxmoxBackupServersTable servers={[server()]} layoutWidth={() => 600} />+ ));+ expect([...container.querySelectorAll('thead th')].map((th) => th.textContent)).toContain(+ 'Jobs',+ );+ expect(jobCells(container)).toEqual([+ ['ok', 'OK'],+ ['critical', 'Sync failed'],+ ]);+ const failed = container.querySelector('[data-backup-server-jobs="critical"]')!;+ expect(failed.getAttribute('title')).toBe('Sync failed · Verify late');+ });++ it('puts a job problem in State on phones, where there is no Jobs column', () => {+ const { container } = render(() => (+ <ProxmoxBackupServersTable servers={[server()]} layoutWidth={() => 375} />+ ));+ const rows = [...container.querySelectorAll('tbody tr')].filter(+ (row) => row.querySelectorAll('td').length > 1,+ );+ expect(rows[0].querySelectorAll('td')[1]).toHaveTextContent('Healthy');+ expect(rows[1].querySelectorAll('td')[1]).toHaveTextContent(/^Sync failed$/);+ });++ it('keeps an unreachable server in State on phones, ahead of its jobs', () => {+ const { container } = render(() => (+ <ProxmoxBackupServersTable servers={[server('unreachable')]} layoutWidth={() => 375} />+ ));+ expect(jobCells(container)).toEqual([]);+ expect(container.querySelector('tbody td:nth-child(2)')).toHaveTextContent('Unreachable');+ });+});diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupServerJobs.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupServerJobs.test.tsnew file mode 100644index 0000000000..b67efc2e19--- /dev/null+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupServerJobs.test.ts@@ -0,0 +1,107 @@+import { describe, expect, it } from 'vitest';++import type { PBSJobHealthEvidence } from '@/types/api';++import { describeDatastoreJobs, summarizeDatastoreJobs } from '../proxmoxBackupServerJobs';++const job = (overrides: Partial<PBSJobHealthEvidence>): PBSJobHealthEvidence => ({+ id: 'job',+ family: 'verify',+ store: 'main',+ enabled: true,+ confidence: 'config-last-run',+ posture: 'healthy',+ postureReason: 'last-run-success',+ ...overrides,+});++describe('summarizeDatastoreJobs', () => {+ it('says OK only when every reported job on the store last succeeded', () => {+ const summary = summarizeDatastoreJobs(+ [+ job({ id: 'garbage:main', family: 'garbage' }),+ job({ id: 'v-1', family: 'verify' }),+ job({ id: 's-1', family: 'sync', postureReason: 'running' }),+ ],+ 'main',+ );+ expect(summary.state).toBe('ok');+ expect(summary.label).toBe('OK');+ expect(describeDatastoreJobs(summary)).toBe('GC OK · Verify OK · Sync running');+ });++ it('leads with the worst backend judgment and lists the rest in the detail', () => {+ const summary = summarizeDatastoreJobs(+ [+ job({ id: 'p-1', family: 'prune', posture: 'warning', postureReason: 'job-overdue' }),+ job({ id: 's-1', family: 'sync', posture: 'critical', postureReason: 'last-run-failed' }),+ job({ id: 'v-1', family: 'verify' }),+ ],+ 'main',+ );+ expect(summary.state).toBe('critical');+ expect(summary.label).toBe('Sync failed');+ expect(describeDatastoreJobs(summary)).toBe('Sync failed · Prune late · Verify OK');+ });++ it('ignores other stores, disabled jobs and backup jobs', () => {+ const summary = summarizeDatastoreJobs(+ [+ job({ id: 's-other', family: 'sync', store: 'offsite', posture: 'critical' }),+ job({ id: 'v-off', family: 'verify', enabled: false, posture: 'critical' }),+ job({ id: 'b-1', family: 'backup', posture: 'critical' }),+ ],+ 'main',+ );+ expect(summary).toEqual({ state: 'none', label: '—', entries: [] });+ });++ it('lets the newest run of a repeated job speak for it', () => {+ const summary = summarizeDatastoreJobs(+ [+ job({+ id: 'verify:v-1',+ posture: 'critical',+ postureReason: 'last-run-failed',+ 'last-run-endtime': 1_000,+ }),+ job({ id: 'verify:v-1', 'last-run-endtime': 2_000 }),+ ],+ 'main',+ );+ expect(summary.label).toBe('OK');+ expect(summary.entries).toHaveLength(1);+ });++ it('never reports a family as OK when its server-wide read failed', () => {+ const summary = summarizeDatastoreJobs(+ [+ job({ id: 'v-1', family: 'verify' }),+ job({+ id: 'garbage:partial',+ family: 'garbage',+ store: undefined,+ posture: 'unknown',+ error: 'permission denied',+ }),+ ],+ 'main',+ );+ expect(summary.state).toBe('unknown');+ expect(summary.label).toBe('GC unknown');+ });++ it('names a job that has not run yet without calling it healthy', () => {+ const summary = summarizeDatastoreJobs(+ [job({ id: 'v-1', posture: 'unknown', postureReason: 'no-run-observed' })],+ 'main',+ );+ expect(summary.state).toBe('unknown');+ expect(summary.label).toBe('Verify not run');+ });++ it('has nothing to say without a datastore or evidence', () => {+ expect(summarizeDatastoreJobs(undefined, 'main').label).toBe('—');+ expect(summarizeDatastoreJobs([job({})], undefined).label).toBe('—');+ });+});diff --git a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.ts b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.tsindex 7f60245720..e1fd4e1c75 100644--- a/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.ts+++ b/frontend-modern/src/features/proxmox/__tests__/proxmoxBackupsTablePresentation.test.ts@@ -48,15 +48,15 @@ describe('Proxmox backups responsive table presentation', () => {'used',]);expect(getBackupServerColumnWidthStyle('server', 'compact')).toEqual({ width: '40%' });- expect(getBackupServerColumnWidthStyle('status', 'compact')).toEqual({ width: '18%' });- expect(getBackupServerColumnWidthStyle('used', 'compact')).toEqual({ width: '25%' });- expect(getBackupServerColumnWidthStyle('datastore', 'compact')).toEqual({ width: '17%' });+ expect(getBackupServerColumnWidthStyle('status', 'compact')).toEqual({ width: '24%' });+ expect(getBackupServerColumnWidthStyle('used', 'compact')).toEqual({ width: '23%' });+ expect(getBackupServerColumnWidthStyle('datastore', 'compact')).toEqual({ width: '13%' });expect(ids(getBackupServerColumns('basic'))).toEqual(['server','status','datastore','used',- 'backups',+ 'jobs',]);expect(ids(getBackupServerColumns('operational'))).toEqual(['server',@@ -65,15 +65,15 @@ describe('Proxmox backups responsive table presentation', () => {'memory','datastore','used',+ 'jobs','backups',]);- expect(ids(getBackupServerColumns('full'))).toHaveLength(10);+ expect(ids(getBackupServerColumns('full'))).toHaveLength(11);});it.each([- ['basic', '15.5%'],['operational', '12%'],- ['expanded', '10.5%'],+ ['expanded', '9%'],['full', '8%'],] as const)('reserves room for nonnumeric inventory states in %s count cells',@@ -89,6 +89,21 @@ describe('Proxmox backups responsive table presentation', () => {},);+ it.each([+ ['basic', '15.5%'],+ ['operational', '11%'],+ ['expanded', '10%'],+ ['full', '10%'],+ ] as const)('fits a worded job result such as "Verify failed" in %s', (layout, width) => {+ expect(getBackupServerColumnWidthStyle('jobs', layout)).toEqual({ width });+ const total = getBackupServerColumns(layout).reduce(+ (sum, column) =>+ sum + Number.parseFloat(getBackupServerColumnWidthStyle(column.id, layout).width as string),+ 0,+ );+ expect(total).toBeCloseTo(100, 3);+ });+it('prioritizes workload posture, restore freshness, and task failures in coverage', () => {const withTasks = { task: true };expect(ids(getCoverageColumns('compact', withTasks))).toEqual([diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupServerJobs.ts b/frontend-modern/src/features/proxmox/proxmoxBackupServerJobs.tsnew file mode 100644index 0000000000..47b552417e--- /dev/null+++ b/frontend-modern/src/features/proxmox/proxmoxBackupServerJobs.ts@@ -0,0 +1,148 @@+import type { PBSJobHealthEvidence } from '@/types/api';++// "Is my PBS OK?" needs the datastore's housekeeping, not just its fill: a+// failed sync means the offsite copy is stale, a failed verify means restores+// are unproven, and failed GC or prune means the store fills faster than its+// usage suggests. The backend already judges every job (posture + reason in+// pbsJobHealthPosture); this only picks the worst judgment per datastore and+// says it in a few words. It never re-derives health from raw task status.++export type DatastoreJobState = 'none' | 'ok' | 'unknown' | 'warning' | 'critical';++export interface DatastoreJobEntry {+ id: string;+ family: string;+ familyLabel: string;+ state: Exclude<DatastoreJobState, 'none'>;+ outcomeLabel: string;+}++export interface DatastoreJobSummary {+ state: DatastoreJobState;+ // Single-line cell text: the worst job ("Sync failed") or "OK". Further+ // problems are listed in the drawer and hover title, not squeezed in here.+ label: string;+ // One entry per job id, worst first, for the drawer and the hover title.+ entries: DatastoreJobEntry[];+}++// Backup jobs are already answered per guest by Coverage; this cell is about+// the datastore's own maintenance and offsite copy.+const DATASTORE_JOB_FAMILIES = ['garbage', 'prune', 'verify', 'sync'] as const;++const FAMILY_LABEL: Record<(typeof DATASTORE_JOB_FAMILIES)[number], string> = {+ garbage: 'GC',+ prune: 'Prune',+ verify: 'Verify',+ sync: 'Sync',+};++const STATE_RANK: Record<Exclude<DatastoreJobState, 'none'>, number> = {+ ok: 0,+ unknown: 1,+ warning: 2,+ critical: 3,+};++const normalize = (value: string | undefined): string => (value ?? '').trim().toLowerCase();++const isDatastoreFamily = (family: string): family is (typeof DATASTORE_JOB_FAMILIES)[number] =>+ (DATASTORE_JOB_FAMILIES as readonly string[]).includes(family);++const stateForPosture = (posture: string | undefined): Exclude<DatastoreJobState, 'none'> => {+ switch (normalize(posture)) {+ case 'healthy':+ return 'ok';+ case 'warning':+ return 'warning';+ case 'critical':+ return 'critical';+ default:+ return 'unknown';+ }+};++const outcomeLabelFor = (state: DatastoreJobEntry['state'], reason: string): string => {+ if (state === 'ok') return reason === 'running' ? 'running' : 'OK';+ if (state === 'critical') return 'failed';+ // Short plain words: on phones the phrase shares the narrow State column.+ if (state === 'warning') return reason === 'job-overdue' ? 'late' : 'warned';+ return reason === 'no-run-observed' ? 'not run' : 'unknown';+};++const runTime = (entry: PBSJobHealthEvidence): number => {+ const endedAt = entry.freshness?.lastRunEndTime+ ? Date.parse(entry.freshness.lastRunEndTime)+ : NaN;+ if (Number.isFinite(endedAt)) return endedAt;+ const seconds = entry['last-run-endtime'] ?? entry['task-endtime'];+ return typeof seconds === 'number' && Number.isFinite(seconds) ? seconds * 1000 : 0;+};++export function summarizeDatastoreJobs(+ evidence: readonly PBSJobHealthEvidence[] | undefined,+ datastoreName: string | undefined,+): DatastoreJobSummary {+ const store = datastoreName?.trim();+ if (!store || !evidence?.length) return { state: 'none', label: '—', entries: [] };++ // A family whose read failed for the whole server (no store attached) leaves+ // every datastore's result for that family unknown, never silently OK.+ const unreadFamilies = new Set(+ evidence+ .filter((entry) => !entry.store?.trim() && stateForPosture(entry.posture) !== 'ok')+ .map((entry) => normalize(entry.family))+ .filter(isDatastoreFamily),+ );++ // Task history can repeat a job; the newest run of each job id speaks for it.+ const newestById = new Map<string, PBSJobHealthEvidence>();+ for (const entry of evidence) {+ const family = normalize(entry.family);+ if (!isDatastoreFamily(family) || entry.enabled === false) continue;+ if (entry.store?.trim() !== store) continue;+ const id = entry.id?.trim() || `${family}:${store}`;+ const previous = newestById.get(id);+ if (!previous || runTime(entry) >= runTime(previous)) newestById.set(id, entry);+ }++ const entries: DatastoreJobEntry[] = [...newestById.entries()].map(([id, entry]) => {+ const family = normalize(entry.family) as (typeof DATASTORE_JOB_FAMILIES)[number];+ const state = stateForPosture(entry.posture);+ return {+ id,+ family,+ familyLabel: FAMILY_LABEL[family],+ state,+ outcomeLabel: outcomeLabelFor(state, normalize(entry.postureReason)),+ };+ });+ for (const family of unreadFamilies) {+ if (entries.some((entry) => entry.family === family && entry.state !== 'ok')) continue;+ entries.push({+ id: `${family}:unread`,+ family,+ familyLabel: FAMILY_LABEL[family],+ state: 'unknown',+ outcomeLabel: 'unknown',+ });+ }+ if (entries.length === 0) return { state: 'none', label: '—', entries: [] };++ const familyOrder = (family: string) => DATASTORE_JOB_FAMILIES.indexOf(family as never);+ entries.sort(+ (left, right) =>+ STATE_RANK[right.state] - STATE_RANK[left.state] ||+ familyOrder(left.family) - familyOrder(right.family) ||+ left.id.localeCompare(right.id),+ );++ const worst = entries[0];+ if (worst.state === 'ok') return { state: 'ok', label: 'OK', entries };+ return { state: worst.state, label: `${worst.familyLabel} ${worst.outcomeLabel}`, entries };+}++export const describeDatastoreJobs = (summary: DatastoreJobSummary): string =>+ summary.entries.length === 0+ ? 'No PBS jobs reported for this datastore'+ : summary.entries.map((entry) => `${entry.familyLabel} ${entry.outcomeLabel}`).join(' · ');diff --git a/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts b/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.tsindex 795010f68e..e3233279e5 100644--- a/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts+++ b/frontend-modern/src/features/proxmox/proxmoxBackupsTablePresentation.ts@@ -19,6 +19,7 @@ export type BackupServerColumnId =| 'uptime'| 'datastore'| 'used'+ | 'jobs'| 'backups'| 'dedup';@@ -74,6 +75,7 @@ export const BACKUP_SERVER_COLUMNS: readonly BackupTableColumn<BackupServerColum{ id: 'uptime', label: 'Uptime', kind: 'numeric-value' },{ id: 'datastore', label: 'Datastore', kind: 'text' },{ id: 'used', label: 'Used', kind: 'numeric-value' },+ { id: 'jobs', label: 'Jobs', kind: 'text' },{ id: 'backups', label: 'Backups', kind: 'numeric-value' },{ id: 'dedup', label: 'Dedup', kind: 'numeric-value' },];@@ -85,12 +87,14 @@ const BACKUP_SERVER_VISIBLE: Record<// Reachability and datastore exhaustion are the two risks that can stop all// future backups. Host telemetry and space-efficiency context return only as// the table gains enough room to keep those headline answers readable. The- // phone projection keeps those two answers whole ("Healthy", "33.6%") and- // lets the backup count return with the first wider layout.+ // phone projection keeps those two answers whole ("Healthy", "33.6%"); its+ // job results live in the row's drawer. Job results (GC, prune, verify,+ // sync) are the next answer, so they take the first wider layout ahead of+ // the backup count, which Coverage and By date already answer per guest.compact: ['server', 'status', 'datastore', 'used'],- basic: ['server', 'status', 'datastore', 'used', 'backups'],- operational: ['server', 'status', 'cpu', 'memory', 'datastore', 'used', 'backups'],- expanded: ['server', 'status', 'cpu', 'memory', 'uptime', 'datastore', 'used', 'backups'],+ basic: ['server', 'status', 'datastore', 'used', 'jobs'],+ operational: ['server', 'status', 'cpu', 'memory', 'datastore', 'used', 'jobs', 'backups'],+ expanded: ['server', 'status', 'cpu', 'memory', 'uptime', 'datastore', 'used', 'jobs', 'backups'],full: BACKUP_SERVER_COLUMNS.map((column) => column.id),};@@ -98,47 +102,53 @@ const BACKUP_SERVER_WEIGHTS: Record<ProxmoxBackupsTableLayoutMode,Partial<Record<BackupServerColumnId, number>>> = {- // Capacity must fit "Unavailable", not just a short percentage. Keep the- // shared 40% identity anchor; the compact status omits its redundant dot.- compact: { server: 40, status: 18, datastore: 17, used: 25 },- // Count must fit Loading and Unavailable, not just a short number. Keep- // reachability and the used/total pair; datastore names already disclose- // their full value on hover and in the existing detail. The 30% identity- // anchor below still owns the server column in this band.- basic: { server: 30, status: 13.6, datastore: 14, used: 26.9, backups: 15.5 },+ // State must fit a job problem ("Sync failed", "Verify late") because the+ // phone layout has no Jobs column, and capacity must fit "Unavailable".+ // Datastore names truncate at either width; keep the shared 40% identity+ // anchor. The compact status omits its redundant dot.+ compact: { server: 40, status: 24, datastore: 13, used: 23 },+ // Jobs must fit "Verify failed" and Count must fit Loading and+ // Unavailable, not just short values. Keep reachability and the used/total+ // pair; datastore names already disclose their full value on hover and in+ // the existing detail. The 30% identity anchor below still owns the server+ // column in this band.+ basic: { server: 30, status: 13.6, datastore: 14, used: 26.9, jobs: 15.5 },operational: {- server: 20,- status: 12,- cpu: 10,- memory: 12,- datastore: 14,- used: 20,- backups: 12,- },- expanded: {server: 18,status: 11,cpu: 8,memory: 11,- uptime: 9,- datastore: 14.5,+ datastore: 12,+ used: 17,+ jobs: 11,+ backups: 12,+ },+ expanded: {+ server: 17,+ status: 10,+ cpu: 7,+ memory: 10,+ uptime: 8,+ datastore: 11,used: 18,- backups: 10.5,+ jobs: 10,+ backups: 9,},// Memory and Used carry a percentage plus a used/total pair, the longest// values in the row, so they take the slack from the one-word status and// version cells instead of truncating.full: {- server: 15,- status: 8,- version: 7,- cpu: 6,- memory: 13.5,- uptime: 7,- datastore: 13,- used: 15.5,+ server: 14,+ status: 7,+ version: 6,+ cpu: 5,+ memory: 12.5,+ uptime: 6,+ datastore: 11,+ used: 14.5,+ jobs: 10,backups: 8,- dedup: 7,+ dedup: 6,},};