From 42143beb39ed59312b6632436012d16914cc480c Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Fri, 26 Dec 2025 08:06:43 +0100 Subject: [PATCH] fix(secubox): fix empty modules page - use data directly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed modules page showing empty list even though backend returns data correctly. Problem: - RPC declare with expect: { modules: [] } automatically extracts the 'modules' field from the JSON response - This means data is already the array, not an object - Code was using data.modules which was undefined - Fell back to empty array [] Solution: - Use data directly instead of data.modules - Added comment explaining the behavior Backend returns: { "modules": [...] } RPC expect extracts: [...] So data = [...] not { modules: [...] } 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../htdocs/luci-static/resources/view/secubox/modules.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luci-app-secubox/htdocs/luci-static/resources/view/secubox/modules.js b/luci-app-secubox/htdocs/luci-static/resources/view/secubox/modules.js index ef21a44..47abde4 100644 --- a/luci-app-secubox/htdocs/luci-static/resources/view/secubox/modules.js +++ b/luci-app-secubox/htdocs/luci-static/resources/view/secubox/modules.js @@ -11,7 +11,8 @@ var callModules = rpc.declare({ return view.extend({ load: function() { return callModules(); }, render: function(data) { - var modules = data.modules || []; + // data is already the array because of expect: { modules: [] } + var modules = data || []; return E('div', {class:'cbi-map'}, [ E('h2', {}, '📦 SecuBox Modules'), E('div', {style:'display:grid;gap:12px'}, modules.map(function(m) {