Merge pull request #4028 from node-red/Add-count-to-join-and-batch-node-labels

Add count to join and batch node labels
This commit is contained in:
Nick O'Leary
2023-02-02 10:21:57 +00:00
committed by GitHub
2 changed files with 14 additions and 2 deletions

View File

@@ -224,7 +224,12 @@
outputs:1,
icon: "join.svg",
label: function() {
return this.name||this._("join.join");
var nam = this.name||this._("join.join");
if (this.mode === "custom" && !isNaN(Number(this.count))) {
nam += " "+this.count;
if (this.accumulate === true) { nam+= "+"; }
}
return nam;
},
labelStyle: function() {
return this.name?"node_label_italic":"";

View File

@@ -107,7 +107,14 @@
outputs:1,
icon: "batch.svg",
label: function() {
return this.name||this._("batch.batch");;
var nam = this.name||this._("batch.batch");
if (this.mode === "count" && !isNaN(Number(this.count))) {
nam += " "+this.count;
}
if (this.mode === "interval" && !isNaN(Number(this.interval))) {
nam += " "+this.interval+"s";
}
return nam;
},
labelStyle: function() {
return this.name ? "node_label_italic" : "";