8784: Fix test for latest firefox.
[arvados.git] / apps / workbench / app / views / users / _virtual_machines.html.erb
1 <div class="panel panel-default">
2   <div class="panel-heading">
3     <h4 class="panel-title">
4       <%= link_to virtual_machines_user_path(current_user) do %>
5         Virtual Machines
6       <% end %>
7
8     </h4>
9   </div>
10
11 <div id="manage_virtual_machines" class="panel-body">
12   <p>
13     For more information see <%= link_to raw('Arvados Docs &rarr; User Guide &rarr; VM access'),
14   "#{Rails.configuration.arvados_docsite}/user/getting_started/vm-login-with-webshell.html",
15   target: "_blank"%>.
16   </p>
17
18   <% if !@my_virtual_machines.any? %>
19     <div id="no_shell_access" class="no_shell_access">
20       <div class="alert alert-warning clearfix">
21         <p>
22           You do not have access to any virtual machines.  Some
23           Arvados features require using the command line.  You may
24           request access to a hosted virtual machine with the command
25           line shell.
26         </p>
27         <div class="pull-right">
28           <%= link_to({
29               action: 'request_shell_access',
30               controller: 'users',
31               id: current_user.uuid
32               },
33               method: :post,
34               remote: true,
35               class: 'btn btn-xs btn-primary',
36               data: {
37               disable_with: "Sending request...",
38               on_error_hide: '.no_shell_access .alert-success',
39               on_error_show: '.no_shell_access .alert-danger',
40               on_error_write: '.no_shell_access .alert-danger .error-text',
41               on_success_hide: '.no_shell_access .alert-danger',
42               }) do %>
43             Send request for shell access
44           <% end %>
45         </div>
46       </div>
47       <div class="alert alert-success" style="display:none">
48         <p class="contain-align-left"><%# (see javascripts/request_shell_access.js) %></p>
49       </div>
50       <div class="alert alert-danger" style="display:none">
51         <p class="contain-align-left">Sorry, something went wrong. Please try again. (<span class="error-text"></span>)</p>
52       </div>
53     </div>
54   <% else %>
55     <script> localStorage.removeItem('request_shell_access'); </script>
56     <table class="table virtual-machines-table">
57       <colgroup>
58         <col style="width: 25%" />
59         <col style="width: 25%" />
60         <col style="width: 50%" />
61       </colgroup>
62       <thead>
63         <tr>
64           <th> Host name </th>
65           <th> Login name </th>
66           <th> Command line </th>
67           <% if Rails.configuration.shell_in_a_box_url %>
68             <th> Web shell <span class="label label-info">beta</span></th>
69           <% end %>
70         </tr>
71       </thead>
72       <tbody>
73         <% @my_virtual_machines.andand.each do |vm| %>
74           <tr>
75             <td style="word-break:break-all;">
76               <%= vm[:hostname] %>
77             </td>
78             <td style="word-break:break-all;">
79               <%= @my_vm_logins[vm[:uuid]].andand.compact.andand.join(", ") %>
80             </td>
81             <td style="word-break:break-all;">
82               <% if @my_vm_logins[vm[:uuid]] %>
83                 <% @my_vm_logins[vm[:uuid]].each do |login| %>
84                   <code>ssh&nbsp;<%= login %>@<%= vm[:hostname] %>.arvados</code>
85                 <% end %>
86               <% end %>
87             </td>
88             <% if Rails.configuration.shell_in_a_box_url %>
89               <td>
90                 <% @my_vm_logins[vm[:uuid]].andand.each do |login| %>
91                   <%= link_to webshell_virtual_machine_path(vm, login: login), title: "Open a terminal session in your browser", class: 'btn btn-xs btn-default', target: "_blank" do %>
92                     Log in as <%= login %><br />
93                   <% end %>
94                 <% end %>
95               </td>
96             <% end %>
97           </tr>
98         <% end %>
99       </tbody>
100     </table>
101   <% end %>
102 </div>
103 </div>
104   <p>In order to access virtual machines using SSH, <%= link_to ssh_keys_user_path(current_user) do%> add an SSH key to your account<%end%> and add a section like this to your SSH configuration file ( <i>~/.ssh/config</i>):</p>
105     <pre>Host *.arvados
106       TCPKeepAlive yes
107       ServerAliveInterval 60
108       ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
109     </pre>