mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Websocket - fix broken test (or rather - fix code to pass test)
This commit is contained in:
parent
518358d9dc
commit
f11b906fd9
@ -180,12 +180,12 @@ module.exports = function(RED) {
|
|||||||
this.serverConfig = RED.nodes.getNode(this.server);
|
this.serverConfig = RED.nodes.getNode(this.server);
|
||||||
if (this.serverConfig) {
|
if (this.serverConfig) {
|
||||||
this.serverConfig.registerInputNode(this);
|
this.serverConfig.registerInputNode(this);
|
||||||
} else {
|
|
||||||
this.error("Missing server configuration");
|
|
||||||
}
|
|
||||||
this.serverConfig.on('opened', function(n) { node.status({fill:"green",shape:"dot",text:"connected "+n}); });
|
this.serverConfig.on('opened', function(n) { node.status({fill:"green",shape:"dot",text:"connected "+n}); });
|
||||||
this.serverConfig.on('erro', function() { node.status({fill:"red",shape:"ring",text:"error"}); });
|
this.serverConfig.on('erro', function() { node.status({fill:"red",shape:"ring",text:"error"}); });
|
||||||
this.serverConfig.on('closed', function() { node.status({fill:"red",shape:"ring",text:"disconnected"}); });
|
this.serverConfig.on('closed', function() { node.status({fill:"red",shape:"ring",text:"disconnected"}); });
|
||||||
|
} else {
|
||||||
|
this.error("Missing server configuration");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RED.nodes.registerType("websocket in",WebSocketInNode);
|
RED.nodes.registerType("websocket in",WebSocketInNode);
|
||||||
|
|
||||||
@ -197,9 +197,11 @@ module.exports = function(RED) {
|
|||||||
if (!this.serverConfig) {
|
if (!this.serverConfig) {
|
||||||
this.error("Missing server configuration");
|
this.error("Missing server configuration");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
this.serverConfig.on('opened', function(n) { node.status({fill:"green",shape:"dot",text:"connected "+n}); });
|
this.serverConfig.on('opened', function(n) { node.status({fill:"green",shape:"dot",text:"connected "+n}); });
|
||||||
this.serverConfig.on('erro', function() { node.status({fill:"red",shape:"ring",text:"error"}); });
|
this.serverConfig.on('erro', function() { node.status({fill:"red",shape:"ring",text:"error"}); });
|
||||||
this.serverConfig.on('closed', function() { node.status({fill:"red",shape:"ring",text:"disconnected"}); });
|
this.serverConfig.on('closed', function() { node.status({fill:"red",shape:"ring",text:"disconnected"}); });
|
||||||
|
}
|
||||||
this.on("input", function(msg) {
|
this.on("input", function(msg) {
|
||||||
var payload;
|
var payload;
|
||||||
if (this.serverConfig.wholemsg) {
|
if (this.serverConfig.wholemsg) {
|
||||||
|
Loading…
Reference in New Issue
Block a user