18874: Merge commit '6f8dcb2b13f3058db656908fb26b09e23b527f08' into 18874-merge-wb2
[arvados.git] / apps / workbench / app / views / work_units / _show_child.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <div class="panel panel-default">
6   <div class="panel-heading">
7       <div class="row">
8         <div class="col-md-3" style="word-break:break-all;">
9           <h4 class="panel-title">
10             <a class="component-detail-panel" data-toggle="collapse" href="#collapse<%= i %>">
11               <%= current_obj.label %> <span class="caret" href="#collapse<%= i %>"></span>
12             </a>
13           </h4>
14         </div>
15
16         <div class="col-md-2 pipeline-instance-spacing">
17           <%= render partial: 'work_units/progress', locals: {wu: current_obj} %>
18         </div>
19
20         <% if not current_obj %>
21           <div class="col-md-7"></div>
22         <% else %>
23           <% walltime = current_obj.walltime %>
24           <% cputime = current_obj.cputime %>
25           <% runningtime = current_obj.runningtime %>
26           <div class="col-md-3">
27           <% if walltime and cputime %>
28             <%= render_runtime([walltime, runningtime].max, false) %>
29             <% if cputime > 0 %> / <%= render_runtime(cputime, false) %> (<%= (cputime/runningtime).round(1) %>&Cross;)<% end %>
30           <% end %>
31           </div>
32
33           <% queuetime = current_obj.queuedtime %>
34           <% if queuetime %>
35             <div class="col-md-3">
36               Queued for <%= render_runtime(queuetime, false) %>.
37             </div>
38           <% elsif current_obj.is_running? %>
39             <div class="col-md-3">
40               <span class="task-summary-status">
41                 <%= current_obj.child_summary_str %>
42               </span>
43             </div>
44           <% end %>
45
46           <div class="col-md-1 pipeline-instance-spacing">
47           <% if current_obj.can_cancel? and @object.editable? %>
48               <%= form_tag "#{current_obj.uri}/cancel", remote: true, style: "display:inline; padding-left: 1em" do |f| %>
49                 <%= hidden_field_tag :return_to, url_for(@object) %>
50                 <%= button_tag "Cancel", {class: 'btn btn-xs btn-warning', id: "cancel-child-button"} %>
51               <% end %>
52           <% end %>
53           </div>
54         <% end %>
55       </div>
56   </div>
57
58   <% content_url = url_for(controller: :work_units, action: :show_child_component, id: @object.uuid, object_type: @object.class.to_s) %>
59   <div id="collapse<%=i%>" class="work-unit-component-detail panel-collapse collapse <%= if expanded then 'in' end %>" content-url="<%=content_url%>" action-data="<%={current_obj_type: current_obj.class.to_s, current_obj_uuid: current_obj.uuid, current_obj_name: current_obj.label, current_obj_parent: current_obj.parent}.to_json%>">
60     <div class="panel-body work-unit-component-detail-body">
61     </div>
62   </div>
63 </div>