fix(secubox): fix empty modules page - use data directly

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 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2025-12-26 08:06:43 +01:00
parent 051d10de12
commit 42143beb39

View File

@ -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) {