From c0ad69cf1177d02a56efd19e51803c961c234ab8 Mon Sep 17 00:00:00 2001 From: morgane Date: Wed, 17 Jun 2026 13:52:58 +0000 Subject: [PATCH] Actualiser assets/js/app.js --- assets/js/app.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index ec130d7..b479b61 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -5196,6 +5196,22 @@ function _applyInsightPhase() { } // ===== DASHBOARD ===== +function renderDashboardLocationCards(counts) { + const container = document.getElementById('dashboard-location-cards'); + if (!container) return; + const keys = Object.keys(LOCATIONS); + container.innerHTML = keys.map(key => { + const info = LOCATIONS[key]; + const count = counts[key] !== undefined ? counts[key] : '-'; + return ` +
+ ${info.icon} + ${count} + ${escapeHtml(info.label)} +
+ `; + }).join(''); +} async function loadDashboard() { // Render one card per known location, with shimmer while loading renderDashboardLocationCards({}); @@ -5429,11 +5445,6 @@ async function loadDashboard() { } catch (err) { console.error('Dashboard load error:', err); - // Remove shimmer even on error so numbers don't disappear forever - ['stat-dispensa', 'stat-frigo', 'stat-freezer'].forEach(id => { - const el = document.getElementById(id); - if (el) { el.classList.remove('stat-loading'); if (el.textContent === '') el.textContent = '-'; } - }); } }