From 34f980312fbdf5ff02e734a1cf0490ba70de50b2 Mon Sep 17 00:00:00 2001 From: CyberMind-FR Date: Fri, 26 Dec 2025 17:13:53 +0100 Subject: [PATCH] fix: system-hub components - Add getTheme() and update ACL MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed two issues preventing components page from loading: 1. Added getTheme() method to theme.js - components.js was calling Theme.getTheme() which didn't exist - Added method to return theme data from SecuBox 2. Updated ACL to grant access to new methods - Added get_components and get_components_by_category to read permissions - Added luci.secubox methods (modules, modules_by_category, get_theme) - Resolves "Access denied" error (-32002) This fixes the "Theme.getTheme is not a function" and "Access denied" errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .../htdocs/luci-static/resources/system-hub/theme.js | 8 ++++++++ .../root/usr/share/rpcd/acl.d/luci-app-system-hub.json | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/luci-app-system-hub/htdocs/luci-static/resources/system-hub/theme.js b/luci-app-system-hub/htdocs/luci-static/resources/system-hub/theme.js index f0ce7622..ad274089 100644 --- a/luci-app-system-hub/htdocs/luci-static/resources/system-hub/theme.js +++ b/luci-app-system-hub/htdocs/luci-static/resources/system-hub/theme.js @@ -66,5 +66,13 @@ return baseclass.extend({ */ getCurrentTheme: function() { return document.documentElement.getAttribute('data-theme') || 'dark'; + }, + + /** + * Get theme preference from SecuBox + * @returns {Promise} Promise resolving to theme data + */ + getTheme: function() { + return callGetTheme(); } }); diff --git a/luci-app-system-hub/root/usr/share/rpcd/acl.d/luci-app-system-hub.json b/luci-app-system-hub/root/usr/share/rpcd/acl.d/luci-app-system-hub.json index 7fc7e77c..5dd693d5 100644 --- a/luci-app-system-hub/root/usr/share/rpcd/acl.d/luci-app-system-hub.json +++ b/luci-app-system-hub/root/usr/share/rpcd/acl.d/luci-app-system-hub.json @@ -7,10 +7,17 @@ "status", "get_system_info", "get_health", + "get_components", + "get_components_by_category", "list_services", "get_logs", "get_storage", "get_settings" + ], + "luci.secubox": [ + "modules", + "modules_by_category", + "get_theme" ] } },