1
0
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:
Dave Conway-Jones 2016-02-12 13:15:05 +00:00
parent 7d95f621df
commit 7610b9a975
6 changed files with 25 additions and 24 deletions

View File

@ -157,11 +157,11 @@
</style> </style>
<script type="text/x-red" data-help-name="inject"> <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 <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 <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 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> to give other nodes a chance to instantiate properly.</p>
<p><b>Note: </b>"Interval between times" and "at a specific time" uses cron. <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 This means that 20 minutes will be at the next hour, 20 minutes past and

View File

@ -39,13 +39,14 @@
</script> </script>
<script type="text/x-red" data-help-name="debug"> <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>The Debug node can be connected to the output of any node. It can be used to display the output of any message
<p>Each message will also display the timestamp, <b>msg.topic</b> and the property chosen to output.</p> 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 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>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>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>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> <p>In addition any calls to node.warn or node.error will appear here.</p>
</script> </script>

View File

@ -44,7 +44,7 @@
<p>Provides 3 outputs... stdout, stderr, and return code.</p> <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>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>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>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>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> <p>The blue status icon will be visible while the node is active.</p>

View File

@ -52,7 +52,8 @@
<script type="text/x-red" data-help-name="template"> <script type="text/x-red" data-help-name="template">
<p>Sets a property based on the provided template.</p> <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: <p>For example, when a template of:
<pre>Hello {{name}}. Today is {{date}}</pre> <pre>Hello {{name}}. Today is {{date}}</pre>
<p>receives a message containing: <p>receives a message containing:

View File

@ -14,7 +14,6 @@
limitations under the License. limitations under the License.
--> -->
<!-- First, the content of the edit dialog is defined. -->
<script type="text/x-red" data-template-name="delay"> <script type="text/x-red" data-template-name="delay">
<div class="form-row"> <div class="form-row">
@ -74,25 +73,23 @@
</script> </script>
<!-- Next, some simple help text is provided for the node. -->
<script type="text/x-red" data-help-name="delay"> <script type="text/x-red" data-help-name="delay">
<p>Introduces a delay into a flow or rate limits messages.</p> <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>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 <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> 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. 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. 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> So each "topic" gets a turn - but the most recent value is always the one sent.</p>
</script> </script>
<!-- Finally, the node type is registered along with all of its properties -->
<script type="text/javascript"> <script type="text/javascript">
RED.nodes.registerType('delay',{ RED.nodes.registerType('delay',{
category: 'function', // the palette category category: 'function',
color:"#E6E0F8", color:"#E6E0F8",
defaults: { // defines the editable properties of the node defaults: {
name: {value:""}, // along with default values. name: {value:""},
pauseType: {value:"delay", required:true}, pauseType: {value:"delay", required:true},
timeout: {value:"5", required:true, validate:RED.validators.number()}, timeout: {value:"5", required:true, validate:RED.validators.number()},
timeoutUnits: {value:"seconds"}, timeoutUnits: {value:"seconds"},
@ -103,10 +100,10 @@
randomUnits: {value: "seconds"}, randomUnits: {value: "seconds"},
drop: {value:false} drop: {value:false}
}, },
inputs:1, // set the number of inputs - only 0 or 1 inputs:1,
outputs:1, // set the number of outputs - 0 to n outputs:1,
icon: "timer.png", // set the icon (held in public/icons) icon: "timer.png",
label: function() { // sets the default label contents label: function() {
if (this.pauseType == "delay") { if (this.pauseType == "delay") {
var units = this.timeoutUnits ? this.timeoutUnits.charAt(0) : "s"; var units = this.timeoutUnits ? this.timeoutUnits.charAt(0) : "s";
if (this.timeoutUnits == "milliseconds") { units = "ms"; } if (this.timeoutUnits == "milliseconds") { units = "ms"; }
@ -122,7 +119,7 @@
return this.name || this._("delay.label.queue")+" "+this.rate+" msg/"+units; 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":""; return this.name?"node_label_italic":"";
}, },
oneditprepare: function() { oneditprepare: function() {

View File

@ -66,18 +66,20 @@
</script> </script>
<script type="text/x-red" data-help-name="trigger"> <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>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. <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 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> <code>msg</code> 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> <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>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. <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> 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 <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> 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> 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> <p>The blue status icon will be visible while the node is active.</p>
</script> </script>