closes #4951
[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     <div id='no_shell_access' class='no_shell_access'>
10       <div class='no_shell_access_msg'>
11         You do not have access to any virtual machines.
12         Some Arvados features require using the command line.
13         You may request access to a hosted virtual machine with the command line shell.
14         &nbsp;&nbsp;&nbsp;
15         <div style='display:inline-block'>
16           <%= button_to('Send request for shell access', request_shell_access_user_url(id: current_user.uuid),
17                          id: 'request_shell_submit', class: 'btn btn-xs btn-primary', remote: true) %>
18         </div>
19       </div><br/>
20       <div class='shell_access_requested alert alert-info'>
21         <p id='shell_access_requested_msg' class="contain-align-left">A request for shell access was sent eariler.</p>
22       </div>
23     </div>
24   <% else %>
25     <script> localStorage.removeItem('request_shell_access'); </script>
26     <table class="table virtual-machines-table">
27       <colgroup>
28         <col style="width: 25%" />
29         <col style="width: 25%" />
30         <col style="width: 50%" />
31       </colgroup>
32       <thead>
33         <tr>
34           <th> Host name </th>
35           <th> Login name </th>
36           <th> Command line </th>
37         </tr>
38       </thead>
39       <tbody>
40         <% @my_virtual_machines.andand.each do |vm| %>
41           <tr>
42             <td style="word-break:break-all;">
43               <%= vm[:hostname] %>
44             </td>
45             <td style="word-break:break-all;">
46               <%= @my_vm_logins[vm[:uuid]].andand.compact.andand.join(", ") %>
47             </td>
48             <td style="word-break:break-all;">
49               <% if @my_vm_logins[vm[:uuid]] %>
50                 <% @my_vm_logins[vm[:uuid]].each do |login| %>
51                   <code>ssh&nbsp;<%= login %>@<%= vm[:hostname] %>.arvados</code>
52                 <% end %>
53               <% end %>
54             </td>
55           </tr>
56         <% end %>
57       </tbody>
58     </table>
59
60     <p><i>~/.ssh/config:</i></p>
61     <pre>Host *.arvados
62       TCPKeepAlive yes
63       ServerAliveInterval 60
64       ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
65     </pre>
66   <% end %>
67 </div>