[ARVADOS] updated: a545242c3e85b644e13b5eb018874fa794f6a520

git at public.curoverse.com git at public.curoverse.com
Thu Feb 6 15:05:52 EST 2014


Summary of changes:
 .../app/assets/stylesheets/application.css         |    7 +++
 .../controllers/pipeline_instances_controller.rb   |    5 +-
 .../app/helpers/pipeline_instances_helper.rb       |   27 ++++++++++++
 .../app/views/pipeline_instances/show.html.erb     |    2 +
 apps/workbench/app/views/users/_tables.html.erb    |   43 ++++++++++++++++----
 services/api/config/environments/test.rb.example   |    2 +-
 6 files changed, 75 insertions(+), 11 deletions(-)

       via  a545242c3e85b644e13b5eb018874fa794f6a520 (commit)
       via  f4d2c84639a27ab1f1a7d1ab8e066bfc957dea1f (commit)
       via  e69e35777d2b8746dc240be51d62671f84f663d4 (commit)
       via  cc527a74c89f44267c50a52194ec0560484a72a0 (commit)
       via  0017e49656e63d6ff348d54a61c0dcdffa74db9a (commit)
      from  35a7da43a50debdfe9fcadc6ed095ac85f96134d (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 a545242c3e85b644e13b5eb018874fa794f6a520
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 11:33:16 2014 -0800

    Add progress bars to pipeline instances table on dashboard.
    
    refs #2006

diff --git a/apps/workbench/app/assets/stylesheets/application.css b/apps/workbench/app/assets/stylesheets/application.css
index 88e672a..95a4044 100644
--- a/apps/workbench/app/assets/stylesheets/application.css
+++ b/apps/workbench/app/assets/stylesheets/application.css
@@ -98,3 +98,10 @@ form.small-form-margin {
 .index-detail .tabbable .tab-content {
     padding: 0 1em;
 }
+.inline-progress-container div.progress {
+    margin-bottom: 0;
+}
+.inline-progress-container {
+    width: 100px;
+    display:inline-block;
+}
diff --git a/apps/workbench/app/helpers/pipeline_instances_helper.rb b/apps/workbench/app/helpers/pipeline_instances_helper.rb
index 766c1c4..dc1326b 100644
--- a/apps/workbench/app/helpers/pipeline_instances_helper.rb
+++ b/apps/workbench/app/helpers/pipeline_instances_helper.rb
@@ -1,4 +1,31 @@
 module PipelineInstancesHelper
+  def pipeline_summary object=nil
+    object ||= @object
+    ret = {todo:0, running:0, queued:0, done:0, failed:0, total:0}
+    object.components.values.each do |c|
+      ret[:total] += 1
+      case
+      when !c[:job]
+        ret[:todo] += 1
+      when c[:job][:success]
+        ret[:done] += 1
+      when c[:job][:failed]
+        ret[:failed] += 1
+      when c[:job][:finished_at]
+        ret[:running] += 1      # XXX finished but !success and !failed??
+      when c[:job][:started_at]
+        ret[:running] += 1
+      else
+        ret[:queued] += 1
+      end
+    end
+    ret.merge! Hash[ret.collect do |k,v|
+                      [('percent_' + k.to_s).to_sym,
+                       ret[:total]<1 ? 0 : (100.0*v/ret[:total]).floor]
+                    end]
+    ret
+  end
+
   def pipeline_jobs object=nil
     object ||= @object
     if object.components[:steps].is_a? Array
diff --git a/apps/workbench/app/views/pipeline_instances/show.html.erb b/apps/workbench/app/views/pipeline_instances/show.html.erb
index cf56b97..2ea59c9 100644
--- a/apps/workbench/app/views/pipeline_instances/show.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/show.html.erb
@@ -87,3 +87,5 @@ table.pipeline-components-table div.progress {
 setInterval(function(){$('a.refresh').click()}, 30000);
 <% end %>
 <% end %>
+
+<pre><%= JSON.pretty_generate @object.attributes %></pre>
diff --git a/apps/workbench/app/views/users/_tables.html.erb b/apps/workbench/app/views/users/_tables.html.erb
index bc9ffb6..ef7d4a8 100644
--- a/apps/workbench/app/views/users/_tables.html.erb
+++ b/apps/workbench/app/views/users/_tables.html.erb
@@ -73,7 +73,7 @@
     <span class="label label-danger">failed</span>
   <% elsif j.running and j.started_at and not j.finished_at %>
     <% percent_total_tasks = 100 / (j.tasks_summary[:running] + j.tasks_summary[:done] + j.tasks_summary[:todo]) rescue 0 %>
-    <div class="progress" style="margin-bottom: 0">
+    <div class="progress">
       <div class="bar bar-success" style="width: <%= j.tasks_summary[:done] * percent_total_tasks rescue 0 %>%;"></div>
       <div class="bar" style="width: <%= j.tasks_summary[:running] * percent_total_tasks rescue 0 %>%; opacity: 0.3"></div>
     </div>
@@ -97,13 +97,15 @@
   <% else %>
     <table class="table table-bordered table-condensed table-fixedlayout">
       <colgroup>
-        <col width="73%" />
-        <col width="15%" />
-        <col width="12%" />
+        <col width="30%" />
+        <col width="30%" />
+        <col width="13%" />
+        <col width="27%" />
       </colgroup>
 
       <tr>
-	<th>Pipeline template</th>
+	<th>Instance</th>
+	<th>Template</th>
 	<th>Age</th>
 	<th>Status</th>
       </tr>
@@ -112,9 +114,13 @@
         <tr>
           <td>
             <small>
-	      <% PipelineTemplate.limit(1).where(uuid: p.pipeline_template_uuid).each do |i| %>
-		<%= link_to i.name, pipeline_instance_path(p.uuid) %>
-	      <% end %>
+	      <%= link_to_if_arvados_object p.uuid, friendly_name: true %>
+            </small>
+          </td>
+
+          <td>
+            <small>
+	      <%= link_to_if_arvados_object p.pipeline_template_uuid, friendly_name: true %>
             </small>
           </td>
 
@@ -130,11 +136,32 @@
               <span class="label label-success">finished</span>
             <% elsif p.success == false %>
               <span class="label label-danger">failed</span>
+            <% elsif p.active and p.modified_at < 30.minutes.ago %>
+              <span class="label label-info">stopped</span>
             <% elsif p.active %>
               <span class="label label-info">running</span>
             <% else %>
               <span class="label">queued</span>
             <% end %>
+
+            <% summary = pipeline_summary p %>
+            <div class="inline-progress-container pull-right">
+              <div class="progress">
+                <div class="bar bar-success" style="width: <%= summary[:percent_done] %>%;">
+                </div>
+                <% if p.success == false %>
+                <div class="bar bar-danger" style="width: <%= 100.0 - summary[:percent_done] %>%;">
+                </div>
+                <% else %>
+                <div class="bar" style="width: <%= summary[:percent_running] %>%;">
+                </div>
+                <div class="bar bar-info" style="width: <%= summary[:percent_queued] %>%;">
+                </div>
+                <div class="bar bar-danger" style="width: <%= summary[:percent_failed] %>%;">
+                </div>
+                <% end %>
+              </div>
+            </div>
           </td>
 
         </tr>

commit f4d2c84639a27ab1f1a7d1ab8e066bfc957dea1f
Merge: 35a7da4 e69e357
Author: Tom Clegg <tom at curoverse.com>
Date:   Thu Feb 6 10:42:34 2014 -0800

    Merge branch 'master' into 1979-workbench-ui


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list