9c40d708a1c833439d67551ea278833f418d4bb2
[arvados.git] / apps / workbench / app / views / users / _manage_virtual_machines.html.erb
1 <div>
2   <p>
3     For more information see <%= link_to raw('Arvados Docs &rarr; User Guide &rarr; SSH access'),
4   "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html",
5   target: "_blank"%>.  A sample <i>~/.ssh/config</i> entry is provided below.
6   </p>
7
8   <% if !@my_virtual_machines.any? %>
9     You do not have access to any virtual machines. Many of the Arvados features depend on having shell access to a hosted VM.
10     &nbsp; <%= link_to 'Request shell access', request_shell_access_user_url(id: current_user.uuid),
11                         {class: 'btn btn-xs btn-primary', :remote => true}  %>
12   <% else %>
13     <table class="table virtual-machines-table">
14       <colgroup>
15         <col style="width: 25%" />
16         <col style="width: 25%" />
17         <col style="width: 50%" />
18       </colgroup>
19       <thead>
20         <tr>
21           <th> Host name </th>
22           <th> Login name </th>
23           <th> Command line </th>
24         </tr>
25       </thead>
26       <tbody>
27         <% @my_virtual_machines.andand.each do |vm| %>
28           <tr>
29             <td style="word-break:break-all;">
30               <%= vm[:hostname] %>
31             </td>
32             <td style="word-break:break-all;">
33               <%= @my_vm_logins[vm[:uuid]].andand.compact.andand.join(", ") %>
34             </td>
35             <td style="word-break:break-all;">
36               <% if @my_vm_logins[vm[:uuid]] %>
37                 <% @my_vm_logins[vm[:uuid]].each do |login| %>
38                   <code>ssh&nbsp;<%= login %>@<%= vm[:hostname] %>.arvados</code>
39                 <% end %>
40               <% end %>
41             </td>
42           </tr>
43         <% end %>
44       </tbody>
45     </table>
46
47     <p><i>~/.ssh/config:</i></p>
48     <pre>Host *.arvados
49       TCPKeepAlive yes
50       ServerAliveInterval 60
51       ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
52     </pre>
53   <% end %>
54 </div>