fix(luci-app-secubox-admin): add graceful RPC fallback to all views

Fixed "No related RPC reply" errors across all admin views by wrapping
ALL RPC calls in L.resolveDefault() with appropriate fallback values.

This allows the frontend to load gracefully even when the backend RPCD
methods are not yet deployed, showing empty data instead of crashing.

Changes:
- health.js: Wrapped getHealth() → L.resolveDefault(getHealth(), {})
- logs.js: Wrapped getLogs() → L.resolveDefault(getLogs(), { logs: '' })
- settings.js: Wrapped getApps() and getModules() with fallbacks
- apps.js: Wrapped getApps() and getModules() (checkUpdates already wrapped)
- dashboard.js: Wrapped all 4 RPC calls (getApps, getModules, getHealth, getAlerts)
- Incremented PKG_RELEASE: 6 → 7
- Updated DEPLOY_UPDATES.md with v1.0.0-7 details

All admin pages now load successfully regardless of backend deployment status.

🤖 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-04 15:06:45 +01:00
parent 1c5d8eb29f
commit 17065bf776
7 changed files with 19 additions and 13 deletions

View File

@ -69,11 +69,17 @@ ubus -S call luci.secubox check_updates
### Package Versions
- `secubox-core`: 0.8.0-6
- `luci-app-secubox-admin`: 1.0.0-6
- `luci-app-secubox-admin`: 1.0.0-7
### Recent Fixes
**v1.0.0-6** (Latest):
**v1.0.0-7** (Latest):
- Added graceful RPC fallback to ALL views
- Wrapped all RPC calls in L.resolveDefault() with appropriate fallback values
- Fixed "No related RPC reply" errors in health.js, logs.js, settings.js, apps.js, dashboard.js
- All pages now load gracefully even when backend not deployed
**v1.0.0-6**:
- Fixed WidgetRenderer constructor error
- Changed from `new WidgetRenderer({...})` to `WidgetRenderer({...})`
- Added comprehensive error handling with try-catch and fallback error display

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-secubox-admin
PKG_VERSION:=1.0.0
PKG_RELEASE:=6
PKG_RELEASE:=7
PKG_LICENSE:=MIT
PKG_MAINTAINER:=CyberMind <contact@cybermind.fr>

View File

@ -8,8 +8,8 @@
return view.extend({
load: function() {
return Promise.all([
API.getApps(),
API.getModules(),
L.resolveDefault(API.getApps(), { apps: [] }),
L.resolveDefault(API.getModules(), { modules: {} }),
L.resolveDefault(API.checkUpdates(), {})
]);
},

View File

@ -11,10 +11,10 @@ return view.extend({
load: function() {
return Promise.all([
API.getApps(),
API.getModules(),
API.getHealth(),
API.getAlerts()
L.resolveDefault(API.getApps(), { apps: [] }),
L.resolveDefault(API.getModules(), { modules: {} }),
L.resolveDefault(API.getHealth(), {}),
L.resolveDefault(API.getAlerts(), { alerts: [] })
]);
},

View File

@ -5,7 +5,7 @@
return view.extend({
load: function() {
return API.getHealth();
return L.resolveDefault(API.getHealth(), {});
},
render: function(health) {

View File

@ -7,7 +7,7 @@ return view.extend({
selectedService: 'system',
load: function() {
return API.getLogs(this.selectedService, 100);
return L.resolveDefault(API.getLogs(this.selectedService, 100), { logs: '' });
},
render: function(logsData) {

View File

@ -7,8 +7,8 @@
return view.extend({
load: function() {
return Promise.all([
API.getApps(),
API.getModules()
L.resolveDefault(API.getApps(), { apps: [] }),
L.resolveDefault(API.getModules(), { modules: {} })
]);
},