From acbed6797a807280e81adfdc960e10d609feccd0 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Fri, 9 Jan 2026 15:17:03 +0100 Subject: [PATCH] fix: Fix timing issue in Media Flow dashboard data display - Move updateFlowStats/updateServiceStats calls after DOM is ready - Use requestAnimationFrame to ensure elements exist before updating - Fixes "0 flows" display bug when data was actually available Co-Authored-By: Claude Opus 4.5 --- .../resources/view/media-flow/dashboard.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/package/secubox/luci-app-media-flow/htdocs/luci-static/resources/view/media-flow/dashboard.js b/package/secubox/luci-app-media-flow/htdocs/luci-static/resources/view/media-flow/dashboard.js index 354c5a62..b9708e72 100644 --- a/package/secubox/luci-app-media-flow/htdocs/luci-static/resources/view/media-flow/dashboard.js +++ b/package/secubox/luci-app-media-flow/htdocs/luci-static/resources/view/media-flow/dashboard.js @@ -270,7 +270,6 @@ return L.view.extend({ }); }; - updateFlowStats(); v.appendChild(flowSection); // Stats by service (from history) @@ -423,16 +422,22 @@ return L.view.extend({ }); }; - updateServiceStats(); v.appendChild(statsSection); + wrapper.appendChild(v); + + // Call update functions after DOM is ready + requestAnimationFrame(function() { + updateFlowStats(); + updateServiceStats(); + }); + // Setup auto-refresh poll.add(L.bind(function() { updateFlowStats(); updateServiceStats(); }, this), 5); - wrapper.appendChild(v); return wrapper; },