From e623c590f006b5468663bf95847b3968b02d0541 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 28 Apr 2026 06:53:57 +0200 Subject: [PATCH] bugfix --- public/javascript/main.js | 13 ++++++++----- public/views/rbac.hbs | 14 ++++++++++++++ src/models/integratedStartMenuItems.json | 1 - src/routes/indexRoutes.js | 24 +++++++++++++----------- 4 files changed, 35 insertions(+), 17 deletions(-) create mode 100644 public/views/rbac.hbs diff --git a/public/javascript/main.js b/public/javascript/main.js index 761e244..0004488 100644 --- a/public/javascript/main.js +++ b/public/javascript/main.js @@ -138,11 +138,13 @@ function restart() { document.head.appendChild(styleTag); } +// console.log(css) styleTag.textContent = css; - - document.getElementById('start-menu-icon').src = - `../images/radix_os_${activeTheme}_img.png`; -console.log(css) + const startmenuicon = document.getElementById('start-menu-icon'); + if(!startmenuicon) { + return true; + } + startmenuicon.src = `../images/radix_os_${activeTheme}_img.png`; return true; } @@ -784,7 +786,8 @@ function positionTooltip(e) { const offset = 20; let x = e.clientX + offset; let y = e.clientY + offset; - + + const rect = tooltip.getBoundingClientRect(); if (x + rect.width > window.innerWidth) { diff --git a/public/views/rbac.hbs b/public/views/rbac.hbs new file mode 100644 index 0000000..05f4999 --- /dev/null +++ b/public/views/rbac.hbs @@ -0,0 +1,14 @@ + + + + + + Role Based Access Control + + +
+
+
+
+ + \ No newline at end of file diff --git a/src/models/integratedStartMenuItems.json b/src/models/integratedStartMenuItems.json index d10d140..9e1a03d 100644 --- a/src/models/integratedStartMenuItems.json +++ b/src/models/integratedStartMenuItems.json @@ -41,7 +41,6 @@ "height": "600px" }, "icon": "app.png", - "license": "rbac", "permissions": [ { "scope": "SYSTEM", diff --git a/src/routes/indexRoutes.js b/src/routes/indexRoutes.js index 3fbc4e2..82d0f23 100644 --- a/src/routes/indexRoutes.js +++ b/src/routes/indexRoutes.js @@ -18,20 +18,20 @@ module.exports = { app.post('/api/open_app', (req, res) => { - const { name, view, viewLabel, location, size, state, zIndex } = req.body; + const { name, view, viewLabel, location, size, state, zIndex } = req.body; - const pluginPath = path.join(global.path.plugins, name, 'plugin.json'); + const pluginPath = path.join(global.path.plugins, name, 'plugin.json'); - let context = fs.existsSync(pluginPath) - ? service.get('fileSystemManager').loadJSON(pluginPath) - : (JSON.parse(JSON.stringify(global.json.startMenuItems.live))).find(item => item.name == name); + let context = fs.existsSync(pluginPath) + ? service.get('fileSystemManager').loadJSON(pluginPath) + : (JSON.parse(JSON.stringify(global.json.startMenuItems.live))).find(item => item.name == name); - context.defaultSize = - context.menu.items.find(item => item.label == viewLabel)?.defaultSize || - { width: 800, height: 600 }; + context.defaultSize = + context.menu.items.find(item => item.label == viewLabel)?.defaultSize || + { width: 800, height: 600 }; - delete context.config; - res.json({ name, view, viewLabel, context, location, size, state, zIndex }); + delete context.config; + res.json({ name, view, viewLabel, context, location, size, state, zIndex }); }); @@ -66,7 +66,9 @@ module.exports = { - + app.post('/window/Server/rbac', async (req, res) => { + await renderWindow(app, 'rbac.hbs', { }, { }, res) + }); app.post('/window/EventLog/eventlog', async (req, res) => { await renderWindow(app, 'eventlog.hbs', { }, { }, res)