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.

Surface active PBS tasks in infrastructure views

rcourtmanee2537987f29
diff --git a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
index d9eca073f9..de078ced5b 100644
--- a/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
+++ b/docs/release-control/v6/internal/subsystems/performance-and-scalability.md
@@ -633,6 +633,15 @@ while canonical drawer discovery-target derivation now lives in
under `unified-resources`. Future discovery-config or target-resolution
changes must extend through that unified-resource owner instead of
re-accumulating discovery heuristics back into the performance hot-path mapper.
+The PBS service-table hot path now follows that same split: raw job arrays may
+cross the transport boundary, but
+`frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts`
+must collapse them into one shared `Activity` presentation via the canonical
+service-model helpers, while
+`frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx`
+stays a thin render shell. Future running-task visibility changes must extend
+through the shared model and accepted performance proof file instead of adding
+per-row PBS status parsing or inline job scans in the table render path.
The dashboard disk list now follows the same pattern: the shell stays in
`frontend-modern/src/components/Dashboard/DiskList.tsx`, while disk-row
presentation derivations and fallback tooltip/runtime wiring live in
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index ee0e800e34..fca7e98bff 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -726,6 +726,16 @@ explanation surfaces still show the full canonical `aiSafeSummary`,
`resourceDetailDrawerServiceModel.ts` owns the pure Docker/PBS/PMG service
summary and breakdown derivations that feed the overview service-details
surface,
+and PBS running-task visibility is part of that same canonical service model:
+raw backup, sync, verify, prune, and garbage job arrays travel through the
+unified-resource metadata contract in `frontend-modern/src/types/resource.ts`
+and `frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts`,
+`resourceDetailDrawerServiceModel.ts` owns active-task status classification and
+shared activity wording, and both
+`frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx`
+and `frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx`
+must render from that shared projection instead of rescanning raw job arrays or
+inventing local PBS status heuristics,
`resourceDetailDrawerIdentityModel.ts` owns the pure identity-card,
discovery-summary, source-debug, and debug-bundle derivations that feed the
overview and debug drawer surfaces,
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
index e6e8756688..b1980dabf1 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawerOverviewTab.tsx
@@ -950,9 +950,17 @@ export const ResourceDetailDrawerOverviewTab: Component<ResourceDetailDrawerOver
</span>
</div>
</Show>
+ <Show when={drawer.pbsActiveTaskCount() > 0}>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Active tasks</span>
+ <span class="font-medium text-emerald-700 dark:text-emerald-300">
+ {formatInteger(drawer.pbsActiveTaskCount())}
+ </span>
+ </div>
+ </Show>
<Show when={drawer.showPbsJobDetail()}>
<div class="space-y-1.5 border-t border-indigo-200 pt-2 dark:border-indigo-700">
- <div class="grid grid-cols-2 gap-2">
+ <div class="grid grid-cols-2 gap-2 md:grid-cols-3">
<div class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
<div class="text-[10px] text-muted">Datastores</div>
<div class="text-sm font-semibold text-base-content">
@@ -965,7 +973,65 @@ export const ResourceDetailDrawerOverviewTab: Component<ResourceDetailDrawerOver
{formatInteger(drawer.pbsJobTotal())}
</div>
</div>
+ <Show when={drawer.pbsActiveTaskCount() > 0}>
+ <div class="rounded border border-emerald-200 bg-emerald-50 px-2 py-1.5 dark:border-emerald-700 dark:bg-emerald-950/40">
+ <div class="text-[10px] text-muted">Active</div>
+ <div class="text-sm font-semibold text-emerald-700 dark:text-emerald-300">
+ {formatInteger(drawer.pbsActiveTaskCount())}
+ </div>
+ </div>
+ </Show>
</div>
+ <Show when={drawer.pbsActiveTaskCount() > 0}>
+ <div
+ data-testid="pbs-active-tasks"
+ class="rounded border border-emerald-200 bg-surface px-2 py-1.5 dark:border-emerald-700"
+ >
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-[10px] font-medium uppercase tracking-wide text-muted">
+ Active tasks
+ </span>
+ <span class="text-[10px] font-semibold text-emerald-700 dark:text-emerald-300">
+ {formatInteger(drawer.pbsActiveTaskCount())}
+ </span>
+ </div>
+ <div class="mt-2 space-y-2 border-t border-emerald-200 pt-2 dark:border-emerald-700">
+ <For each={drawer.pbsActiveTasks()}>
+ {(task) => (
+ <div class="flex items-start justify-between gap-2 text-[10px]">
+ <div class="min-w-0">
+ <div
+ class="truncate font-medium text-base-content"
+ title={task.label}
+ >
+ {task.label}
+ </div>
+ <Show when={task.context}>
+ <div
+ class="truncate text-muted"
+ title={task.context ?? undefined}
+ >
+ {task.context}
+ </div>
+ </Show>
+ <Show when={task.error}>
+ <div
+ class="truncate text-rose-700 dark:text-rose-300"
+ title={task.error}
+ >
+ {task.error}
+ </div>
+ </Show>
+ </div>
+ <span class="shrink-0 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 font-medium text-emerald-700 dark:border-emerald-700 dark:bg-emerald-950/40 dark:text-emerald-300">
+ {task.statusLabel}
+ </span>
+ </div>
+ )}
+ </For>
+ </div>
+ </div>
+ </Show>
<details class="rounded border border-indigo-200 bg-surface px-2 py-1.5 dark:border-indigo-700">
<summary class="flex cursor-pointer list-none items-center justify-between text-[10px] font-medium text-muted">
<span>Types</span>
diff --git a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
index a93307d562..14e0cb208d 100644
--- a/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
+++ b/frontend-modern/src/components/Infrastructure/UnifiedResourcePBSTableSection.tsx
@@ -70,7 +70,7 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
class={table.serviceCountColumn().className}
width={table.serviceCountColumn().width}
>
- Jobs
+ Activity
</TableHead>
<TableHead
class={table.serviceHealthColumn().className}
@@ -128,6 +128,11 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
getServiceHealthSummaryPresentation(resource.status, pbsRow()?.health)
.textClass,
);
+ const activityClass = createMemo(() =>
+ (pbsRow()?.activeTaskCount || 0) > 0
+ ? 'text-[11px] font-semibold text-emerald-700 dark:text-emerald-300'
+ : 'text-xs text-base-content',
+ );
const rowClass = createMemo(() => {
const baseBorder = 'border-b border-border-subtle';
@@ -215,10 +220,22 @@ export const UnifiedResourcePBSTableSection: Component<UnifiedResourcePBSTableSe
<TableCell classList={{ hidden: !table.isVisible('secondary') && !table.isMobile() }}>
<div class="flex justify-center">
<Show
- when={pbsRow()?.jobs != null}
+ when={pbsRow()?.activity}
fallback={<span class="text-xs text-slate-400">—</span>}
>
- <span class="text-xs text-base-content">{pbsRow()!.jobs}</span>
+ <div
+ class="flex flex-col items-center leading-tight"
+ title={[pbsRow()!.activity, pbsRow()!.activityDetail]
+ .filter(Boolean)
+ .join(' · ')}
+ >
+ <span class={activityClass()}>{pbsRow()!.activity}</span>
+ <Show when={pbsRow()?.activityDetail}>
+ <span class="text-[10px] text-muted">
+ {pbsRow()!.activityDetail}
+ </span>
+ </Show>
+ </div>
</Show>
</div>
</TableCell>
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx
index 223d574ee4..15cca4dc20 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.service-cards.test.tsx
@@ -116,6 +116,90 @@ describe('ResourceDetailDrawer service cards', () => {
);
});
+ it('surfaces active PBS tasks before and inside job detail', () => {
+ const resource = baseResource({
+ id: 'pbs-2',
+ type: 'pbs',
+ name: 'pbs-active',
+ displayName: 'PBS Active',
+ platformId: '192.168.0.9',
+ platformType: 'proxmox-pbs',
+ platformData: {
+ sources: ['pbs'],
+ pbs: {
+ hostname: 'pbs-active.local',
+ connectionHealth: 'online',
+ datastoreCount: 2,
+ backupJobCount: 2,
+ syncJobCount: 1,
+ verifyJobCount: 1,
+ backupJobs: [
+ {
+ id: 'backup-nightly',
+ store: 'fast',
+ type: 'vm',
+ vmid: '100',
+ lastBackup: '',
+ nextRun: '',
+ status: 'running',
+ error: '',
+ },
+ {
+ id: 'backup-weekly',
+ store: 'archive',
+ type: 'ct',
+ vmid: '200',
+ lastBackup: '',
+ nextRun: '',
+ status: 'ok',
+ error: '',
+ },
+ ],
+ syncJobs: [
+ {
+ id: 'sync-remote',
+ store: 'fast',
+ remote: 'offsite',
+ status: 'queued',
+ lastSync: '',
+ nextRun: '',
+ error: '',
+ },
+ ],
+ verifyJobs: [
+ {
+ id: 'verify-1',
+ store: 'fast',
+ status: 'ok',
+ lastVerify: '',
+ nextRun: '',
+ error: '',
+ },
+ ],
+ },
+ },
+ });
+
+ const { getByText, getByRole, getByTestId } = render(() => (
+ <ResourceDetailDrawer resource={resource} />
+ ));
+
+ expect(getByText('2 datastores · 2 active tasks')).toBeInTheDocument();
+ fireEvent.click(getByRole('button', { name: 'Show service' }));
+ const serviceDetails = within(getByTestId('resource-service-details-section'));
+ expect(serviceDetails.getByText('Active tasks')).toBeInTheDocument();
+ expect(serviceDetails.getByText('2')).toBeInTheDocument();
+
+ fireEvent.click(getByRole('button', { name: 'Show jobs' }));
+ const activeTasks = within(getByTestId('pbs-active-tasks'));
+ expect(activeTasks.getByText('Backup backup-nightly')).toBeInTheDocument();
+ expect(activeTasks.getByText('fast · VM 100')).toBeInTheDocument();
+ expect(activeTasks.getByText('Running')).toBeInTheDocument();
+ expect(activeTasks.getByText('Sync sync-remote')).toBeInTheDocument();
+ expect(activeTasks.getByText('fast · Remote offsite')).toBeInTheDocument();
+ expect(activeTasks.getByText('Queued')).toBeInTheDocument();
+ });
+
it('renders PMG card with compact summary and queue/mail breakdown sections', () => {
const resource = baseResource({
id: 'pmg-1',
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
index 9d9ed807d4..9675b882ef 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.performance.contract.test.tsx
@@ -264,6 +264,14 @@ describe('UnifiedResourceTable performance contract', () => {
);
});
+ it('keeps PBS activity projection in the shared table-model owner', () => {
+ expect(unifiedResourceTableModelSource).toContain('getPbsActivitySummary');
+ expect(unifiedResourcePBSTableSectionSource).toContain('Activity');
+ expect(unifiedResourcePBSTableSectionSource).not.toContain('backupJobs');
+ expect(unifiedResourcePBSTableSectionSource).not.toContain('syncJobs');
+ expect(unifiedResourcePBSTableSectionSource).not.toContain('getPbsActivitySummary');
+ });
+
it('keeps infrastructure summary fetch runtime out of the render shell', () => {
expect(infrastructureSummarySource).toContain('useInfrastructureSummaryState');
expect(infrastructureSummarySource).not.toContain('fetchInfrastructureSummaryAndCache');
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsx
index d76f5f2549..d45bd357b1 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/UnifiedResourceTable.workloads-link.test.tsx
@@ -165,7 +165,41 @@ describe('UnifiedResourceTable workloads links', () => {
sources: ['pbs'],
pbs: {
datastoreCount: 2,
- backupJobCount: 1,
+ backupJobCount: 2,
+ syncJobCount: 1,
+ backupJobs: [
+ {
+ id: 'backup-nightly',
+ store: 'fast',
+ type: 'vm',
+ vmid: '100',
+ lastBackup: '',
+ nextRun: '',
+ status: 'running',
+ error: '',
+ },
+ {
+ id: 'backup-weekly',
+ store: 'archive',
+ type: 'ct',
+ vmid: '200',
+ lastBackup: '',
+ nextRun: '',
+ status: 'ok',
+ error: '',
+ },
+ ],
+ syncJobs: [
+ {
+ id: 'sync-remote',
+ store: 'fast',
+ remote: 'offsite',
+ status: 'queued',
+ lastSync: '',
+ nextRun: '',
+ error: '',
+ },
+ ],
},
},
recentChanges: [
@@ -219,7 +253,7 @@ describe('UnifiedResourceTable workloads links', () => {
expect(getByText('PBS Services')).toBeInTheDocument();
expect(getByText('PMG Services')).toBeInTheDocument();
expect(getByText('Datastores')).toBeInTheDocument();
- expect(getByText('Jobs')).toBeInTheDocument();
+ expect(getByText('Activity')).toBeInTheDocument();
expect(getAllByText('Action').length).toBeGreaterThan(0);
expect(getByText('Queue')).toBeInTheDocument();
expect(getByText('Deferred')).toBeInTheDocument();
@@ -231,7 +265,8 @@ describe('UnifiedResourceTable workloads links', () => {
if (pbsRow) {
const row = within(pbsRow);
expect(row.getByText('2')).toBeInTheDocument();
- expect(row.getByText('1')).toBeInTheDocument();
+ expect(row.getByText('2 active')).toBeInTheDocument();
+ expect(row.getByText('3 total')).toBeInTheDocument();
expect(row.getByText('Timeline 1')).toBeInTheDocument();
expect(row.queryByText('Capabilities 1')).toBeNull();
expect(row.queryByText('Relationships 1')).toBeNull();
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.test.ts b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.test.ts
index 3365a53e46..3bc5669cf7 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.test.ts
+++ b/frontend-modern/src/components/Infrastructure/__tests__/resourceDetailDrawerServiceModel.test.ts
@@ -1,6 +1,8 @@
import { describe, expect, it } from 'vitest';
import {
+ buildPbsActiveTasks,
+ getPbsActivitySummary,
buildPbsVisibleJobBreakdown,
buildPmgVisibleMailBreakdown,
buildPmgVisibleQueueBreakdown,
@@ -35,6 +37,90 @@ describe('resourceDetailDrawerServiceModel', () => {
).toBe('2 datastores · 4 jobs');
});
+ it('derives active PBS tasks from the canonical raw job payloads', () => {
+ const pbs = {
+ datastoreCount: 2,
+ backupJobCount: 2,
+ syncJobCount: 1,
+ verifyJobCount: 1,
+ pruneJobCount: 0,
+ garbageJobCount: 0,
+ backupJobs: [
+ {
+ id: 'backup-nightly',
+ store: 'fast',
+ type: 'vm',
+ vmid: '100',
+ lastBackup: '',
+ nextRun: '',
+ status: 'running',
+ error: '',
+ },
+ {
+ id: 'backup-weekly',
+ store: 'archive',
+ type: 'ct',
+ vmid: '200',
+ lastBackup: '',
+ nextRun: '',
+ status: 'ok',
+ error: '',
+ },
+ ],
+ syncJobs: [
+ {
+ id: 'sync-remote',
+ store: 'fast',
+ remote: 'offsite',
+ status: 'queued',
+ lastSync: '',
+ nextRun: '',
+ error: '',
+ },
+ ],
+ verifyJobs: [
+ {
+ id: 'verify-1',
+ store: 'fast',
+ status: 'ok',
+ lastVerify: '',
+ nextRun: '',
+ error: '',
+ },
+ ],
+ };
+
+ expect(buildPbsActiveTasks(pbs)).toEqual([
+ {
+ id: 'backup-nightly',
+ label: 'Backup backup-nightly',
+ context: 'fast · VM 100',
+ statusLabel: 'Running',
+ error: undefined,
+ },
+ {
+ id: 'sync-remote',
+ label: 'Sync sync-remote',
+ context: 'fast · Remote offsite',
+ statusLabel: 'Queued',
+ error: undefined,
+ },
+ ]);
+ expect(getPbsActivitySummary(pbs)).toEqual({
+ label: '2 active',
+ detail: '4 total',
+ activeTaskCount: 2,
+ });
+ expect(
+ getServiceDetailsSummary({
+ resourceType: 'pbs',
+ docker: undefined,
+ pbs,
+ pmg: undefined,
+ }),
+ ).toBe('2 datastores · 2 active tasks');
+ });
+
it('keeps PMG backlog and breakdown visibility canonical', () => {
const pmg = {
queueTotal: 519,
diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerServiceModel.ts b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerServiceModel.ts
index 1e8a15b9a0..7a94357a2b 100644
--- a/frontend-modern/src/components/Infrastructure/resourceDetailDrawerServiceModel.ts
+++ b/frontend-modern/src/components/Infrastructure/resourceDetailDrawerServiceModel.ts
@@ -1,5 +1,16 @@
-import type { DockerPlatformData } from './resourceDetailMappers';
+import type {
+ DockerPlatformData,
+ PBSPlatformData,
+ PMGPlatformData,
+} from './resourceDetailMappers';
import { formatInteger } from './resourceDetailMappers';
+import type {
+ PBSBackupJob,
+ PBSGarbageJob,
+ PBSPruneJob,
+ PBSSyncJob,
+ PBSVerifyJob,
+} from '@/types/api';
export type ResourceDetailValueBreakdownEntry = {
label: string;
@@ -7,26 +18,6 @@ export type ResourceDetailValueBreakdownEntry = {
warn?: boolean;
};
-type PbsPlatformDataLike = {
- datastoreCount?: number;
- backupJobCount?: number;
- syncJobCount?: number;
- verifyJobCount?: number;
- pruneJobCount?: number;
- garbageJobCount?: number;
-};
-
-type PmgPlatformDataLike = {
- queueTotal?: number;
- queueActive?: number;
- queueDeferred?: number;
- queueHold?: number;
- queueIncoming?: number;
- mailCountTotal?: number;
- spamIn?: number;
- virusIn?: number;
-};
-
const filterVisibleBreakdown = <T extends ResourceDetailValueBreakdownEntry>(
entries: T[],
): T[] => {
@@ -37,7 +28,131 @@ const filterVisibleBreakdown = <T extends ResourceDetailValueBreakdownEntry>(
const formatCount = (value: number, singular: string, plural = `${singular}s`): string =>
`${formatInteger(value)} ${value === 1 ? singular : plural}`;
-export const getPbsJobTotal = (pbs: PbsPlatformDataLike | undefined): number => {
+const normalizeDelimitedLabel = (value: string): string =>
+ value
+ .trim()
+ .split(/[\s_-]+/)
+ .filter((part) => part.length > 0)
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
+ .join(' ');
+
+const normalizePbsTaskStatus = (status?: string): string =>
+ (status || '')
+ .trim()
+ .toLowerCase()
+ .replace(/[_-]+/g, ' ')
+ .replace(/\s+/g, ' ');
+
+const PBS_ACTIVE_STATUS_TOKENS = [
+ 'running',
+ 'active',
+ 'queued',
+ 'pending',
+ 'starting',
+ 'started',
+ 'in progress',
+] as const;
+
+const PBS_INACTIVE_STATUS_TOKENS = [
+ 'ok',
+ 'idle',
+ 'stopped',
+ 'disabled',
+ 'error',
+ 'failed',
+ 'warning',
+ 'unknown',
+ 'success',
+ 'successful',
+ 'complete',
+ 'completed',
+ 'scheduled',
+] as const;
+
+const hasStatusToken = (status: string, token: string): boolean =>
+ new RegExp(`(?:^|\\b)${token.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}(?:$|\\b)`, 'i').test(
+ status,
+ );
+
+const isPbsTaskStatusActive = (status?: string): boolean => {
+ const normalized = normalizePbsTaskStatus(status);
+ if (!normalized) return false;
+ if (PBS_INACTIVE_STATUS_TOKENS.some((token) => hasStatusToken(normalized, token))) {
+ return false;
+ }
+ return PBS_ACTIVE_STATUS_TOKENS.some((token) => hasStatusToken(normalized, token));
+};
+
+const formatPbsTaskStatusLabel = (status?: string): string => {
+ const normalized = normalizePbsTaskStatus(status);
+ if (!normalized) return 'Active';
+ return normalizeDelimitedLabel(normalized);
+};
+
+const joinPbsTaskContext = (...parts: Array<string | null | undefined>): string | null => {
+ const filtered = parts
+ .map((part) => part?.trim())
+ .filter((part): part is string => Boolean(part));
+ return filtered.length > 0 ? filtered.join(' · ') : null;
+};
+
+const formatPbsBackupWorkload = (type?: string, vmid?: string): string | null => {
+ const normalizedType = (type || '').trim().toLowerCase();
+ if (!normalizedType && !(vmid || '').trim()) return null;
+ const typeLabel =
+ normalizedType === 'vm'
+ ? 'VM'
+ : normalizedType === 'ct'
+ ? 'Container'
+ : normalizedType
+ ? normalizeDelimitedLabel(normalizedType)
+ : 'Workload';
+ const workloadId = (vmid || '').trim();
+ return workloadId ? `${typeLabel} ${workloadId}` : typeLabel;
+};
+
+const buildPbsTaskLabel = (taskType: string, id?: string): string => {
+ const normalizedId = (id || '').trim();
+ return normalizedId ? `${taskType} ${normalizedId}` : taskType;
+};
+
+export type PbsActiveTaskEntry = {
+ id: string;
+ label: string;
+ context: string | null;
+ statusLabel: string;
+ error?: string;
+};
+
+export type PbsActivitySummary = {
+ label: string | null;
+ detail: string | null;
+ activeTaskCount: number;
+};
+
+const buildPbsActiveTaskEntry = (
+ taskType: string,
+ job:
+ | PBSBackupJob
+ | PBSSyncJob
+ | PBSVerifyJob
+ | PBSPruneJob
+ | PBSGarbageJob,
+ context: string | null,
+): PbsActiveTaskEntry | null => {
+ if (!isPbsTaskStatusActive(job.status)) {
+ return null;
+ }
+ return {
+ id: job.id,
+ label: buildPbsTaskLabel(taskType, job.id),
+ context,
+ statusLabel: formatPbsTaskStatusLabel(job.status),
+ error: job.error?.trim() || undefined,
+ };
+};
+
+export const getPbsJobTotal = (pbs: PBSPlatformData | undefined): number => {
if (!pbs) return 0;
return (
(pbs.backupJobCount || 0) +
@@ -49,7 +164,7 @@ export const getPbsJobTotal = (pbs: PbsPlatformDataLike | undefined): number =>
};
export const buildPbsVisibleJobBreakdown = (
- pbs: PbsPlatformDataLike | undefined,
+ pbs: PBSPlatformData | undefined,
): ResourceDetailValueBreakdownEntry[] => {
if (!pbs) return [];
@@ -62,11 +177,78 @@ export const buildPbsVisibleJobBreakdown = (
]);
};
-export const getPmgQueueBacklog = (pmg: PmgPlatformDataLike | undefined): number =>
+export const buildPbsActiveTasks = (pbs: PBSPlatformData | undefined): PbsActiveTaskEntry[] => {
+ if (!pbs) return [];
+
+ const tasks: PbsActiveTaskEntry[] = [];
+
+ for (const job of pbs.backupJobs ?? []) {
+ const entry = buildPbsActiveTaskEntry(
+ 'Backup',
+ job,
+ joinPbsTaskContext(job.store, formatPbsBackupWorkload(job.type, job.vmid)),
+ );
+ if (entry) tasks.push(entry);
+ }
+
+ for (const job of pbs.syncJobs ?? []) {
+ const entry = buildPbsActiveTaskEntry(
+ 'Sync',
+ job,
+ joinPbsTaskContext(job.store, job.remote ? `Remote ${job.remote}` : null),
+ );
+ if (entry) tasks.push(entry);
+ }
+
+ for (const job of pbs.verifyJobs ?? []) {
+ const entry = buildPbsActiveTaskEntry('Verify', job, joinPbsTaskContext(job.store));
+ if (entry) tasks.push(entry);
+ }
+
+ for (const job of pbs.pruneJobs ?? []) {
+ const entry = buildPbsActiveTaskEntry('Prune', job, joinPbsTaskContext(job.store));
+ if (entry) tasks.push(entry);
+ }
+
+ for (const job of pbs.garbageJobs ?? []) {
+ const entry = buildPbsActiveTaskEntry(
+ 'Garbage Collection',
+ job,
+ joinPbsTaskContext(job.store),
+ );
+ if (entry) tasks.push(entry);
+ }
+
+ return tasks;
+};
+
+export const getPbsActivitySummary = (
+ pbs: PBSPlatformData | undefined,
+): PbsActivitySummary => {
+ const totalJobs = getPbsJobTotal(pbs);
+ const activeTaskCount = buildPbsActiveTasks(pbs).length;
+
+ if (activeTaskCount > 0) {
+ return {
+ label: `${formatInteger(activeTaskCount)} active`,
+ detail:
+ totalJobs > activeTaskCount ? `${formatInteger(totalJobs)} total` : null,
+ activeTaskCount,
+ };
+ }
+
+ return {
+ label: totalJobs > 0 ? `${formatInteger(totalJobs)} jobs` : null,
+ detail: null,
+ activeTaskCount: 0,
+ };
+};
+
+export const getPmgQueueBacklog = (pmg: PMGPlatformData | undefined): number =>
!pmg ? 0 : (pmg.queueDeferred || 0) + (pmg.queueHold || 0);
export const buildPmgVisibleQueueBreakdown = (
- pmg: PmgPlatformDataLike | undefined,
+ pmg: PMGPlatformData | undefined,
): ResourceDetailValueBreakdownEntry[] => {
if (!pmg) return [];
@@ -79,7 +261,7 @@ export const buildPmgVisibleQueueBreakdown = (
};
export const buildPmgVisibleMailBreakdown = (
- pmg: PmgPlatformDataLike | undefined,
+ pmg: PMGPlatformData | undefined,
): ResourceDetailValueBreakdownEntry[] => {
if (!pmg) return [];
@@ -93,8 +275,8 @@ export const buildPmgVisibleMailBreakdown = (
export const getServiceDetailsSummary = (args: {
resourceType: string;
docker: DockerPlatformData | undefined;
- pbs: PbsPlatformDataLike | undefined;
- pmg: PmgPlatformDataLike | undefined;
+ pbs: PBSPlatformData | undefined;
+ pmg: PMGPlatformData | undefined;
}): string | null => {
const { resourceType, docker, pbs, pmg } = args;
@@ -106,9 +288,10 @@ export const getServiceDetailsSummary = (args: {
}
if (pbs) {
+ const activeTaskCount = buildPbsActiveTasks(pbs).length;
return `${formatCount(pbs.datastoreCount || 0, 'datastore')} · ${formatCount(
- getPbsJobTotal(pbs),
- 'job',
+ activeTaskCount > 0 ? activeTaskCount : getPbsJobTotal(pbs),
+ activeTaskCount > 0 ? 'active task' : 'job',
)}`;
}
diff --git a/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts b/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts
index a0f8bcd537..4dc05cbb25 100644
--- a/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts
+++ b/frontend-modern/src/components/Infrastructure/resourceDetailMappers.ts
@@ -6,6 +6,11 @@ import type {
HostSensorSummary,
Memory,
Node,
+ PBSBackupJob,
+ PBSGarbageJob,
+ PBSPruneJob,
+ PBSSyncJob,
+ PBSVerifyJob,
} from '@/types/api';
import type { Resource, ResourceMetric, ResourceVMwareMeta } from '@/types/resource';
import { formatTemperature } from '@/utils/temperature';
@@ -66,6 +71,11 @@ export type PBSPlatformData = {
verifyJobCount?: number;
pruneJobCount?: number;
garbageJobCount?: number;
+ backupJobs?: PBSBackupJob[];
+ syncJobs?: PBSSyncJob[];
+ verifyJobs?: PBSVerifyJob[];
+ pruneJobs?: PBSPruneJob[];
+ garbageJobs?: PBSGarbageJob[];
connectionHealth?: string;
};
diff --git a/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts b/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts
index 3711b6a764..014e29bcd6 100644
--- a/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts
+++ b/frontend-modern/src/components/Infrastructure/unifiedResourceTableModel.ts
@@ -1,28 +1,21 @@
import type { Resource } from '@/types/resource';
import { getServiceHealthSummaryPresentation } from '@/utils/serviceHealthPresentation';
import type { IODistributionStats } from '@/components/Infrastructure/infrastructureSelectors';
+import type { PBSPlatformData, PMGPlatformData } from './resourceDetailMappers';
+import {
+ getPbsActivitySummary,
+ getPbsJobTotal,
+} from './resourceDetailDrawerServiceModel';
-type PBSServiceData = {
- datastoreCount?: number;
- backupJobCount?: number;
- syncJobCount?: number;
- verifyJobCount?: number;
- pruneJobCount?: number;
- garbageJobCount?: number;
- connectionHealth?: string;
-};
-
-type PMGServiceData = {
- nodeCount?: number;
- queueTotal?: number;
- queueDeferred?: number;
- queueHold?: number;
- connectionHealth?: string;
-};
+type PBSServiceData = PBSPlatformData;
+type PMGServiceData = PMGPlatformData;
export type PBSTableRow = {
datastores: number | null;
jobs: number | null;
+ activity: string | null;
+ activityDetail: string | null;
+ activeTaskCount: number;
health: string | null;
tone: ReturnType<typeof getServiceHealthSummaryPresentation>['tone'];
};
@@ -52,17 +45,16 @@ export const getPBSTableRow = (resource: Resource): PBSTableRow | null => {
| { pbs?: PBSServiceData; pmg?: PMGServiceData }
| undefined;
const pbs = platformData?.pbs;
- const totalJobs =
- (pbs?.backupJobCount || 0) +
- (pbs?.syncJobCount || 0) +
- (pbs?.verifyJobCount || 0) +
- (pbs?.pruneJobCount || 0) +
- (pbs?.garbageJobCount || 0);
+ const totalJobs = getPbsJobTotal(pbs);
+ const activitySummary = getPbsActivitySummary(pbs);
const health = pbs?.connectionHealth?.trim() || null;
return {
datastores: (pbs?.datastoreCount || 0) > 0 ? pbs?.datastoreCount || 0 : null,
jobs: totalJobs > 0 ? totalJobs : null,
+ activity: activitySummary.label,
+ activityDetail: activitySummary.detail,
+ activeTaskCount: activitySummary.activeTaskCount,
health,
tone: getServiceHealthSummaryPresentation(resource.status, health).tone,
};
diff --git a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
index cfc00cef37..16f0bc7333 100644
--- a/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
+++ b/frontend-modern/src/components/Infrastructure/useResourceDetailDrawerDerivedState.ts
@@ -36,6 +36,7 @@ import {
} from '@/components/Infrastructure/resourceDetailMappers';
import { toDiscoveryConfig } from '@/components/Infrastructure/resourceDetailDiscoveryModel';
import {
+ buildPbsActiveTasks,
buildPbsVisibleJobBreakdown,
buildPmgVisibleMailBreakdown,
buildPmgVisibleQueueBreakdown,
@@ -216,6 +217,8 @@ export const useResourceDetailDrawerDerivedState = (
return formatRelativeTime(parsed);
});
const pbsVisibleJobBreakdown = createMemo(() => buildPbsVisibleJobBreakdown(pbsData()));
+ const pbsActiveTasks = createMemo(() => buildPbsActiveTasks(pbsData()));
+ const pbsActiveTaskCount = createMemo(() => pbsActiveTasks().length);
const pmgVisibleQueueBreakdown = createMemo(() => buildPmgVisibleQueueBreakdown(pmgData()));
const pmgVisibleMailBreakdown = createMemo(() => buildPmgVisibleMailBreakdown(pmgData()));
@@ -359,6 +362,8 @@ export const useResourceDetailDrawerDerivedState = (
pbsData,
pmgData,
pbsJobTotal,
+ pbsActiveTasks,
+ pbsActiveTaskCount,
pmgQueueBacklog,
pmgUpdatedRelative,
pbsVisibleJobBreakdown,
diff --git a/frontend-modern/src/types/resource.ts b/frontend-modern/src/types/resource.ts
index 78525cdb1e..921c1ae24d 100644
--- a/frontend-modern/src/types/resource.ts
+++ b/frontend-modern/src/types/resource.ts
@@ -13,6 +13,11 @@ import type {
HostSensorSummary,
HostRAIDArray,
Memory,
+ PBSBackupJob,
+ PBSGarbageJob,
+ PBSPruneJob,
+ PBSSyncJob,
+ PBSVerifyJob,
} from '@/types/api';
import {
PLATFORM_TYPE_KEYS as GENERATED_PLATFORM_TYPE_KEYS,
@@ -284,6 +289,11 @@ export interface ResourcePBSMeta {
verifyJobCount?: number;
pruneJobCount?: number;
garbageJobCount?: number;
+ backupJobs?: PBSBackupJob[];
+ syncJobs?: PBSSyncJob[];
+ verifyJobs?: PBSVerifyJob[];
+ pruneJobs?: PBSPruneJob[];
+ garbageJobs?: PBSGarbageJob[];
connectionHealth?: string;
affectedDatastoreCount?: number;
affectedDatastores?: string[];
diff --git a/tests/integration/tests/63-pbs-active-tasks.spec.ts b/tests/integration/tests/63-pbs-active-tasks.spec.ts
new file mode 100644
index 0000000000..a73087f838
--- /dev/null
+++ b/tests/integration/tests/63-pbs-active-tasks.spec.ts
@@ -0,0 +1,278 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+import { expect, test as base } from '@playwright/test';
+
+import { createAuthenticatedStorageState } from './helpers';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+const ARTIFACTS_DIR = path.resolve(__dirname, '..', '..', 'tmp', 'pbs-active-tasks');
+const RESOURCE_ID = 'pbs-active';
+const RESOURCE_ID_ENCODED = encodeURIComponent(RESOURCE_ID);
+
+type WorkerFixtures = {
+ authStorageStatePath: string;
+};
+
+const test = base.extend<{}, WorkerFixtures>({
+ storageState: async ({ authStorageStatePath }, use) => {
+ await use(authStorageStatePath);
+ },
+ authStorageStatePath: [async ({ browser }, use, workerInfo) => {
+ const storageStatePath = path.resolve(
+ __dirname,
+ '..',
+ '..',
+ 'tmp',
+ 'playwright-auth',
+ `pbs-active-tasks-${workerInfo.project.name}.json`,
+ );
+ fs.mkdirSync(path.dirname(storageStatePath), { recursive: true });
+ await createAuthenticatedStorageState(browser, storageStatePath);
+ try {
+ await use(storageStatePath);
+ } finally {
+ fs.rmSync(storageStatePath, { force: true });
+ }
+ }, { scope: 'worker' }],
+});
+
+test.describe('PBS active tasks', () => {
+ test.setTimeout(180_000);
+
+ test('surfaces running PBS tasks in the service table and shared detail drawer', async ({
+ page,
+ }, testInfo) => {
+ test.skip(testInfo.project.name.startsWith('mobile-'), 'Desktop runtime proof');
+ fs.mkdirSync(ARTIFACTS_DIR, { recursive: true });
+
+ await page.route('**/api/resources**', async (route) => {
+ const requestUrl = new URL(route.request().url());
+
+ if (requestUrl.pathname === '/api/resources') {
+ await route.fulfill({
+ status: 200,
+ contentType: 'application/json',
+ body: JSON.stringify({
+ data: [
+ {
+ id: RESOURCE_ID,
+ type: 'pbs',
+ name: 'pbs-active',
+ displayName: 'PBS Active',
+ platformId: RESOURCE_ID,
+ platformType: 'proxmox-pbs',
+ sourceType: 'api',
+ sources: ['pbs'],
+ status: 'online',
+ lastSeen: '2026-04-20T22:30:00Z',
+ canonicalIdentity: {
+ displayName: 'PBS Active',
+ hostname: 'pbs-active.lab.local',
+ platformId: RESOURCE_ID,
+ },
+ pbs: {
+ instanceId: RESOURCE_ID,
+ hostname: 'pbs-active.lab.local',
+ version: '3.4-1',
+ uptimeSeconds: 86400,
+ datastoreCount: 2,
+ backupJobCount: 2,
+ syncJobCount: 1,
+ verifyJobCount: 1,
+ backupJobs: [
+ {
+ id: 'backup-nightly',
+ store: 'fast',
+ type: 'vm',
+ vmid: '100',
+ lastBackup: '2026-04-20T00:00:00Z',
+ nextRun: '2026-04-21T00:00:00Z',
+ status: 'running',
+ error: '',
+ },
+ {
+ id: 'backup-weekly',
+ store: 'archive',
+ type: 'ct',
+ vmid: '200',
+ lastBackup: '2026-04-19T00:00:00Z',
+ nextRun: '2026-04-26T00:00:00Z',
+ status: 'ok',
+ error: '',
+ },
+ ],
+ syncJobs: [
+ {
+ id: 'sync-remote',
+ store: 'fast',
+ remote: 'offsite',
+ status: 'queued',
+ lastSync: '2026-04-20T12:00:00Z',
+ nextRun: '2026-04-20T23:00:00Z',
+ error: '',
+ },
+ ],
+ verifyJobs: [
+ {
+ id: 'verify-1',
+ store: 'fast',
+ status: 'ok',
+ lastVerify: '2026-04-20T01:00:00Z',
+ nextRun: '2026-04-21T01:00:00Z',
+ error: '',
+ },
+ ],
+ connectionHealth: 'online',
+ },
+ platformData: {
+ sources: ['pbs'],
+ pbs: {
+ instanceId: RESOURCE_ID,
+ hostname: 'pbs-active.lab.local',
+ version: '3.4-1',
+ uptimeSeconds: 86400,
+ datastoreCount: 2,
+ backupJobCount: 2,
+ syncJobCount: 1,
+ verifyJobCount: 1,
+ backupJobs: [
+ {
+ id: 'backup-nightly',
+ store: 'fast',
+ type: 'vm',
+ vmid: '100',
+ lastBackup: '2026-04-20T00:00:00Z',
+ nextRun: '2026-04-21T00:00:00Z',
+ status: 'running',
+ error: '',
+ },
+ {
+ id: 'backup-weekly',
+ store: 'archive',
+ type: 'ct',
+ vmid: '200',
+ lastBackup: '2026-04-19T00:00:00Z',
+ nextRun: '2026-04-26T00:00:00Z',
+ status: 'ok',
+ error: '',
+ },
+ ],
+ syncJobs: [
+ {
+ id: 'sync-remote',
+ store: 'fast',
+ remote: 'offsite',
+ status: 'queued',
+ lastSync: '2026-04-20T12:00:00Z',
+ nextRun: '2026-04-20T23:00:00Z',
+ error: '',
+ },
+ ],
+ verifyJobs: [
+ {
+ id: 'verify-1',
+ store: 'fast',
+ status: 'ok',
+ lastVerify: '2026-04-20T01:00:00Z',
+ nextRun: '2026-04-21T01:00:00Z',
+ error: '',
+ },
+ ],
+ connectionHealth: 'online',
+ },
+ },
+ },
+ ],
+ meta: {
+ page: 1,
+ limit: 100,
+ total: 1,
+ totalPages: 1,
+ },
+ }),
+ });
+ return;
+ }
+
+ if (requestUrl.pathname === `/api/resources/${RESOURCE_ID_ENCODED}/facets`) {
+ await route.fulfill({
+ status: 200,
+ contentType: 'application/json',
+ body: JSON.stringify({
+ capabilities: [],
+ relationships: [],
+ recentChanges: [],
+ counts: {
+ recentChanges: 0,
+ },
+ }),
+ });
+ return;
+ }
+
+ await route.continue();
+ });
+
+ await page.route('**/api/ai/intelligence**', async (route) => {
+ await route.fulfill({
+ status: 200,
+ contentType: 'application/json',
+ body: JSON.stringify({
+ resource_id: RESOURCE_ID,
+ resource_name: 'PBS Active',
+ resource_type: 'pbs',
+ health: {
+ score: 94,
+ grade: 'A',
+ trend: 'stable',
+ factors: [],
+ prediction: 'Pulse is surfacing active PBS backup activity through the shared infrastructure drawer.',
+ },
+ dependencies: [],
+ dependents: [],
+ correlations: [],
+ recent_changes: [],
+ note_count: 0,
+ }),
+ });
+ });
+
+ await page.goto(
+ `/infrastructure?source=proxmox-pbs&resource=${encodeURIComponent(RESOURCE_ID)}`,
+ {
+ waitUntil: 'domcontentloaded',
+ },
+ );
+
+ await expect(page.getByTestId('infrastructure-page')).toBeVisible();
+ await expect(page.getByText('PBS Services')).toBeVisible();
+ await expect(page.getByText('Activity', { exact: true })).toBeVisible();
+
+ const pbsRow = page.locator(`tr[data-summary-series-id="${RESOURCE_ID}"]`);
+ await expect(pbsRow).toBeVisible();
+ await expect(pbsRow.getByText('2 active', { exact: true })).toBeVisible();
+ await expect(pbsRow.getByText('4 total', { exact: true })).toBeVisible();
+
+ const serviceSection = page.getByTestId('resource-service-details-section');
+ await expect(serviceSection).toContainText('2 datastores · 2 active tasks');
+ await serviceSection.getByRole('button', { name: 'Show service' }).click();
+ await expect(serviceSection.getByText('Active tasks', { exact: true })).toBeVisible();
+ await serviceSection.getByText('2', { exact: true }).first().waitFor();
+
+ await serviceSection.getByRole('button', { name: 'Show jobs' }).click();
+ const activeTasks = page.getByTestId('pbs-active-tasks');
+ await expect(activeTasks).toBeVisible();
+ await expect(activeTasks.getByText('Backup backup-nightly')).toBeVisible();
+ await expect(activeTasks.getByText('fast · VM 100')).toBeVisible();
+ await expect(activeTasks.getByText('Running')).toBeVisible();
+ await expect(activeTasks.getByText('Sync sync-remote')).toBeVisible();
+ await expect(activeTasks.getByText('fast · Remote offsite')).toBeVisible();
+ await expect(activeTasks.getByText('Queued')).toBeVisible();
+
+ await page.screenshot({
+ path: path.resolve(ARTIFACTS_DIR, 'pbs-active-tasks.png'),
+ fullPage: true,
+ });
+ });
+});