UNPKG

node-red-contrib-atcommon

Version:
69 lines (60 loc) 3.35 kB
<!-- Copyright JS Foundation and other contributors, http://js.foundation 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. --> <!-- Sample html file that corresponds to the 99-sample.js file --> <!-- This creates and configures the onscreen elements of the node --> <!-- If you use this as a template, update the copyright with your own name. --> <!-- First, the content of the edit dialog is defined. --> <!-- Next, some simple help text is provided for the node. --> <script type="text/x-red" data-help-name="atplatform"> <!-- data-help-name identifies the node type this help is for --> <!-- This content appears in the Info sidebar when a node is selected --> <!-- The first <p> is used as the pop-up tool tip when hovering over a --> <!-- node in the palette. --> <p>Platform node will output once automatically after start</p> <p>The Output is an object called <code>msg</code> containing <code>msg.payload</code> and 3 attributes of <code>msg.payload</code> are as follows</p> <p> <code>msg.payload.ModuleID</code>: Module ID<br/> <code>msg.payload.BIOSVer</code>: BIOS Version<br/> <code>msg.payload.ECVer</code>: EC Version<br/> <code>msg.payload.OSVer</code>: OS Version<br/> <code>msg.payload.CPUName</code>: CPU Model Name<br/> <code>msg.payload.MemAvail</code>: Available Memory<br/> <code>msg.payload.diskInfo</code>: Disk and partition information<br/> </p> <p>The Input format is the same with the output format</p> <p>Example:</p> <p>If you want to get BIOS version, inject a string like <code>msg.payload = {BIOSVer: true}</code></p> <p>The output string--<code>msg.payload.BIOSVer</code> is the value you get.</p> <br /> <p>In addition, it won't output once automatically after start as follows</p> <p><code>msg.payload.Comports</code>: COM Ports <br/></p> </script> <!-- Finally, the node type is registered along with all of its properties --> <!-- The example below shows a small subset of the properties that can be set--> <script type="text/javascript"> RED.nodes.registerType('atplatform',{ category: 'Advantech IIoT', // the palette category inputs:1, // set the number of inputs - only 0 or 1 outputs:1, // set the number of outputs - 0 to n // set the icon (held in icons dir below where you save the node) icon: "white-globe.png", // saved in icons/myicon.png color: "#0059aa", paletteLabel: "Platform", label: function() { // sets the default label contents return "Platform"; }, labelStyle: function() { // sets the class to apply to the label return ""; } }); </script>