X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/52f0c22a42444d1db0648870ae42f918bd3f63c1..4108d902330bb04a70885f316700cf1da9e7d920:/apps/workbench/app/views/application/_job_progress.html.erb diff --git a/apps/workbench/app/views/application/_job_progress.html.erb b/apps/workbench/app/views/application/_job_progress.html.erb index 49ba39d450..efe1819ebd 100644 --- a/apps/workbench/app/views/application/_job_progress.html.erb +++ b/apps/workbench/app/views/application/_job_progress.html.erb @@ -1,43 +1,51 @@ -<% - failed = j[:tasks_summary][:failed] || 0 rescue 0 - done = j[:tasks_summary][:done] || 0 rescue 0 - running = j[:tasks_summary][:running] || 0 rescue 0 - todo = j[:tasks_summary][:todo] || 0 rescue 0 - - if j[:success] == false and done + running + failed == 0 - # The job failed but no tasks were ever started (i.e. crunch-dispatch - # was unable to start the job). Display a full 100% failed progress bar. - failed_percent = 100 - success_percent = 0 - running_percent = 0 - elsif done + running + failed + todo == 0 - # No tasks were ever created for this job; - # render an empty progress bar. - failed_percent = 0 - success_percent = 0 - running_percent = 0 - else - percent_total_tasks = 100.0 / (done + running + failed + todo) - if defined? scaleby - percent_total_tasks *= scaleby - end - failed_percent = failed * percent_total_tasks - success_percent = done * percent_total_tasks - running_percent = running * percent_total_tasks - end -%> - -<% if not defined? scaleby %> -
-<% end %> +<% if (j.andand[:state] == "Running" or defined? scaleby) and (not defined? show_progress_bar or show_progress_bar) %> + <% + failed = j[:tasks_summary][:failed] || 0 rescue 0 + done = j[:tasks_summary][:done] || 0 rescue 0 + running = j[:tasks_summary][:running] || 0 rescue 0 + todo = j[:tasks_summary][:todo] || 0 rescue 0 + + if done + running + failed + todo == 0 + # No tasks were ever created for this job; + # render an empty progress bar. + done_percent = 0 + else + percent_total_tasks = 100.0 / (done + running + failed + todo) + if defined? scaleby + percent_total_tasks *= scaleby + end + done_percent = (done+failed) * percent_total_tasks + end + %> + + <% if not defined? scaleby %> +
+ <% end %> + + + + + <% if not defined? scaleby %> +
+ <% end %> + +<% else %> + +<% to_label = { + "Cancelled" => "danger", + "Complete" => "success", + "Running" => "info", + "Failed" => "danger", + "Queued" => "default", + nil => "default" + } %> - - - - - - + + <%= if defined? title + title + else + if j.andand[:state] then j[:state].downcase else "Not ready" end + end + %> -<% if not defined? scaleby %> -
<% end %>