UNPKG

node-red-contrib-natsstreaming

Version:
88 lines (82 loc) 3.28 kB
<script type="text/javascript"> RED.nodes.registerType('nats-streaming-publish', { category: 'NATS streaming', color: '#FDF0C2', defaults: { name: { value: "" }, server: { value: "", type: "nats-streaming-server" }, message: { value: "" }, channel: { value: "", required: true }, clientID: { value: "", required: true }, log: { value: false } }, inputs: 1, outputs: 0, icon: "nats-icon-white.png", align: 'right', label: function () { return this.name || "nats-streaming-publish"; } }); </script> <script type="text/x-red" data-template-name="nats-streaming-publish"> <div class="form-row"> <label for="node-input-name"><i class="fa fa-stack-exchange"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-server"><i class="fa fa-stack-exchange"></i> Server</label> <input type="text" id="node-input-server" placeholder="localhost"> </div> <div class="form-row"> <label for="node-input-channel"><i class="fa fa-stack-exchange"></i> Channel</label> <input type="text" id="node-input-channel" placeholder="Channel"> </div> <div class="form-row"> <label for="node-input-clientID"><i class="fa fa-stack-exchange"></i> Client ID</label> <input type="text" id="node-input-clientID" placeholder="Client ID"> </div> <div class="form-row"> <label for="node-input-message"><i class="fa fa-stack-exchange"></i> Message</label> <input type="text" id="node-input-message" placeholder="Message"> </div> <div class="form-row"> <input type="checkbox" id="node-input-log" value="Log" style="display:inline-block checked; width: auto; vertical-align: top;"> <label for="node-input-log" style="width: auto"></i> Write to log if message is puglished</label> </div> <div class="form-tips"> <span>Tip: Leav message and/or channel blank if you want to set them via msg properties</span> </div> </script> <script type="text/x-red" data-help-name="nats-streaming-publish"> <p>Publish a message to NATS Streaming server</p> <h3>Inputs</h3> <dl class="message-properties"> <dt>payload <span class="property-type">string | JSON</span> </dt> <dd> The payload of the message to publish. </dd> <dt>channel <span class="property-type">string</span> </dt> <dd> The channel the message is published to. </dd> </dl> <h3>Details</h3> <p>The payload and channel can also be set within the node itself. If a property is set within the node, it cannot be overridden by the corresponding message property.</p> </script>