UNPKG

prisme-flow

Version:

prisme platform flow engine

102 lines (86 loc) 3.77 kB
<!-- Created by prisme.io on 09/06/2017. @author <a href="mailto:hello@prisme.io">savane vamara</a> (prisme.io) --> <script type="text/x-red" data-template-name="bigfile reader"> <div class="form-row"> <label for="node-input-filename"><i class="fa fa-file"></i>Big File</label> <input type="text" id="node-input-filename"> </div> <div class="form-row"> <label>&nbsp;</label> <input type="checkbox" id="node-input-nopayload" style="display: inline-block; width: auto; vertical-align: top;"> <label for="node-input-nopayload" style="width: 70%;">Payload is never a filename</label> </div> <div class="form-row"> <label for="node-input-encoding"><i class="fa fa-sign-in"></i>Read as</label> <select id="node-input-encoding"> <option value="utf8">utf8</option> <option value="ascii">ascii</option> <option value="base64">base64</option> <option value="binary">binary (latin-1)</option> <option value="hex">hex (hexadecimal)</option> <option value="ucs2">ucs2 (= uft16le)</option> </select> </div> <div class="form-row"> <label for="node-input-flow"><i class="fa fa-paper-plane-o" aria-hidden="true"></i>Output as</label> <select id="node-input-flow"> <option value="blocks">multiple blocks</option> <option value="lines">multiple lines</option> <option value="buffer">a buffer</option> </select> </div> <div class="form-row"> <label>&nbsp;</label> <label for="node-input-highWaterMark" style="width: 30%;"><i class="fa fa-truck"></i> Block size (KB)</label> <input style="width: 10%;" type="text" id="node-input-highWaterMark"> </div> <div class="form-row"> <label for="node-input-format"><i class="fa fa-sign-out" aria-hidden="true"></i>Send as</label> <select id="node-input-format"> <option value="utf8">utf8</option> <option value="ascii">ascii</option> <option value="base64">base64</option> <option value="binary">binary (latin-1)</option> <option value="hex">hex (hexadecimal)</option> <option value="ucs2">ucs2 (= uft16le)</option> </select> </div> <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> </script> <script type="text/x-red" data-help-name="bigfile reader"> <p>Reads the specified file and sends the content as <code>msg.payload</code>, and the filename as <code>msg.filename</code>.</p> <p>The filename can be configured in the node. If left blank it should be set by <code>msg.filename</code> on the incoming message.</p> <p>The node can send <b>blocks of data</b> or <b>lines of data</b> or <b>a whole buffer of data</b> </script> <script type="text/javascript"> RED.nodes.registerType('bigfile reader',{ category: 'storage-input', defaults: { name: {value:""}, filename: {value:""}, nopayload: {value: false}, flow: {value: "blocks"}, highWaterMark: { value: 16 }, // blocks encoding: { value: "utf8" }, // line-by-line + fs format: { value: "utf8" }, // line-by-line + string keepEmptyLines: { value: false } // line-by-line }, color:"#0099cc", inputs:1, outputs:2, icon: "bigfile.png", label: function() { return this.name || 'bigfile'; }, labelStyle: function() { return this.name?"node_label_italic":""; } }); </script>