Let msgpack work on any msg property

This commit is contained in:
Dave Conway-Jones 2019-10-20 22:48:00 +01:00
parent e3ab387814
commit 04daa5b97e
No known key found for this signature in database
GPG Key ID: 302A6725C594817F
2 changed files with 13 additions and 2 deletions

View File

@ -1,5 +1,9 @@
<script type="text/x-red" data-template-name="msgpack">
<div class="form-row">
<label for="node-input-property"><i class="fa fa-ellipsis-h"></i> <span data-i18n="node-red:common.label.property"></span></label>
<input type="text" id="node-input-property" style="width:70%;"/>
</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" placeholder="Name">
@ -18,7 +22,8 @@
category: 'function',
color:"#DEBD5C",
defaults: {
name: {value:""}
name: {value:""},
property: {value:"payload",required:true}
},
inputs:1,
outputs:1,
@ -28,6 +33,12 @@
},
labelStyle: function() {
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
if (this.property === undefined) {
$("#node-input-property").val("payload");
}
$("#node-input-property").typedInput({default:'msg',types:['msg']});
}
});
</script>

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-msgpack",
"version" : "1.1.3",
"version" : "1.2.0",
"description" : "A Node-RED node to pack and unpack objects to msgpack format",
"dependencies" : {
"msgpack-lite" : "^0.1.26"