Improved error message if network connection got lost.

This commit is contained in:
Martin Edenhofer 2013-06-19 10:22:26 +02:00
parent 040b0581fb
commit d668fc7d6c

View file

@ -147,7 +147,7 @@ class _Singleton extends App.Controller
check = => check = =>
@log 'Websocket', 'notice', 'no websockend ping response, reconnect...' @log 'Websocket', 'notice', 'no websockend ping response, reconnect...'
@close() @close()
@delay check, 120000, 'websocket-ping-check', 'ws' @delay check, 90000, 'websocket-ping-check', 'ws'
pong: -> pong: ->
return if @backend is 'ajax' return if @backend is 'ajax'
@ -183,7 +183,8 @@ class _Singleton extends App.Controller
@clearDelay('websocket-no-connection-try-reconnect') @clearDelay('websocket-no-connection-try-reconnect')
if @error if @error
@error.modalHide() @error.modalHide()
@error = undefined @error = false
@tryToConnect = false
@auth() @auth()
@ -202,7 +203,7 @@ class _Singleton extends App.Controller
@_receiveMessage(pipe) @_receiveMessage(pipe)
@ws.onclose = (e) => @ws.onclose = (e) =>
@log 'Websocket', 'debug', "ws:onclose", e @log 'Websocket', 'notice', 'close websocket connection'
# take connection down and keep it down # take connection down and keep it down
return if @connectionKeepDown return if @connectionKeepDown
@ -226,8 +227,12 @@ class _Singleton extends App.Controller
return return
# show reconnect message # show reconnect message
@error = new App.ErrorModal( @error = new App.ControllerModal(
message: 'No connection to websocket, trying to reconnect...' title: 'Lost network connection!'
message: 'Lost network connection to system, trying to reconnect...'
backdrop: false
keyboard: false
show: true
) )
if !@tryToConnect if !@tryToConnect
@delay message, 7000, 'websocket-no-connection-try-reconnect-message', 'ws' @delay message, 7000, 'websocket-no-connection-try-reconnect-message', 'ws'