3605: Dashboard compute node and pipeline status work in progress
[arvados.git] / apps / workbench / app / views / projects / _compute_node_status.html.erb
1 <div class="row">
2
3   <% nodes = Node.all %>
4
5   <div class="col-sm-4 compute-summary-numbers">
6     <div class="panel panel-default">
7     <table>
8       <colgroup>
9         <col width="25%">
10         <col width="25%">
11         <col width="25%">
12         <col width="25%">
13       </colgroup>
14       <tr>
15         <td>0</td>
16         <td><%= nodes.select {|n| n.crunch_worker_state.in? ["busy", "idle"] }.size %></td>
17         <td><%= nodes.select {|n| n.crunch_worker_state == "busy" }.size %></td>
18         <td><%= nodes.select {|n| n.crunch_worker_state == "idle" }.size %></td>
19       </tr>
20       <tr>
21         <th>Queue</th>
22         <th>Nodes</th>
23         <th>Busy</th>
24         <th>Idle</th>
25       </tr>
26     </table>
27     </div>
28   </div>
29   <div class="col-sm-8">
30     <div class="clearfix" style="margin-top:0.5em; margin-bottom:0.5em">
31       <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
32         <% if n.crunch_worker_state.in? ["busy", "idle"] %>
33           <div class="pull-left compute-summary">
34             <a data-toggle="collapse" href="#detail_<%= n.hostname %>" class="compute-summary-head label label-<%= if n.crunch_worker_state == 'busy' then 'primary' else 'default' end %>">
35               <%= n.hostname %>
36             </a>
37             <div id="detail_<%= n.hostname %>" class="collapse compute-detail">
38               state: <%= n.crunch_worker_state %><br>
39               <% [:total_cpu_cores, :total_ram_mb, :total_scratch_mb].each do |i| %>
40                 <%= i.to_s.gsub '_', ' ' %>: <%= n.info[i] %><br>
41               <% end %>
42             </div>
43           </div>
44         <% end %>
45       <% end %>
46     </div>
47   </div>
48 </div>