🎨 Design System v0.3.0 (Demo-inspired) - New dark palette: #0a0a0f, #6366f1→#8b5cf6 gradients - Typography: Inter + JetBrains Mono - Compact stats grid (130px min) - Gradient text effects with background-clip - Sticky navigation tabs - Enhanced card borders and hover effects 📚 Comprehensive Documentation Suite - DEVELOPMENT-GUIDELINES.md (33KB, 900+ lines) - 9 major sections: Design, Architecture, RPCD, ACL, JS, CSS, Errors, Validation, Deployment - Complete code templates and best practices - Common error diagnostics and solutions - QUICK-START.md (6.4KB) - 8 critical rules for immediate reference - Quick code templates - Error quick fixes table - deploy-module-template.sh (8.1KB) - Standardized deployment with automatic backup - Permission fixes, cache clearing, verification - Updated CLAUDE.md, README.md with documentation index - Updated .claude/README.md to v2.0 🔄 Version Updates - luci-app-secubox: 0.1.2 → 0.2.2 - luci-app-system-hub: 0.1.1 → 0.2.2 - Updated all version strings (api.js, overview.js, CSS files) 🎯 CSS Enhancements - common.css: Complete rewrite with demo palette - overview.css: Dashboard header with gradient - services.css: Updated version to 0.2.2 - components.css: Updated version to 0.2.2 🔧 Critical Rules Documented 1. RPCD naming: file = ubus object (luci. prefix) 2. Menu path = view file location 3. Permissions: 755 (RPCD), 644 (CSS/JS) 4. ALWAYS run validate-modules.sh 5. CSS variables only (no hardcode) 6. Dark mode mandatory 7. Typography: Inter + JetBrains Mono 8. Gradients: --sh-primary → --sh-primary-end 🤖 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.2.2
|
|
*/
|
|
|
|
// Debug log to verify correct version is loaded
|
|
console.log('🔧 System Hub API v0.2.2 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: {}
|
|
});
|
|
|
|
var callGetComponentsByCategory = rpc.declare({
|
|
object: 'luci.system-hub',
|
|
method: 'get_components_by_category',
|
|
params: ['category'],
|
|
expect: {}
|
|
});
|
|
|
|
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
|
|
});
|