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:
@@ -310,7 +310,7 @@ var api = module.exports = {
|
||||
}
|
||||
}
|
||||
|
||||
if(runtime.settings.runtimeState ? runtime.settings.runtimeState.enabled === false : false) {
|
||||
if(!runtime.settings.runtimeState || runtime.settings.runtimeState.enabled !== true) {
|
||||
throw (makeError("Method Not Allowed", "not_allowed", 405))
|
||||
}
|
||||
switch (opts.requestedState) {
|
||||
|
@@ -153,11 +153,11 @@ var api = module.exports = {
|
||||
}
|
||||
|
||||
safeSettings.runtimeState = {
|
||||
//unless runtimeState.ui and runtimeState.enabled are explicitly false, they will default to true.
|
||||
enabled: (runtime.settings.runtimeState && runtime.settings.runtimeState.enabled === false) ? false : true,
|
||||
ui: (runtime.settings.runtimeState && runtime.settings.runtimeState.ui === false) ? false : true
|
||||
//unless runtimeState.ui and runtimeState.enabled are explicitly true, they will default to false.
|
||||
enabled: !!runtime.settings.runtimeState && runtime.settings.runtimeState.enabled === true,
|
||||
ui: !!runtime.settings.runtimeState && runtime.settings.runtimeState.ui === true
|
||||
}
|
||||
if(safeSettings.runtimeState.enabled === false) {
|
||||
if(safeSettings.runtimeState.enabled !== true) {
|
||||
safeSettings.runtimeState.ui = false; // cannot have UI without endpoint
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user