Merge branch '20300-rails7'
[arvados.git] / apps / workbench / app / views / jobs / _show_recent.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <% content_for :css do %>
6   table.topalign>tbody>tr>td {
7   vertical-align: top;
8   }
9   table.topalign>thead>tr>td {
10   vertical-align: bottom;
11   }
12 <% end %>
13
14 <%= render partial: "paging", locals: {results: objects, object: @object} %>
15
16 <table class="topalign table">
17   <thead>
18     <tr class="contain-align-left">
19       <th>
20       </th><th>
21         status
22       </th><th>
23         uuid
24       </th><th>
25         script
26       </th><th>
27         version
28       </th><th>
29         output
30       </th>
31     </tr>
32   </thead>
33   <tbody>
34
35     <% @objects.sort_by { |j| j[:created_at] }.reverse.each do |j| %>
36
37     <tr class="cell-noborder">
38       <td>
39         <i class="icon-plus-sign expand-collapse-row" data-id="<%= j.uuid %>" style="cursor: pointer"></i>
40       </td>
41       <td>
42         <div class="inline-progress-container">
43           <%= render partial: 'job_progress', locals: {:j => j} %>
44         </div>
45       </td>
46       <td>
47         <%= link_to_if_arvados_object j %>
48       </td>
49       <td>
50         <%= j.script %>
51       </td>
52       <td>
53         <%= j.script_version.andand[0..8] %>
54       </td>
55       <td>
56         <%= link_to_if_arvados_object j.output %>
57       </td>
58     </tr>
59     <tr class="cell-noborder" id="<%= j.uuid %>" style="display:none">
60       <td colspan="7"><table class="table table-justforlayout"><tr>
61       <td style="border-left: 1px solid black">
62         <table class="table table-condensed">
63           <tr>
64             <td>
65               queued
66             </td>
67             <td>
68               &#x2709;&nbsp;<span title="<%= j.created_at %>"><%= raw distance_of_time_in_words(Time.now, j.created_at).sub('about ','~').sub(' ','&nbsp;') + '&nbsp;ago' if j.created_at %></span>
69             </td>
70             <td>
71               <%= raw('for&nbsp;' + distance_of_time_in_words(j.started_at, j.created_at).sub('about ','~').sub(' ','&nbsp;')) if j.created_at and j.started_at %>
72             </td>
73           </tr>
74           <% if j.started_at.is_a? Time %>
75           <tr>
76             <td>
77               started
78             </td>
79             <td>
80               &#x2708;&nbsp;<span title="<%= j.created_at %>"><%= raw distance_of_time_in_words(j.started_at, Time.now).sub('about ','~').sub(' ','&nbsp;') + '&nbsp;ago' if j.started_at %></span>
81             </td>
82             <td>
83               <% if j.finished_at.is_a? Time %>
84               <%= raw('ran&nbsp;' + distance_of_time_in_words(j.finished_at, j.started_at).sub('about ','~').sub(' ','&nbsp;')) %>
85               <% elsif j.state == "Running" %>
86               <span class="badge badge-success" title="tasks finished">&#x2714;&nbsp;<%= j.tasks_summary[:done] %></span>
87               <span class="badge badge-info" title="tasks running">&#x2708;&nbsp;<%= j.tasks_summary[:running] %></span>
88               <span class="badge" title="tasks todo">&#x2709;&nbsp;<%= j.tasks_summary[:todo] %></span>
89               <% if j.tasks_summary[:failed] %>
90               <span class="badge badge-warning" title="task failures">&#x2716;&nbsp;<%= j.tasks_summary[:failed] %></span>
91               <% end %>
92               <% end %>
93             </td>
94           </tr>
95           <% end %>
96         </table>
97       </td><td>
98         <table class="table table-condensed">
99           <tr><td colspan="2">
100               <%= j.script %> <%= j.script_version %>
101           </td></tr>
102           <% j.script_parameters.sort.each do |k,v| %>
103           <tr>
104             <td><%= k %></td><td><%= link_to_if_arvados_object v %></td>
105           </tr>
106           <% end %>
107           <tr>
108             <td>output</td><td><%= link_to_if_arvados_object j.output %></td>
109           </tr>
110         </table>
111       </td><td>
112         <table class="table table-condensed">
113         <% j.runtime_constraints.sort.each do |k,v| %>
114         <tr><td><%= v %></td><td><%= k %></td></tr>
115         <% end %>
116         </table>
117       </td>
118       </tr></table></td>
119     </tr>
120
121     <% end %>
122
123   </tbody>
124 </table>