Fix export functionality to exclude computed field from JSON output

This commit is contained in:
2025-10-27 19:59:43 +01:00
parent bee0f72c10
commit cbfa6bd48f

View File

@@ -59,8 +59,12 @@ function InstanceCard({
// Fetch the most up-to-date instance data from the backend // Fetch the most up-to-date instance data from the backend
const instanceData = await instancesApi.get(instance.name); const instanceData = await instancesApi.get(instance.name);
// Remove docker_enabled as it's a computed field, not persisted to disk
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { docker_enabled, ...persistedData } = instanceData;
// Convert to JSON string with pretty formatting (matching backend format) // Convert to JSON string with pretty formatting (matching backend format)
const jsonString = JSON.stringify(instanceData, null, 2); const jsonString = JSON.stringify(persistedData, null, 2);
// Create a blob and download link // Create a blob and download link
const blob = new Blob([jsonString], { type: "application/json" }); const blob = new Blob([jsonString], { type: "application/json" });