UNPKG

node-red-contrib-axis-host

Version:

Axis Devices resource binding nodes that provides access to events, image capture and analytics data. Node-RED must be running on the Axis Device.

49 lines (43 loc) 1.46 kB
<script type="text/x-red" data-template-name="Trigger"> <div class="form-row"> <label for="node-input-eventId"><i class="icon-tag"></i> Event type</label> <select id="node-input-eventId"> <option value="event">Event</option> <option value="state">State</option> <option value="data">Data</option> </select> </div> <div class="form-row user_input_value"> <label for="node-input-value"><i class="icon-tag"></i> Value </label> <label for="node-input-value"><span id="valueType"></span></label> <input type="text" id="node-input-value" placeholder="Leave blank when msg.payload is the value."> </div> </script> <script type="text/javascript"> RED.nodes.registerType('Trigger',{ category: 'Axis', color: '#FFCC33', defaults: { eventId: { value:"event"}, value: { value: "" } }, icon: "font-awesome/fa-bolt", inputs:1, outputs:0, label: function() { return "Trigger: " + this.eventId; }, oneditprepare: function() { $("#node-input-eventId").change(function() { var type = $("#node-input-eventId").val(); if( type === "event" ) $("#valueType").html("number (int)"); if( type === "state" ) $("#valueType").html("Boolean (true/false)"); if( type === "data" ) $("#valueType").html("String (e.g. JSON)"); }); } }); </script> <script type="text/x-red" data-help-name="Trigger"> </script>