X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8b4a1d1138ace590583601621f5cebedb8868c03..8e6d577f1381da0d42481ef8dd0479241e3c50bf:/apps/workbench/app/views/projects/_show_dashboard.html.erb diff --git a/apps/workbench/app/views/projects/_show_dashboard.html.erb b/apps/workbench/app/views/projects/_show_dashboard.html.erb index c02577fcfd..873d4f3f70 100644 --- a/apps/workbench/app/views/projects/_show_dashboard.html.erb +++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb @@ -1,3 +1,29 @@ +<% + recent_procs = recent_processes(12) + + wus = {} + outputs = [] + recent_procs.each do |p| + wu = p.work_unit + wus[p] = wu + outputs << wu.outputs + end + outputs = outputs.flatten.uniq + + collection_pdhs = outputs.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact + collection_uuids = outputs - collection_pdhs + + if Rails.configuration.show_recent_collections_in_dashboard + recent_cs = recent_collections(8) + collection_uuids = collection_uuids + recent_cs[:collections].collect {|c| c.uuid} + collection_uuids.flatten.uniq + end + + preload_collections_for_objects collection_uuids if collection_uuids.any? + preload_for_pdhs collection_pdhs if collection_pdhs.any? + preload_links_for_objects(collection_pdhs + collection_uuids) +%> +
@@ -26,13 +52,11 @@ <% end %>
- <% _recent_processes = recent_processes(12) %>
- <% if _recent_processes.empty? %> + <% if recent_procs.empty? %> No recent pipelines or processes. <% else %> - <% _recent_processes.each do |p| %> - <% wu = p.work_unit %> + <% wus.each do |p, wu| %> <% if wu.is_finished? %>
@@ -106,7 +130,7 @@
- <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]) %> + <% nodes = Node.filter([["last_ping_at", ">", Time.now - 3600]]).results %>
Compute node status @@ -139,6 +163,7 @@
+ <% if Rails.configuration.show_recent_collections_in_dashboard %>
Recent collections @@ -148,11 +173,12 @@
- <% r = recent_collections(8) %> - <% r[:collections].each do |p| %> + <% recent_cs[:collections].each do |p| %>
- <%= link_to_if_arvados_object r[:owners][p[:owner_uuid]], friendly_name: true %>/ + <% if recent_cs[:owners][p[:owner_uuid]].is_a?(Group) %> + <%= link_to_if_arvados_object recent_cs[:owners][p[:owner_uuid]], friendly_name: true %>/ + <% end %> <%= render_localized_date(p[:modified_at], "noseconds") %>
<%= link_to_if_arvados_object p, {friendly_name: true, no_tags: true} %> @@ -161,5 +187,6 @@ <% end %>
+ <% end %>