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.

Use canonical inventory export format in fallback builders

rcourtman37e2322c0e86
diff --git a/docs/release-control/v6/internal/subsystems/frontend-primitives.md b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
index 147ea1ddce..6240f76a55 100644
--- a/docs/release-control/v6/internal/subsystems/frontend-primitives.md
+++ b/docs/release-control/v6/internal/subsystems/frontend-primitives.md
@@ -201,6 +201,10 @@ or fallback filename date-stamp styles
when the catalog is
present; the first valid selection and all request semantics must come from the
parsed backend definition.
+The same rule applies to VM inventory export transport details: request
+builders and fallback filenames must derive the export format and extension
+from the parsed inventory definition instead of hardcoding `csv` in frontend
+helpers.
That same fallback contract also includes the single-report filename subject,
so frontend download builders may not substitute resource display names when
the catalog says fallback attachment names are keyed off canonical resource IDs.
diff --git a/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts b/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts
index 79170da637..d88be9e46f 100644
--- a/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts
+++ b/frontend-modern/src/components/Settings/__tests__/reportingInventoryExportModel.test.ts
@@ -8,12 +8,13 @@ import {
describe('reporting inventory export model', () => {
it('builds a VM inventory export filename', () => {
const now = new Date('2026-03-20T12:34:56.000Z');
- expect(buildVMInventoryExportFilename(now, 'vm-inventory', 'utc_yyyymmdd')).toBe('vm-inventory-20260320.csv');
+ expect(buildVMInventoryExportFilename(now, 'csv', 'vm-inventory', 'utc_yyyymmdd')).toBe('vm-inventory-20260320.csv');
});
it('builds the canonical VM inventory export request', () => {
const now = new Date('2026-03-20T12:34:56.000Z');
const request = buildVMInventoryExportRequest(now, {
+ format: 'csv',
exportEndpoint: '/api/admin/reports/inventory/vms/export',
filenamePrefix: 'vm-inventory',
filenameDateStyle: 'utc_yyyymmdd',
@@ -48,6 +49,7 @@ describe('reporting inventory export model', () => {
label: 'Pool',
description: 'Canonical Proxmox pool membership.',
});
+ expect(definition.format).toBe('csv');
});
it('rejects inventory definitions without declared columns', () => {
diff --git a/frontend-modern/src/components/Settings/reportingInventoryExportModel.ts b/frontend-modern/src/components/Settings/reportingInventoryExportModel.ts
index 76d40d6c92..92274df014 100644
--- a/frontend-modern/src/components/Settings/reportingInventoryExportModel.ts
+++ b/frontend-modern/src/components/Settings/reportingInventoryExportModel.ts
@@ -27,24 +27,26 @@ export interface ReportingInventoryExportDefinition {
export function buildVMInventoryExportFilename(
now: Date,
+ format: ReportingInventoryExportDefinition['format'],
filenamePrefix: string,
filenameDateStyle: ReportingFilenameDateStyle,
): string {
const date = formatReportingFilenameDate(now, filenameDateStyle);
- return `${filenamePrefix}-${date}.csv`;
+ return `${filenamePrefix}-${date}.${format}`;
}
export function buildVMInventoryExportRequest(
now: Date,
definition: Pick<
ReportingInventoryExportDefinition,
- 'exportEndpoint' | 'filenamePrefix' | 'filenameDateStyle'
+ 'exportEndpoint' | 'filenamePrefix' | 'filenameDateStyle' | 'format'
>,
): ReportingInventoryExportRequestDefinition {
- const params = new URLSearchParams({ format: 'csv' });
+ const params = new URLSearchParams({ format: definition.format });
return {
filename: buildVMInventoryExportFilename(
now,
+ definition.format,
definition.filenamePrefix,
definition.filenameDateStyle,
),