mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Better attempt at making Inject node label more "useful".
Addresses Issue #489
This commit is contained in:
parent
7da108e129
commit
977a9e1c83
@ -138,15 +138,17 @@
|
||||
icon: "inject.png",
|
||||
label: function() {
|
||||
if (this.payloadType === "string") {
|
||||
return this.name||this.topic||this.payload||"inject";
|
||||
//if (this.topic !== "") {
|
||||
// return this.name||this.topic +" : "+this.payload||this.topic;
|
||||
//}
|
||||
//else {
|
||||
// return this.name||this.payload||this.topic||"inject";
|
||||
//}
|
||||
if ((this.topic.length + this.payload.length) <= 32) {
|
||||
return this.name||this.topic + ":" + this.payload;
|
||||
}
|
||||
else if (this.payload.length < 24) {
|
||||
return this.name||":"+this.payload;
|
||||
}
|
||||
}
|
||||
else { return this.name||this.topic||"inject"; }
|
||||
if ((this.topic.length < 24) && (this.topic.length > 0)) {
|
||||
return this.name||this.topic+":";
|
||||
}
|
||||
else { return this.name||(this.payloadType==="date"?"timestamp":null)||"inject"; }
|
||||
},
|
||||
labelStyle: function() {
|
||||
return this.name?"node_label_italic":"";
|
||||
|
Loading…
Reference in New Issue
Block a user