mirror of
https://github.com/node-red/node-red.git
synced 2025-12-26 23:26:46 +01:00
NLS Core nodes
NLS exec node NLS function/temple/delay nodes NLS function/template/delay/trigger/comment nodes NLS io nodes (mqtt/httpin/websocket/watch/serial) NLS messages.json for tcpin NLS io nodes (tcpin & udp half) NLS io nodes (udp) NLS logic nodes (switch/change) NLS logic (range) and parsers (csv&html) nodes NLS parser nodes (json/xml) NLS test case update for logic/parsers NLS analysis and hardware nodes NLS storage nodes (file/redisout/mongodb) and test NLS storage node (tail) NLS social nodes (feedparse/email/irc) NLS socal node (twitter half change) NLS social node (twitter) and core node (unknown)
This commit is contained in:
committed by
Nick O'Leary
parent
c105b2df37
commit
2fe859b111
@@ -42,7 +42,7 @@ module.exports = function(RED) {
|
||||
this.broker = n.broker;
|
||||
this.brokerConfig = RED.nodes.getNode(this.broker);
|
||||
if (this.brokerConfig) {
|
||||
this.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
this.status({fill:"red",shape:"ring",text:RED._("common.status.disconnected")});
|
||||
this.client = connectionPool.get(this.brokerConfig.broker,this.brokerConfig.port,this.brokerConfig.clientid,this.brokerConfig.username,this.brokerConfig.password);
|
||||
var node = this;
|
||||
if (this.topic) {
|
||||
@@ -55,22 +55,22 @@ module.exports = function(RED) {
|
||||
node.send(msg);
|
||||
}, this.id);
|
||||
this.client.on("connectionlost",function() {
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.disconnected")});
|
||||
});
|
||||
this.client.on("connect",function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
||||
});
|
||||
if (this.client.isConnected()) {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
||||
} else {
|
||||
this.client.connect();
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.error("topic not defined");
|
||||
this.error(RED._("mqtt.errors.not-defined"));
|
||||
}
|
||||
} else {
|
||||
this.error("missing broker configuration");
|
||||
this.error(RED._("mqtt.errors.missing-config"));
|
||||
}
|
||||
this.on('close', function() {
|
||||
if (this.client) {
|
||||
@@ -90,7 +90,7 @@ module.exports = function(RED) {
|
||||
this.brokerConfig = RED.nodes.getNode(this.broker);
|
||||
|
||||
if (this.brokerConfig) {
|
||||
this.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
this.status({fill:"red",shape:"ring",text:RED._("common.status.disconnected")});
|
||||
this.client = connectionPool.get(this.brokerConfig.broker,this.brokerConfig.port,this.brokerConfig.clientid,this.brokerConfig.username,this.brokerConfig.password);
|
||||
var node = this;
|
||||
this.on("input",function(msg) {
|
||||
@@ -110,22 +110,22 @@ module.exports = function(RED) {
|
||||
if (msg.hasOwnProperty("topic") && (typeof msg.topic === "string") && (msg.topic !== "")) { // topic must exist
|
||||
this.client.publish(msg); // send the message
|
||||
}
|
||||
else { node.warn("Invalid topic specified"); }
|
||||
else { node.warn(RED._("mqtt.errors.invalid-topic")); }
|
||||
}
|
||||
});
|
||||
this.client.on("connectionlost",function() {
|
||||
node.status({fill:"red",shape:"ring",text:"disconnected"});
|
||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.disconnected")});
|
||||
});
|
||||
this.client.on("connect",function() {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
||||
});
|
||||
if (this.client.isConnected()) {
|
||||
node.status({fill:"green",shape:"dot",text:"connected"});
|
||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
||||
} else {
|
||||
this.client.connect();
|
||||
}
|
||||
} else {
|
||||
this.error("missing broker configuration");
|
||||
this.error(RED._("mqtt.errors.missing-config"));
|
||||
}
|
||||
this.on('close', function() {
|
||||
if (this.client) {
|
||||
|
||||
Reference in New Issue
Block a user