Merge branch '11509-keep-web-cors-range'
[arvados.git] / apps / workbench / app / views / projects / _show_dashboard.html.erb
index ab6eb16f5153862061a40c6b59f85bd89819c4f5..bcfeb6a466e544926dc4a8c7555dcbcd0cdd4ab7 100644 (file)
 %>
 
 <%
+  recent_procs_panel_width = 6
   if !PipelineInstance.api_exists?(:index)
     recent_procs_title = 'Recent processes'
     run_proc_title = 'Choose a workflow to run:'
+    show_node_status = false
+    # Recent processes panel should take the entire width when is the only one
+    # being rendered.
+    if !Rails.configuration.show_recent_collections_on_dashboard
+      recent_procs_panel_width = 12
+    end
   else
     recent_procs_title = 'Recent pipelines and processes'
     run_proc_title = 'Choose a pipeline or workflow to run:'
+    show_node_status = true
   end
 %>
 
   <div class="row">
-    <div class="col-md-6">
+    <div class="col-md-<%= recent_procs_panel_width %>">
       <div class="panel panel-default" style="min-height: 10.5em">
         <div class="panel-heading">
           <span class="panel-title"><%=recent_procs_title%></span>
     </div>
 
     <div class="col-md-6">
+      <% if show_node_status %>
       <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]).results %>
       <div class="panel panel-default" style="min-height: 10.5em">
         <div class="panel-heading"><span class="panel-title">Compute node status</span>
           </div>
         </div>
       </div>
+      <% end %>
       <% if Rails.configuration.show_recent_collections_on_dashboard %>
       <div class="panel panel-default">
         <div class="panel-heading"><span class="panel-title">Recent collections</span>