mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Remove 'retined' property from node.status calls
This commit is contained in:
@@ -79,7 +79,7 @@ module.exports = function(RED) {
|
||||
this.brokerConfig = RED.nodes.getNode(this.broker);
|
||||
var node = this;
|
||||
if (this.brokerConfig) {
|
||||
this.status({fill:"red",shape:"ring",text:"disconnected"},true);
|
||||
this.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
this.client = connectionPool.get(this.brokerConfig.broker,this.brokerConfig.port,this.brokerConfig.clientid,this.brokerConfig.username,this.brokerConfig.password);
|
||||
var node = this;
|
||||
this.client.subscribe(this.topic,2,function(topic,payload,qos,retain) {
|
||||
@@ -90,10 +90,10 @@ module.exports = function(RED) {
|
||||
node.send(msg);
|
||||
});
|
||||
this.client.on("connectionlost",function() {
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"},true);
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
});
|
||||
this.client.on("connect",function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"},true);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
});
|
||||
this.client.connect();
|
||||
} else {
|
||||
@@ -131,10 +131,10 @@ module.exports = function(RED) {
|
||||
}
|
||||
});
|
||||
this.client.on("connectionlost",function() {
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"},true);
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
});
|
||||
this.client.on("connect",function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"},true);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
});
|
||||
|
||||
this.client.connect();
|
||||
|
@@ -71,10 +71,10 @@ module.exports = function(RED) {
|
||||
});
|
||||
});
|
||||
node.port.on('ready', function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"},true);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
});
|
||||
node.port.on('closed', function() {
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"},true);
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||
});
|
||||
} else {
|
||||
this.error("missing serial config");
|
||||
@@ -97,7 +97,7 @@ module.exports = function(RED) {
|
||||
|
||||
if (this.serialConfig) {
|
||||
var node = this;
|
||||
node.status({fill:"grey",shape:"dot",text:"unknown"},true);
|
||||
node.status({fill:"grey",shape:"dot",text:"unknown"});
|
||||
node.port = serialPool.get(this.serialConfig.serialport,
|
||||
this.serialConfig.serialbaud,
|
||||
this.serialConfig.databits,
|
||||
@@ -108,10 +108,10 @@ module.exports = function(RED) {
|
||||
node.send({ "payload": msg });
|
||||
});
|
||||
this.port.on('ready', function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"},true);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
});
|
||||
this.port.on('closed', function() {
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"},true);
|
||||
node.status({fill:"red",shape:"ring",text:"not connected"});
|
||||
});
|
||||
} else {
|
||||
this.error("missing serial config");
|
||||
|
@@ -41,12 +41,12 @@ module.exports = function(RED) {
|
||||
var reconnectTimeout;
|
||||
var setupTcpClient = function() {
|
||||
node.log("connecting to "+node.host+":"+node.port);
|
||||
node.status({fill:"grey",shape:"dot",text:"connecting"},true);
|
||||
node.status({fill:"grey",shape:"dot",text:"connecting"});
|
||||
var id = (1+Math.random()*4294967295).toString(16);
|
||||
client = net.connect(node.port, node.host, function() {
|
||||
buffer = (node.datatype == 'buffer')? new Buffer(0):"";
|
||||
node.log("connected to "+node.host+":"+node.port);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"},true);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
});
|
||||
connectionPool[id] = client;
|
||||
|
||||
@@ -198,11 +198,11 @@ module.exports = function(RED) {
|
||||
|
||||
var setupTcpClient = function() {
|
||||
node.log("connecting to "+node.host+":"+node.port);
|
||||
node.status({fill:"grey",shape:"dot",text:"connecting"},true);
|
||||
node.status({fill:"grey",shape:"dot",text:"connecting"});
|
||||
client = net.connect(node.port, node.host, function() {
|
||||
connected = true;
|
||||
node.log("connected to "+node.host+":"+node.port);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"},true);
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
});
|
||||
client.on('error', function (err) {
|
||||
node.log('error : '+err);
|
||||
@@ -211,7 +211,7 @@ module.exports = function(RED) {
|
||||
});
|
||||
client.on('close', function() {
|
||||
node.log("connection lost to "+node.host+":"+node.port);
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"},true);
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
connected = false;
|
||||
client.destroy();
|
||||
if (!node.closing) {
|
||||
|
Reference in New Issue
Block a user