From 189389f96a12975c7e2552dd29f9ade1e2ae3e21 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 5 May 2020 17:35:08 +0100 Subject: [PATCH] [inject] Tidy up node label --- .../nodes/core/common/20-inject.html | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/packages/node_modules/@node-red/nodes/core/common/20-inject.html b/packages/node_modules/@node-red/nodes/core/common/20-inject.html index 0501042c32..af784978a7 100644 --- a/packages/node_modules/@node-red/nodes/core/common/20-inject.html +++ b/packages/node_modules/@node-red/nodes/core/common/20-inject.html @@ -224,13 +224,27 @@ return lab; }, label: function() { + var suffix = ""; + // if fire once then add small indication + if (this.once) { + suffix = " ¹"; + } + // but replace with repeat one if set to repeat + if ((this.repeat && this.repeat != 0) || this.crontab) { + suffix = " ↻"; + } + if (this.name) { + return this.name+suffix; + } + + var payloadProperty; + var topicProperty; + var payload; + var payloadType; + var topic; + if (Array.isArray(this.props)) { - // find the payload & topic - var payloadProperty; - var topicProperty; - var payload; - var payloadType; - var topic; + // find the payload & topic if they are set for (var i=0,l=this.props.length; i