UNPKG

node-red-contrib-kolibri

Version:

Node-RED nodes for connecting to a Kolibri Broker (e.g. HMS Hub)

65 lines (60 loc) 2.28 kB
<script type="text/javascript"> (function () { 'use strict'; /* * Copyright 2021 HMS Industrial Networks AB * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http: //www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ RED.nodes.registerType('kolibri-out', { category: 'network', defaults: { name: { value: '' }, path: { value: '', required: true }, broker: { value: '', type: 'kolibri-broker', required: true } }, inputs: 1, outputs: 0, color: '#ffaaaa', icon: 'bridge.png', align: 'right', label: function () { return this.name || this.path || 'kolibri'; }, labelStyle: function () { return this.name ? 'node_label_italic' : ''; } }); })(); </script> <!-- Kolibri output node --> <script type="text/html" data-template-name="kolibri-out"> <div class="form-row"> <label for="node-input-broker"><i class="fa fa-globe"></i> Kolibri broker</span></label> <input type="text" id="node-input-broker"> </div> <div class="form-row"> <label for="node-input-path"><i class="fa fa-tasks"></i> Data point path</label> <input type="text" id="node-input-path" placeholder="Path"> </div> <br/> <!-- By convention, most nodes have a 'name' property. The following div --> <!-- provides the necessary field. Should always be the last option --> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> </script> <script type="text/html" data-help-name="kolibri-out"> <p>Connects to the specified Kolibri broker and writes to the specified data point.</p> </script>