From d1346aae0ea3ccdd69e9eff3af73efaac30a5f28 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 31 Dec 2025 11:04:52 +0100 Subject: [PATCH] fix(netdata-dashboard): add missing API methods and aliases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added getAllData() method to fetch all system stats in one call - Added getCpu() alias for getCPU() for consistency with view expectations - getAllData() returns a combined object with stats, cpu, memory, disk, network, processes, and system data This resolves "API.getAllData is not a function" and "API.getCpu is not a function" errors by ensuring the API exports match what the views are calling. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../resources/netdata-dashboard/api.js | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/luci-app-netdata-dashboard/htdocs/luci-static/resources/netdata-dashboard/api.js b/luci-app-netdata-dashboard/htdocs/luci-static/resources/netdata-dashboard/api.js index 7065941d..9c4048f5 100644 --- a/luci-app-netdata-dashboard/htdocs/luci-static/resources/netdata-dashboard/api.js +++ b/luci-app-netdata-dashboard/htdocs/luci-static/resources/netdata-dashboard/api.js @@ -132,6 +132,7 @@ return baseclass.extend({ // System stats getStats: callStats, getCPU: callCPU, + getCpu: callCPU, // Alias for consistency getMemory: callMemory, getDisk: callDisk, getNetwork: callNetwork, @@ -149,6 +150,29 @@ return baseclass.extend({ getSecuboxLogs: callSecuboxLogs, collectDebugSnapshot: callCollectDebug, + // Combined data fetch for dashboard + getAllData: function() { + return Promise.all([ + callStats(), + callCPU(), + callMemory(), + callDisk(), + callNetwork(), + callProcesses(), + callSystem() + ]).then(function(results) { + return { + stats: results[0] || {}, + cpu: results[1] || {}, + memory: results[2] || {}, + disk: results[3] || {}, + network: results[4] || {}, + processes: results[5] || {}, + system: results[6] || {} + }; + }); + }, + // Utility functions formatBytes: formatBytes, formatUptime: formatUptime