X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6929750b2f8f1f0b01b40f0ac516ec5f9e431c4d..ce7d731ac808245bd44d1999001a1e9de8f0e4db:/apps/workbench/public/webshell/shell_in_a_box.js diff --git a/apps/workbench/public/webshell/shell_in_a_box.js b/apps/workbench/public/webshell/shell_in_a_box.js index 6fdf10d721..0c7e800ef8 100644 --- a/apps/workbench/public/webshell/shell_in_a_box.js +++ b/apps/workbench/public/webshell/shell_in_a_box.js @@ -134,7 +134,9 @@ ShellInABox.prototype.sessionClosed = function() { } this.vt100('Session closed.'); } - this.showReconnect(true); + // Revealing the "reconnect" button is commented out until we hook + // up the username+token auto-login mechanism to the new session: + //this.showReconnect(true); } catch (e) { } }; @@ -185,6 +187,7 @@ ShellInABox.prototype.sendRequest = function(request) { } } }(this); + ShellInABox.lastRequestSent = Date.now(); request.send(content); }; @@ -205,8 +208,13 @@ ShellInABox.prototype.onReadyStateChange = function(request) { this.sendRequest(request); } } else if (request.status == 0) { - // Time Out - this.sendRequest(request); + if (ShellInABox.lastRequestSent + 2000 < Date.now()) { + // Timeout, try again + this.sendRequest(request); + } else { + this.vt100('\r\n\r\nRequest failed.'); + this.sessionClosed(); + } } else { this.sessionClosed(); }