add port label to file node and update info

This commit is contained in:
Dave Conway-Jones 2017-03-06 19:05:52 +00:00
parent 59da705b8f
commit d351aa842c
1 changed files with 13 additions and 7 deletions

View File

@ -48,8 +48,10 @@
<p>Writes <code>msg.payload</code> to the file specified, for example to create a log.</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>A newline is added to every message. But this can be turned off if required, for example, to allow binary files to be written.</p>
<p>The default behaviour is to append to the file. This can be changed to overwrite the file each time, for example if you want to output a "static" web page or report.</p>
<p>A newline is added to every message. But this can be turned off if required, for example,
to allow binary files to be written.</p>
<p>The default behaviour is to append to the file. This can be changed to overwrite the file
each time, for example if you want to output a "static" web page or report.</p>
<p>This node can also be configured to delete a file if required.</p>
</script>
@ -69,6 +71,7 @@
<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">
</div>
<div class="form-tips"><span data-i18n="file.tip"></span></div>
</script>
<script type="text/x-red" data-help-name="file in">
@ -95,7 +98,7 @@
align: "right",
label: function() {
if (this.overwriteFile === "delete") {
return this.name||this._("file.label.deletelabel",{file:this.filename})
return this.name||this._("file.label.deletelabel",{file:this.filename});
} else {
return this.name||this.filename||this._("file.label.filelabel");
}
@ -104,10 +107,10 @@
return this.name?"node_label_italic":"";
},
oneditprepare: function() {
$("#node-input-overwriteFile").on("change",function() {
if (this.value === "delete") { $("#node-appline").hide(); }
else { $("#node-appline").show(); }
});
$("#node-input-overwriteFile").on("change",function() {
if (this.value === "delete") { $("#node-appline").hide(); }
else { $("#node-appline").show(); }
});
}
});
@ -121,6 +124,9 @@
color:"BurlyWood",
inputs:1,
outputs:1,
outputLabels: function(i) {
return (this.format === "utf8") ? "UTF8 string" : "binary buffer";
},
icon: "file.png",
label: function() {
return this.name||this.filename||this._("file.label.filelabel");