mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
81 lines
3.3 KiB
HTML
81 lines
3.3 KiB
HTML
|
<!--
|
||
|
Copyright 2014 IBM Corp.
|
||
|
|
||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
you may not use this file except in compliance with the License.
|
||
|
You may obtain a copy of the License at
|
||
|
|
||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||
|
|
||
|
Unless required by applicable law or agreed to in writing, software
|
||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
See the License for the specific language governing permissions and
|
||
|
limitations under the License.
|
||
|
-->
|
||
|
|
||
|
<script type="text/x-red" data-template-name="daemon">
|
||
|
<div class="form-row">
|
||
|
<label for="node-input-command"><i class="fa fa-file"></i> Command</label>
|
||
|
<input type="text" id="node-input-command" placeholder="command">
|
||
|
</div>
|
||
|
<div class="form-row">
|
||
|
<label for="node-input-args"><i class="fa fa-list"></i> Args</label>
|
||
|
<input type="text" id="node-input-args" placeholder="space separated arguments">
|
||
|
</div>
|
||
|
<div class="form-row">
|
||
|
<label> </label>
|
||
|
<input type="checkbox" id="node-input-cr" style="display: inline-block; width: auto; vertical-align: top;">
|
||
|
<label for="node-input-cr" style="width: 70%;">Add [enter] to every message ?</label>
|
||
|
</div>
|
||
|
<div class="form-row">
|
||
|
<label> </label>
|
||
|
<input type="checkbox" id="node-input-redo" style="display: inline-block; width: auto; vertical-align: top;">
|
||
|
<label for="node-input-redo" style="width: 70%;">Relaunch command on exit or error ?</label>
|
||
|
</div>
|
||
|
<div class="form-row">
|
||
|
<label for="node-input-op"> and</label>
|
||
|
<select id="node-input-op" style='width:70%'>
|
||
|
<option value="string">format reply as a string</option>
|
||
|
<option value="buffer">leave reply as a buffer</option>
|
||
|
<option value="number">try to convert reply to a number</option>
|
||
|
</select>
|
||
|
</div>
|
||
|
<div class="form-row">
|
||
|
<label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
|
||
|
<input type="text" id="node-input-name" placeholder="Name">
|
||
|
</div>
|
||
|
</script>
|
||
|
|
||
|
<script type="text/x-red" data-help-name="daemon">
|
||
|
<p>Calls out to a long running system command. Sends <b>msg.payload</b> to stdin of the process.</p>
|
||
|
<p>Provides 3 outputs... stdout, stderr, and return code , from the running command.</p>
|
||
|
<p>If the called program stops (i.e. a return code is produced), this node can attempt to restart the command.</p>
|
||
|
<p><b>Note :</b> when you stop Node-RED running we may not get a chance to kill the called program so it may remain running. You <i>may</i> have to kill it manually.</p>
|
||
|
</script>
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
RED.nodes.registerType('daemon',{
|
||
|
category: 'advanced-function',
|
||
|
color:"darksalmon",
|
||
|
defaults: {
|
||
|
command: {value:"",required:true},
|
||
|
args: {value:""},
|
||
|
cr: {value:false},
|
||
|
redo: {value:true},
|
||
|
op: {value:"string"},
|
||
|
name: {value:""}
|
||
|
},
|
||
|
inputs:1,
|
||
|
outputs:3,
|
||
|
icon: "arrow-in.png",
|
||
|
align: "right",
|
||
|
label: function() {
|
||
|
return this.name||this.command;
|
||
|
},
|
||
|
labelStyle: function() {
|
||
|
return this.name?"node_label_italic":"";
|
||
|
}
|
||
|
});
|
||
|
</script>
|