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 relationship freshness and metadata

rcourtman145bdc6768f5
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index 09b0c7c1fd..99a169bfd0 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -133,6 +133,9 @@ The same API contract now also owns the dedicated frontend resource facet
client in `frontend-modern/src/api/resources.ts`, which fetches the governed
capability, relationship, and timeline surfaces from `internal/api/resources.go`
instead of teaching the drawer or list views to reconstruct them inline.
+Those relationship and timeline payloads now also carry `lastSeenAt` freshness
+and optional metadata through the same owned contract, so the drawer can
+preserve provenance without inventing a separate graph-detail schema.
The tenant-scoped unified resource API now also stays on canonical
unified-resource seeds end to end: `internal/api/resources.go`,
`internal/api/router_helpers.go`, and `internal/api/state_provider.go` no
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index f0c8e2b8c4..4838adaa42 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -193,6 +193,10 @@ timeline endpoint is paginated. Relationship and timeline references in that
drawer now route through the canonical infrastructure resource filter, so the
resource graph remains navigable from the history surface instead of being
purely descriptive text.
+Relationship cards in that drawer also surface `lastSeenAt` freshness and
+optional metadata blocks, and timeline cards surface change metadata when it
+is present, so the graph history view preserves the richer provenance already
+carried by the unified-resource model instead of flattening those fields away.
The Connected infrastructure settings surface now also depends on a backend
owned `connectedInfrastructure` projection derived from unified resources plus
reporting-ignore state. That projection is now also the only v6 client
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index 3735ea247c..343f0fcd73 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -72,6 +72,9 @@ const buildInfrastructureResourceHref = (resourceId: string): string | null => {
return trimmed ? buildInfrastructurePath({ resource: trimmed }) : null;
};
+const hasMetadataEntries = (value?: Record<string, unknown> | null): boolean =>
+ Boolean(value && Object.keys(value).length > 0);
+
const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
type DrawerTab =
| 'overview'
@@ -1535,7 +1538,25 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
formatRelativeTime(relationship.observedAt)}
</span>
</div>
+ <div class="flex items-center justify-between gap-2">
+ <span class="text-muted">Last Seen</span>
+ <span class="font-medium text-base-content">
+ {formatFacetTimestamp(relationship.lastSeenAt) ||
+ formatFacetTimestamp(relationship.observedAt) ||
+ formatRelativeTime(relationship.lastSeenAt)}
+ </span>
+ </div>
</div>
+ <Show when={hasMetadataEntries(relationship.metadata)}>
+ <details class="mt-2 rounded border border-border bg-base px-2 py-1">
+ <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">
+ Metadata
+ </summary>
+ <pre class="mt-2 overflow-auto whitespace-pre-wrap break-words text-[10px] text-base-content">
+ {JSON.stringify(relationship.metadata ?? {}, null, 2)}
+ </pre>
+ </details>
+ </Show>
</div>
)}
</For>
@@ -1607,6 +1628,16 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
{change.reason}
</div>
</Show>
+ <Show when={hasMetadataEntries(change.metadata)}>
+ <details class="mt-1 rounded border border-border bg-base px-2 py-1">
+ <summary class="cursor-pointer list-none text-[10px] font-medium text-muted">
+ Metadata
+ </summary>
+ <pre class="mt-2 overflow-auto whitespace-pre-wrap break-words text-[10px] text-base-content">
+ {JSON.stringify(change.metadata ?? {}, null, 2)}
+ </pre>
+ </details>
+ </Show>
<Show when={change.relatedResources && change.relatedResources.length > 0}>
<div class="mt-1 flex flex-wrap items-center gap-1 text-muted">
<span>Related:</span>
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
index 3bd4165e2c..be90219b5c 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceDetailDrawer.history.test.tsx
@@ -75,6 +75,10 @@ describe('ResourceDetailDrawer history tab', () => {
discoverer: 'proxmox_adapter',
observedAt: '2026-03-18T12:00:00Z',
lastSeenAt: '2026-03-18T12:05:00Z',
+ metadata: {
+ cluster: 'pve-prod',
+ hypervisor: 'pve-1',
+ },
},
],
recentChanges: [
@@ -92,6 +96,10 @@ describe('ResourceDetailDrawer history tab', () => {
actor: 'agent:oncall-helper',
relatedResources: ['node:pve-1'],
reason: 'Routine restart requested',
+ metadata: {
+ ticket: 'INC-1234',
+ policy: 'routine-maintenance',
+ },
},
],
counts: {
@@ -148,6 +156,10 @@ describe('ResourceDetailDrawer history tab', () => {
discoverer: 'proxmox_adapter',
observedAt: '2026-03-18T12:00:00Z',
lastSeenAt: '2026-03-18T12:05:00Z',
+ metadata: {
+ cluster: 'pve-prod',
+ hypervisor: 'pve-1',
+ },
},
],
recentChanges: [
@@ -165,6 +177,10 @@ describe('ResourceDetailDrawer history tab', () => {
actor: 'agent:oncall-helper',
relatedResources: ['node:pve-1'],
reason: 'Routine restart requested',
+ metadata: {
+ ticket: 'INC-1234',
+ policy: 'routine-maintenance',
+ },
},
],
counts: {
@@ -206,5 +222,9 @@ describe('ResourceDetailDrawer history tab', () => {
panel.getByRole('link', { name: 'Open related resource node:pve-1 in Infrastructure' }),
).toHaveAttribute('href', '/infrastructure?resource=node%3Apve-1');
expect(panel.getByText('Routine restart requested')).toBeInTheDocument();
+ expect(panel.getByText('Last Seen')).toBeInTheDocument();
+ expect(panel.getAllByText('Metadata')).toHaveLength(2);
+ expect(panel.getByText(/"hypervisor": "pve-1"/)).toBeInTheDocument();
+ expect(panel.getByText(/"ticket": "INC-1234"/)).toBeInTheDocument();
});
});