X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0a98952530fb465fa31566fa5e0192bea9fc16e4..f526141fa776df068d011093ccb89f31f52e69be:/apps/workbench/app/views/work_unit/_show_component.html.erb diff --git a/apps/workbench/app/views/work_unit/_show_component.html.erb b/apps/workbench/app/views/work_unit/_show_component.html.erb index dbf1c11f8d..58b8aa861b 100644 --- a/apps/workbench/app/views/work_unit/_show_component.html.erb +++ b/apps/workbench/app/views/work_unit/_show_component.html.erb @@ -8,22 +8,22 @@
- <% if wu.state_label == 'Running' and wu.child_summary_str %> -
+
+ <% if wu.is_running? and wu.child_summary_str %> <%= wu.child_summary_str %> -
<% end %> +
<%= render partial: 'work_unit/progress', locals: {wu: wu} %>
- <% if wu.state_label.in? ["Queued", "Running"] and wu.can_cancel? and @object.editable? %> -
+
+ <% if wu.can_cancel? and @object.editable? %> <%= form_tag "#{wu.uri}/cancel", remote: true, style: "display:inline; padding-left: 1em" do |f| %> <%= hidden_field_tag :return_to, url_for(@object) %> <%= button_tag "Cancel", {class: 'btn btn-xs btn-danger', id: "cancel-obj-button"} %> <% end %> -
- <% end %> + <% end %> +
@@ -31,73 +31,14 @@ <% end %>
- <% if wu.state_label == 'Paused' %> + <% if wu.is_paused? %>

- This <%= wu.title %> is paused. Children that are - already running will continue to run, but no new work will be submitted. + This <%= wu.title %> is paused. Children that are already running + will continue to run, but no new processes will be submitted.

<% end %> - <% runningtime = determine_wallclock_runtime(wu.children) %> - -

- <% if wu.started_at %> - This <%= wu.title %> started at <%= render_localized_date(wu.started_at) %>. - It - <% if wu.state_label == 'Complete' %> - completed in - <% elsif wu.state_label == 'Failed' %> - failed after - <% else %> - has been active for - <% end %> - - <% walltime = if wu.finished_at then - wu.finished_at - wu.started_at - else - Time.now - wu.started_at - end %> - - <%= if walltime > runningtime - render_runtime(walltime, false) - else - render_runtime(runningtime, false) - end %><% if wu.finished_at %> at <%= render_localized_date(wu.finished_at) %><% end %>. - <% else %> - <% if wu.state_label %> This <%= wu.title %> is <%= if wu.state_label == 'Running' then 'active' else wu.state_label.downcase end %>. <% end %> - <% walltime = 0 %> - <% end %> - - <% if wu.state_label == 'Failed' %> - Check the Log tab for more detail about why it failed. - <% end %> -

- - <% if wu.state_label %> -

- It - <% if wu.state_label == 'Running' %> - has run - <% else %> - ran - <% end %> - for - <% - cputime = wu.children.map { |c| - if c.started_at - (c.runtime_constraints.andand[:min_nodes] || 1) * ((c.finished_at || Time.now()) - c.started_at) - else - 0 - end - }.reduce(:+) || 0 %> - <%= render_runtime(runningtime, false) %><% if (walltime - runningtime) > 0 %> - (<%= render_runtime(walltime - runningtime, false) %> queued)<% end %><% if cputime == 0 %>.<% else %> - and used - <%= render_runtime(cputime, false) %> - of node allocation time (<%= (cputime/runningtime).round(1) %>⨯ scaling). - <% end %> -

- <% end %> + <%= raw(wu.show_runtime) %>