X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/17e79aa5b26b8c0b3228247451172999ad81baff..d1d4aba8c3eb7e3b605639a4b02cb9d26c033ad2:/apps/workbench/app/views/work_unit/_show_child.html.erb?ds=sidebyside
diff --git a/apps/workbench/app/views/work_unit/_show_child.html.erb b/apps/workbench/app/views/work_unit/_show_child.html.erb
index a38d900792..70e48cbdcb 100644
--- a/apps/workbench/app/views/work_unit/_show_child.html.erb
+++ b/apps/workbench/app/views/work_unit/_show_child.html.erb
@@ -21,62 +21,36 @@
<% else %>
- <% if current_obj.state_label.in? ["Complete", "Failed", "Cancelled"] %>
- <% if current_obj.log_collection %>
- <% logCollection = Collection.find? current_obj.log_collection %>
- <% if logCollection %>
- <%= link_to "Log", job_path(current_obj.uuid, anchor: "Log") %>
- <% else %>
- Log unavailable
- <% end %>
- <% end %>
- <% elsif current_obj.state_label == "Running" %>
- <% job = Job.find? current_obj.uuid %>
- <% if job %>
- <%= link_to "Log", job_path(current_obj.uuid, anchor: "Log") %>
- <% else %>
- Log unavailable
- <% end %>
- <% end %>
+ <%= current_obj.link_to_log %>
<%# column offset 5 %>
- <% if current_obj.state_label != "Queued" %>
+ <% walltime = current_obj.walltime %>
+ <% cputime = current_obj.cputime %>
+ <% if walltime and cputime %>
- <% if current_obj.started_at %>
- <% walltime = ((if current_obj.finished_at then current_obj.finished_at else Time.now() end) - current_obj.started_at) %>
- <% cputime = (current_obj.runtime_constraints.andand[:min_nodes] || 1) *
- ((current_obj.finished_at || Time.now()) - current_obj.started_at) %>
<%= render_runtime(walltime, false) %>
<% if cputime > 0 %> / <%= render_runtime(cputime, false) %> (<%= (cputime/walltime).round(1) %>⨯)<% end %>
- <% end %>
<% end %>
- <% if current_obj.state_label == "Queued" %>
+ <% queuetime = current_obj.queuedtime %>
+ <% if queuetime %>
<%# column offset 5 %>
- <% queuetime = Time.now - Time.parse(current_obj.created_at.to_s) %>
Queued for <%= render_runtime(queuetime, false) %>.
- <% elsif current_obj.state_label == "Running" %>
- <% if current_obj.child_summary %>
- <%# column offset 8 %>
-
-
- <%= current_obj.child_summary[:done] %> <%= "task".pluralize(current_obj.child_summary[:done]) %> done,
- <%= current_obj.child_summary[:failed] %> failed,
- <%= current_obj.child_summary[:running] %> running,
- <%= current_obj.child_summary[:todo] %> pending
-
-
- <% end %>
- <% elsif current_obj.state_label.in? ["Complete", "Failed", "Cancelled"] %>
+ <% elsif current_obj.show_child_summary %>
+ <%# column offset 8 %>
+
+
+ <%= current_obj.child_summary_str %>
+
+
+ <% elsif current_obj.is_finished? %>
<%# column offset 8 %>
<% if current_obj.output %>
- <%= link_to_arvados_object_if_readable(current_obj.output, 'Output data not available', friendly_name: true) %>
- <% elsif current_obj.output %>
<%= link_to_arvados_object_if_readable(current_obj.output, 'Output data not available', link_text: "Output of #{current_obj.label}") %>
<% else %>
No output.
@@ -84,12 +58,12 @@
<% end %>
- <% if current_obj.state_label.in? ["Queued", "Running"] and @object.work_unit(@object.name).can_cancel? and @object.editable? %>
+ <% if current_obj.can_be_canceled? and @object.editable? %>
<%# column offset 11 %>
<%= form_tag "#{current_obj.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-job-button"} %>
+ <%= button_tag "Cancel", {class: 'btn btn-xs btn-danger', id: "cancel-child-button"} %>
<% end %>
<% end %>