[ARVADOS] updated: 8bfd0bd237a017b2e5c7cdcd69e677b5b111d558

Git user git at public.curoverse.com
Thu Jun 9 16:17:07 EDT 2016


Summary of changes:
 apps/workbench/app/models/job_work_unit.rb           |  7 +------
 apps/workbench/app/models/proxy_work_unit.rb         |  8 ++++----
 .../app/views/projects/_compute_node_status.html.erb |  9 +--------
 .../views/projects/_compute_node_summary.html.erb    |  7 ++-----
 .../app/views/projects/_show_dashboard.html.erb      | 20 ++++++++++++++------
 .../test/integration/application_layout_test.rb      |  4 ++--
 apps/workbench/test/integration/logins_test.rb       |  2 +-
 .../test/integration/pipeline_templates_test.rb      |  2 +-
 apps/workbench/test/integration/user_profile_test.rb |  4 ++--
 9 files changed, 28 insertions(+), 35 deletions(-)

       via  8bfd0bd237a017b2e5c7cdcd69e677b5b111d558 (commit)
      from  e016b28393b74cd30a78ebe03eca7e37a51fefd3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 8bfd0bd237a017b2e5c7cdcd69e677b5b111d558
Author: radhika <radhika at curoverse.com>
Date:   Thu Jun 9 16:16:06 2016 -0400

    9318: Update the compute node status pane to make sure the Details option is only offered when there are any active nodes.

diff --git a/apps/workbench/app/models/job_work_unit.rb b/apps/workbench/app/models/job_work_unit.rb
index 4391809..a3f13f3 100644
--- a/apps/workbench/app/models/job_work_unit.rb
+++ b/apps/workbench/app/models/job_work_unit.rb
@@ -73,12 +73,7 @@ class JobWorkUnit < ProxyWorkUnit
 
   def outputs
     items = []
-    children.each do |c|
-      items.concat c.outputs
-    end
-    if !items.any?
-      items << get(:output) if get(:output)
-    end
+    items << get(:output) if get(:output)
     items
   end
 
diff --git a/apps/workbench/app/models/proxy_work_unit.rb b/apps/workbench/app/models/proxy_work_unit.rb
index b1d758b..b0f754a 100644
--- a/apps/workbench/app/models/proxy_work_unit.rb
+++ b/apps/workbench/app/models/proxy_work_unit.rb
@@ -25,25 +25,25 @@ class ProxyWorkUnit < WorkUnit
 
   def created_at
     t = get(:created_at)
-    t = Time.parse(t) if (t.andand.class == String)
+    t = Time.parse(t) if (t.is_a? String)
     t
   end
 
   def started_at
     t = get(:started_at)
-    t = Time.parse(t) if (t.andand.class == String)
+    t = Time.parse(t) if (t.is_a? String)
     t
   end
 
   def modified_at
     t = get(:modified_at)
-    t = Time.parse(t) if (t.andand.class == String)
+    t = Time.parse(t) if (t.is_a? String)
     t
   end
 
   def finished_at
     t = get(:finished_at)
-    t = Time.parse(t) if (t.andand.class == String)
+    t = Time.parse(t) if (t.is_a? String)
     t
   end
 
diff --git a/apps/workbench/app/views/projects/_compute_node_status.html.erb b/apps/workbench/app/views/projects/_compute_node_status.html.erb
index 6ad7ff4..c2f5f39 100644
--- a/apps/workbench/app/views/projects/_compute_node_status.html.erb
+++ b/apps/workbench/app/views/projects/_compute_node_status.html.erb
@@ -1,9 +1,6 @@
 <h4>Node status</h4>
-<% active_nodes = 0 %>
 <div class="compute-summary-nodelist">
-    <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
-      <% if n.crunch_worker_state.in? ["busy", "idle"] and (Time.now - n[:last_ping_at]) < 3600 %>
-        <% active_nodes += 1 %>
+    <% nodes.each do |n| %>
         <div class="compute-summary">
           <a data-toggle="collapse" href="#detail_<%= n.hostname %>" class="compute-summary-head label label-<%= if n.crunch_worker_state == 'busy' then 'primary' else 'default' end %>">
             <%= n.hostname %>
@@ -15,9 +12,5 @@
             <% end %>
           </div>
         </div>
-      <% end %>
-    <% end %>
-    <% if active_nodes == 0 %>
-      No active nodes
     <% end %>
 </div>
diff --git a/apps/workbench/app/views/projects/_compute_node_summary.html.erb b/apps/workbench/app/views/projects/_compute_node_summary.html.erb
index 7d6a4fb..652d4ad 100644
--- a/apps/workbench/app/views/projects/_compute_node_summary.html.erb
+++ b/apps/workbench/app/views/projects/_compute_node_summary.html.erb
@@ -1,17 +1,14 @@
 <div class="compute-summary-numbers">
     <table>
       <colgroup>
-        <col width="25%">
-        <col width="25%">
-        <col width="25%">
+        <col width="50%">
+        <col width="50%">
       </colgroup>
       <tr>
-        <td><%= Job.queue_size %></td>
         <td><%= nodes.select {|n| n.crunch_worker_state == "busy" }.size %></td>
         <td><%= nodes.select {|n| n.crunch_worker_state == "idle" }.size %></td>
       </tr>
       <tr>
