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