1 <%# Copyright (C) The Arvados Authors. All rights reserved.
3 SPDX-License-Identifier: AGPL-3.0 %>
6 <title><%= @object.hostname %> / <%= Rails.configuration.Workbench.SiteName %></title>
7 <link rel="stylesheet" href="<%= asset_path 'webshell/styles.css' %>" type="text/css">
8 <style type="text/css">
13 <script type="text/javascript"><!--
15 // We would like to hide overflowing lines as this can lead to
16 // visually jarring results if the browser substitutes oversized
17 // Unicode characters from different fonts. Unfortunately, a bug
18 // in Firefox prevents it from allowing multi-line text
19 // selections whenever we change the "overflow" style. So, only
20 // do so for non-Netscape browsers.
21 if (typeof navigator.appName == 'undefined' ||
22 navigator.appName != 'Netscape') {
23 document.write('<style type="text/css">' +
24 '#vt100 #console div, #vt100 #alt_console div {' +
25 ' overflow: hidden;' +
31 function login(username, token) {
32 var sh = new ShellInABox("<%= j @webshell_url %>");
34 var findText = function(txt) {
35 var a = document.querySelectorAll("span.ansi0");
36 for (var i = 0; i < a.length; i++) {
37 if (a[i].textContent.indexOf(txt) > -1) {
44 var trySendToken = function() {
45 // change this text when PAM is reconfigured to present a
46 // password prompt that we can wait for.
47 if (findText("login:")) {
48 sh.keysPressed("<%= j Thread.current[:arvados_api_token] %>\n");
49 sh.vt100('(sent authentication token)\n');
51 setTimeout(trySendToken, 200);
55 var trySendLogin = function() {
56 if (findText("login:")) {
57 sh.keysPressed("<%= j params[:login] %>\n");
58 // Make this wait shorter when PAM is reconfigured to
59 // present a password prompt that we can wait for.
60 setTimeout(trySendToken, 3000);
62 setTimeout(trySendLogin, 200);
70 <script type="text/javascript" src="<%= asset_path 'webshell/shell_in_a_box.js' %>"></script>
72 <!-- Load ShellInABox from a timer as Konqueror sometimes fails to
73 correctly deal with the enclosing frameset (if any), if we do not
76 <body onload="setTimeout(login, 1000)"
77 scroll="no"><noscript>JavaScript must be enabled for ShellInABox</noscript>