Daemon - allow manual start rather than always auto

to close #479
This commit is contained in:
Dave Conway-Jones 2018-08-23 08:57:15 +01:00
parent 6d36f5db8a
commit c59c05c693
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
3 changed files with 14 additions and 3 deletions

View File

@ -11,12 +11,17 @@
</div>
<div class="form-row">
<label>&nbsp;</label>
<input type="checkbox" id="node-input-cr" style="display: inline-block; width: auto; vertical-align: top;">
<input type="checkbox" id="node-input-autorun" style="display:inline-block; width: auto; vertical-align:baseline;">
<label for="node-input-autorun" style="width: 70%;">Auto-start daemon on deploy ?</label>
</div>
<div class="form-row">
<label>&nbsp;</label>
<input type="checkbox" id="node-input-cr" style="display:inline-block; width:auto; vertical-align:baseline;">
<label for="node-input-cr" style="width: 70%;">Add [enter] to every message sent ?</label>
</div>
<div class="form-row">
<label>&nbsp;</label>
<input type="checkbox" id="node-input-redo" style="display: inline-block; width: auto; vertical-align: top;">
<input type="checkbox" id="node-input-redo" style="display:inline-block; width:auto; vertical-align:baseline;">
<label for="node-input-redo" style="width: 70%;">Relaunch command on exit or error ?</label>
</div>
<div class="form-row">
@ -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); }
}
});
</script>

View File

@ -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) {

View File

@ -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" : {
},