From ac4e48fa4ae778ef13f3ca374735b3651006ab57 Mon Sep 17 00:00:00 2001 From: rcourtman Date: Tue, 2 Dec 2025 15:03:40 +0000 Subject: [PATCH] fix: Properly show disabled storage status from Proxmox Storage that is disabled in Proxmox (Datacenter > Storage > enabled=no) was incorrectly showing as "available" in Pulse. The issue was that Enabled/Active fields defaulted to true and were never set to false from the per-node API response. Now the model correctly initializes Enabled/Active from the Proxmox per-node storage API response, and the status determination prioritizes checking the disabled state first. Related to #796 --- internal/monitoring/monitor_polling.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/monitoring/monitor_polling.go b/internal/monitoring/monitor_polling.go index 3dc7e07..64d90ab 100644 --- a/internal/monitoring/monitor_polling.go +++ b/internal/monitoring/monitor_polling.go @@ -1319,6 +1319,7 @@ func (m *Monitor) pollStorageWithNodes(ctx context.Context, instanceName string, shared := hasClusterConfig && clusterConfig.Shared == 1 // Create storage model + // Initialize Enabled/Active from per-node API response modelStorage := models.Storage{ ID: storageID, Name: storage.Storage, @@ -1332,8 +1333,8 @@ func (m *Monitor) pollStorageWithNodes(ctx context.Context, instanceName string, Usage: safePercentage(float64(storage.Used), float64(storage.Total)), Content: sortContent(storage.Content), Shared: shared, - Enabled: true, - Active: true, + Enabled: storage.Enabled == 1, + Active: storage.Active == 1, } // If this is ZFS storage, attach pool status information @@ -1380,13 +1381,14 @@ func (m *Monitor) pollStorageWithNodes(ctx context.Context, instanceName string, } } - // Determine status based on active/enabled flags - if storage.Active == 1 || modelStorage.Active { - modelStorage.Status = "available" - } else if modelStorage.Enabled { - modelStorage.Status = "inactive" - } else { + // Determine status based on enabled/active flags + // Priority: disabled storage always shows as "disabled", regardless of active state + if !modelStorage.Enabled { modelStorage.Status = "disabled" + } else if modelStorage.Active { + modelStorage.Status = "available" + } else { + modelStorage.Status = "inactive" } nodeStorageList = append(nodeStorageList, modelStorage)