From 379ce69b667a7ad8589ac4edc2cf130c771b270f Mon Sep 17 00:00:00 2001 From: andersonid Date: Mon, 29 Sep 2025 18:11:01 -0300 Subject: [PATCH] Fix: corrigido JavaScript do dashboard para exibir dados do cluster-health --- app/static/index.html | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/static/index.html b/app/static/index.html index 9fef017..9697692 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -1662,6 +1662,10 @@ const data = await response.json(); currentData = data; updateStats(data); + + // Update cluster health dashboard + updateClusterHealthDisplay(data, data); + showSuccess('Cluster status loaded successfully. Loading analysis...'); // Automatically load validations after initial scan @@ -3006,11 +3010,14 @@ document.getElementById('cpuOvercommitText').textContent = `${healthData.cpu_overcommit_percentage.toFixed(1)}% overcommit`; - // Memory - const memoryUsagePercent = (healthData.cluster_memory_requests / healthData.cluster_memory_capacity) * 100; + // Memory - Convert bytes to GiB + const memoryRequestsGiB = healthData.cluster_memory_requests / (1024 * 1024 * 1024); + const memoryCapacityGiB = healthData.cluster_memory_capacity / (1024 * 1024 * 1024); + const memoryUsagePercent = (memoryRequestsGiB / memoryCapacityGiB) * 100; + document.getElementById('memoryUsageBar').style.width = Math.min(memoryUsagePercent, 100) + '%'; document.getElementById('memoryUsageText').textContent = - `${healthData.cluster_memory_requests.toFixed(1)} / ${healthData.cluster_memory_capacity.toFixed(1)} GiB`; + `${memoryRequestsGiB.toFixed(1)} / ${memoryCapacityGiB.toFixed(1)} GiB`; document.getElementById('memoryOvercommitText').textContent = `${healthData.memory_overcommit_percentage.toFixed(1)}% overcommit`; } @@ -3035,7 +3042,7 @@
CPU: ${consumer.cpu_requests.toFixed(1)} cores
-
Memory: ${consumer.memory_requests.toFixed(1)} GiB
+
Memory: ${(consumer.memory_requests / (1024 * 1024 * 1024)).toFixed(1)} GiB
${consumer.qos_class}
`;