X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e910d13fc5fc63a86f20be3b758c08db3d429bc6..e01762a0adcdee209f305cfc2ae902ab4eb94899:/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 9ddd1d59d8..437f05a499 100644
--- a/apps/workbench/app/views/projects/_show_dashboard.html.erb
+++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb
@@ -3,18 +3,20 @@
Active pipelines
+ <% if current_user.andand.is_active %>
- <%= link_to(
- choose_pipeline_templates_path(
- title: 'Choose a pipeline to run:',
- action_name: 'Next: choose inputs ',
- action_href: pipeline_instances_path,
- action_method: 'post',
- action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => current_user.uuid, 'success' => 'redirect-to-created-object'}.to_json),
- { class: "btn btn-primary btn-xs", remote: true, method: 'get' }) do %>
- Run a pipeline...
- <% end %>
-
+ <%= link_to(
+ choose_pipeline_templates_path(
+ title: 'Choose a pipeline to run:',
+ action_name: 'Next: choose inputs ',
+ action_href: pipeline_instances_path,
+ action_method: 'post',
+ action_data: {'selection_param' => 'pipeline_instance[pipeline_template_uuid]', 'pipeline_instance[owner_uuid]' => current_user.uuid, 'success' => 'redirect-to-created-object'}.to_json),
+ { class: "btn btn-primary btn-xs", remote: true }) do %>
+ Run a pipeline...
+ <% end %>
+
+ <% end %>
<% _running_pipelines = running_pipelines %>
@@ -32,55 +34,31 @@
- <% running = [] %>
- <% failed = [] %>
- <% completed = [] %>
- <% queued = [] %>
<% p.components.each do |k, v| %>
<% if v.is_a? Hash and v[:job] %>
- <% if v[:job][:state] == "Running" %>
- <% running << k %>
- <% elsif v[:job][:state] == "Failed" or v[:job][:state] == "Cancelled" %>
- <% failed << k %>
- <% elsif v[:job][:state] == "Complete" %>
- <% completed << k %>
- <% elsif v[:job][:state] == "Queued" %>
- <% queued << k %>
- <% end %>
+ <%= render partial: 'job_progress', locals: {:j => v[:job], :scaleby => (1.0/p.components.size)} %>
<% end %>
<% end %>
- <% completed_pct = (completed.size * 100) / p.components.size %>
- <% failed_pct = (failed.size * 100) / p.components.size %>
- <% running_pct = (running.size * 100) / p.components.size %>
- <% queued_pct = (queued.size * 100) / p.components.size %>
-
-
-
-
-
-
-
-
-
-
-
-
-
+ <%
+ running = p.components.select { |k, c| c.is_a? Hash and c[:job].andand[:state] == "Running" }
+ queued = p.components.select { |k, c| c.is_a? Hash and c[:job].andand[:state] == "Queued" }
+ %>
+
Started at <%= render_localized_date(p[:started_at] || p[:created_at], "noseconds") %>.
<% pipeline_time = Time.now - (p[:started_at] || p[:created_at]) %>
Active for <%= render_runtime(pipeline_time, false) %>.
- <% running.each do |k| %>
- <%= k %>
+ <% running.each do |k,v| %>
+ <%= render partial: 'job_progress', locals: {:j => v[:job], :show_progress_bar => false, :title => k} %>
<% end %>
- <% queued.each do |k| %>
- <%= k %>
+ <% queued.each do |k,v| %>
+ <%= render partial: 'job_progress', locals: {:j => v[:job], :show_progress_bar => false, :title => k} %>
<% end %>