3296: good tests do add value.
[arvados.git] / apps / workbench / app / views / users / _manage_virtual_machines.html.erb
index 8215f1f907d164e93d7227e6cdfecc4aecc6550a..36cab183f3abd08d85dd14afca83bb19b2428097 100644 (file)
@@ -5,43 +5,46 @@
   target: "_blank"%>.  A sample <i>~/.ssh/config</i> entry is provided below.
   </p>
 
-  <table class="table virtual-machines-table">
-    <colgroup>
-      <col style="width: 25%" />
-      <col style="width: 25%" />
-      <col style="width: 50%" />
-    </colgroup>
-    <thead>
-      <tr>
-        <th> Host name </th>
-        <th> Login name </th>
-        <th> Command line </th>
-      </tr>
-    </thead>
-    <tbody>
-      <% @my_virtual_machines.andand.each do |vm| %>
+  <% if !@my_virtual_machines.any? %>
+    You do not seem to have access to any virtual machines. If you would like to request access, please contact your system admin.
+  <% else %>
+    <table class="table virtual-machines-table">
+      <colgroup>
+        <col style="width: 25%" />
+        <col style="width: 25%" />
+        <col style="width: 50%" />
+      </colgroup>
+      <thead>
         <tr>
-          <td style="word-break:break-all;">
-            <%= vm[:hostname] %>
-          </td>
-          <td style="word-break:break-all;">
-            <%= @my_vm_logins[vm[:uuid]].andand.compact.andand.join(", ") %>
-          </td>
-          <td style="word-break:break-all;">
-            <% if @my_vm_logins[vm[:uuid]] %>
-              <% @my_vm_logins[vm[:uuid]].each do |login| %>
-                <code>ssh&nbsp;<%= login %>@<%= vm[:hostname] %>.arvados</code>
-              <% end %>
-            <% end %>
-          </td>
+          <th> Host name </th>
+          <th> Login name </th>
+          <th> Command line </th>
         </tr>
-      <% end %>
-    </tbody>
-  </table>
-
-<p><i>~/.ssh/config:</i></p>
-<pre>Host *.arvados
-  ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
-</pre>
+      </thead>
+      <tbody>
+        <% @my_virtual_machines.andand.each do |vm| %>
+          <tr>
+            <td style="word-break:break-all;">
+              <%= vm[:hostname] %>
+            </td>
+            <td style="word-break:break-all;">
+              <%= @my_vm_logins[vm[:uuid]].andand.compact.andand.join(", ") %>
+            </td>
+            <td style="word-break:break-all;">
+              <% if @my_vm_logins[vm[:uuid]] %>
+                <% @my_vm_logins[vm[:uuid]].each do |login| %>
+                  <code>ssh&nbsp;<%= login %>@<%= vm[:hostname] %>.arvados</code>
+                <% end %>
+              <% end %>
+            </td>
+          </tr>
+        <% end %>
+      </tbody>
+    </table>
 
+    <p><i>~/.ssh/config:</i></p>
+    <pre>Host *.arvados
+      ProxyCommand ssh -p2222 turnout@switchyard.<%= current_api_host || 'xyzzy.arvadosapi.com' %> -x -a $SSH_PROXY_FLAGS %h
+    </pre>
+  <% end %>
 </div>