mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add node status updates
This commit is contained in:
@@ -20,7 +20,7 @@ var clone = require("clone");
|
||||
|
||||
var flows = require("./flows");
|
||||
|
||||
|
||||
var comms = require("../comms");
|
||||
|
||||
function Node(n) {
|
||||
this.id = n.id;
|
||||
@@ -114,6 +114,11 @@ Node.prototype.error = function(msg) {
|
||||
if (this.name) o.name = this.name;
|
||||
this.emit("log",o);
|
||||
}
|
||||
|
||||
/**
|
||||
* status: { fill:"red|green", shape:"dot|ring", text:"blah" }
|
||||
*/
|
||||
Node.prototype.status = function(status,retain) {
|
||||
comms.publish("status/"+this.id,status,retain);
|
||||
}
|
||||
|
||||
module.exports = Node;
|
||||
|
Reference in New Issue
Block a user