From 941308c596febf645d62faf7c2c74f855d48317d Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Sun, 28 Dec 2025 14:13:22 +0100 Subject: [PATCH] fix(system-hub): Add missing renderHealthGauge method - TypeError: this.renderHealthGauge is not a function - Added renderHealthGauge method to render health score gauge - Takes score, scoreClass, scoreLabel parameters - Displays score/100, label, and progress bar with appropriate styling Method creates: - Health score display (e.g., 85/100) - Status label (Excellent/Good/Warning/Critical) - Progress bar with color-coded fill based on health class --- .../resources/view/system-hub/overview.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 68c8a5ec..ef3cfe30 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 @@ -88,6 +88,22 @@ return view.extend({ ]); }, + renderHealthGauge: function(score, scoreClass, scoreLabel) { + return E('div', { 'class': 'sh-health-gauge sh-health-' + scoreClass }, [ + E('div', { 'class': 'sh-health-score' }, [ + E('span', { 'class': 'sh-health-score-value' }, score), + E('span', { 'class': 'sh-health-score-max' }, '/100') + ]), + E('div', { 'class': 'sh-health-label' }, scoreLabel), + E('div', { 'class': 'sh-health-progress' }, [ + E('div', { + 'class': 'sh-health-progress-fill sh-health-progress-' + scoreClass, + 'style': 'width: ' + score + '%' + }) + ]) + ]); + }, + renderStatsOverview: function() { var score = this.healthData.score || 0; var scoreClass = score >= 80 ? 'excellent' : (score >= 60 ? 'good' : (score >= 40 ? 'warning' : 'critical'));