-        <th>Queued jobs</th>
         <th>Busy nodes</th>
         <th>Idle nodes</th>
       </tr>
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index efd6acf..12b3ef2 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -1,7 +1,7 @@
   <div class="row">
     <div class="col-md-6">
       <div class="panel panel-default" style="min-height: 10.5em">
-        <div class="panel-heading"><span class="panel-title">Recent processes</span>
+        <div class="panel-heading"><span class="panel-title">Recent pipelines and processes</span>
           <% if current_user.andand.is_active %>
             <span class="pull-right">
               <span>
@@ -28,7 +28,7 @@
         <% _recent_processes = recent_processes(12) %>
         <div class="panel-body recent-processes">
           <% if _recent_processes.empty? %>
-            No recent processes.
+            No recent pipelines or processes.
           <% else %>
           <% _recent_processes.each do |p| %>
             <% wu = p.work_unit %>
@@ -127,12 +127,20 @@
         <div class="panel-body compute-node-summary-pane">
           <div>
             <%= render partial: 'compute_node_summary', locals: {nodes: nodes} %>
-            <div style="text-align: center">
-              <a data-toggle="collapse" href="#compute_node_status">Details <span class="caret"></span></a>
-            </div>
+            <% active_nodes = [] %>
+            <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
+              <% if n.crunch_worker_state.in? ["busy", "idle"] and (Time.now - n[:last_ping_at]) < 3600 %>
+                <% active_nodes << n %>
+              <% end %>
+            <% end %>
+            <% if active_nodes.any? %>
+              <div style="text-align: center">
+                <a data-toggle="collapse" href="#compute_node_status">Details <span class="caret"></span></a>
+              </div>
+            <% end %>
           </div>
           <div id="compute_node_status" class="collapse">
-            <%= render partial: 'compute_node_status', locals: {nodes: nodes} %>
+            <%= render partial: 'compute_node_status', locals: {nodes: active_nodes} %>
           </div>
         </div>
       </div>
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 969ec89..2d101f9 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -179,7 +179,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
 
         first('button', text: 'x').click
       end
-      assert_text 'Recent processes' # seeing dashboard now
+      assert_text 'Recent pipelines and processes' # seeing dashboard now
     end
   end
 
@@ -249,7 +249,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
     test "visit dashboard as #{token}" do
       visit page_with_token(token)
 
-      assert_text 'Recent processes' # seeing dashboard now
+      assert_text 'Recent pipelines and processes' # seeing dashboard now
       within('.recent-processes') do
         page.has_button? 'Run a pipeline'
         page.has_link? 'All pipelines'
diff --git a/apps/workbench/test/integration/logins_test.rb b/apps/workbench/test/integration/logins_test.rb
index ed16e8c..0d6514d 100644
--- a/apps/workbench/test/integration/logins_test.rb
+++ b/apps/workbench/test/integration/logins_test.rb
@@ -7,7 +7,7 @@ class LoginsTest < ActionDispatch::IntegrationTest
 
   test "login with api_token works after redirect" do
     visit page_with_token('active_trustedclient')
-    assert page.has_text?('Recent processes'), "Missing 'Recent processes' from page"
+    assert page.has_text?('Recent pipelines and processes'), "Missing 'Recent pipelines and processes' from page"
     assert_no_match(/\bapi_token=/, current_path)
   end
 
diff --git a/apps/workbench/test/integration/pipeline_templates_test.rb b/apps/workbench/test/integration/pipeline_templates_test.rb
index ccd97fb..4fce9e0 100644
--- a/apps/workbench/test/integration/pipeline_templates_test.rb
+++ b/apps/workbench/test/integration/pipeline_templates_test.rb
@@ -35,7 +35,7 @@ class PipelineTemplatesTest < ActionDispatch::IntegrationTest
     assert page.has_text? 'Textile description for pipeline template'
     assert page.has_link? 'Go to dashboard'
     click_link 'Go to dashboard'
-    assert page.has_text? 'Recent processes'
+    assert page.has_text? 'Recent pipelines and processes'
 
     # again visit recent templates page and verify edited description
     visit page_with_token("active", "/pipeline_templates")
diff --git a/apps/workbench/test/integration/user_profile_test.rb b/apps/workbench/test/integration/user_profile_test.rb
index ea9b836..a98fa35 100644
--- a/apps/workbench/test/integration/user_profile_test.rb
+++ b/apps/workbench/test/integration/user_profile_test.rb
@@ -20,7 +20,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
         assert page.has_text?('Save profile'), 'No text - Save profile'
         add_profile user
       else
-        assert page.has_text?('Recent processes'), 'Not found text - Recent processes'
+        assert page.has_text?('Recent pipelines and processes'), 'Not found text - Recent pipelines and processes'
         assert page.has_no_text?('Save profile'), 'Found text - Save profile'
       end
     elsif invited
@@ -119,7 +119,7 @@ class UserProfileTest < ActionDispatch::IntegrationTest
     end
 
     # profile saved and in home page now
-    assert page.has_text?('Recent processes'), 'No text - Recent processes'
+    assert page.has_text?('Recent pipelines and processes'), 'No text - Recent pipelines and processes'
   end
 
   [

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list