[verto-communicator] - Added change server feature

When someone set any wss server and do login
VC doesn't record the settings on localStorage,
so when we reload the browser, it will try to connect on
"wss://" + window.location.hostname + ":8082" and if
this wss server is offline for any reason, user will
be stuck on splash screen by auto-login step plus reconnect
modal blocking any action.

- Added button "Change Server" on modal reconnection alert;
- Stop jsonRpcClient retry timeout and delete verto instance
to create a new one when user login with new wss server;
- Record wss server and hostname on localStorage.
This commit is contained in:
StefanYohansson
2016-12-27 11:25:35 -03:00
committed by Mike Jerris
parent 8c12569d0e
commit 42f94a112b
6 changed files with 29 additions and 11 deletions

View File

@@ -359,6 +359,11 @@
return self._ws_socket ? true : false;
};
$.JsonRpcClient.prototype.stopRetrying = function() {
if (self.to)
clearTimeout(self.to);
}
$.JsonRpcClient.prototype._getSocket = function(onmessage_cb) {
// If there is no ws url set, we don't have a socket.
// Likewise, if there is no window.WebSocket.