Merge branch 'master' into 2919-provenance-graph-cutoff
[arvados.git] / services / api / app / views / pipeline_instances / index.html.erb
1 <table style="width:100%">
2   <tr class="contain-align-left">
3     <th>
4       success
5     </th><th>
6       active
7     </th><th>
8       % complete
9     </th><th>
10       uuid
11     </th><th>
12       pipeline template
13     </th><th>
14       name
15     </th><th>
16       last updated
17     </th>
18   </tr>
19
20   <% @objects.each do |o| %>
21
22   <% status = (o.state == 'Complete') ? 'success' : ((o.state == 'Failed') ? 'failure' : 'pending') %>
23
24   <tr class="pipeline-instance-status pipeline-instance-status-<%= status %>" data-showhide-selector="tr#extra-info-<%= o.uuid %>" style="cursor:pointer">
25     <td>
26       <%= status %>
27     </td><td>
28       <%= (o.state == 'RunningOnServer') ? 'yes' : '-' %>
29     </td><td>
30       <%= (o.progress_ratio * 1000).floor / 10 %>
31     </td><td>
32       <%= o.uuid %>
33     </td><td>
34       <%= o.pipeline_template_uuid %>
35     </td><td>
36       <%= o.name %>
37     </td><td>
38       <%= distance_of_time_in_words(o.updated_at, Time.now, true) + ' ago' if o.updated_at %>
39     </td>
40   </tr>
41
42   <% if  %>
43   <tr id="extra-info-<%= o.uuid %>" data-showhide-default>
44     <td colspan="7">
45       <table>
46         <% o.progress_table.each do |r| %>
47         <tr>
48           <% r[2] = "#{(r[2]*100).floor}%" %>
49           <% r[4] = r[4][0..5] rescue '' %>
50           <% r.each do |c| %>
51           <td>
52             <%= (c.is_a? Time) ? distance_of_time_in_words(c, Time.now, true) + ' ago' : c %>
53           </td>
54           <% end %>
55         </tr>
56         <% end %>
57       </table>
58     </td>
59   </tr>
60
61   <% end %>
62   <% end %>
63 </table>