UNPKG

node-red-contrib-self-healing

Version:
92 lines (88 loc) 2.55 kB
<script type="text/javascript"> RED.nodes.registerType("checkpoint", { category: "SHEN", color: "#74b9ff", defaults: { name: { value: "" }, ttl: { value: 3600 }, }, inputs: 1, outputs: 1, inputLabels: "InCommand", outputLabels: ["OutCommand"], icon: "status.png", label: function () { return this.name || "checkpoint"; }, }); </script> <script type="text/html" data-template-name="checkpoint"> <div class="form-row"> <br /> <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" id="minchangeCtrl"> <label for="node-input-ttl" style="width:80%;"> <i class="icon-tag"></i> Checkpoint's time to live (in seconds): </label> <input type="number" id="node-input-ttl" placeholder="3600" min="0" step="1" /> </div> </script> <script type="text/html" data-help-name="checkpoint"> <p>A node that saves messages sent to an actuator and resends on restart.</p> <h3>Details</h3> <p> This node can be placed between a node that is sending a message do another node, in order to store the last message that is sent. Every message is immediatelly redirected to the destination node as soon as it's received by the checkpoint node. When there's a restart, the checkpoint will resend the last message if it's within a specified time to live. </p> <h3>Setup</h3> <p> In order for the checkpoint node to work properly, local context storage must be set in your .node-red folder, by adding the following: <dl> <pre> contextStorage: { default: "memoryOnly", memoryOnly: { module: 'memory' }, file: { module: 'localfilesystem' }, }, </dl> </p> <h3>Properties</h3> <dl class="message-properties"> <dt>name<span class="property-type">string</span></dt> <dd>name of node to be displayed in editor</dd> <dt>ttl<span class="property-type">integer</span></dt> <dd>last message's time to live, in seconds</dd> </dl> <h3>Inputs</h3> <dl class="message-properties"> <p>Any type of message</p> </dl> <h3>Outputs</h3> <dl class="message-properties"> <p>Equal to the last message sent as input </p> </dl> </script>