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.
This commit is contained in:
CyberMind-FR 2025-12-28 03:05:47 +01:00
parent f71100150a
commit 6d06ef584f

View File

@ -652,25 +652,32 @@ return view.extend({
// Update real-time metrics (v0.3.2) // Update real-time metrics (v0.3.2)
var realtimeMetrics = document.querySelector('.sh-realtime-metrics'); var realtimeMetrics = document.querySelector('.sh-realtime-metrics');
if (realtimeMetrics) { if (realtimeMetrics) {
dom.content(realtimeMetrics, this.renderRealtimeMetrics().children); var newMetrics = this.renderRealtimeMetrics();
dom.content(realtimeMetrics, Array.prototype.slice.call(newMetrics.childNodes));
} }
// Update stats overview // Update stats overview
var statsOverview = document.querySelector('.sh-stats-overview-grid'); var statsOverview = document.querySelector('.sh-stats-overview-grid');
if (statsOverview) { 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 // Update system info grid
var systemInfoGrid = document.querySelector('.sh-system-info-grid'); var systemInfoGrid = document.querySelector('.sh-system-info-grid');
if (systemInfoGrid) { 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 // Update quick status indicators
var statusIndicators = document.querySelector('.sh-status-indicators-grid'); var statusIndicators = document.querySelector('.sh-status-indicators-grid');
if (statusIndicators) { if (statusIndicators) {
dom.content(statusIndicators, this.renderQuickStatusIndicators().children); var newIndicators = this.renderQuickStatusIndicators();
dom.content(statusIndicators, Array.prototype.slice.call(newIndicators.childNodes));
} }
}, },