diff --git a/docs/docs/meshcentral/config.md b/docs/docs/meshcentral/config.md index 9c2aebe4..95e43249 100644 --- a/docs/docs/meshcentral/config.md +++ b/docs/docs/meshcentral/config.md @@ -1642,6 +1642,11 @@ See description for information about each item. "type": "object", "description": "LDAP options passed to ldapauth-fork" }, + "hidePowerState": { + "type": "boolean", + "default": false, + "description": "When enabled, this will hide the power state table in the web ui" + }, "agentInviteCodes": { "type": "boolean", "default": false, diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 571cffd6..93560b1f 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -1640,6 +1640,11 @@ "type": "object", "description": "LDAP options passed to ldapauth-fork" }, + "hidePowerState": { + "type": "boolean", + "default": false, + "description": "When enabled, this will hide the power state table in the web ui" + }, "agentInviteCodes": { "type": "boolean", "default": false, diff --git a/sample-config-advanced.json b/sample-config-advanced.json index 556ade53..0b9a92c7 100644 --- a/sample-config-advanced.json +++ b/sample-config-advanced.json @@ -189,6 +189,7 @@ "_agentKey": [ "abc", "123" ], "_ipkvm": false, "minify": true, + "_hidePowerState": true, "_newAccounts": true, "_newAccountsUserGroups": [ "ugrp//xxxxxxxxxxxxxxxxx" ], "_userNameIsEmail": true, diff --git a/views/default.handlebars b/views/default.handlebars index 6e4ac0b0..f33a23ee 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -8315,7 +8315,10 @@ // Add the language and timezone of the browser to the server so the server can localize the time correctly. var tz = ''; try { tz = '&tz=' + encodeURIComponentEx(Intl.DateTimeFormat().resolvedOptions().timeZone); } catch (ex) {} - QH('p10html2', '' + x + '
' + "Day" + '' + "7 Day Power State" + '
'); + const hidePowerState = {{{hidePowerState}}}; + if(!hidePowerState){ + QH('p10html2', '' + x + '
' + "Day" + '' + "7 Day Power State" + '
'); + } } // Return a color for the given power state diff --git a/webserver.js b/webserver.js index 3bb9e851..f40459ae 100644 --- a/webserver.js +++ b/webserver.js @@ -3104,7 +3104,8 @@ module.exports.CreateWebServer = function (parent, db, args, certificates, doneF amtscanoptions: amtscanoptions, pluginHandler: (parent.pluginHandler == null) ? 'null' : parent.pluginHandler.prepExports(), webRelayPort: ((args.relaydns != null) ? ((typeof args.aliasport == 'number') ? args.aliasport : args.port) : ((parent.webrelayserver != null) ? ((typeof args.relayaliasport == 'number') ? args.relayaliasport : parent.webrelayserver.port) : 0)), - webRelayDns: ((args.relaydns != null) ? args.relaydns[0] : '') + webRelayDns: ((args.relaydns != null) ? args.relaydns[0] : ''), + hidePowerState: (domain.hidepowerstate ? 'true' : 'false') }, dbGetFunc.req, domain), user); } xdbGetFunc.req = req;