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.

Render legacy reporting without inventory export

rcourtmanf15a186a0417
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 3cb9d48b9d..67a5808054 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -234,6 +234,11 @@ performance-report transport (`/api/reporting` and `/api/reporting/generate-mult
so the reporting panel does not go dead on mixed-version installs, but that
compatibility path is intentionally report-only and must not invent the newer
catalog-owned VM inventory export surface.
+`ReportingPanel.tsx` must therefore treat `vmInventoryExport` as optional when
+it renders a governed reporting catalog. A legacy compatibility catalog with no
+inventory export still owns a valid enabled reporting surface and must continue
+to render the performance-report workflow instead of collapsing back to the
+unavailable shell.
That same catalog load must also remain retryable after transient failure.
`useReportingPanelState.ts` may memoize or dedupe in-flight work, but it must
not permanently latch a failed first fetch and force operators to reload the
diff --git a/frontend-modern/src/components/Settings/ReportingPanel.tsx b/frontend-modern/src/components/Settings/ReportingPanel.tsx
index 70a99a2c02..348e052780 100644
--- a/frontend-modern/src/components/Settings/ReportingPanel.tsx
+++ b/frontend-modern/src/components/Settings/ReportingPanel.tsx
@@ -189,7 +189,7 @@ export function ReportingPanel() {
<p class="text-sm text-warning">{reportingCatalogError()}</p>
</Show>
- <Show when={performanceReport() && inventoryDefinition()}>
+ <Show when={performanceReport()}>
<section class="space-y-6">
<div class="space-y-2">
<h4 class="text-base font-semibold text-base-content">
diff --git a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
index ea2373daee..8a9e61f2ab 100644
--- a/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
+++ b/frontend-modern/src/components/Settings/__tests__/ReportingPanel.test.tsx
@@ -181,6 +181,29 @@ describe('ReportingPanel', () => {
).toBeInTheDocument();
});
+ it('renders performance reports when the catalog only exposes the legacy report surface', () => {
+ useReportingPanelStateMock.mockReturnValue(
+ buildState({
+ reportingCatalog: () => ({
+ ...baseCatalog,
+ guidance: {
+ title: 'Advanced Insights',
+ description: 'Performance reports remain available on older backends.',
+ },
+ vmInventoryExport: null,
+ }),
+ }),
+ );
+
+ render(() => <ReportingPanel />);
+
+ expect(screen.getByText('Performance Reports')).toBeInTheDocument();
+ expect(screen.queryByText('VM Inventory Export')).not.toBeInTheDocument();
+ expect(
+ screen.getByText('Performance reports remain available on older backends.'),
+ ).toBeInTheDocument();
+ });
+
it('shows a generic loading shell before the reporting catalog arrives', () => {
useReportingPanelStateMock.mockReturnValue(
buildState({
diff --git a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
index 7c7f323422..dd23435cd7 100644
--- a/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/settingsArchitecture.test.ts
@@ -1118,6 +1118,10 @@ describe('Settings architecture guardrails', () => {
expect(reportingPanelSource).not.toContain('Advanced Reporting (Pro)');
expect(reportingPanelSource).not.toContain('Advanced Insights');
expect(reportingPanelSource).not.toContain('Detailed Reporting');
+ expect(reportingPanelSource).toContain('<Show when={performanceReport()}>');
+ expect(reportingPanelSource).not.toContain(
+ '<Show when={performanceReport() && inventoryDefinition()}>',
+ );
expect(reportingPanelSource).not.toContain(
'Performance reports come from the historical metrics store',
);
diff --git a/frontend-modern/src/components/Settings/useReportingPanelState.ts b/frontend-modern/src/components/Settings/useReportingPanelState.ts
index 1ab7a74a87..c986838062 100644
--- a/frontend-modern/src/components/Settings/useReportingPanelState.ts
+++ b/frontend-modern/src/components/Settings/useReportingPanelState.ts
@@ -87,12 +87,11 @@ export const useReportingPanelState = () => {
const request = buildReportingCatalogRequest();
const response = await apiFetch(request.url);
if (!response.ok) {
- const error = await apiErrorFromResponse(response, getReportingCatalogErrorMessage());
- if ((error as { status?: number }).status === 404) {
+ if (response.status === 404) {
setReportingCatalog(buildLegacyReportingCatalogFallback());
return;
}
- throw error;
+ throw await apiErrorFromResponse(response, getReportingCatalogErrorMessage());
}
setReportingCatalog(parseReportingCatalog(await response.json()));