+<%# Copyright (C) The Arvados Authors. All rights reserved.
+
+SPDX-License-Identifier: AGPL-3.0 %>
+
<%# Work unit status %>
-<div>
- <div>
- <%# Need additional handling for main object display %>
- <% if @object.uuid == wu.uuid %>
- <div>
- <div class="pull-right">
- <div>
- <div class="pipeline-instance-spacing">
- <div class="col-md-7">
- <% if wu.is_running? and wu.child_summary_str %>
- <%= wu.child_summary_str %>
- <% end %>
- </div>
- <div class="col-md-3">
- <%= render partial: 'work_units/progress', locals: {wu: wu} %>
- </div>
- <div class="col-md-1">
- <% 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 %>
- </div>
- </div>
- </div>
- </div>
- </div>
+<div class="row">
+ <div class="col-md-4">
+ <% if wu.is_paused? %>
+ <p>
+ This <%= wu.title %> is paused. Children that were running
+ were cancelled and no new processes will be submitted.
+ </p>
<% end %>
- <div class="col-md-10" >
- <% if wu.is_paused? %>
- <p>
- This <%= wu.title %> is paused. Children that are already running
- will continue to run, but no new processes will be submitted.
- </p>
+ <%= raw(wu.show_runtime) %>
+ </div>
+ <%# Need additional handling for main object display %>
+ <% if @object.uuid == wu.uuid %>
+ <div class="col-md-3">
+ <% if wu.is_running? and wu.child_summary_str %>
+ <%= wu.child_summary_str %>
+ <% end %>
+ </div>
+ <div class="col-md-3">
+ <%= render partial: 'work_units/progress', locals: {wu: wu} %>
+ </div>
+ <div class="col-md-2">
+ <% if wu.can_cancel? and @object.editable? %>
+ <% confirm = if wu.confirm_cancellation then {confirm: wu.confirm_cancellation} else {} end %>
+ <%= 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-warning', id: "cancel-obj-button", data: confirm} %>
+ <% end %>
<% end %>
+ </div>
+ <% end %>
+</div>
+
+<%# Display runtime error information %>
+<% if wu.runtime_status.andand[:error] %>
+<div class="container">
+ <div class="col-md-12">
+ <div class="panel panel-danger">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ <a class="component-detail-panel" data-toggle="collapse" href="#errorDetail">
+ <span class="caret"></span> Error: <%= h(wu.runtime_status[:error]) %>
+ </a>
+ </h4>
+ </div>
+ <div id="errorDetail" class="panel-body panel-collapse collapse">
+ <% if wu.runtime_status[:errorDetail] %>
+ <pre><%= h(wu.runtime_status[:errorDetail]) %></pre>
+ <% else %>
+ No detailed information available.
+ <% end %>
+ </div>
+ </div>
+ </div>
+</div>
+<% end %>
- <%= raw(wu.show_runtime) %>
+<%# Display runtime warning message %>
+<% if wu.runtime_status.andand[:warning] %>
+<div class="container">
+ <div class="col-md-12">
+ <div class="panel panel-warning">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ <a class="component-detail-panel" data-toggle="collapse" href="#warningDetail">
+ <span class="caret"></span> Warning: <%= h(wu.runtime_status[:warning]) %>
+ </a>
+ </h4>
+ </div>
+ <div id="warningDetail" class="panel-body panel-collapse collapse">
+ <% if wu.runtime_status[:warningDetail] %>
+ <pre><%= h(wu.runtime_status[:warningDetail]) %></pre>
+ <% else %>
+ No detailed information available.
+ <% end %>
+ </div>
</div>
</div>
</div>
+<% end %>
<p>
<%= render(partial: 'work_units/component_detail', locals: {current_obj: wu}) %>
</p>
<%# Work unit children %>
-
-<%
- uuids = wu.children.collect {|c| c.uuid}.compact
- if uuids.any?
- resource_class = resource_class_for_uuid(uuids.first, friendly_name: true)
- preload_objects_for_dataclass resource_class, uuids
- end
-
- collections = wu.children.collect {|j| j.outputs}.compact
- collections = collections.flatten.uniq
- collections.concat wu.children.collect {|j| j.docker_image}.uniq.compact
- collections_pdhs = collections.select {|x| !(m = CollectionsHelper.match(x)).nil?}.uniq.compact
- collections_uuids = collections - collections_pdhs
- preload_collections_for_objects collections_uuids if collections_uuids.any?
- preload_for_pdhs collections_pdhs if collections_pdhs.any?
-%>
-
<% if wu.has_unreadable_children %>
<%= render(partial: "pipeline_instances/show_components_json",
locals: {error_name: "Unreadable components", backtrace: nil, wu: wu}) %>
<% else %>
- <% @descendent_count = 0 if !@descendent_count %>
<% wu.children.each do |c| %>
- <% @descendent_count += 1 %>
- <%= render(partial: 'work_units/show_child', locals: {current_obj: c, i: @descendent_count, expanded: false}) %>
+ <%= render(partial: 'work_units/show_child', locals: {current_obj: c, i: (c.uuid || rand(2**128).to_s(36)), expanded: false}) %>
<% end %>
<% end %>