From 17d499cbe389d7c16d9d39a360c010178870439e Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 10 May 2015 09:21:42 +0200 Subject: [PATCH] Improved logging. --- .../app/lib/app_post/websocket.js.coffee | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee index 22db43da0..8c08194ba 100644 --- a/app/assets/javascripts/app/lib/app_post/websocket.js.coffee +++ b/app/assets/javascripts/app/lib/app_post/websocket.js.coffee @@ -34,7 +34,7 @@ class App.WebSocket class _webSocketSingleton extends App.Controller @include App.LogInclude - queue: [] + queue: [] supported: true lastSpoolMessage: undefined sentSpoolFinished: true @@ -43,6 +43,7 @@ class _webSocketSingleton extends App.Controller connectionWasEstablished: false tryToConnect: false backend: 'websocket' + backend_port: '' client_id: undefined error: false @@ -185,14 +186,16 @@ class _webSocketSingleton extends App.Controller if @backend is 'websocket' @ws = new window.WebSocket( protocol + window.location.hostname + '/ws' ) else if @backend is 'websocketPort' - websocket_port = App.Config.get('websocket_port') || '6042' - @ws = new window.WebSocket( protocol + window.location.hostname + ':' + websocket_port + '/' ) + @backend_port = App.Config.get('websocket_port') || '6042' + @ws = new window.WebSocket( protocol + window.location.hostname + ':' + @backend_port + '/' ) else @_ajaxInit() # Set event handlers. @ws.onopen = => - @log 'notice', "new websocket (#{@channel()}) connection open" + if @backend_port + port = ":#{@backend_port}" + @log 'notice', "new websocket (#{@channel()}#{port}) connection open" @connectionEstablished = true @connectionWasEstablished = true @@ -201,7 +204,7 @@ class _webSocketSingleton extends App.Controller App.Delay.clear('websocket-no-connection-try-reconnect-message', 'ws') if @error @error.hide() - @error = false + @error = false @tryToConnect = false @auth()