Limit "compare" selection mechanism to 2 or 3 pipelines. Closes #2101
[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 <table class="topalign table">
11   <thead>
12     <tr class="contain-align-left">
13       <th>
14       </th><th>
15         status
16       </th><th>
17         progress
18       </th><th>
19         uuid
20       </th><th>
21         script
22       </th><th>
23         version
24       </th><th>
25         output
26       </th>
27     </tr>
28   </thead>
29   <tbody>
30
31     <% @jobs.sort_by { |j| j[:created_at] }.reverse.each do |j| %>
32
33     <tr class="cell-noborder">
34       <td>
35         <i class="icon-plus-sign expand-collapse-row" data-id="<%= j.uuid %>" style="cursor: pointer"></i>
36       </td>
37       <td>
38         <% if j.success == false %>
39         <span class="badge badge-warning" title="fail">&#x2716;</span>
40         <% elsif j.success %>
41         <span class="badge badge-success" title="success">&#x2714;</span>
42         <% elsif j.running %>
43         <span class="badge badge-info" title="running">&#x2708;</span>
44         <% else %>
45         <span class="badge" title="queued">&#x2709;</span>
46         <% end %>
47       </td>
48       <td>
49         <% if j.started_at and not j.finished_at %>
50         <% percent_total_tasks = 100 / (j.tasks_summary[:running] + j.tasks_summary[:done] + j.tasks_summary[:todo]) rescue 0 %>
51         <div class="progress" style="margin-bottom: 0">
52           <div class="bar bar-success" style="width: <%= j.tasks_summary[:done] * percent_total_tasks rescue 0 %>%;"></div>
53           <div class="bar" style="width: <%= j.tasks_summary[:running] * percent_total_tasks rescue 0 %>%; opacity: 0.3"></div>
54         </div>
55         <% end %>
56       </td>
57       <td>
58         <%= link_to_if_arvados_object j.uuid %>
59       </td>
60       <td>
61         <%= j.script %>
62       </td>
63       <td>
64         <%= j.script_version.andand[0..8] %>
65       </td>
66       <td>
67         <%= link_to_if_arvados_object j.output %>
68       </td>
69     </tr>
70     <tr class="cell-noborder" id="<%= j.uuid %>" style="display:none">
71       <td colspan="7"><table class="table table-justforlayout"><tr>
72       <td style="border-left: 1px solid black">
73         <table class="table table-condensed">
74           <tr>
75             <td>
76               queued
77             </td>
78             <td>
79               &#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>
80             </td>
81             <td>
82               <%= 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 %>
83             </td>
84           </tr>
85           <% if j.started_at.is_a? Time %>
86           <tr>
87             <td>
88               started
89             </td>
90             <td>
91               &#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>
92             </td>
93             <td>
94               <% if j.finished_at.is_a? Time %>
95               <%= raw('ran&nbsp;' + distance_of_time_in_words(j.finished_at, j.started_at).sub('about ','~').sub(' ','&nbsp;')) %>
96               <% elsif j.running %>
97               <span class="badge badge-success" title="tasks finished">&#x2714;&nbsp;<%= j.tasks_summary[:done] %></span>
98               <span class="badge badge-info" title="tasks running">&#x2708;&nbsp;<%= j.tasks_summary[:running] %></span>
99               <span class="badge" title="tasks todo">&#x2709;&nbsp;<%= j.tasks_summary[:todo] %></span>
100               <% if j.tasks_summary[:failed] %>
101               <span class="badge badge-warning" title="task failures">&#x2716;&nbsp;<%= j.tasks_summary[:failed] %></span>
102               <% end %>
103               <% end %>
104             </td>
105           </tr>
106           <% end %>
107         </table>
108       </td><td>
109         <table class="table table-condensed">
110           <tr><td colspan="2">
111               <%= j.script %> <%= j.script_version %>
112           </td></tr>
113           <% j.script_parameters.sort.each do |k,v| %>
114           <tr>
115             <td><%= k %></td><td><%= link_to_if_arvados_object v %></td>
116           </tr>
117           <% end %>
118           <tr>
119             <td>output</td><td><%= link_to_if_arvados_object j.output %></td>
120           </tr>
121         </table>
122       </td><td>
123         <table class="table table-condensed">
124         <% j.runtime_constraints.sort.each do |k,v| %>
125         <tr><td><%= v %></td><td><%= k %></td></tr>
126         <% end %>
127         </table>
128       </td>
129       </tr></table></td>
130     </tr>
131
132     <% end %>
133
134   </tbody>
135 </table>
136