mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
default stop/start feature to enabled:false
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
@@ -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})
|
||||
}
|
||||
|
Reference in New Issue
Block a user