diff --git a/app/static/index.html b/app/static/index.html index e4f769e..17e36da 100644 --- a/app/static/index.html +++ b/app/static/index.html @@ -1276,8 +1276,8 @@ - - + +
@@ -1390,14 +1390,14 @@ Refresh -
+
Loading workloads... +
+
- - @@ -1406,7 +1406,7 @@ +
@@ -1415,15 +1415,15 @@ -
+ +
Loading VPA data... -
+
@@ -1431,10 +1431,10 @@

Smart Recommendations

-
+ + Refresh + +
@@ -1493,7 +1493,7 @@
Loading recommendations... -
+ @@ -1549,7 +1549,7 @@ Refresh - +
@@ -1677,9 +1677,9 @@ } else if (section === 'requests-limits') { loadRequestsLimits(); } else if (section === 'vpa-management') { - loadVPAManagement(); + loadVPAManagement(); } else if (section === 'historical-analysis') { - loadHistoricalAnalysis(); + loadHistoricalAnalysis(); } else if (section === 'settings') { loadSettings(); } @@ -1727,24 +1727,25 @@ async function preloadAllWorkloadDetails() { if (!window.workloadsData) return; - // Load details for all namespaces in parallel - const loadPromises = window.workloadsData.map(async (namespace, index) => { - try { - const response = await fetch(`/api/v1/validations/namespace/${namespace.namespace}`); - const data = await response.json(); - - // Store the data for when accordion is opened - window.workloadDetails = window.workloadDetails || {}; - window.workloadDetails[namespace.namespace] = data; - - } catch (error) { - console.error(`Error loading details for namespace ${namespace.namespace}:`, error); - window.workloadDetails = window.workloadDetails || {}; - window.workloadDetails[namespace.namespace] = { error: 'Failed to load details' }; + try { + // Load all validations by namespace + const response = await fetch('/api/v1/validations/by-namespace'); + const data = await response.json(); + + // Store the data for each namespace + window.workloadDetails = {}; + if (data.namespaces) { + data.namespaces.forEach(namespace => { + window.workloadDetails[namespace.namespace] = { + validations: namespace.pods ? Object.values(namespace.pods).flatMap(pod => pod.validations) : [] + }; + }); } - }); - - await Promise.all(loadPromises); + + } catch (error) { + console.error('Error loading namespace details:', error); + window.workloadDetails = {}; + } } function toggleWorkloadIssues(index) { @@ -1890,7 +1891,7 @@

No Recommendations Available

No smart recommendations found for the current cluster state.

-
+
`; updateBulkSelectUI(); return; @@ -1926,7 +1927,7 @@
-
+

${title}

${workload.workload_name} -
+
${workload.namespace} @@ -1962,7 +1963,7 @@
Score: ${workload.priority_score}/10 -
+
Impact: ${workload.estimated_impact} @@ -1980,14 +1981,14 @@ - `; +
+ `; return; } @@ -2707,7 +2708,7 @@ - `).join('')} + `).join('')} `;