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:
parent
8b3627777f
commit
ed78d4bb49
@ -41,9 +41,15 @@ return view.extend({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render: function(payload) {
|
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.firstRun = payload[0] || {};
|
||||||
this.appList = (payload[1] && payload[1].apps) || [];
|
// Handle both array and object formats
|
||||||
this.profileList = (payload[2] && payload[2].profiles) || [];
|
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' }, [
|
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-theme/core/variables.css') }),
|
||||||
E('link', { 'rel': 'stylesheet', 'href': L.resource('secubox/common.css') }),
|
E('link', { 'rel': 'stylesheet', 'href': L.resource('secubox/common.css') }),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user