From ed78d4bb494c83db3cbf4997a188ccba9034b3ac Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Wed, 7 Jan 2026 13:19:39 +0100 Subject: [PATCH] fix: Handle array response format in wizard data parsing (v0.6.0-r21) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fixed wizard page not displaying profiles and apps - RPC expect parameters extract nested properties automatically - listApps with expect: {apps: []} returns array directly, not {apps: [...]} - listProfiles with expect: {profiles: []} returns array directly - Updated wizard.js to handle both array and object formats - Added Array.isArray() checks for backward compatibility - Fixes "No profiles available" and "No manifests detected" errors - Added debug console logging for troubleshooting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../luci-static/resources/view/secubox/wizard.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/luci-app-secubox/htdocs/luci-static/resources/view/secubox/wizard.js b/luci-app-secubox/htdocs/luci-static/resources/view/secubox/wizard.js index 8fbb4977..ead6cfe4 100644 --- a/luci-app-secubox/htdocs/luci-static/resources/view/secubox/wizard.js +++ b/luci-app-secubox/htdocs/luci-static/resources/view/secubox/wizard.js @@ -41,9 +41,15 @@ return view.extend({ }, render: function(payload) { + console.log('[SecuBox Wizard] Received payload:', payload); + console.log('[SecuBox Wizard] Apps data:', payload[1]); + console.log('[SecuBox Wizard] Profiles data:', payload[2]); this.firstRun = payload[0] || {}; - this.appList = (payload[1] && payload[1].apps) || []; - this.profileList = (payload[2] && payload[2].profiles) || []; + // Handle both array and object formats + this.appList = Array.isArray(payload[1]) ? payload[1] : (payload[1] && payload[1].apps) || []; + this.profileList = Array.isArray(payload[2]) ? payload[2] : (payload[2] && payload[2].profiles) || []; + console.log('[SecuBox Wizard] Parsed appList:', this.appList); + console.log('[SecuBox Wizard] Parsed profileList:', this.profileList); var container = E('div', { 'class': 'secubox-wizard-page' }, [ E('link', { 'rel': 'stylesheet', 'href': L.resource('secubox-theme/core/variables.css') }), E('link', { 'rel': 'stylesheet', 'href': L.resource('secubox/common.css') }),