default stop/start feature to enabled:false

This commit is contained in:
Steve-Mcl
2022-06-27 18:06:53 +01:00
parent 2f1f587c50
commit 51baed4932
6 changed files with 16 additions and 16 deletions

View File

@@ -1,12 +1,12 @@
RED.runtime = (function() {
let state = ""
let settings = {ui: true, enabled: true};
let settings = {ui: false, enabled: false};
const STOPPED = "stopped"
const STARTED = "started"
return {
init: function() {
// refresh the current runtime status from server
settings = RED.settings.runtimeState;
settings = Object.assign({}, settings, RED.settings.runtimeState);
RED.runtime.requestState()
// {id:"flows-run-state", started: false, state: "stopped", retain:true}
@@ -29,7 +29,7 @@ RED.runtime = (function() {
// disable pointer events on node buttons (e.g. inject/debug nodes)
$(".red-ui-flow-node-button").toggleClass("red-ui-flow-node-button-stopped", state === STOPPED)
// show/hide Start/Stop based on current state
if(!RED.settings.runtimeState || RED.settings.runtimeState.ui !== false) {
if(settings.enabled === true && settings.ui === true) {
RED.menu.setVisible("deploymenu-item-runtime-stop", state === STARTED)
RED.menu.setVisible("deploymenu-item-runtime-start", state === STOPPED)
}

View File

@@ -69,7 +69,7 @@ RED.deploy = (function() {
{id:"deploymenu-item-node",toggle:"deploy-type",icon:"red/images/deploy-nodes.svg",label:RED._("deploy.modifiedNodes"),sublabel:RED._("deploy.modifiedNodesDesc"),onselect:function(s) { if(s){changeDeploymentType("nodes")}}},
null
]
if(!RED.settings.runtimeState || RED.settings.runtimeState.ui !== false) {
if(RED.settings.runtimeState && RED.settings.runtimeState.ui === true) {
mainMenuItems.push({id:"deploymenu-item-runtime-start", icon:"red/images/start.svg",label:"Start"/*RED._("deploy.startFlows")*/,sublabel:"Start Flows" /*RED._("deploy.startFlowsDesc")*/,onselect:"core:start-flows", visible:false})
mainMenuItems.push({id:"deploymenu-item-runtime-stop", icon:"red/images/stop.svg",label:"Stop"/*RED._("deploy.startFlows")*/,sublabel:"Stop Flows" /*RED._("deploy.startFlowsDesc")*/,onselect:"core:stop-flows", visible:false})
}