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.

Default infrastructure links in summary cards

rcourtmanb783838c8178
diff --git a/docs/release-control/v6/internal/subsystems/api-contracts.md b/docs/release-control/v6/internal/subsystems/api-contracts.md
index c270984a3f..e1f7b6a77f 100644
--- a/docs/release-control/v6/internal/subsystems/api-contracts.md
+++ b/docs/release-control/v6/internal/subsystems/api-contracts.md
@@ -85,7 +85,7 @@ Own canonical runtime payload shapes between backend and frontend.
and the shared `frontend-modern/src/components/Infrastructure/ResourcePolicySummary.tsx` card, so the AI summary page and resource drawer render the same governed policy-posture counts instead of carrying duplicate posture UI loops
and the shared `frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx` card, so learned correlations and graph context stay rendered through one governed frontend card instead of separate page-local list loops
and the same shared graph card's ordering and truncation rule, so callers pass raw correlations instead of encoding their own top-N sort behavior
- and the shared `frontend-modern/src/routing/resourceLinks.ts` infrastructure resource-link helper, so resource-only links in the summary page, resource drawer, and problem-resource dashboard panels stay on the same canonical path-construction rule instead of rebuilding infrastructure URLs inline
+ and the shared `frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx` and `frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx` cards' infrastructure resource-link default, so the Patrol page, resource drawer, and problem-resource dashboard panels inherit the canonical resource-filter path construction instead of rebuilding infrastructure URLs inline
8. Route frontend API-client parsed error propagation, API-error-status fallback handling, allowed-status handling, custom status-specific error handling, command-trigger success envelope handling, shared response parsing pipelines, missing-resource lookup handling, metadata CRUD routing, stream event consumption, response status, collection normalization, scalar payload coercion, and structured error normalization through canonical shared helpers under `frontend-modern/src/api/`
9. Add or change API token scope, assignment, and revocation presentation through `frontend-modern/src/components/Settings/APITokenManager.tsx`
10. Add or change infrastructure operations token generation, lookup, assignment, and reporting/install presentation through `frontend-modern/src/components/Settings/InfrastructureOperationsController.tsx`
diff --git a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
index e60df9f719..53c899a12d 100644
--- a/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
+++ b/docs/release-control/v6/internal/subsystems/patrol-intelligence.md
@@ -117,11 +117,13 @@ That same store now owns the Patrol dashboard load bundle as well, so the
page refresh path stays aligned on a single orchestrated AI bundle instead of
repeating the individual summary, findings, approval, and correlation fetches
inline.
-Resource-only Infrastructure links on the Patrol page, resource drawer, and
-problem-resource dashboard panels now resolve through the shared
-`frontend-modern/src/routing/resourceLinks.ts` helper, so canonical resource
-href construction stays in the routing boundary instead of being rebuilt as
-local wrappers in each surface.
+The shared
+`frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx` and
+`frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx`
+cards now own the canonical Infrastructure resource-link default, so the
+Patrol page and resource drawer inherit resource-filter href construction
+through the shared summary cards instead of rebuilding local wrappers in each
+surface.
The Patrol intelligence page and resource drawer now also share the canonical
`frontend-modern/src/components/Infrastructure/ResourcePolicySummary.tsx`
card, so the data-governance posture counts stay rendered from one governed
diff --git a/docs/release-control/v6/internal/subsystems/unified-resources.md b/docs/release-control/v6/internal/subsystems/unified-resources.md
index e68e9e0030..41f4756962 100644
--- a/docs/release-control/v6/internal/subsystems/unified-resources.md
+++ b/docs/release-control/v6/internal/subsystems/unified-resources.md
@@ -269,11 +269,12 @@ 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 same Infrastructure resource-only links now also resolve through the
-shared `frontend-modern/src/routing/resourceLinks.ts` helper from the Patrol
-page, resource drawer, and problem-resource dashboard panels, so the canonical
-resource-filter path construction stays owned by the routing boundary rather
-than being duplicated per surface.
+The same Infrastructure resource-only links now also default through the
+shared `frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx`
+and `frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx`
+cards from the Patrol page, resource drawer, and problem-resource dashboard
+panels, so canonical resource-filter path construction stays owned by the
+shared summary cards rather than being duplicated per surface.
The same timeline and facet-bundle reads now also accept governed `kind` and
`sourceType` filters, plus a governed `sourceAdapter` filter for adapter-level
provenance drill-down, so history can narrow by canonical change class and
diff --git a/frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx b/frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx
index b8a7d10ab6..0c73dca05b 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceChangeSummary.tsx
@@ -1,6 +1,7 @@
import { type Component, For, Show, createMemo } from 'solid-js';
import type { ResourceChange } from '@/types/resource';
import { formatRelativeTime } from '@/utils/format';
+import { buildInfrastructureResourceHref } from '@/routing/resourceLinks';
import {
formatResourceChangeHeadline,
formatResourceChangeKind,
@@ -11,7 +12,7 @@ interface ResourceChangeSummaryProps {
title: string;
subtitle?: string;
emptyText?: string;
- buildResourceHref: (resourceId: string) => string | null | undefined;
+ buildResourceHref?: (resourceId: string) => string | null | undefined;
maxChanges?: number;
compact?: boolean;
class?: string;
@@ -34,6 +35,7 @@ export const ResourceChangeSummary: Component<ResourceChangeSummaryProps> = (pro
const visibleChanges = createMemo(() => sortedChanges().slice(0, maxChanges()));
const hasChanges = () => visibleChanges().length > 0;
const compact = () => props.compact ?? false;
+ const buildResourceHref = props.buildResourceHref ?? buildInfrastructureResourceHref;
const itemPadding = () => (compact() ? 'p-2.5' : 'p-3');
const itemText = () => (compact() ? 'text-[11px]' : 'text-xs');
const headlineText = () => (compact() ? 'text-[11px]' : 'text-sm');
@@ -41,7 +43,7 @@ export const ResourceChangeSummary: Component<ResourceChangeSummaryProps> = (pro
const gapSize = () => (compact() ? 'gap-2' : 'gap-3');
const renderRelatedResource = (resourceId: string) => {
- const href = props.buildResourceHref(resourceId);
+ const href = buildResourceHref(resourceId);
const className =
'rounded-full border border-border-subtle bg-surface px-2 py-0.5 font-medium text-muted transition-colors hover:border-border hover:text-base-content';
@@ -81,7 +83,7 @@ export const ResourceChangeSummary: Component<ResourceChangeSummaryProps> = (pro
<For each={visibleChanges()}>
{(change) => {
const headline = formatResourceChangeHeadline(change);
- const resourceHref = props.buildResourceHref(change.resourceId);
+ const resourceHref = buildResourceHref(change.resourceId);
const relatedResources = (change.relatedResources ?? []).slice(0, 3);
return (
diff --git a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
index e8b3bf2a99..494bb851f1 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceDetailDrawer.tsx
@@ -855,7 +855,6 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
class="space-y-0"
title="Latest canonical change"
changes={intel().recent_changes}
- buildResourceHref={buildInfrastructureResourceHref}
maxChanges={1}
compact
/>
@@ -865,7 +864,6 @@ const DrawerContent: Component<ResourceDetailDrawerProps> = (props) => {
dependencies={resourceDependencies()}
dependents={resourceDependents()}
correlations={resourceCorrelations()}
- buildResourceHref={buildInfrastructureResourceHref}
showLastSeen
/>
</div>
diff --git a/frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx b/frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx
index 4387ff659a..a8c19628a7 100644
--- a/frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx
+++ b/frontend-modern/src/components/Infrastructure/ResourceGraphSummary.tsx
@@ -1,6 +1,7 @@
import { For, Show, createMemo, type Component } from 'solid-js';
import type { ResourceCorrelation } from '@/types/aiIntelligence';
import { formatRelativeTime } from '@/utils/format';
+import { buildInfrastructureResourceHref } from '@/routing/resourceLinks';
import {
formatResourceCorrelationEndpoint,
formatResourceCorrelationHeadline,
@@ -14,7 +15,7 @@ interface ResourceGraphSummaryProps {
dependents?: string[] | null;
title?: string;
summaryText?: string;
- buildResourceHref: (resourceId: string) => string | null | undefined;
+ buildResourceHref?: (resourceId: string) => string | null | undefined;
showLastSeen?: boolean;
class?: string;
maxCorrelations?: number;
@@ -40,6 +41,7 @@ export const ResourceGraphSummary: Component<ResourceGraphSummaryProps> = (props
const correlations = createMemo(() => sortResourceCorrelations(props.correlations ?? []));
const dependencies = () => props.dependencies ?? [];
const dependents = () => props.dependents ?? [];
+ const buildResourceHref = props.buildResourceHref ?? buildInfrastructureResourceHref;
const maxCorrelations = () => props.maxCorrelations ?? 3;
const hasContent = () =>
dependencies().length > 0 || dependents().length > 0 || correlations().length > 0;
@@ -76,7 +78,7 @@ export const ResourceGraphSummary: Component<ResourceGraphSummaryProps> = (props
<div class="mt-1 flex flex-wrap gap-1">
<For each={dependencies().slice(0, maxCorrelations())}>
{(dependency) => {
- const href = props.buildResourceHref(dependency);
+ const href = buildResourceHref(dependency);
return href ? (
<a
class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px] text-blue-700 hover:underline dark:text-blue-300"
@@ -102,7 +104,7 @@ export const ResourceGraphSummary: Component<ResourceGraphSummaryProps> = (props
<div class="mt-1 flex flex-wrap gap-1">
<For each={dependents().slice(0, maxCorrelations())}>
{(dependent) => {
- const href = props.buildResourceHref(dependent);
+ const href = buildResourceHref(dependent);
return href ? (
<a
class="inline-flex items-center rounded bg-surface-alt px-1.5 py-0.5 text-[10px] text-blue-700 hover:underline dark:text-blue-300"
@@ -128,8 +130,8 @@ export const ResourceGraphSummary: Component<ResourceGraphSummaryProps> = (props
<div class="mt-1 space-y-1.5">
<For each={correlations().slice(0, maxCorrelations())}>
{(correlation) => {
- const sourceHref = props.buildResourceHref(correlation.source_id);
- const targetHref = props.buildResourceHref(correlation.target_id);
+ const sourceHref = buildResourceHref(correlation.source_id);
+ const targetHref = buildResourceHref(correlation.target_id);
const headline = formatResourceCorrelationHeadline(correlation);
const summary = formatResourceCorrelationSummary(correlation);
const sourceLabel = formatResourceCorrelationEndpoint(correlation, 'source');
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceChangeSummary.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceChangeSummary.test.tsx
index 9d4b8b391d..a89a45cd34 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceChangeSummary.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceChangeSummary.test.tsx
@@ -37,7 +37,6 @@ describe('ResourceChangeSummary', () => {
relatedResources: ['vm-200', 'vm-300'],
},
]}
- buildResourceHref={(resourceId) => `/infrastructure?resource=${resourceId}`}
maxChanges={1}
/>
));
@@ -62,7 +61,6 @@ describe('ResourceChangeSummary', () => {
title="Latest canonical change"
emptyText="No canonical changes were recorded."
changes={[]}
- buildResourceHref={(resourceId) => `/infrastructure?resource=${resourceId}`}
/>
));
diff --git a/frontend-modern/src/components/Infrastructure/__tests__/ResourceGraphSummary.test.tsx b/frontend-modern/src/components/Infrastructure/__tests__/ResourceGraphSummary.test.tsx
index 9f48b90427..12f408117c 100644
--- a/frontend-modern/src/components/Infrastructure/__tests__/ResourceGraphSummary.test.tsx
+++ b/frontend-modern/src/components/Infrastructure/__tests__/ResourceGraphSummary.test.tsx
@@ -25,7 +25,6 @@ describe('ResourceGraphSummary', () => {
},
]}
summaryText="5 total"
- buildResourceHref={(resourceId) => `/infrastructure?resource=${resourceId}`}
/>
));
@@ -63,7 +62,6 @@ describe('ResourceGraphSummary', () => {
description: 'Disk pressure often precedes restarts',
},
]}
- buildResourceHref={(resourceId) => `/infrastructure?resource=${resourceId}`}
showLastSeen
/>
));
diff --git a/frontend-modern/src/pages/AIIntelligence.tsx b/frontend-modern/src/pages/AIIntelligence.tsx
index b121e43c14..87a6d3f406 100644
--- a/frontend-modern/src/pages/AIIntelligence.tsx
+++ b/frontend-modern/src/pages/AIIntelligence.tsx
@@ -98,9 +98,6 @@ import {
getTrialStartErrorMessage,
getTrialTryAgainLaterMessage,
} from '@/utils/upgradePresentation';
-import {
- buildInfrastructureResourceHref,
-} from '@/routing/resourceLinks';
type PatrolTab = 'findings' | 'history';
export function AIIntelligence() {
@@ -1279,7 +1276,6 @@ export function AIIntelligence() {
title="Recent changes"
subtitle="Canonical 24h timeline"
changes={summary().recent_changes}
- buildResourceHref={buildInfrastructureResourceHref}
/>
<div class="space-y-4">
@@ -1336,7 +1332,6 @@ export function AIIntelligence() {
title="Learned correlations"
correlations={aiIntelligenceStore.correlations?.correlations ?? []}
summaryText={`${correlationTotal()} total`}
- buildResourceHref={buildInfrastructureResourceHref}
/>
</Show>
diff --git a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
index 44e018dac7..eda91f320e 100644
--- a/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
+++ b/frontend-modern/src/pages/__tests__/AIIntelligence.test.tsx
@@ -3,7 +3,6 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@solidjs/testing-li
import { createSignal } from 'solid-js';
import { AIIntelligence } from '../AIIntelligence';
-import { buildInfrastructureResourceHref } from '@/routing/resourceLinks';
const { findingsPanelState, runHistoryState, intelligenceState } = vi.hoisted(() => ({
findingsPanelState: {
@@ -435,10 +434,7 @@ describe('AIIntelligence entitlement gating', () => {
const storage1Link = screen.getByRole('link', {
name: 'Open source resource Storage 1 in Infrastructure',
});
- expect(storage2Link).toHaveAttribute(
- 'href',
- buildInfrastructureResourceHref('storage-2') ?? '',
- );
+ expect(storage2Link).toHaveAttribute('href', '/infrastructure?resource=storage-2');
expect(screen.getByRole('link', { name: 'Open target resource VM 200 in Infrastructure' }))
.toHaveAttribute('href', '/infrastructure?resource=vm-200');
expect(screen.getByRole('link', { name: 'Open target resource VM 100 in Infrastructure' }))