UNPKG

node-red-contrib-easybotics-gphoto-upload

Version:
88 lines (76 loc) 2.33 kB
<script type="text/javascript"> RED.nodes.registerType('photo-account', { category: 'config', defaults: { name: {value:""} }, credentials: { username: {type:"text"}, password: {type:"password"} }, label: "Gphoto Account", }); </script> <script type="text/x-red" data-template-name="photo-account"> <p> Google username and password:<br> <b> Please make a new account just for this instead of pasting your google account details into node-red...<br> </b></p> <div class="form-row"> <label for="node-config-input-username"><i class="icon-tag"></i> Username</label> <input type="text" id="node-config-input-username"> </div> <div class="form-row"> <label for="node-config-input-password"><i class="icon-tag"></i> Password</label> <input type="password" id="node-config-input-password"> </div> </script> <script type="text/javascript"> RED.nodes.registerType('upload-photo', { category: 'Google Photos', defaults: { name: {value:""}, fileName: {value:""}, albumName: {value:""}, account: {type:'photo-account', required:true}, }, inputs: 1, outputs: 1, icon: "arrow-in.png", label: function() { return this,name || "Upload Photo"; } }); </script> <script type="text/x-red" data-template-name="upload-photo"> <div class="form-row"> <label for="node-input-account"><i class='fa fa-tag'></i> Account </label> <input type='text' id='node-input-account'/> </div> <div class="form-row"> <label for="node-input-fileName"><i class='fa fa-tag'></i> File Name </label> <input type='text' id='node-input-fileName'/> </div> <div class="form-row"> <label for="node-input-album"><i class='fa fa-tag'></i> Album </label> <input type='text' id='node-input-albumName'/> </div> </script> <script type="text/x-red" data-help-name="upload-photo"> <p> <br> <b> fileName: </b> name of the image on the filesystem <br> <b> albumName: </b> gphotos to insert the image into <br><br> Also takes an object with the following properties: <br> <b> msg.payload </b> fileName <br> <b> OR </b> <br> <b> msg.payload.fileName </b> and <b> msg.payload.albumName </b> <br> Missing properties are filled in by the node-settings, if missing name or album nothing will be uploaded </p> </script>