[ARVADOS] updated: 2db7fce3ceb4626d0091ea5093598ef9f4a12480

git at public.curoverse.com git at public.curoverse.com
Thu Oct 30 21:26:56 EDT 2014


Summary of changes:
 .../app/controllers/actions_controller.rb          | 26 +++++++++
 .../app/controllers/application_controller.rb      |  5 --
 .../_dashboard_finished_pipeline_rows.html.erb     | 57 ++++++++++++++++++++
 .../app/views/projects/_show_dashboard.html.erb    | 63 +++++-----------------
 apps/workbench/config/routes.rb                    |  1 +
 5 files changed, 96 insertions(+), 56 deletions(-)
 create mode 100644 apps/workbench/app/views/application/_dashboard_finished_pipeline_rows.html.erb

       via  2db7fce3ceb4626d0091ea5093598ef9f4a12480 (commit)
      from  e2fe6c0e5c1c62a37e03519590c04a5186a2cc9b (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 2db7fce3ceb4626d0091ea5093598ef9f4a12480
Author: radhika <radhika at curoverse.com>
Date:   Thu Oct 30 21:26:21 2014 -0400

    4024: add inifinite scrollling to dashboard.

diff --git a/apps/workbench/app/controllers/actions_controller.rb b/apps/workbench/app/controllers/actions_controller.rb
index 59dcbb9..77ea121 100644
--- a/apps/workbench/app/controllers/actions_controller.rb
+++ b/apps/workbench/app/controllers/actions_controller.rb
@@ -206,4 +206,30 @@ class ActionsController < ApplicationController
     end
   end
 
+  expose_action :dashboard_finished_pipeline_rows do
+    limit = params[:limit] ? params[:limit] : 8
+    finished_at = params[:finished_at] ? params[:finished_at] : Time.now+1.years if !finished_at
+    @finished_pipelines = PipelineInstance.limit(limit).
+                            order(["finished_at desc"]).
+                            filter([["state", "in", ["Complete", "Failed", "Paused"]],
+                                    ["finished_at", "<", finished_at]])
+    if @finished_pipelines.results.any?
+      @finished_pipelines_lookup = preload_objects_for_dataclass PipelineTemplate, @finished_pipelines.map(&:pipeline_template_uuid)
+      @next_finished_pipelines_href = url_for(action: :dashboard_finished_pipeline_rows,
+                                              limit: limit,
+                                              finished_at: @finished_pipelines.results.last.finished_at)
+    else
+      @next_finished_pipelines_href = nil
+    end
+
+    respond_to do |f|
+      f.json {
+        render json: {
+          content: render_to_string(partial: "dashboard_finished_pipeline_rows.html",
+                                    formats: [:html]),
+          next_page_href: @next_finished_pipelines_href
+        }
+      }
+    end
+  end
 end
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 4f5d8fd..c8cbd82 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -728,11 +728,6 @@ class ApplicationController < ActionController::Base
     pi
   end
 
-  helper_method :finished_pipelines
-  def finished_pipelines lim
-    PipelineInstance.limit(lim).order(["finished_at desc"]).filter([["state", "in", ["Complete", "Failed", "Paused"]], ["finished_at", "!=", nil]])
-  end
-
   helper_method :recent_collections
   def recent_collections lim
     c = Collection.limit(lim).order(["modified_at desc"]).filter([["owner_uuid", "is_a", "arvados#group"]])
diff --git a/apps/workbench/app/views/application/_dashboard_finished_pipeline_rows.html.erb b/apps/workbench/app/views/application/_dashboard_finished_pipeline_rows.html.erb
new file mode 100644
index 0000000..1249449
--- /dev/null
+++ b/apps/workbench/app/views/application/_dashboard_finished_pipeline_rows.html.erb
@@ -0,0 +1,57 @@
+  <% @finished_pipelines.andand.results.each do |p| %>
+    <tr class="filterable"
+        data-object-uuid="<%= p.uuid %>"
+        data-kind="<%= p.kind %>"
+        data-object-created-at="<%= p.created_at %>"
+      >
+      <td>
+            <div class="dashboard-panel-info-row">
+              <div class="row">
+                <div class="col-md-6 text-overflow-ellipsis">
+                  <%= link_to_if_arvados_object p, {friendly_name: true, lookup: @finished_pipelines_lookup} %>
+                </div>
+                <div class="col-md-2">
+                  <%= render partial: "pipeline_status_label", locals: {p: p}%>
+                </div>
+                <div class="col-md-4">
+                  <%= render_localized_date(p[:finished_at] || p[:modified_at], "noseconds") %>
+                </div>
+              </div>
+              <div class="row">
+                <div class="col-md-12">
+                  <% if p[:started_at] and p[:finished_at] %>
+                    <% pipeline_time = p[:finished_at] - p[:started_at] %>
+                    Active for <%= render_runtime(pipeline_time, false) %>
+                  <% end %>
+
+                  <span class="pull-right text-overflow-ellipsis" style="max-width: 100%">
+                    <% outputs = [] %>
+                    <% p.components.each do |k, c| %>
+                      <% outputs << c[:output_uuid] if c[:output_uuid] %>
+                    <% end %>
+                    <% if outputs.size == 0 %>
+                      No output.
+                    <% elsif outputs.size == 1 %>
+                      <i class="fa fa-fw fa-archive"></i> <%= link_to_if_arvados_object outputs[0], friendly_name: true %>
+                    <% else %>
+                      <a href="#<%= p[:uuid] %>-outputs" data-toggle="collapse">Outputs <span class="caret"></span></a>
+                    <% end %>
+                  </span>
+                </div>
+              </div>
+
+              <div class="row collapse" id="<%= p[:uuid] %>-outputs" >
+                <div class="col-md-12">
+                  <div class="pull-right" style="max-width: 100%">
+                    <% outputs.each do |out| %>
+                      <div class="text-overflow-ellipsis">
+                        <i class="fa fa-fw fa-archive"></i> <%= link_to_if_arvados_object out, friendly_name: true %>
+                      </div>
+                    <% end %>
+                  </div>
+                </div>
+              </div>
+            </div>
+      </td>
+    </tr>
+  <% end %>
diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb
index 0d71f94..e5cb0c5 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -18,8 +18,7 @@
         </div>
 
         <% _running_pipelines = running_pipelines %>
-        <% _finished_pipelines = finished_pipelines(8) %>
-        <% lookup = preload_objects_for_dataclass PipelineTemplate, (_running_pipelines.map(&:pipeline_template_uuid) + _finished_pipelines.map(&:pipeline_template_uuid)) %>
+        <% lookup = preload_objects_for_dataclass PipelineTemplate, (_running_pipelines.map(&:pipeline_template_uuid)) %>
 
         <div class="panel-body">
           <% if _running_pipelines.empty? %>
@@ -75,55 +74,17 @@
           </span>
         </div>
         <div class="panel-body">
-          <% _finished_pipelines.each do |p| %>
-            <div class="dashboard-panel-info-row">
-              <div class="row">
-                <div class="col-md-6 text-overflow-ellipsis">
-                  <%= link_to_if_arvados_object p, {friendly_name: true, lookup: lookup} %>
-                </div>
-                <div class="col-md-2">
-                  <%= render partial: "pipeline_status_label", locals: {p: p}%>
-                </div>
-                <div class="col-md-4">
-                  <%= render_localized_date(p[:finished_at] || p[:modified_at], "noseconds") %>
-                </div>
-              </div>
-              <div class="row">
-                <div class="col-md-12">
-                  <% if p[:started_at] and p[:finished_at] %>
-                    <% pipeline_time = p[:finished_at] - p[:started_at] %>
-                    Active for <%= render_runtime(pipeline_time, false) %>
-                  <% end %>
-
-                  <span class="pull-right text-overflow-ellipsis" style="max-width: 100%">
-                    <% outputs = [] %>
-                    <% p.components.each do |k, c| %>
-                      <% outputs << c[:output_uuid] if c[:output_uuid] %>
-                    <% end %>
-                    <% if outputs.size == 0 %>
-                      No output.
-                    <% elsif outputs.size == 1 %>
-                      <i class="fa fa-fw fa-archive"></i> <%= link_to_if_arvados_object outputs[0], friendly_name: true %>
-                    <% else %>
-                      <a href="#<%= p[:uuid] %>-outputs" data-toggle="collapse">Outputs <span class="caret"></span></a>
-                    <% end %>
-                  </span>
-                </div>
-              </div>
-
-              <div class="row collapse" id="<%= p[:uuid] %>-outputs" >
-                <div class="col-md-12">
-                  <div class="pull-right" style="max-width: 100%">
-                    <% outputs.each do |out| %>
-                      <div class="text-overflow-ellipsis">
-                        <i class="fa fa-fw fa-archive"></i> <%= link_to_if_arvados_object out, friendly_name: true %>
-                      </div>
-                    <% end %>
-                  </div>
-                </div>
-              </div>
-            </div>
-          <% end %>
+          <table class="table table-condensed arv-index arv-recently-finished-pipelines">
+            <colgroup>
+              <col width="0*" style="max-width: fit-content;" />
+            </colgroup>
+            <tbody data-infinite-scroller="recently-finished-pipelines-scroll"
+                   data-infinite-content-href="<%= dashboard_finished_pipeline_rows_path %>" >
+            </tbody>
+            <thead>
+              <tr> <th></th> </tr>
+            </thead>
+          </table>
         </div>
       </div>
     </div>
diff --git a/apps/workbench/config/routes.rb b/apps/workbench/config/routes.rb
index 9f9696f..8628534 100644
--- a/apps/workbench/config/routes.rb
+++ b/apps/workbench/config/routes.rb
@@ -82,6 +82,7 @@ ArvadosWorkbench::Application.routes.draw do
   get 'actions' => 'actions#show'
   get 'websockets' => 'websocket#index'
   post "combine_selected" => 'actions#combine_selected_files_into_collection'
+  get 'dashboard_finished_pipeline_rows' => 'actions#dashboard_finished_pipeline_rows'
 
   root :to => 'projects#index'
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list