-
Notifications
You must be signed in to change notification settings - Fork 594
/
daemon.html
80 lines (78 loc) · 3.77 KB
/
daemon.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<script type="text/html" data-template-name="daemon">
<div class="form-row">
<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">
</div>
<div class="form-row">
<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">
</div>
<div class="form-row">
<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">
</div>
<div class="form-row">
<label> </label>
<input type="checkbox" id="node-input-autorun" style="display:inline-block; width: auto; vertical-align:baseline;">
<label for="node-input-autorun" style="width: 70%;"><span data-i18n="daemon.label.autostart"></span></label>
</div>
<div class="form-row">
<label> </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%;"><span data-i18n="daemon.label.addenter"></span></label>
</div>
<div class="form-row">
<label> </label>
<input type="checkbox" id="node-input-redo" style="display:inline-block; width:auto; vertical-align:baseline;">
<label for="node-input-redo" style="width: 70%;"><span data-i18n="daemon.label.relaunch"></span></label>
</div>
<div class="form-row">
<label for="node-input-op"><span data-i18n="daemon.label.reply"></span></label>
<select id="node-input-op" style='width:70%'>
<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>
</select>
</div>
<div class="form-row">
<label for="node-input-closer"><span data-i18n="daemon.label.onclose"></span></label>
<select id="node-input-closer" style='width:70%'>
<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>
</select>
</div>
<div class="form-tips"><span data-i18n="[html]daemon.tip"></span></div>
</script>
<script type="text/javascript">
RED.nodes.registerType('daemon',{
category: 'function',
color:"darksalmon",
defaults: {
name: {value:""},
command: {value:"",required:true},
args: {value:""},
autorun: {value:true},
cr: {value:false},
redo: {value:true},
op: {value:"string"},
closer: {value:"SIGKILL"}
},
inputs:1,
outputs:3,
inputLabels: "stdin",
outputLabels: ["stdout","stderr","exit code"],
icon: "arrow-in.png",
label: function() {
return this.name||this.command.replace(/\\n /g,"\\\\n ")||"daemon";
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
if (this.autorun === undefined) { $("#node-input-autorun").prop('checked', true); }
}
});
</script>