projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
9587: include "owner" in trash rows; update trash icon.
[arvados.git]
/
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 448bfda59a7f8518507e142e862b57fe0098aafe..0c7e800ef8e71aa308fb8d2af6f51b0498d0e8ac 100644
(file)
--- 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.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) {
}
};
} catch (e) {
}
};
@@
-175,7
+177,6
@@
ShellInABox.prototype.sendRequest = function(request) {
(this.session ? '&session=' +
encodeURIComponent(this.session) : '&rooturl='+
encodeURIComponent(this.rooturl));
(this.session ? '&session=' +
encodeURIComponent(this.session) : '&rooturl='+
encodeURIComponent(this.rooturl));
- request.setRequestHeader('Content-Length', content.length);
request.onreadystatechange = function(shellInABox) {
return function() {
request.onreadystatechange = function(shellInABox) {
return function() {
@@
-186,6
+187,7
@@
ShellInABox.prototype.sendRequest = function(request) {
}
}
}(this);
}
}
}(this);
+ ShellInABox.lastRequestSent = Date.now();
request.send(content);
};
request.send(content);
};
@@
-206,8
+208,13
@@
ShellInABox.prototype.onReadyStateChange = function(request) {
this.sendRequest(request);
}
} else if (request.status == 0) {
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();
}
} else {
this.sessionClosed();
}
@@
-233,7
+240,6
@@
ShellInABox.prototype.sendKeys = function(keys) {
'&height=' + this.terminalHeight +
'&session=' +encodeURIComponent(this.session)+
'&keys=' + encodeURIComponent(keys);
'&height=' + this.terminalHeight +
'&session=' +encodeURIComponent(this.session)+
'&keys=' + encodeURIComponent(keys);
- request.setRequestHeader('Content-Length', content.length);
request.onreadystatechange = function(shellInABox) {
return function() {
try {
request.onreadystatechange = function(shellInABox) {
return function() {
try {