mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
Update core nodes to pull common msgs from node-red ns
This commit is contained in:
parent
7d011dac99
commit
da209a6b66
@ -30,8 +30,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips"><span data-i18n="[html]arduino.tip.io"></span></div>
|
<div class="form-tips"><span data-i18n="[html]arduino.tip.io"></span></div>
|
||||||
</script>
|
</script>
|
||||||
@ -86,8 +86,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips"><span data-i18n="[html]arduino.tip.io"></span></div>
|
<div class="form-tips"><span data-i18n="[html]arduino.tip.io"></span></div>
|
||||||
</script>
|
</script>
|
||||||
|
@ -75,9 +75,9 @@ module.exports = function(RED) {
|
|||||||
if (typeof this.serverConfig === "object") {
|
if (typeof this.serverConfig === "object") {
|
||||||
this.board = this.serverConfig.board;
|
this.board = this.serverConfig.board;
|
||||||
var node = this;
|
var node = this;
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.connecting")});
|
node.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.connecting")});
|
||||||
node.board.on('connect', function() {
|
node.board.on('connect', function() {
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
//console.log("i",node.state,node.pin);
|
//console.log("i",node.state,node.pin);
|
||||||
if (node.state == "ANALOG") {
|
if (node.state == "ANALOG") {
|
||||||
node.board.on('analogChange', function(e) {
|
node.board.on('analogChange', function(e) {
|
||||||
@ -122,10 +122,10 @@ module.exports = function(RED) {
|
|||||||
if (typeof this.serverConfig === "object") {
|
if (typeof this.serverConfig === "object") {
|
||||||
this.board = this.serverConfig.board;
|
this.board = this.serverConfig.board;
|
||||||
var node = this;
|
var node = this;
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.connecting")});
|
node.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.connecting")});
|
||||||
|
|
||||||
node.board.on('connect', function() {
|
node.board.on('connect', function() {
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
//console.log("o",node.state,node.pin);
|
//console.log("o",node.state,node.pin);
|
||||||
node.board.pinMode(node.pin, node.state);
|
node.board.pinMode(node.pin, node.state);
|
||||||
node.on("input", function(msg) {
|
node.on("input", function(msg) {
|
||||||
|
@ -20,8 +20,8 @@
|
|||||||
<input type="text" id="node-input-serial">
|
<input type="text" id="node-input-serial">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -61,8 +61,8 @@
|
|||||||
<input type="text" id="node-input-serial">
|
<input type="text" id="node-input-serial">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -76,10 +76,10 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
node.port.on('ready', function() {
|
node.port.on('ready', function() {
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
});
|
});
|
||||||
node.port.on('closed', function() {
|
node.port.on('closed', function() {
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.not-connected")});
|
node.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.not-connected")});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.error(RED._("serial.errors.missing-conf"));
|
this.error(RED._("serial.errors.missing-conf"));
|
||||||
@ -108,7 +108,7 @@ module.exports = function(RED) {
|
|||||||
if (node.serialConfig.out != "count") { buf = new Buffer(bufMaxSize); }
|
if (node.serialConfig.out != "count") { buf = new Buffer(bufMaxSize); }
|
||||||
else { buf = new Buffer(Number(node.serialConfig.newline)); }
|
else { buf = new Buffer(Number(node.serialConfig.newline)); }
|
||||||
var i = 0;
|
var i = 0;
|
||||||
node.status({fill:"grey",shape:"dot",text:RED._("common.status.not-connected")});
|
node.status({fill:"grey",shape:"dot",text:RED._("node-red:common.status.not-connected")});
|
||||||
node.port = serialPool.get(this.serialConfig.serialport,
|
node.port = serialPool.get(this.serialConfig.serialport,
|
||||||
this.serialConfig.serialbaud,
|
this.serialConfig.serialbaud,
|
||||||
this.serialConfig.databits,
|
this.serialConfig.databits,
|
||||||
@ -179,10 +179,10 @@ module.exports = function(RED) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.port.on('ready', function() {
|
this.port.on('ready', function() {
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
});
|
});
|
||||||
this.port.on('closed', function() {
|
this.port.on('closed', function() {
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.not-connected")});
|
node.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.not-connected")});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.error(RED._("serial.errors.missing-conf"));
|
this.error(RED._("serial.errors.missing-conf"));
|
||||||
|
@ -62,8 +62,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-dname"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-dname"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-dname" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-dname" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips" id="node-tip"><span data-i18n="[html]email.tip.cred"></span></div>
|
<div class="form-tips" id="node-tip"><span data-i18n="[html]email.tip.cred"></span></div>
|
||||||
</script>
|
</script>
|
||||||
@ -144,8 +144,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips" id="node-tip"><span data-i18n="[html]email.tip.cred"></span></div>
|
<div class="form-tips" id="node-tip"><span data-i18n="[html]email.tip.cred"></span></div>
|
||||||
<div id="node-input-tip" class="form-tips"><span data-i18n="[html]email.tip.recent"></span></div>
|
<div id="node-input-tip" class="form-tips"><span data-i18n="[html]email.tip.recent"></span></div>
|
||||||
|
@ -73,7 +73,7 @@ module.exports = function(RED) {
|
|||||||
if (smtpTransport) {
|
if (smtpTransport) {
|
||||||
node.status({fill:"blue",shape:"dot",text:RED._("email.status.sending")});
|
node.status({fill:"blue",shape:"dot",text:RED._("email.status.sending")});
|
||||||
if (msg.to && node.name && (msg.to !== node.name)) {
|
if (msg.to && node.name && (msg.to !== node.name)) {
|
||||||
node.warn(RED._("common.errors.nooverride"));
|
node.warn(RED._("node-red:common.errors.nooverride"));
|
||||||
}
|
}
|
||||||
var sendopts = { from: node.userid }; // sender address
|
var sendopts = { from: node.userid }; // sender address
|
||||||
sendopts.to = node.name || msg.to; // comma separated list of addressees
|
sendopts.to = node.name || msg.to; // comma separated list of addressees
|
||||||
@ -237,20 +237,20 @@ module.exports = function(RED) {
|
|||||||
node.log(RED._("email.status.newemail",{topic:pay.topic}));
|
node.log(RED._("email.status.newemail",{topic:pay.topic}));
|
||||||
}
|
}
|
||||||
else { node.log(RED._("email.status.duplicate",{topic:pay.topic})); }
|
else { node.log(RED._("email.status.duplicate",{topic:pay.topic})); }
|
||||||
//node.status({fill:"green",shape:"dot",text:RED._("common.status.ok")});
|
//node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.ok")});
|
||||||
node.status({});
|
node.status({});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
node.log(RED._("email.status.inboxzero"));
|
node.log(RED._("email.status.inboxzero"));
|
||||||
//node.status({fill:"green",shape:"dot",text:RED._("common.status.ok")});
|
//node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.ok")});
|
||||||
node.status({});
|
node.status({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
imap.end();
|
imap.end();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
node.status({fill:"grey",shape:"dot",text:RED._("common.status.connecting")});
|
node.status({fill:"grey",shape:"dot",text:RED._("node-red:common.status.connecting")});
|
||||||
imap.connect();
|
imap.connect();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
<input type="text" id="node-input-interval" style="width: 50px"> <span data-i18n="feedparse.label.minutes"></span>
|
<input type="text" id="node-input-interval" style="width: 50px"> <span data-i18n="feedparse.label.minutes"></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
<input type="text" id="node-input-channel" placeholder="#nodered">
|
<input type="text" id="node-input-channel" placeholder="#nodered">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips"><span data-i18n="[html]irc.tip.in"></span></div>
|
<div class="form-tips"><span data-i18n="[html]irc.tip.in"></span></div>
|
||||||
</script>
|
</script>
|
||||||
@ -133,8 +133,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips"><span data-i18n="[html]irc.tip.out"></span></div>
|
<div class="form-tips"><span data-i18n="[html]irc.tip.out"></span></div>
|
||||||
</script>
|
</script>
|
||||||
|
@ -48,7 +48,7 @@ module.exports = function(RED) {
|
|||||||
var node = this;
|
var node = this;
|
||||||
if (node.serverConfig.ircclient === null) {
|
if (node.serverConfig.ircclient === null) {
|
||||||
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server);
|
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server);
|
||||||
node.status({fill:"grey",shape:"dot",text:RED._("common.status.connecting")});
|
node.status({fill:"grey",shape:"dot",text:RED._("node-red:common.status.connecting")});
|
||||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
||||||
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
||||||
node.serverConfig.ircclient.setMaxListeners(0);
|
node.serverConfig.ircclient.setMaxListeners(0);
|
||||||
@ -58,7 +58,7 @@ module.exports = function(RED) {
|
|||||||
node.serverConfig.ircclient.addListener('netError', function(message) {
|
node.serverConfig.ircclient.addListener('netError', function(message) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.net")+": "+JSON.stringify(message)); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.net")+": "+JSON.stringify(message)); }
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.neterror")});
|
node.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.neterror")});
|
||||||
});
|
});
|
||||||
node.serverConfig.ircclient.addListener('connect', function() {
|
node.serverConfig.ircclient.addListener('connect', function() {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
@ -67,21 +67,21 @@ module.exports = function(RED) {
|
|||||||
node.serverConfig.ircclient.addListener('registered', function(message) {
|
node.serverConfig.ircclient.addListener('registered', function(message) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
node.log(node.serverConfig.ircclient.nick+" "+RED._("irc.errors.online")+": "+message.server);
|
node.log(node.serverConfig.ircclient.nick+" "+RED._("irc.errors.online")+": "+message.server);
|
||||||
node.status({fill:"yellow",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"yellow",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
node.serverConfig.ircclient.join( node.channel, function(data) {
|
node.serverConfig.ircclient.join( node.channel, function(data) {
|
||||||
node.log(data+" "+RED._("irc.errors.joined")+": "+node.channel);
|
node.log(data+" "+RED._("irc.errors.joined")+": "+node.channel);
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.joined")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.joined")});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
node.serverConfig.ircclient.addListener('ping', function(server) {
|
node.serverConfig.ircclient.addListener('ping', function(server) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.ping")+" "+JSON.stringify(server)); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.ping")+" "+JSON.stringify(server)); }
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.ok")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.ok")});
|
||||||
});
|
});
|
||||||
node.serverConfig.ircclient.addListener('quit', function(nick, reason, channels, message) {
|
node.serverConfig.ircclient.addListener('quit', function(nick, reason, channels, message) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.quit")+": "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.quit")+": "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
||||||
node.status({fill:"grey",shape:"ring",text:RED._("common.status.quit")});
|
node.status({fill:"grey",shape:"ring",text:RED._("node-red:common.status.quit")});
|
||||||
//node.serverConfig.ircclient.disconnect( function() {
|
//node.serverConfig.ircclient.disconnect( function() {
|
||||||
// node.serverConfig.ircclient.connect();
|
// node.serverConfig.ircclient.connect();
|
||||||
//});
|
//});
|
||||||
@ -102,7 +102,7 @@ module.exports = function(RED) {
|
|||||||
if ((Date.now()-node.serverConfig.lastseen) > 300000) { // If more than 5 mins
|
if ((Date.now()-node.serverConfig.lastseen) > 300000) { // If more than 5 mins
|
||||||
//node.serverConfig.ircclient.disconnect();
|
//node.serverConfig.ircclient.disconnect();
|
||||||
//node.serverConfig.ircclient.connect();
|
//node.serverConfig.ircclient.connect();
|
||||||
node.status({fill:"grey",shape:"ring",text:RED._("common.status.noconnection")});
|
node.status({fill:"grey",shape:"ring",text:RED._("node-red:common.status.noconnection")});
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.connectionlost")); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.connectionlost")); }
|
||||||
}
|
}
|
||||||
//node.serverConfig.ircclient.send.apply(node.serverConfig.ircclient,["TIME"]); // request time to check link
|
//node.serverConfig.ircclient.send.apply(node.serverConfig.ircclient,["TIME"]); // request time to check link
|
||||||
@ -114,10 +114,10 @@ module.exports = function(RED) {
|
|||||||
|
|
||||||
node.ircclient.addListener('registered', function(message) {
|
node.ircclient.addListener('registered', function(message) {
|
||||||
//node.log(node.ircclient.nick+" "+RED._("irc.errors.online"));
|
//node.log(node.ircclient.nick+" "+RED._("irc.errors.online"));
|
||||||
node.status({fill:"yellow",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"yellow",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
node.ircclient.join( node.channel, function(data) {
|
node.ircclient.join( node.channel, function(data) {
|
||||||
// node.log(data+" "+RED._("irc.errors.joined")+" "+node.channel);
|
// node.log(data+" "+RED._("irc.errors.joined")+" "+node.channel);
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.joined")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.joined")});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
node.ircclient.addListener('message', function (from, to, message) {
|
node.ircclient.addListener('message', function (from, to, message) {
|
||||||
@ -183,7 +183,7 @@ module.exports = function(RED) {
|
|||||||
var node = this;
|
var node = this;
|
||||||
if (node.serverConfig.ircclient === null) {
|
if (node.serverConfig.ircclient === null) {
|
||||||
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server);
|
node.log(RED._("irc.errors.connect")+": "+node.serverConfig.server);
|
||||||
node.status({fill:"grey",shape:"dot",text:RED._("common.status.connecting")});
|
node.status({fill:"grey",shape:"dot",text:RED._("node-red:common.status.connecting")});
|
||||||
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
var options = {autoConnect:true,autoRejoin:false,floodProtection:true,secure:node.serverConfig.ssl,selfSigned:node.serverConfig.cert,port:node.serverConfig.port,retryDelay:20000};
|
||||||
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
node.serverConfig.ircclient = new irc.Client(node.serverConfig.server, node.serverConfig.nickname, options);
|
||||||
node.serverConfig.ircclient.setMaxListeners(0);
|
node.serverConfig.ircclient.setMaxListeners(0);
|
||||||
@ -193,7 +193,7 @@ module.exports = function(RED) {
|
|||||||
node.serverConfig.ircclient.addListener('netError', function(message) {
|
node.serverConfig.ircclient.addListener('netError', function(message) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.net")+": "+JSON.stringify(message)); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.net")+": "+JSON.stringify(message)); }
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.neterror")});
|
node.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.neterror")});
|
||||||
});
|
});
|
||||||
node.serverConfig.ircclient.addListener('connect', function() {
|
node.serverConfig.ircclient.addListener('connect', function() {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
@ -202,21 +202,21 @@ module.exports = function(RED) {
|
|||||||
node.serverConfig.ircclient.addListener('registered', function(message) {
|
node.serverConfig.ircclient.addListener('registered', function(message) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
node.log(node.serverConfig.ircclient.nick+" "+RED._("irc.errors.online")+": "+message.server);
|
node.log(node.serverConfig.ircclient.nick+" "+RED._("irc.errors.online")+": "+message.server);
|
||||||
node.status({fill:"yellow",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"yellow",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
node.serverConfig.ircclient.join( node.channel, function(data) {
|
node.serverConfig.ircclient.join( node.channel, function(data) {
|
||||||
node.log(data+" "+RED._("irc.errors.joined")+": "+node.channel);
|
node.log(data+" "+RED._("irc.errors.joined")+": "+node.channel);
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.joined")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.joined")});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
node.serverConfig.ircclient.addListener('ping', function(server) {
|
node.serverConfig.ircclient.addListener('ping', function(server) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.ping")+" "+JSON.stringify(server)); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.ping")+" "+JSON.stringify(server)); }
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.ok")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.ok")});
|
||||||
});
|
});
|
||||||
node.serverConfig.ircclient.addListener('quit', function(nick, reason, channels, message) {
|
node.serverConfig.ircclient.addListener('quit', function(nick, reason, channels, message) {
|
||||||
node.serverConfig.lastseen = Date.now();
|
node.serverConfig.lastseen = Date.now();
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.quit")+": "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.quit")+": "+nick+" "+reason+" "+channels+" "+JSON.stringify(message)); }
|
||||||
node.status({fill:"grey",shape:"ring",text:RED._("common.status.quit")});
|
node.status({fill:"grey",shape:"ring",text:RED._("node-red:common.status.quit")});
|
||||||
//node.serverConfig.ircclient.disconnect( function() {
|
//node.serverConfig.ircclient.disconnect( function() {
|
||||||
// node.serverConfig.ircclient.connect();
|
// node.serverConfig.ircclient.connect();
|
||||||
//});
|
//});
|
||||||
@ -237,7 +237,7 @@ module.exports = function(RED) {
|
|||||||
if ((Date.now()-node.serverConfig.lastseen) > 300000) { // If more than 5 mins
|
if ((Date.now()-node.serverConfig.lastseen) > 300000) { // If more than 5 mins
|
||||||
//node.serverConfig.ircclient.disconnect();
|
//node.serverConfig.ircclient.disconnect();
|
||||||
//node.serverConfig.ircclient.connect();
|
//node.serverConfig.ircclient.connect();
|
||||||
node.status({fill:"grey",shape:"ring",text:RED._("common.status.noconnection")});
|
node.status({fill:"grey",shape:"ring",text:RED._("node-red:common.status.noconnection")});
|
||||||
if (RED.settings.verbose) { node.log(RED._("irc.errors.connectionlost")); }
|
if (RED.settings.verbose) { node.log(RED._("irc.errors.connectionlost")); }
|
||||||
}
|
}
|
||||||
//node.serverConfig.ircclient.send.apply(node.serverConfig.ircclient,["TIME"]); // request time to check link
|
//node.serverConfig.ircclient.send.apply(node.serverConfig.ircclient,["TIME"]); // request time to check link
|
||||||
|
@ -111,8 +111,8 @@
|
|||||||
<input type="text" id="node-input-tags" data-i18n="[placeholder]twitter.placeholder.for">
|
<input type="text" id="node-input-tags" data-i18n="[placeholder]twitter.placeholder.for">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips"><span data-i18n="[html]twitter.tip"></span></div>
|
<div class="form-tips"><span data-i18n="[html]twitter.tip"></span></div>
|
||||||
</script>
|
</script>
|
||||||
@ -194,8 +194,8 @@
|
|||||||
<input type="text" id="node-input-twitter">
|
<input type="text" id="node-input-twitter">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -34,8 +34,8 @@
|
|||||||
<input type="password" id="node-config-input-password">
|
<input type="password" id="node-config-input-password">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-config-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-config-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-config-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -94,8 +94,8 @@
|
|||||||
<label for="node-input-multi" style="width: 70%;"><span data-i18n="mongodb.label.updateall"></span></label>
|
<label for="node-input-multi" style="width: 70%;"><span data-i18n="mongodb.label.updateall"></span></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips" id="node-warning" style="display: none"><span data-i18n="[html]mongodb.tip"></span></div>
|
<div class="form-tips" id="node-warning" style="display: none"><span data-i18n="[html]mongodb.tip"></span></div>
|
||||||
</script>
|
</script>
|
||||||
@ -187,8 +187,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips" id="node-warning" style="display: none"><span data-i18n="[html]mongodb.tip"></span></div>
|
<div class="form-tips" id="node-warning" style="display: none"><span data-i18n="[html]mongodb.tip"></span></div>
|
||||||
</script>
|
</script>
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="common.label.name"></span></label>
|
<label for="node-input-name"><i class="fa fa-tag"></i> <span data-i18n="node-red:common.label.name"></span></label>
|
||||||
<input type="text" id="node-input-name" data-i18n="[placeholder]common.label.name">
|
<input type="text" id="node-input-name" data-i18n="[placeholder]node-red:common.label.name">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-tips"><span data-i18n="[html]redisout.tip"></span></div>
|
<div class="form-tips"><span data-i18n="[html]redisout.tip"></span></div>
|
||||||
</script>
|
</script>
|
||||||
|
@ -43,7 +43,7 @@ module.exports = function(RED) {
|
|||||||
clearTimeout(connection.retry_timer);
|
clearTimeout(connection.retry_timer);
|
||||||
connection.end();
|
connection.end();
|
||||||
}
|
}
|
||||||
delete connections[connection._id];
|
delete connections[connection._id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -61,17 +61,17 @@ module.exports = function(RED) {
|
|||||||
this.client = redisConnectionPool.get(this.hostname,this.port);
|
this.client = redisConnectionPool.get(this.hostname,this.port);
|
||||||
|
|
||||||
if (this.client.connected) {
|
if (this.client.connected) {
|
||||||
this.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
this.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
} else {
|
} else {
|
||||||
this.status({fill:"red",shape:"ring",text:RED._("common.status.disconnected")},true);
|
this.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.disconnected")},true);
|
||||||
}
|
}
|
||||||
|
|
||||||
var node = this;
|
var node = this;
|
||||||
this.client.on("end", function() {
|
this.client.on("end", function() {
|
||||||
node.status({fill:"red",shape:"ring",text:RED._("common.status.disconnected")});
|
node.status({fill:"red",shape:"ring",text:RED._("node-red:common.status.disconnected")});
|
||||||
});
|
});
|
||||||
this.client.on("connect", function() {
|
this.client.on("connect", function() {
|
||||||
node.status({fill:"green",shape:"dot",text:RED._("common.status.connected")});
|
node.status({fill:"green",shape:"dot",text:RED._("node-red:common.status.connected")});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.on("input", function(msg) {
|
this.on("input", function(msg) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user