fixing dashboard graphics
This commit is contained in:
+2
-2
@@ -639,8 +639,8 @@ async function loadDashboard() {
|
||||
const maxVal = Math.max(...Object.values(severityCounts), 1);
|
||||
chartEl.innerHTML = `<div class="d-flex align-items-end gap-2" style="height:120px">${Object.entries(severityCounts).map(([sev, cnt]) => {
|
||||
const color = { critical: 'danger', warning: 'warning', info: 'info' }[sev] || 'secondary';
|
||||
const pct = (cnt / maxVal) * 100;
|
||||
return `<div class="d-flex flex-column align-items-center flex-fill"><div class="bg-${color}" style="width:100%;height:${pct}%;min-height:4px;border-radius:4px 4px 0 0"></div><small class="mt-1">${sev}<br><strong>${cnt}</strong></small></div>`;
|
||||
const pct = maxVal > 0 ? (cnt / maxVal) * 100 : 0;
|
||||
return `<div class="d-flex flex-column align-items-center flex-fill" style="height:100%"><div class="bg-${color}" style="width:100%;height:${pct}%;min-height:4px;border-radius:4px 4px 0 0"></div><small class="mt-1">${sev}<br><strong>${cnt}</strong></small></div>`;
|
||||
}).join('')}</div>`;
|
||||
|
||||
document.getElementById('lastUpdated').textContent = 'Updated ' + new Date().toLocaleTimeString();
|
||||
|
||||
Reference in New Issue
Block a user