mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Added condition that.statusType === "counter" in the debug.html file
This commit is contained in:
		| @@ -521,7 +521,10 @@ | ||||
|  | ||||
|             $("#node-input-tostatus").on('change',function() { | ||||
|                 if ($(this).is(":checked")) { | ||||
|                     if (!that.hasOwnProperty("statusVal") || that.statusVal !== "") { | ||||
|                     if (that.statusType === "counter") { | ||||
|                         that.statusVal = ""; | ||||
|                     } | ||||
|                     else if (!that.hasOwnProperty("statusVal") || that.statusVal === "") { | ||||
|                         var type = $("#node-input-typed-complete").typedInput('type'); | ||||
|                         var comp = "payload"; | ||||
|                         if (type !== 'full') { | ||||
|   | ||||
| @@ -37,7 +37,8 @@ module.exports = function(RED) { | ||||
|         var node = this; | ||||
| 		if ( node.statusType === "counter" ){ | ||||
| 			node.status({fill:"blue", shape:"ring", text: node.counter}); | ||||
| 		} else { | ||||
| 		}  | ||||
|         else { | ||||
| 			node.status({fill:"", shape:"", text: ""}); | ||||
| 		} | ||||
|         var preparedEditExpression = null; | ||||
| @@ -125,18 +126,22 @@ module.exports = function(RED) { | ||||
|                     if (err) { node.error(err); return; } | ||||
|  | ||||
| 					if ( node.statusType === "counter" ){ | ||||
| 						const differenceOfTime  = ((new Date()).getTime() - node.lastTime); | ||||
| 						const differenceOfTime  = (new Date().getTime() - node.lastTime); | ||||
| 						node.lastTime = new Date().getTime(); | ||||
| 						node.counter++; | ||||
| 						if ( differenceOfTime > 100 ){ | ||||
| 							node.status({fill:"blue", shape:"ring", text: node.counter}); | ||||
| 						} else { | ||||
| 							if (node.timeout) { clearTimeout(node.timeout) } | ||||
| 						}  | ||||
|                         else { | ||||
| 							if (node.timeout) { | ||||
|                                  clearTimeout(node.timeout)  | ||||
|                             } | ||||
| 							node.timeout = setTimeout(() => { | ||||
| 								node.status({fill:"blue", shape:"ring", text: node.counter}) | ||||
| 							}, 200) | ||||
| 						} | ||||
| 					} else { | ||||
| 					}  | ||||
|                     else { | ||||
| 						var output = debugMsg.msg; | ||||
| 						var st = (typeof output === 'string') ? output : util.inspect(output); | ||||
| 						var fill = "grey"; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user