Merge branch '8784-dir-listings'
[arvados.git] / apps / workbench / app / views / virtual_machines / webshell.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <html>
6     <title><%= @object.hostname %> / <%= Rails.configuration.site_name %></title>
7     <link rel="stylesheet" href="<%= asset_path 'webshell/styles.css' %>" type="text/css">
8     <style type="text/css">
9       body {
10         margin: 0px;
11       }
12     </style>
13     <script type="text/javascript"><!--
14       (function() {
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;' +
26                          '}' +
27                          '</style>');
28         }
29       })();
30
31       function login(username, token) {
32         var sh = new ShellInABox("<%= j @webshell_url %>");
33         setTimeout(function() {
34           sh.keysPressed("<%= j params[:login] %>\n");
35           setTimeout(function() {
36             sh.keysPressed("<%= j Thread.current[:arvados_api_token] %>\n");
37             sh.vt100('(sent authentication token)\n');
38           }, 2000);
39         }, 2000);
40       }
41     // -->
42 </script>
43     <link rel="icon" href="<%= asset_path 'favicon.ico' %>" type="image/x-icon">
44     <script type="text/javascript" src="<%= asset_path 'webshell/shell_in_a_box.js' %>"></script>
45   </head>
46   <!-- Load ShellInABox from a timer as Konqueror sometimes fails to
47        correctly deal with the enclosing frameset (if any), if we do not
48        do this
49    -->
50 <body onload="setTimeout(login, 1000)"
51     scroll="no"><noscript>JavaScript must be enabled for ShellInABox</noscript>
52 </body>
53 </html>