UNPKG

node-red-node-jy-archer

Version:

jy-archer allows you to exchange data with Archer Html Page

198 lines (181 loc) 6.84 kB
<!-- Copyright 2020 jinyistudio --> <!-- jy-archer out config --> <script type="text/x-red" data-template-name="jy-archer out"> <div class="form-row"> <label for="node-input-vname"><span>Property</span></label> <input type="text" id="node-input-vname"> </div> <div class="form-row"> <label for="node-input-vtype"><span>Data Type</span></label> <select type="text" id="node-input-vtype" style="width:auto;"> <option value="1"> Number</option> <option value="2"> Text</option> <option value="3"> Boolean</option> </select> </div> <div class="form-row"> <label for="node-input-vval"></i> Value</label> <input type="text" id="node-input-vval"> </div> <div class="form-row"> <label for="node-input-name"><span data-i18n="node-red:common.label.name"></span></label> <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name"> </div> </script> <script type="text/x-red" data-help-name="jy-archer out"> <p>jy-archer allows you to exchange data with Archer Html Page</p> </script> <script type="text/javascript"> RED.nodes.registerType('jy-archer out',{ category: 'JinYi Studio', color: '#BBB', defaults: { vname: {value:"", required:true, validate: function(v) { return Boolean(v!=''); } }, vtype: {value:1, required:true}, vval: {value:""} }, inputs:1, outputs:1, paletteLabel: "Archer out", icon: "archer.png", label: function() { return this.name||this.vname; } }); </script> <!-- jy-archer in config --> <script type="text/x-red" data-template-name="jy-archer in"> <div class="form-row"> <label for="node-input-prop"><span>Property</span></label> <input type="text" id="node-input-prop"> </div> <div class="form-row"> <label for="node-input-topic"></i>Topic</label> <input type="text" id="node-input-topic"> </div> <div class="form-row"> <label for="node-input-name"><span data-i18n="node-red:common.label.name"></span></label> <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name"> </div> </script> <script type="text/x-red" data-help-name="jy-archer in"> <p>Archer in allows you to receive data from Archer Html Page</p> </script> <script type="text/javascript"> RED.nodes.registerType('jy-archer in',{ category: 'JinYi Studio', color: '#BBB', defaults: { prop: {value:"", required:true, validate: function(v) { return Boolean(v!=''); } } }, inputs:1, outputs:1, paletteLabel: "Archer in", icon: "archer.png", label: function() { return this.name||'= '+this.prop; } }); </script> <!-- jy-archer eval config --> <script type="text/x-red" data-template-name="jy-archer eval"> <div class="form-row"> <label for="node-input-prop"><span>Property</span></label> <input type="text" id="node-input-prop"> </div> <div class="form-row"> <label for="node-input-value"><span>Value</span></label> <input type="text" id="node-input-value"> <input type="hidden" id="node-input-valuetype" style="width:200px;"> </div> <div class="form-row"> <label for="node-input-name"><span data-i18n="node-red:common.label.name"></span></label> <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name"> </div> </script> <script type="text/x-red" data-help-name="jy-archer eval"> <p>Archer in allows you to receive data from Archer Html Page</p> </script> <script type="text/javascript"> RED.nodes.registerType('jy-archer eval',{ category: 'JinYi Studio', color: '#BBB', defaults: { prop: {value:"", required:true, validate: function(v) { return Boolean(v!=''); }, value: { value: 1, validate: RED.validators.typedInput('payloadtype')}, valuetype: {value: 'num' } } }, inputs:1, outputs:1, paletteLabel: "Archer Eval", icon: "archer.png", label: function() { return this.name||'= '+this.prop; }, oneditprepare: function() { $("#node-input-value").typedInput({ default:'num', types:['str','num','bool','bin','json'], typeField: "#node-input-valuetype" }); } }); </script> <!-- jy-archer runFunction config --> <script type="text/x-red" data-template-name="jy-archer run"> <div class="form-row"> <label for="node-input-prop"><span>Property</span></label> <input type="text" id="node-input-prop"> </div> <div class="form-row"> <label for="node-input-value"><span>Value</span></label> <input type="text" id="node-input-value" style="width:200px;"> <input type="hidden" id="node-input-valuetype" style="width:200px;"> </div> <div class="form-row"> <label for="node-input-name"><span data-i18n="node-red:common.label.name"></span></label> <input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name"> </div> </script> <script type="text/x-red" data-help-name="jy-archer run"> <p>Archer run allows you calling user function in the Archer Page</p> </script> <script type="text/javascript"> RED.nodes.registerType('jy-archer run',{ category: 'JinYi Studio', color: '#BBB', defaults: { prop: {value:"", required:true, validate: function(v) { return Boolean(v!=''); }, value: { value: 1, validate: RED.validators.typedInput('valuetype')}, valuetype: {value: 'num' } } }, inputs:1, outputs:1, paletteLabel: "Archer Run", icon: "archer.png", label: function() { return this.name||'= '+this.prop; }, oneditprepare: function() { $("#node-input-value").typedInput({ default:'num', types:['str','num','bool','bin','json'], typeField: "#node-input-valuetype" }); } }); </script>