1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

let inject "between time" also fire at start - Plus new info

This commit is contained in:
Dave Conway-Jones 2017-03-24 14:01:26 +00:00
parent b1e3fc5761
commit 9928e8562a

View File

@ -150,22 +150,28 @@
}
</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.</p>
<p>The payload defaults to the current time in millisecs since 1970, but can
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>Inject once at start</i> option actually waits a short interval before firing
to give other nodes a chance to instantiate properly.</p>
<p>The <i>Flow</i> and <i>Global</i> options allow one to inject a flow or global
context value.
</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
40 minutes past - not in 20 minutes time. If you want every 20 minutes
from now - use the "interval" option.</p>
<p><b>Note: </b>all string input is escaped. To add a carriage return to a string
you should use a following function.</p>
<p>Injects a message with an optional topic into a flow by pressing the button on the left side of the node.
Several payload javascript types can be injected at various intervals into the flow.</p>
<p><b>Outputs</b></p>
<ul>
<li><code>msg.payload</code> - <i>timestamp | string | number | boolean | JSON | flow | global</i></li>
<li><code><i>msg.topic</i></code> - <i>string</i> - optional meta-data</li>
</ul>
<p><b>Details</b></p>
<p>The Inject node can initiate a flow with a specific payload value.
The default payload is a timestamp of the current time in millisecs since 1970.
Strings, numbers, JSON objects, and booleans types can be injected.
The <i>Flow</i> and <i>Global</i> options allow the user to inject a flow or global context value.</p>
<p>The repeat function allows the payload to be sent on the required schedule - <i>Once</i>, at a <i>set interval</i>,
between certain times (local time where the Node-RED process is running), or at a <i>specific interval</i>.</p>
<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>: <i>"Interval between times"</i> and <i>"at a specific time"</i> uses cron.
This means that 20 minutes will be at the next hour, 20 minutes past and 40 minutes past - not in 20 minutes time.
If you want every 20 minutes from now - use the "interval" option.</p>
<p><b>Note</b>: all string input is escaped. To add a carriage return to a string you should use a following function.</p>
</script>
<script type="text/javascript">
@ -260,7 +266,7 @@
var id = $("#inject-time-type-select").val();
$(".inject-time-row").hide();
$("#inject-time-row-"+id).show();
if ((id == "none") || (id == "interval")) {
if ((id == "none") || (id == "interval") || (id == "interval-time")) {
$("#node-once").show();
}
else {