Add output type to mqtt node

Fixes #1912
This commit is contained in:
Arnaud Durand
2018-10-11 21:22:44 +02:00
committed by DurandA
parent 673a6bbe2c
commit 84a6a5235e
5 changed files with 28 additions and 1 deletions

View File

@@ -28,6 +28,13 @@
<option value="2">2</option>
</select>
</div>
<div class="form-row">
<label for="node-input-datatype"><i class="fa fa-sign-out"></i> <span data-i18n="mqtt.label.output"></span></label>
<select id="node-input-datatype" style="width:70%;">
<option value="buffer" data-i18n="mqtt.output.buffer"></option>
<option value="utf8" data-i18n="mqtt.output.string"></option>
</select>
</div>
<div class="form-row">
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
@@ -61,6 +68,7 @@
name: {value:""},
topic: {value:"",required:true,validate: RED.validators.regex(/^(#$|(\+|[^+#]*)(\/(\+|[^+#]*))*(\/(\+|#|[^+#]*))?$)/)},
qos: {value: "2"},
datatype: {value:"utf8",required:true},
broker: {type:"mqtt-broker", required:true}
},
color:"#d8bfd8",
@@ -77,6 +85,9 @@
if (this.qos === undefined) {
$("#node-input-qos").val("2");
}
if (this.datatype === undefined) {
$("#node-input-datatype").val("utf8");
}
}
});
</script>