Merge branch '3193-manage-account' of git.curoverse.com:arvados into 3193-manage...
[arvados.git] / apps / workbench / app / views / users / _manage_ssh_keys.html.erb
index 2c6c7dd8b6959ad5503b8143632dfabad1ce97d8..c8a68a87d98c9b2aaa6d47a9630b5fa26872d654 100644 (file)
@@ -1,55 +1,44 @@
 <div>
-<h4>Add / Delete SSH Keys</h4>
-  <table class="table virtual-machines-table">
-    <colgroup>
-      <col style="width: 95%" />
-      <col style="width: 5%" />
-    </colgroup>
-    <tbody>
-      <% @my_ssh_keys.andand.each do |key| %>
+  <% if !@my_ssh_keys.any? %>
+     <p> You have not yet set up an SSH public key for use with Arvados. </p>
+     <p>  <%= link_to "Click here to learn about SSH keys in Arvados.",
+                 "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html", 
+                 style: "font-weight: bold",
+                 target: "_blank" %>       </p>
+     <p> When you have an SSH key you would like to use, add it using the <b>Add</b> button. </p>
+  <% end %>
+
+  <% if @my_ssh_keys.andand.any? %>
+    <table class="table virtual-machines-table" style="table-layout:fixed; overflow:hidden; white-space: nowrap;">
+      <colgroup>
+        <col style="width: 15%" />
+        <col style="width: 80%" />
+        <col style="width: 5%" />
+      </colgroup>
+      <thead>
         <tr>
-          <td style="word-break:break-all;">
-            <%= key[:public_key] %>
-          </td>
-          <td>
-            <%= link_to(authorized_key_path(id: key[:uuid]), method: 'delete', class: 'btn btn-sm', data: {confirm: "Really delete key"}) do %>
-                <i class="fa fa-fw fa-trash-o"></i>
-            <% end %>
-          </td>
+          <th> Name </th>
+          <th> Public Key </th>
+          <th> </th>
         </tr>
-      <% end %>
-    </tbody>
-  </table>
-</div>
-
-<hr>
-
-<div>
-<h4>Setting up SSH keys</h4>
-<p>
-Sample <code>~/.ssh/config</code>:
-</p>
-
-<pre>
-Host *.arvados
-  ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
-<% if @my_vm_logins.andand.first %>
-  User <%= @my_vm_logins[@my_vm_logins.andand.keys.first].andand.first %>
-<% end %>
-</pre>
-
-<p>
-Sample login command:
-</p>
-
-<pre>
-ssh <%= @my_virtual_machines.first.andand.hostname.andand.sub('.'+current_api_host,'') or 'vm-hostname' %>.arvados
-</pre>
-
-<p>
-  See also:
-  <%= link_to raw('Arvados Docs &rarr; User Guide &rarr; SSH access'),
-  "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access-unix.html",
-  target: "_blank"%>.
-</p>
+      </thead>
+      <tbody>
+        <% @my_ssh_keys.andand.each do |key| %>
+          <tr>
+            <td style="width:50px; overflow:hidden;">
+              <%= key[:name] %>
+            </td>
+            <td style="width:100px; overflow:hidden;">
+              <%= key[:public_key] %>
+            </td>
+            <td>
+              <%= link_to(authorized_key_path(id: key[:uuid]), method: 'delete', class: 'btn btn-sm', data: {confirm: "Really delete key"}) do %>
+                  <i class="fa fa-fw fa-trash-o"></i>
+              <% end %>
+            </td>
+          </tr>
+        <% end %>
+      </tbody>
+    </table>
+  <% end %>
 </div>