From 6b237db9239beed044bab6e244eb20ebea2b288e Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 2 Feb 2026 16:01:12 +0000 Subject: [PATCH] fix(alerts): hide misleading Backup/Snapshot inputs in Global Defaults card, preserve per-resource backup config on threshold edit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Global Defaults card in VMs & Containers rendered number inputs for Backup and Snapshot columns. These wrote to guestDefaults which has no backup/snapshot fields, so values were silently lost on save — appearing to "reset to 0." Filter these special toggle columns out of the Global Defaults card since backup/snapshot thresholds are configured in the dedicated Backups/Snapshots sections. Also fix saveEdit not preserving backup/snapshot in the raw override config (hysteresisThresholds), which caused per-resource backup overrides to be silently dropped when editing other thresholds on the same resource. Related to #1126 --- frontend-modern/src/components/Alerts/ResourceTable.tsx | 2 +- frontend-modern/src/components/Alerts/ThresholdsTable.tsx | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend-modern/src/components/Alerts/ResourceTable.tsx b/frontend-modern/src/components/Alerts/ResourceTable.tsx index 3265a892f..3121e739d 100644 --- a/frontend-modern/src/components/Alerts/ResourceTable.tsx +++ b/frontend-modern/src/components/Alerts/ResourceTable.tsx @@ -511,7 +511,7 @@ export function ResourceTable(props: ResourceTableProps) {
- + { const m = normalizeMetricKey(c); return m !== 'backup' && m !== 'snapshot'; })}> {(column) => { const metric = normalizeMetricKey(column); const bounds = metricBounds(metric); diff --git a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx index 102e6b33d..3c35281dc 100644 --- a/frontend-modern/src/components/Alerts/ThresholdsTable.tsx +++ b/frontend-modern/src/components/Alerts/ThresholdsTable.tsx @@ -2062,6 +2062,12 @@ export function ThresholdsTable(props: ThresholdsTableProps) { } else { delete hysteresisThresholds.note; } + if (previousRaw?.backup) { + hysteresisThresholds.backup = previousRaw.backup; + } + if (previousRaw?.snapshot) { + hysteresisThresholds.snapshot = previousRaw.snapshot; + } newRawConfig[resourceId] = hysteresisThresholds; props.setRawOverridesConfig(newRawConfig);