2016-04-18 22:38:44 +02:00
|
|
|
<!DOCTYPE html>
|
2014-12-24 22:51:17 +01:00
|
|
|
|
2020-04-01 18:51:51 +02:00
|
|
|
<script type="text/html" data-template-name="daemon">
|
2014-12-24 22:51:17 +01:00
|
|
|
<div class="form-row">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-command"><i class="fa fa-file"></i><span data-i18n="daemon.label.command"></span></label>
|
|
|
|
<input type="text" id="node-input-command" data-i18n="[placeholder]daemon.label.command">
|
2014-12-24 22:51:17 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-args"><i class="fa fa-list"></i><span data-i18n="daemon.label.arguments"></span></label>
|
|
|
|
<input type="text" id="node-input-args" data-i18n="[placeholder]daemon.placeholder.arguments">
|
2014-12-24 22:51:17 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label> </label>
|
2018-08-23 09:57:15 +02:00
|
|
|
<input type="checkbox" id="node-input-autorun" style="display:inline-block; width: auto; vertical-align:baseline;">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-autorun" style="width: 70%;"><span data-i18n="daemon.label.autostart"></span></label>
|
2018-08-23 09:57:15 +02:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label> </label>
|
|
|
|
<input type="checkbox" id="node-input-cr" style="display:inline-block; width:auto; vertical-align:baseline;">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-cr" style="width: 70%;"><span data-i18n="daemon.label.addenter"></span></label>
|
2014-12-24 22:51:17 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
|
|
<label> </label>
|
2018-08-23 09:57:15 +02:00
|
|
|
<input type="checkbox" id="node-input-redo" style="display:inline-block; width:auto; vertical-align:baseline;">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-redo" style="width: 70%;"><span data-i18n="daemon.label.relaunch"></span></label>
|
2014-12-24 22:51:17 +01:00
|
|
|
</div>
|
|
|
|
<div class="form-row">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-op"><span data-i18n="daemon.label.reply"></span></label>
|
2014-12-24 22:51:17 +01:00
|
|
|
<select id="node-input-op" style='width:70%'>
|
2021-10-18 22:12:00 +02:00
|
|
|
<option value="buffer" data-i18n="[label]daemon.option.reply.buffer"></option>
|
|
|
|
<option value="string" data-i18n="[label]daemon.option.reply.string"></option>
|
|
|
|
<option value="lines" data-i18n="[label]daemon.option.reply.lines"></option>
|
|
|
|
<option value="number" data-i18n="[label]daemon.option.reply.number"></option>
|
2014-12-24 22:51:17 +01:00
|
|
|
</select>
|
|
|
|
</div>
|
2018-05-09 10:42:51 +02:00
|
|
|
<div class="form-row">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-closer"><span data-i18n="daemon.label.onclose"></span></label>
|
2018-05-09 10:42:51 +02:00
|
|
|
<select id="node-input-closer" style='width:70%'>
|
2021-10-18 22:12:00 +02:00
|
|
|
<option value="SIGKILL" data-i18n="[label]daemon.option.onclose.sigkill"></option>
|
|
|
|
<option value="SIGTERM" data-i18n="[label]daemon.option.onclose.sigterm"></option>
|
|
|
|
<option value="SIGINT" data-i18n="[label]daemon.option.onclose.sigint"></option>
|
2018-05-09 10:42:51 +02:00
|
|
|
</select>
|
|
|
|
</div>
|
2014-12-24 22:51:17 +01:00
|
|
|
<div class="form-row">
|
2021-10-18 22:12:00 +02:00
|
|
|
<label for="node-input-name"><i class="fa fa-tag"></i><span data-i18n="node-red:common.label.name"></span></label>
|
|
|
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
2014-12-24 22:51:17 +01:00
|
|
|
</div>
|
2021-10-18 22:12:00 +02:00
|
|
|
<div class="form-tips"><span data-i18n="[html]daemon.tip"></span></div>
|
2014-12-24 22:51:17 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
RED.nodes.registerType('daemon',{
|
2019-09-19 10:29:48 +02:00
|
|
|
category: 'function',
|
2014-12-24 22:51:17 +01:00
|
|
|
color:"darksalmon",
|
|
|
|
defaults: {
|
2018-05-09 10:42:51 +02:00
|
|
|
name: {value:""},
|
2014-12-24 22:51:17 +01:00
|
|
|
command: {value:"",required:true},
|
|
|
|
args: {value:""},
|
2018-08-23 09:57:15 +02:00
|
|
|
autorun: {value:true},
|
2014-12-24 22:51:17 +01:00
|
|
|
cr: {value:false},
|
|
|
|
redo: {value:true},
|
|
|
|
op: {value:"string"},
|
2018-05-09 10:42:51 +02:00
|
|
|
closer: {value:"SIGKILL"}
|
2014-12-24 22:51:17 +01:00
|
|
|
},
|
|
|
|
inputs:1,
|
|
|
|
outputs:3,
|
2019-09-19 10:29:48 +02:00
|
|
|
inputLabels: "stdin",
|
2017-01-29 18:46:50 +01:00
|
|
|
outputLabels: ["stdout","stderr","exit code"],
|
2014-12-24 22:51:17 +01:00
|
|
|
icon: "arrow-in.png",
|
|
|
|
label: function() {
|
2020-06-22 23:45:34 +02:00
|
|
|
return this.name||this.command.replace(/\\n /g,"\\\\n ")||"daemon";
|
2014-12-24 22:51:17 +01:00
|
|
|
},
|
|
|
|
labelStyle: function() {
|
|
|
|
return this.name?"node_label_italic":"";
|
2018-08-23 09:57:15 +02:00
|
|
|
},
|
|
|
|
oneditprepare: function() {
|
|
|
|
if (this.autorun === undefined) { $("#node-input-autorun").prop('checked', true); }
|
2014-12-24 22:51:17 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|