Merge pull request #1 from curoverse/master
[arvados.git] / apps / workbench / app / views / projects / _compute_node_status.html.erb
1 <h4>Queue</h4>
2 <% queue = Job.queue %>
3 <% if queue.any? %>
4
5 <% queue.each do |j| %>
6   <div class="row">
7     <div class="col-md-3 text-overflow-ellipsis">
8       <%= link_to_if_arvados_object j, friendly_name: true %>
9     </div>
10     <div class="col-md-4">
11       <%= render_localized_date(j[:created_at]) %>
12     </div>
13     <div class="col-md-3">
14       <%= render_runtime(Time.now - j[:created_at], false) %>
15     </div>
16     <div class="col-md-2">
17       <%= j[:priority] %>
18     </div>
19   </div>
20 <% end %>
21   <div class="row">
22     <div class="col-md-3">
23       <b>Job</b>
24     </div>
25     <div class="col-md-4">
26       <b>Submitted</b>
27     </div>
28     <div class="col-md-3">
29       <b>Queued</b>
30     </div>
31     <div class="col-md-2">
32       <b>Priority</b>
33     </div>
34   </div>
35   <% if Job.queue_size > queue.size %>
36     <i>Note: some items in the queue are not visible to you.</i>
37   <% end %>
38   <div>
39   </div>
40 <% else %>
41   There are currently no jobs in your queue.
42 <% end %>
43
44 <h4>Node status</h4>
45 <div class="compute-summary-nodelist">
46     <% nodes.sort_by { |n| n.hostname || "" }.each do |n| %>
47       <% if n.crunch_worker_state.in? ["busy", "idle"] and (Time.now - n[:last_ping_at]) < 3600 %>
48         <div class="compute-summary">
49           <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 %>">
50             <%= n.hostname %>
51           </a>
52           <div id="detail_<%= n.hostname %>" class="collapse compute-detail">
53             state: <%= n.crunch_worker_state %><br>
54             <% [:total_cpu_cores, :total_ram_mb, :total_scratch_mb].each do |i| %>
55               <%= i.to_s.gsub '_', ' ' %>: <%= n.properties[i] %><br>
56             <% end %>
57           </div>
58         </div>
59       <% end %>
60     <% end %>
61 </div>