fix(dashboard): add cache-busting and defensive chartManager guards to fix empty charts
Some checks failed
CI / Check (push) Has been cancelled
CI / Clippy (push) Has been cancelled
CI / Formatting (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / Release Build (push) Has been cancelled

This commit is contained in:
2026-03-02 13:28:29 -05:00
parent 8d50ce7c22
commit 1766a12ea2
8 changed files with 88 additions and 34 deletions

View File

@@ -75,6 +75,9 @@ class ClientsPage {
async loadClientUsageChart() {
try {
const cm = window.chartManager || await window.waitForChartManager();
if (!cm) { this.showEmptyChart('client-usage-chart', 'Chart system unavailable'); return; }
const data = await window.api.get('/usage/clients');
if (!data || data.length === 0) {
@@ -91,7 +94,7 @@ class ClientsPage {
}]
};
window.chartManager.createHorizontalBarChart('client-usage-chart', chartData);
cm.createHorizontalBarChart('client-usage-chart', chartData);
} catch (error) {
console.error('Error loading client usage chart:', error);