Major Features: • SecuBox v0.1.2: Real-time module auto-detection via opkg • System Hub: Dynamic component detection leveraging SecuBox • Responsive card grid layout for modules and components • Category filtering tabs (All/Security/Monitoring/Network/System) • Auto-refresh every 30 seconds with real-time status SecuBox Changes: • Added detect_real_modules() function to scan opkg for installed packages • Enhanced get_modules() with dual-source detection (UCI + auto-detected) • Enhanced get_modules_by_category() with same dual-source logic • Auto-categorization based on package name patterns • Real version detection from opkg for installed packages • Added in_uci flag to distinguish module sources • Responsive modules.js with card-based layout • New modules.css with theme support and animations System Hub Changes: • Added get_components() and get_components_by_category() to RPCD • Components leverage SecuBox module detection via ubus • Completely rewritten components.js with responsive cards • New components.css matching SecuBox design language • Extended API with getComponents() methods • Unified component management with quick actions Deployment: • Added deploy-secubox-v0.1.2.sh for SecuBox deployment • Added deploy-system-hub-dynamic.sh for System Hub deployment • Added deploy-dynamic-modules.sh for combined deployment 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
121 lines
2.6 KiB
JavaScript
121 lines
2.6 KiB
JavaScript
'use strict';
|
|
'require baseclass';
|
|
'require rpc';
|
|
|
|
/**
|
|
* System Hub API
|
|
* Package: luci-app-system-hub
|
|
* RPCD object: luci.system-hub
|
|
* Version: 0.1.1
|
|
*/
|
|
|
|
// Debug log to verify correct version is loaded
|
|
console.log('🔧 System Hub API v0.1.1 loaded at', new Date().toISOString());
|
|
|
|
var callStatus = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'status',
|
|
expect: {}
|
|
});
|
|
|
|
var callGetSystemInfo = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_system_info',
|
|
expect: {}
|
|
});
|
|
|
|
var callGetHealth = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_health',
|
|
expect: {}
|
|
});
|
|
|
|
var callListServices = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'list_services',
|
|
expect: { services: [] }
|
|
});
|
|
|
|
var callServiceAction = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'service_action',
|
|
params: ['service', 'action'],
|
|
expect: {}
|
|
});
|
|
|
|
var callGetLogs = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_logs',
|
|
params: ['lines', 'filter'],
|
|
expect: { logs: [] }
|
|
});
|
|
|
|
var callBackupConfig = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'backup_config',
|
|
expect: {}
|
|
});
|
|
|
|
var callRestoreConfig = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'restore_config',
|
|
params: ['data'],
|
|
expect: {}
|
|
});
|
|
|
|
var callReboot = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'reboot',
|
|
expect: {}
|
|
});
|
|
|
|
var callGetStorage = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_storage',
|
|
expect: { storage: [] }
|
|
});
|
|
|
|
var callGetSettings = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_settings',
|
|
expect: {}
|
|
});
|
|
|
|
var callSaveSettings = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'save_settings',
|
|
params: ['auto_refresh', 'health_check', 'debug_mode', 'refresh_interval', 'log_retention', 'cpu_warning', 'cpu_critical', 'mem_warning', 'mem_critical', 'disk_warning', 'disk_critical', 'temp_warning', 'temp_critical'],
|
|
expect: {}
|
|
});
|
|
|
|
var callGetComponents = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_components',
|
|
expect: { modules: [] }
|
|
});
|
|
|
|
var callGetComponentsByCategory = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_components_by_category',
|
|
params: ['category'],
|
|
expect: { modules: [] }
|
|
});
|
|
|
|
return baseclass.extend({
|
|
// RPC methods - exposed via ubus
|
|
getStatus: callStatus,
|
|
getSystemInfo: callGetSystemInfo,
|
|
getHealth: callGetHealth,
|
|
getComponents: callGetComponents,
|
|
getComponentsByCategory: callGetComponentsByCategory,
|
|
listServices: callListServices,
|
|
serviceAction: callServiceAction,
|
|
getLogs: callGetLogs,
|
|
backupConfig: callBackupConfig,
|
|
restoreConfig: callRestoreConfig,
|
|
reboot: callReboot,
|
|
getStorage: callGetStorage,
|
|
getSettings: callGetSettings,
|
|
saveSettings: callSaveSettings
|
|
});
|