UNPKG

@marcel-domke/node-red-contrib-reolink

Version:

A unofficial Node-RED node for receiving real-time data and controlling your Reolink camera.

90 lines (80 loc) 3.72 kB
<!-- Copyright 2024 Marcel Domke 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. --> <!-- Node Definition --> <script type="text/javascript"> RED.nodes.registerType('reolink-device', { category: 'config', defaults: { name: { value: "" }, ip: { value: "", required: true }, user: { value: "admin", required: true }, pass: { value: "", required: true }, https: { value: false }, disableCertVerification: { value: false } }, label: function () { return this.name || "Reolink Device"; }, oneditprepare: function () { $('#node-input-name').val(this.name); $('#node-input-ip').val(this.ip); $('#node-input-user').val(this.user); $('#node-input-https').prop('checked', this.https); $('#node-input-disableCertVerification').prop('checked', this.disableCertVerification); }, oneditsave: function () { this.name = $('#node-input-name').val(); this.ip = $('#node-input-ip').val(); this.user = $('#node-input-user').val(); this.pass = $('#node-input-pass').val(); this.https = $('#node-input-https').prop('checked'); this.disableCertVerification = $('#node-input-disableCertVerification').prop('checked'); } }); </script> <!-- Edit Template --> <script type="text/html" data-template-name="reolink-device"> <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="Node name"> </div> <div class="form-row"> <label for="node-input-ip"><i class="fa fa-tag"></i> IP Address</label> <input type="text" id="node-input-ip" placeholder="192.168.1.x"> </div> <div class="form-row"> <label for="node-input-user"><i class="fa fa-user"></i> Username</label> <input type="text" id="node-input-user" placeholder="Username"> </div> <div class="form-row"> <label for="node-input-pass"><i class="fa fa-key"></i> Password</label> <input type="password" id="node-input-pass" placeholder="Password" autocomplete="new-password"> </div> <div class="form-row"> <label for="node-input-https"><i class="fa fa-lock"></i> HTTPS</label> <input type="checkbox" id="node-input-https"> <br>Use HTTPS instead of HTTP. (Recommended) </div> <div class="form-row"> <label for="node-input-disableCertVerification"><i class="fa fa-lock"></i> Self Signed</label> <input type="checkbox" id="node-input-disableCertVerification"> <br>Disables the certificate verification. For self signed certificates and testing purposes. </div> <hr> <div class="form-row"> <i class="fa fa-exclamation-triangle" style="color:orange;"></i> Ensure that HTTP / HTTPS is activated in the camera settings. <br> <i class="fa fa-exclamation-triangle" style="color:orange;"></i> Use HTTP only in a trusted home network. </div> </script>