From c59c05c693790994b12b92ae0ec5862398cdb50c Mon Sep 17 00:00:00 2001 From: Dave Conway-Jones Date: Thu, 23 Aug 2018 08:57:15 +0100 Subject: [PATCH] Daemon - allow manual start rather than always auto to close #479 --- utility/daemon/daemon.html | 13 +++++++++++-- utility/daemon/daemon.js | 2 ++ utility/daemon/package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/utility/daemon/daemon.html b/utility/daemon/daemon.html index 58bf99f6..bdd5f28d 100644 --- a/utility/daemon/daemon.html +++ b/utility/daemon/daemon.html @@ -11,12 +11,17 @@
- + + +
+
+ +
- +
@@ -62,6 +67,7 @@ name: {value:""}, command: {value:"",required:true}, args: {value:""}, + autorun: {value:true}, cr: {value:false}, redo: {value:true}, op: {value:"string"}, @@ -77,6 +83,9 @@ }, labelStyle: function() { return this.name?"node_label_italic":""; + }, + oneditprepare: function() { + if (this.autorun === undefined) { $("#node-input-autorun").prop('checked', true); } } }); diff --git a/utility/daemon/daemon.js b/utility/daemon/daemon.js index 07e49709..97568c7d 100644 --- a/utility/daemon/daemon.js +++ b/utility/daemon/daemon.js @@ -12,6 +12,8 @@ module.exports = function(RED) { this.redo = n.redo; this.running = false; this.closer = n.closer || "SIGKILL"; + this.autorun = true; + if (n.autorun === false) { this.autorun = false; } var node = this; function inputlistener(msg) { diff --git a/utility/daemon/package.json b/utility/daemon/package.json index faeb72bd..a45c56c0 100644 --- a/utility/daemon/package.json +++ b/utility/daemon/package.json @@ -1,6 +1,6 @@ { "name" : "node-red-node-daemon", - "version" : "0.0.21", + "version" : "0.0.22", "description" : "A Node-RED node that runs and monitors a long running system command.", "dependencies" : { },