mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
core nodes info updates
This commit is contained in:
parent
7d95f621df
commit
7610b9a975
@ -157,11 +157,11 @@
|
||||
</style>
|
||||
<script type="text/x-red" data-help-name="inject">
|
||||
<p>Pressing the button on the left side of the node allows a message on a topic
|
||||
to be injected into the flow. This is mainly for test purposes.</p>
|
||||
to be injected into the flow.</p>
|
||||
<p>The payload defaults to the current time in millisecs since 1970, but can
|
||||
also be set to a String or left blank.</p>
|
||||
also be set to various other javascript types.</p>
|
||||
<p>The repeat function allows the payload to be sent on the required schedule.</p>
|
||||
<p>The <i>Fire once at start</i> option actually waits a short interval before firing
|
||||
<p>The <i>Inject once at start</i> option actually waits a short interval before firing
|
||||
to give other nodes a chance to instantiate properly.</p>
|
||||
<p><b>Note: </b>"Interval between times" and "at a specific time" uses cron.
|
||||
This means that 20 minutes will be at the next hour, 20 minutes past and
|
||||
|
@ -39,13 +39,14 @@
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="debug">
|
||||
<p>The Debug node can be connected to the output of any node. It can be used to display the output of any message property in the debug tab of the sidebar. The default is to display <b>msg.payload</b>.</p>
|
||||
<p>Each message will also display the timestamp, <b>msg.topic</b> and the property chosen to output.</p>
|
||||
<p>The Debug node can be connected to the output of any node. It can be used to display the output of any message
|
||||
property in the debug tab of the sidebar. The default is to display <code>msg.payload</code>.</p>
|
||||
<p>Each message will also display the timestamp, <code>msg.topic</code> and the type of property chosen to output.</p>
|
||||
<p>The sidebar can be accessed under the options drop-down in the top right corner.</p>
|
||||
<p>The button to the right of the node will toggle its output on and off so you can de-clutter the debug window.</p>
|
||||
<p>If the payload is an object or buffer it will be stringified first for display and indicate that by saying "(Object)" or "(Buffer)".</p>
|
||||
<p>Selecting any particular message will highlight (in red) the debug node that reported it. This is useful if you wire up multiple debug nodes.</p>
|
||||
<p>Optionally can show the complete <b>msg</b> object.</p>
|
||||
<p>Optionally can show the complete <code>msg</code> object, and send messages to the console log.</p>
|
||||
<p>In addition any calls to node.warn or node.error will appear here.</p>
|
||||
</script>
|
||||
|
||||
|
@ -44,7 +44,7 @@
|
||||
<p>Provides 3 outputs... stdout, stderr, and return code.</p>
|
||||
<p>By default uses exec() which calls the command, then gets a callback on completion, returning the complete result in one message, along with any errors.</p>
|
||||
<p>Optionally can use spawn() instead, which returns the output from stdout and stderr as the command runs (usually one line at a time). On completion it then returns a return code (on the 3rd output).</p>
|
||||
<p>The optional append gets added to the command after the <b>msg.payload</b> - so you can do things like pipe the result to another command.</p>
|
||||
<p>The optional append gets added to the command after the <code>msg.payload</code> - so you can do things like pipe the result to another command.</p>
|
||||
<p>Parameters with spaces should be enclosed in quotes - <i>"This is a single parameter"</i></p>
|
||||
<p>If stdout is binary a <i>buffer</i> is returned - otherwise returns a <i>string</i>.</p>
|
||||
<p>The blue status icon will be visible while the node is active.</p>
|
||||
|
@ -52,7 +52,8 @@
|
||||
|
||||
<script type="text/x-red" data-help-name="template">
|
||||
<p>Sets a property based on the provided template.</p>
|
||||
<p>This uses the <i><a href="http://mustache.github.io/mustache.5.html" target="_new">mustache</a></i> format.</p>
|
||||
<p>By default this uses the <i><a href="http://mustache.github.io/mustache.5.html" target="_new">mustache</a></i>
|
||||
format, but this can be switched off if required.</p>
|
||||
<p>For example, when a template of:
|
||||
<pre>Hello {{name}}. Today is {{date}}</pre>
|
||||
<p>receives a message containing:
|
||||
|
@ -14,7 +14,6 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<!-- First, the content of the edit dialog is defined. -->
|
||||
<script type="text/x-red" data-template-name="delay">
|
||||
|
||||
<div class="form-row">
|
||||
@ -74,25 +73,23 @@
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Next, some simple help text is provided for the node. -->
|
||||
<script type="text/x-red" data-help-name="delay">
|
||||
<p>Introduces a delay into a flow or rate limits messages.</p>
|
||||
<p>The default delay is 5 seconds and rate limit of 1 msg/second, but both can be configured.</p>
|
||||
<p>When set to rate limit messages, they are spread across the configured time period. It can
|
||||
also be set to discard any intermediate messages that arrive.</p>
|
||||
<p>The "topic based fair queue" adds messages to a release queue tagged by their <b>msg.topic</b> property.
|
||||
<p>The "topic based fair queue" adds messages to a release queue tagged by their <code>msg.topic</code> property.
|
||||
At each "tick", derived from the rate, the next "topic" is released.
|
||||
Any messages arriving on the same topic before release replace those in that position in the queue.
|
||||
So each "topic" gets a turn - but the most recent value is always the one sent.</p>
|
||||
</script>
|
||||
|
||||
<!-- Finally, the node type is registered along with all of its properties -->
|
||||
<script type="text/javascript">
|
||||
RED.nodes.registerType('delay',{
|
||||
category: 'function', // the palette category
|
||||
category: 'function',
|
||||
color:"#E6E0F8",
|
||||
defaults: { // defines the editable properties of the node
|
||||
name: {value:""}, // along with default values.
|
||||
defaults: {
|
||||
name: {value:""},
|
||||
pauseType: {value:"delay", required:true},
|
||||
timeout: {value:"5", required:true, validate:RED.validators.number()},
|
||||
timeoutUnits: {value:"seconds"},
|
||||
@ -103,10 +100,10 @@
|
||||
randomUnits: {value: "seconds"},
|
||||
drop: {value:false}
|
||||
},
|
||||
inputs:1, // set the number of inputs - only 0 or 1
|
||||
outputs:1, // set the number of outputs - 0 to n
|
||||
icon: "timer.png", // set the icon (held in public/icons)
|
||||
label: function() { // sets the default label contents
|
||||
inputs:1,
|
||||
outputs:1,
|
||||
icon: "timer.png",
|
||||
label: function() {
|
||||
if (this.pauseType == "delay") {
|
||||
var units = this.timeoutUnits ? this.timeoutUnits.charAt(0) : "s";
|
||||
if (this.timeoutUnits == "milliseconds") { units = "ms"; }
|
||||
@ -122,7 +119,7 @@
|
||||
return this.name || this._("delay.label.queue")+" "+this.rate+" msg/"+units;
|
||||
}
|
||||
},
|
||||
labelStyle: function() { // sets the class to apply to the label
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
},
|
||||
oneditprepare: function() {
|
||||
|
@ -66,18 +66,20 @@
|
||||
</script>
|
||||
|
||||
<script type="text/x-red" data-help-name="trigger">
|
||||
<p>Creates two messages on the output separated by a timeout whenever ANY <b>msg</b> arrives on the input.</p>
|
||||
<p>Creates two messages on the output separated by a timeout whenever <i>any</i> <code>msg</code> arrives on the input.</p>
|
||||
<p>For example, this can be used to toggle a Raspberry PI GPIO pin on and off.</p>
|
||||
<p>The two output states can be specified as can the duration of the timer.
|
||||
Either output can be set to a value, or templated from the inbound
|
||||
<b>msg</b> using mustache syntax. <pre>The payload is {{payload}}</pre></p>
|
||||
<p>If the payload is an object then setting the output to <i>existing payload</i> will pass the complete payload object through.</p>
|
||||
<code>msg</code> using mustache syntax. <pre>The payload is {{payload}}</pre></p>
|
||||
<p>If the <code>msg.payload</code> is an object then setting the output to
|
||||
<i>existing payload</i> will pass the complete payload object through.</p>
|
||||
<p>Optionally the timer can be extended by being retriggered... or not.</p>
|
||||
<p>By setting the first output to <i>nothing</i>, and selecting extend timer - a watchdog timer can be created.
|
||||
No output will happen as long as repeated inputs occur within the timeout period.</p>
|
||||
<p>Setting the timer to 0 creates an "infinite" timeout - the first output will happen but the second
|
||||
never will, and neither can the first be retriggered - so a true one shot.</p>
|
||||
<p>If a <b>msg.reset</b> property is present any timeout currently in progress
|
||||
<p>If a <code>msg.reset</code> property is present, or the <code>msg.payload</code>
|
||||
matches the optional reset value, any timeout currently in progress
|
||||
will be cleared and the second output will not happen.</p>
|
||||
<p>The blue status icon will be visible while the node is active.</p>
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user