Add 'apps/arv-web/' from commit 'f9732ad8460d013c2f28363655d0d1b91894dca5'
[arvados.git] / apps / workbench / app / views / users / _manage_ssh_keys.html.erb
1 <div>
2   <% if !@my_ssh_keys.any? %>
3      <p> You have not yet set up an SSH public key for use with Arvados. </p>
4      <p>  <%= link_to "Click here",
5                   "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html",
6                   style: "font-weight: bold",
7                   target: "_blank" %>  to learn about SSH keys in Arvados.
8      </p>
9      <p> When you have an SSH key you would like to use, add it using the <b>Add</b> button. </p>
10   <% else %>
11     <table class="table manage-ssh-keys-table">
12       <colgroup>
13         <col style="width: 35%" />
14         <col style="width: 55%" />
15         <col style="width: 10%" />
16       </colgroup>
17       <thead>
18         <tr>
19           <th> Name </th>
20           <th> Key Fingerprint </th>
21           <th> </th>
22         </tr>
23       </thead>
24       <tbody>
25         <% @my_ssh_keys.andand.each do |key| %>
26           <tr style="word-break:break-all;">
27             <td>
28               <%= key[:name] %>
29             </td>
30             <td style="word-break:break-all;">
31               <% if key[:public_key] && key[:public_key].size > 0 %>
32                 <div>
33                   <span title="<%=key[:public_key]%>"> <%=
34                     begin
35                       SSHKey.fingerprint key[:public_key]
36                     rescue
37                       "INVALID KEY: " + key[:public_key]
38                     end
39                    %> </span>
40                 </div>
41               <% else %>
42                   <%= key[:public_key] %>
43               <% end %>
44             </td>
45             <td>
46               <%= link_to(authorized_key_path(id: key[:uuid]), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete key?"}) do %>
47                   <i class="fa fa-fw fa-trash-o"></i>
48               <% end %>
49             </td>
50           </tr>
51         <% end %>
52       </tbody>
53     </table>
54   <% end %>
55 </div>