1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge branch 'master' into 0.19

This commit is contained in:
Nick O'Leary 2018-07-18 13:22:35 +01:00
commit cecea318da
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
3 changed files with 16 additions and 8 deletions

View File

@ -212,11 +212,11 @@ module.exports = function(RED) {
if (this.serverConfig) { if (this.serverConfig) {
this.serverConfig.registerInputNode(this); this.serverConfig.registerInputNode(this);
// TODO: nls // TODO: nls
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:RED._("websocket.status.connected",{count: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:"common.status.error"}); });
this.serverConfig.on('closed', function(n) { this.serverConfig.on('closed', function(n) {
if (n > 0) { node.status({fill:"green",shape:"dot",text:"connected "+n}); } if (n > 0) { node.status({fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:n})}); }
else { node.status({fill:"red",shape:"ring",text:"disconnected"}); } else { node.status({fill:"red",shape:"ring",text:"common.status.disconnected"}); }
}); });
} else { } else {
this.error(RED._("websocket.errors.missing-conf")); this.error(RED._("websocket.errors.missing-conf"));
@ -240,11 +240,11 @@ module.exports = function(RED) {
} }
else { else {
// TODO: nls // TODO: nls
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:RED._("websocket.status.connected",{count: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:"common.status.error"}); });
this.serverConfig.on('closed', function(n) { this.serverConfig.on('closed', function(n) {
if (n > 0) { node.status({fill:"green",shape:"dot",text:"connected "+n}); } if (n > 0) { node.status({fill:"green",shape:"dot",text:RED._("websocket.status.connected",{count:n})}); }
else { node.status({fill:"red",shape:"ring",text:"disconnected"}); } else { node.status({fill:"red",shape:"ring",text:"common.status.disconnected"}); }
}); });
} }
this.on("input", function(msg) { this.on("input", function(msg) {

View File

@ -422,6 +422,10 @@
"url1": "URL should use ws:// or wss:// scheme and point to an existing websocket listener.", "url1": "URL should use ws:// or wss:// scheme and point to an existing websocket listener.",
"url2": "By default, <code>payload</code> will contain the data to be sent over, or received from a websocket. The client can be configured to send or receive the entire message object as a JSON formatted string." "url2": "By default, <code>payload</code> will contain the data to be sent over, or received from a websocket. The client can be configured to send or receive the entire message object as a JSON formatted string."
}, },
"status": {
"connected": "connected __count__",
"connected_plural": "connected __count__"
},
"errors": { "errors": {
"connect-error": "An error occured on the ws connection: ", "connect-error": "An error occured on the ws connection: ",
"send-error": "An error occurred while sending: ", "send-error": "An error occurred while sending: ",

View File

@ -422,6 +422,10 @@
"url1": "URLには ws:&#47;&#47; または wss:&#47;&#47; スキーマを使用して、存在するwebsocketリスナを設定してください。", "url1": "URLには ws:&#47;&#47; または wss:&#47;&#47; スキーマを使用して、存在するwebsocketリスナを設定してください。",
"url2": "標準では <code>payload</code> がwebsocketから送信、受信されるデータを持ちます。クライアントはJSON形式の文字列としてメッセージ全体を送信、受信するよう設定できます。" "url2": "標準では <code>payload</code> がwebsocketから送信、受信されるデータを持ちます。クライアントはJSON形式の文字列としてメッセージ全体を送信、受信するよう設定できます。"
}, },
"status": {
"connected": "接続数 __count__",
"connected_plural": "接続数 __count__"
},
"errors": { "errors": {
"connect-error": "ws接続でエラーが発生しました: ", "connect-error": "ws接続でエラーが発生しました: ",
"send-error": "送信中にエラーが発生しました: ", "send-error": "送信中にエラーが発生しました: ",