mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
added sending params object in handleStatus in comms.js and using params object in status event in red.js. added test for handleStatusEvent with params for comms.js
This commit is contained in:
@@ -517,7 +517,7 @@ var RED = (function() {
|
||||
var node = RED.nodes.node(parts[1]);
|
||||
if (node) {
|
||||
if (msg.hasOwnProperty("text") && msg.text !== null && /^[@a-zA-Z]/.test(msg.text)) {
|
||||
msg.text = node._(msg.text.toString(),{defaultValue:msg.text.toString()});
|
||||
msg.text = node._(msg.text.toString(),{defaultValue:msg.text.toString(), ...(msg.params || {})});
|
||||
}
|
||||
node.status = msg;
|
||||
node.dirtyStatus = true;
|
||||
|
||||
@@ -51,6 +51,10 @@ function handleStatusEvent(event) {
|
||||
fill: event.status.fill,
|
||||
shape: event.status.shape
|
||||
};
|
||||
const params = event.status.params;
|
||||
if(params && typeof params === "object" && !Array.isArray(params)){
|
||||
status.params = params;
|
||||
}
|
||||
publish("status/"+event.id,status,true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user