UNPKG

node-red-contrib-freebox

Version:
3 lines 2.19 kB
<script type="text/x-red" data-template-name="poll"><div class="form-row"><label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="label.name"></span></label><div style="display:inline-block;width:calc(100% - 105px)"><input type="text" id="node-input-name" data-i18n="[placeholder]label.name"></div></div><div class="form-row"><label for="node-input-url"><i class="fa fa-link"></i> <span data-i18n="label.url"></span></label><div style="display:inline-block;width:calc(100% - 105px)"><input type="text" id="node-input-url" data-i18n="[placeholder]label.url"></div></div><div class="form-row"><label for="node-input-interval"><i class="fa fa-clock-o"></i> <span data-i18n="label.interval"></span></label><div style="display:inline-block;width:calc(100% - 105px)"><input type="text" id="node-input-interval" data-i18n="[placeholder]label.interval"></div></div><div class="form-row"><label for="node-input-server"><i class="fa fa-server"></i> <span data-i18n="label.server"></span></label><div style="display:inline-block;width:calc(100% - 105px)"><input type="text" id="node-input-server" data-i18n="[placeholder]label.server"></div></div></script> <script type="text/javascript">RED.nodes.registerType("poll",{category:"freebox",color:"#a6bbcf",inputs:0,outputs:1,defaults:{name:{value:""},url:{value:""},interval:{value:1e3},server:{value:"",type:"freebox-server",required:!0}},icon:"freebox.png",paletteLabel:"poll",label:function(){return this.name||"poll"}});</script> <script type="text/x-red" data-help-name="poll"><p>This node provides a way to poll api via the url parameter (or msg.url if passed). The poll is triggered every <em>interval</em> parameter.</p><h3>Configuration</h3><dl class="message-properties"><dt>Name<span class="property-type">string</span></dt><dt>Url<span class="property-type"></span></dt><dd>Optionnal (default msg.url)</dd><ul><li>Type: <code>string</code> the url to make the call</li></ul><dt>Interval<span class="property-type"></span></dt><dd>Optionnal (default 1000)</dd><ul><li>Type: <code>string</code> the number of milliseconds between each poll</li></ul><dt>Server<span class="property-type">freebox-server</span></dt></dl></script>