in /nodes, click row to show info[]
[arvados.git] / app / views / nodes / index.html.erb
1 <table style="width:100%">
2   <tr class="contain-align-left">
3     <th>
4       status
5     </th><th>
6       uuid
7     </th><th>
8       hostname
9     </th><th>
10       domain
11     </th><th>
12       ip address
13     </th><th>
14       created
15     </th><th>
16       startup delay
17     </th><th>
18       last ping
19     </th><th>
20       instance_id
21     </th>
22   </tr>
23
24   <% @objects.each do |o| %>
25
26   <tr class="node-status node-status-<%= o.status %>" data-showhide-selector="tr#extra-info-<%= o.uuid %>" style="cursor:pointer">
27     <td>
28       <%= o.status %>
29     </td><td>
30       <%= o.uuid %>
31     </td><td>
32       <%= o.hostname %>
33     </td><td>
34       <%= o.domain %>
35     </td><td>
36       <%= o.ip_address %>
37     </td><td>
38       <%= o.created_at %>
39     </td><td>
40       <%= distance_of_time_in_words(o.first_ping_at, o.created_at, true) if o.first_ping_at %>
41     </td><td>
42       <%= distance_of_time_in_words(o.last_ping_at, Time.now, true) + ' ago' if o.last_ping_at %>
43     </td><td>
44       <%= o.info[:ec2_instance_id] %>
45     </td>
46   </tr>
47
48   <% if  %>
49   <tr id="extra-info-<%= o.uuid %>" <%= 'data-showhide-default' unless o.info[:ec2_start_command] and !o.first_ping_at %>>
50     <td colspan="8">
51       <dl>
52       <% o.info.each do |k,v| %>
53       <dt><em><%= k %></em></dt>
54       <dd><%= v %></dd>
55       <% end %>
56       </dl>
57     </td>
58   </tr>
59
60   <% end %>
61   <% end %>
62 </table>