From 6d06ef584fdc1a32975663b1dc7ee14dc238f641 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sun, 28 Dec 2025 03:05:47 +0100 Subject: [PATCH] fix(system-hub): correct HTMLCollection display error in updateDashboard Fixed updateDashboard() to properly convert childNodes to array before passing to dom.content(). Was showing '[object HTMLCollection]' instead of rendering the updated metrics. Changed from: - dom.content(el, element.children) To: - Array.prototype.slice.call(element.childNodes) This ensures proper DOM manipulation and fixes the refresh cycle. --- .../resources/view/system-hub/overview.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/luci-app-system-hub/htdocs/luci-static/resources/view/system-hub/overview.js b/luci-app-system-hub/htdocs/luci-static/resources/view/system-hub/overview.js index 0dffb8c5..6c435184 100644 --- a/luci-app-system-hub/htdocs/luci-static/resources/view/system-hub/overview.js +++ b/luci-app-system-hub/htdocs/luci-static/resources/view/system-hub/overview.js @@ -652,25 +652,32 @@ return view.extend({ // Update real-time metrics (v0.3.2) var realtimeMetrics = document.querySelector('.sh-realtime-metrics'); if (realtimeMetrics) { - dom.content(realtimeMetrics, this.renderRealtimeMetrics().children); + var newMetrics = this.renderRealtimeMetrics(); + dom.content(realtimeMetrics, Array.prototype.slice.call(newMetrics.childNodes)); } // Update stats overview var statsOverview = document.querySelector('.sh-stats-overview-grid'); if (statsOverview) { - dom.content(statsOverview, this.renderStatsOverview().children); + var newStats = this.renderStatsOverview(); + dom.content(statsOverview, Array.prototype.slice.call(newStats.childNodes)); } // Update system info grid var systemInfoGrid = document.querySelector('.sh-system-info-grid'); if (systemInfoGrid) { - dom.content(systemInfoGrid, this.renderSystemInfoGrid().querySelector('.sh-system-info-grid').children); + var newInfoGrid = this.renderSystemInfoGrid(); + var gridElement = newInfoGrid.querySelector('.sh-system-info-grid'); + if (gridElement) { + dom.content(systemInfoGrid, Array.prototype.slice.call(gridElement.childNodes)); + } } // Update quick status indicators var statusIndicators = document.querySelector('.sh-status-indicators-grid'); if (statusIndicators) { - dom.content(statusIndicators, this.renderQuickStatusIndicators().children); + var newIndicators = this.renderQuickStatusIndicators(); + dom.content(statusIndicators, Array.prototype.slice.call(newIndicators.childNodes)); } },