UNPKG

node-red-contrib-httppostcache

Version:

If posting data is failed, data is stored in file after posting process.

160 lines (148 loc) 4.89 kB
<!-- * file: lazurite.html * * Copyright (C) 2016-17 Lapis Semiconductor Co., Ltd. * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. * !--> <!-- <script type="text/x-red" data-template-name="http-post-cache-debug"> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name"> </div> <div class="form-row"> <label for="node-input-channel"><i class="fas fa-cog"></i> config</label> <input type="http-post-cache-config" id="node-input-channel"></input> </div> </script> <script type="text/javascript"> RED.nodes.registerType('http-post-cache-debug',{ category: 'storage', paletteLabel: 'httpPostCacheDebug', color:"BurlyWood", align: 'left', inputs:1, outputs:1, icon: "lazurite.png", label: function() { return this.name || "httpPostCacheDebug"; }, labelStyle: function() { return this.text?"node_label_italic":""; }, defaults: { channel: {value:"", required:true, type:"http-post-cache-channel"}, name : {value:""} } }); </script> --> <script type="text/x-red" data-template-name="http-post-cache-input"> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name"> </div> <div class="form-row"> <label for="node-input-channel"><i class="fas fa-cog"></i> config</label> <input type="http-post-cache-channel" id="node-input-channel"></input> </div> </script> <script type="text/javascript"> RED.nodes.registerType('http-post-cache-input',{ category: 'storage', paletteLabel: 'httpPostCacheInput', color:"BurlyWood", align: 'left', inputs:1, outputs:1, icon: "file-in.svg", label: function() { return this.name || "httpPostCacheInput"; }, labelStyle: function() { return this.text?"node_label_italic":""; }, defaults: { channel: {value:"", required:true, type:"http-post-cache-channel"}, name : {value:""} } }); </script> <script type="text/x-red" data-help-name="http-post-cache-input"> <p>File Cache Input</p> </script> <script type="text/x-red" data-template-name="http-post-cache-judge"> <div class="form-row"> <label for="node-input-name"><i class="fa fa-tag"></i> Name</label> <input type="text" id="node-input-name"> </div> <div class="form-row"> <label for="node-input-channel"><i class="fas fa-cog"></i> config</label> <input type="http-post-cache-config" id="node-input-channel"></input> </div> </script> <script type="text/javascript"> RED.nodes.registerType('http-post-cache-judge',{ category: 'storage', paletteLabel: 'httpPostCacheJudge', color:"BurlyWood", align: 'right', inputs:1, outputs:0, icon: "file-out.svg", label: function() { return this.name || "httpPostCacheJudge"; }, labelStyle: function() { return this.text?"node_label_italic":""; }, defaults: { channel: {value:"", required:true, type:"http-post-cache-channel"}, name: {value:""} } }); </script> <script type="text/x-red" data-help-name="http-post-cache-output"> <p> File Cache Output</p> </script> <script type="text/x-red" data-template-name="http-post-cache-channel"> <div class="form-row"> <label for="node-config-input-path"><i class="fa fa-dot-circle-o"></i> path</label> <input type="text" id="node-config-input-path" placeholder="/home/pi/temp"> </div> <div class="form-row"> <label for="node-config-input-interval"><i class="fa fa-user"></i> interval</label> <input type="text" id="node-config-input-interval" placeholder="interval(ms)"> </div> <div class="form-row"> <label for="node-config-input-expiration"><i class="fa fa-user"></i> expiration</label> <input type="text" id="node-config-input-expiration" placeholder="expiretion(days)"> </div> </script> <script type="text/javascript"> RED.nodes.registerType('http-post-cache-channel',{ category: 'config', defaults: { path: {value:"", required:true }, interval: {value:"100", required:true }, expiration: {value:"1", required:true }, }, label: function() { return "path:"+this.path + ",interval:" + this.interval; } }); </script>