Fix 2.4.2 upgrade notes formatting refs #19330
[arvados.git] / apps / workbench / app / views / users / _ssh_keys.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <div class="panel panel-default">
6   <div class="panel-heading">
7     <div class="pull-right">
8       <%= link_to raw('<i class="fa fa-plus"></i>' " Add new SSH key"), add_ssh_key_popup_url,
9                    {class: 'btn btn-xs btn-primary', :remote => true, 'data-toggle' =>  "modal",
10                     'data-target' => '#add-ssh-key-modal-window'}  %>
11     </div>
12     <h4 class="panel-title">
13       <%= link_to ssh_keys_user_path(current_user) do %>
14         SSH Keys
15       <%end%>
16     </h4>
17   </div>
18
19 <div id="manage_ssh_keys" class="panel-body">
20   <% if !@my_ssh_keys.any? %>
21      <p> You have not yet set up an SSH public key for use with Arvados. <%= link_to "Learn more.",
22                   "#{Rails.configuration.Workbench.ArvadosDocsite}/user/getting_started/ssh-access-unix.html",
23                   style: "font-weight: bold",
24                   target: "_blank" %>
25      </p>
26      <p> When you have an SSH key you would like to use, add it using the <b>Add</b> button. </p>
27   <% else %>
28     <table class="table manage-ssh-keys-table">
29       <colgroup>
30         <col style="width: 35%" />
31         <col style="width: 55%" />
32         <col style="width: 10%" />
33       </colgroup>
34       <thead>
35         <tr>
36           <th> Name </th>
37           <th> Key Fingerprint </th>
38           <th> </th>
39         </tr>
40       </thead>
41       <tbody>
42         <% @my_ssh_keys.andand.each do |key| %>
43           <tr style="word-break:break-all;">
44             <td>
45               <%= key[:name] %>
46             </td>
47             <td style="word-break:break-all;">
48               <% if key[:public_key] && key[:public_key].size > 0 %>
49                 <div>
50                   <span title="<%=key[:public_key]%>"> <%=
51                     begin
52                       SSHKey.fingerprint key[:public_key]
53                     rescue
54                       "INVALID KEY: " + key[:public_key]
55                     end
56                    %> </span>
57                 </div>
58               <% else %>
59                   <%= key[:public_key] %>
60               <% end %>
61             </td>
62             <td>
63               <%= link_to(authorized_key_path(id: key[:uuid]), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete key?"}) do %>
64                   <i class="fa fa-fw fa-trash-o"></i>
65               <% end %>
66             </td>
67           </tr>
68         <% end %>
69       </tbody>
70     </table>
71   <% end %>
72 </div>
73 </div>