UNPKG

node-red-contrib-sitx

Version:

Node-RED Nodes for sending & receiving Cursor on Target TAK Data with PAR Sit(x).

117 lines (100 loc) 3.63 kB
<!-- Author:: Greg Albrecht <gba@snstac.com> Copyright:: Copyright 2023 Sensors & Signals LLC License:: Apache License, Version 2.0 Source:: https://github.com/snstac/node-red-contrib-sitx --> <script type="text/x-red" data-template-name="sitx_config"> <div class="form-row"> <label for="node-config-input-accessKeyID"><i class="icon-bookmark"></i> Access Key ID</label> <input type="text" id="node-config-input-accessKeyID"> </div> <div class="form-row"> <label for="node-config-input-secretKey"><i class="icon-bookmark"></i> Secret Key</label> <input type="text" id="node-config-input-secretKey"> </div> <div class="form-row"> <label for="node-config-input-subdomain"><i class="icon-bookmark"></i> Subdomain</label> <input type="text" id="node-config-input-subdomain"> </div> <div class="form-row"> <label for="node-config-input-scope"><i class="icon-bookmark"></i> Scope</label> <input type="text" id="node-config-input-scope"> </div> <div class="form-row"> <label for="node-config-input-group"><i class="icon-bookmark"></i> Group</label> <input type="text" id="node-config-input-group"> </div> <div class="form-row"> <label for="node-config-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-config-input-name" placeholder="Name"> </div> </script> <script type="text/x-red" data-help-name="sitx_config"> <p>Authentication for PAR Sit(x) Bridge Adaptor API.</p> <p>Requires a Access Key ID, Secret Key, Subdomain, Group & Authorized Scope.</p> <p><a href="https://github.com/snstac/node-red-contrib-sitx">More info.</a></p> </script> <script type="text/x-red" data-template-name="Sit(x) Node"> <div class="form-row"> <label for="node-input-name"><i class="icon-tag"></i> Name</label> <input type="text" id="node-input-name" placeholder="Name"> </div> <div class="form-row"> <label for="node-input-sitx_config"><i class="icon-tag"></i> Config</label> <input type="text" id="node-input-sitx_config"> </div> </script> <script type="text/x-red" data-help-name="Sit(x) Node"> <p>PAR Sit(x) Node. Sends & receives Cursor on Target events from the Sit(x) Websocket.</p> <p><a href="https://github.com/snstac/node-red-contrib-sitx">More info.</a></p> </script> <script type="text/javascript"> const nodeCategory = 'network'; const nodeColor = '#2FC726'; const nodeIcon = 'sitx.png'; // eslint-disable-next-line no-undef RED.nodes.registerType('sitx_config', { category: 'config', color: nodeColor, icon: nodeIcon, labelStyle: function () { return this.name ? 'node_label_italic' : ''; }, defaults: { name: { value: '', required: false }, }, credentials: { accessKeyID: { type: 'text' }, secretKey: { type: 'text' }, scope: { type: 'text' }, subdomain: { type: 'text' }, group: { type: 'text' }, }, label: function () { if (this.name) { return this.name; } }, }); // eslint-disable-next-line no-undef RED.nodes.registerType('Sit(x) Node', { category: nodeCategory, color: nodeColor, icon: nodeIcon, labelStyle: function () { return this.name ? 'node_label_italic' : ''; }, defaults: { name: { value: '' }, sitx_config: { value: '', type: 'sitx_config' }, }, inputs: 1, outputs: 1, label: function () { // eslint-disable-next-line no-undef let levelNode = RED.nodes.node(this.sitx_config); return this.name || (levelNode ? levelNode.label() : 'Sit(x)'); }, }); </script>