X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/edc5e4b6645b9b983a85a892bf3d3ad1432a657d..bff57ea5cd61b02b829d831e3637151b1cf4b94c:/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..1fbe5057be 100644 --- a/apps/workbench/app/views/projects/_show_dashboard.html.erb +++ b/apps/workbench/app/views/projects/_show_dashboard.html.erb @@ -5,13 +5,13 @@
Active pipelines <%= 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 %> + 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 %> @@ -32,55 +32,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 %>