Add simulated data fallback for historical analysis when Prometheus is not accessible

This commit is contained in:
2025-09-30 18:06:10 -03:00
parent 2b2b3c23b2
commit 5f3f737b3a
2 changed files with 72 additions and 29 deletions

View File

@@ -1556,8 +1556,13 @@
const clusterTotalDiv = document.getElementById('clusterTotal');
const workloadDataDiv = document.getElementById('workloadData');
// Add data source indicator
const dataSourceIndicator = data.data_source === 'simulated' ?
'<div style="background: #fff3cd; border: 1px solid #ffeaa7; border-radius: 4px; padding: 10px; margin-bottom: 15px; color: #856404;"><strong>📊 Demo Mode:</strong> Showing simulated data for demonstration. Prometheus integration requires proper RBAC configuration.</div>' :
'<div style="background: #d4edda; border: 1px solid #c3e6cb; border-radius: 4px; padding: 10px; margin-bottom: 15px; color: #155724;"><strong>✅ Live Data:</strong> Real metrics from Prometheus</div>';
// Render cluster total resources
clusterTotalDiv.innerHTML = `
clusterTotalDiv.innerHTML = dataSourceIndicator + `
<div class="cluster-stats">
<div class="stat-card">
<h4>CPU Total</h4>