fix: Handle array response format in wizard data parsing (v0.6.0-r21)

- 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 <noreply@anthropic.com>
This commit is contained in:
CyberMind-FR 2026-01-07 13:19:39 +01:00
parent 8b3627777f
commit ed78d4bb49

View File

@ -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') }),