From 63c1be323963a393776bb16291a698419f6ce182 Mon Sep 17 00:00:00 2001 From: Ben Loh Date: Wed, 19 Jan 2022 10:47:11 -0800 Subject: [PATCH 01/54] export: Fix node header key typo. `Notes` header was not being exported poroperly. --- build/app/view/netcreate/export-logic.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/app/view/netcreate/export-logic.js b/build/app/view/netcreate/export-logic.js index 12a6efb03..b775dd9cf 100644 --- a/build/app/view/netcreate/export-logic.js +++ b/build/app/view/netcreate/export-logic.js @@ -35,7 +35,7 @@ const NODEKEY_LABELS = { 'label': 'Label', 'attributes:Node_Type': 'Attributes:Node_Type', 'attributes:Extra Info': 'Attributes:Extra Info', - 'attributes:Nodes': 'Attributes:Notes', + 'attributes:Notes': 'Attributes:Notes', 'degrees': 'Degrees', 'meta:created': 'Meta:Created', 'meta:updated': 'Meta:Updated' From 69a181ed4b9536cc9d98b28d26ebbb35961e7f81 Mon Sep 17 00:00:00 2001 From: Ben Loh Date: Mon, 24 Jan 2022 10:17:50 -0800 Subject: [PATCH 02/54] toml: Add `IsAdmin` to settings so NodeSelector and More can use it to hide/enable features. --- build/app/settings.js | 6 ++++++ build/app/view/netcreate/components/NodeSelector.jsx | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/build/app/settings.js b/build/app/settings.js index 49e56d607..3576ef4f2 100644 --- a/build/app/settings.js +++ b/build/app/settings.js @@ -63,6 +63,12 @@ let RELOAD_TIMER = null; /*/ MOD.CurrentTime = () => { return DATE.toDateString(); }; +/// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +/*/ +/*/ MOD.IsAdmin = () => { + return (MOD.EJSProp('client').ip === '127.0.0.1') || + location.href.includes('admin=true'); + } /// SERVER-PROVIDED PROPERTIES //////////////////////////////////////////////// /// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/app/view/netcreate/components/NodeSelector.jsx b/build/app/view/netcreate/components/NodeSelector.jsx index 3c26815f7..eb07fff87 100644 --- a/build/app/view/netcreate/components/NodeSelector.jsx +++ b/build/app/view/netcreate/components/NodeSelector.jsx @@ -132,7 +132,7 @@ const SETTINGS = require('settings'); const thisIdentifier = 'nodeSelector'; // SELECTION identifier -const isLocalHost = (SETTINGS.EJSProp('client').ip === '127.0.0.1') || (location.href.includes('admin=true')); +const isAdmin = SETTINGS.IsAdmin(); var UDATA = null; @@ -1045,8 +1045,8 @@ class NodeSelector extends UNISYS.Component {