15087: Make container status a separate panel
[arvados.git] / apps / workbench / app / views / projects / _container_summary.html.erb
1 <%# Copyright (C) The Arvados Authors. All rights reserved.
2
3 SPDX-License-Identifier: AGPL-3.0 %>
4
5 <div class="compute-summary-numbers">
6     <table>
7       <colgroup>
8         <col width="50%">
9         <col width="50%">
10       </colgroup>
11       <tr>
12         <% pending_containers = Container.order("modified_at asc").filter([["state", "in", ["Queued", "Locked"]], ["priority", ">", 0]]).limit(1) %>
13         <% running_containers = Container.order("started_at asc").where(state: "Running").limit(1) %>
14         <td><%= pending_containers.items_available %></td>
15         <td><%= running_containers.items_available %></td>
16       </tr>
17       <tr>
18         <th>Pending containers</th>
19         <th>Running containers</th>
20       </tr>
21       <tr>
22         <th><%= if pending_containers.first then render_runtime(Time.now - pending_containers.first.modified_at, false, false) else "-" end %></th>
23         <th><%= if running_containers.first then render_runtime(Time.now - running_containers.first.started_at, false, false) else "-" end %></th>
24       </tr>
25       <tr>
26         <th>Oldest pending</th>
27         <th>Longest running</th>
28       </tr>
29     </table>
30
31 </div>