3193: show only a portion of the ssh key so that the page does not have to scroll...
[arvados.git] / apps / workbench / app / views / users / _manage_ssh_keys.html.erb
1 <div>
2 <h4>Add / Delete SSH Keys</h4>
3   <% if !@my_ssh_keys.any? %>
4      <p> You have not yet set up an SSH public key for use with Arvados. </p>
5      <p>  <%= link_to "Click here to learn about SSH keys in Arvados.",
6                   "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html", 
7                   style: "font-weight: bold",
8                   target: "_blank" %>       </p>
9      <p> When you have an SSH key you would like to use, add it using the <b>Add</b> button. </p>
10   <% end %>
11
12   <% if @my_ssh_keys.andand.any? %>
13     <table class="table virtual-machines-table" style="table-layout:fixed; overflow:hidden; white-space: nowrap;">
14       <colgroup>
15         <col style="width: 15%" />
16         <col style="width: 80%" />
17         <col style="width: 5%" />
18       </colgroup>
19       <thead>
20         <tr>
21           <th> Name </th>
22           <th> Public Key </th>
23           <th> </th>
24         </tr>
25       </thead>
26       <tbody>
27         <% @my_ssh_keys.andand.each do |key| %>
28           <tr>
29             <td style="width:50px; overflow:hidden;">
30               <%= key[:name] %>
31             </td>
32             <td style="width:100px; overflow:hidden;">
33               <%= key[:public_key] %>
34             </td>
35             <td>
36               <%= link_to(authorized_key_path(id: key[:uuid]), method: 'delete', class: 'btn btn-sm', data: {confirm: "Really delete key"}) do %>
37                   <i class="fa fa-fw fa-trash-o"></i>
38               <% end %>
39             </td>
40           </tr>
41         <% end %>
42       </tbody>
43     </table>
44   <% end %>
45 </div>
46
47 <hr>
48
49 <div>
50 <h4>Setting up SSH access</h4>
51 <p>
52 Sample <code>~/.ssh/config</code>:
53 </p>
54
55 <pre>
56 Host *.arvados
57   ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
58 <% if @my_vm_logins.andand.first %>
59   User <%= @my_vm_logins[@my_vm_logins.andand.keys.first].andand.first %>
60 <% end %>
61 </pre>
62
63 <p>
64 Sample login command:
65 </p>
66
67 <pre>
68 ssh <%= @my_virtual_machines.first.andand.hostname.andand.sub('.'+current_api_host,'') or 'vm-hostname' %>.arvados
69 </pre>
70
71 <p>
72   See also:
73   <%= link_to raw('Arvados Docs &rarr; User Guide &rarr; SSH access'),
74   "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html",
75   target: "_blank"%>.
76 </p>
77 </div>