+// -*- mode: javascript; js-indent-level: 4; indent-tabs-mode: nil; -*-
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
+
+var loaded_nodes_js;
+$(function(){
+ if (loaded_nodes_js) return; loaded_nodes_js = true;
+
+ $('[data-showhide-selector]').on('click', function(e){
+ var x = $($(this).attr('data-showhide-selector'));
+ if (x.css('display') == 'none')
+ x.show();
+ else
+ x.hide();
+ });
+ $('[data-showhide-default]').hide();
+});
-<table>
+<table style="width:100%">
<tr class="contain-align-left">
<th>
status
startup delay
</th><th>
last ping
+ </th><th>
+ instance_id
</th>
</tr>
<% @objects.each do |o| %>
- <tr class="node-status node-status-<%= o.status %>">
+ <tr class="node-status node-status-<%= o.status %>" data-showhide-selector="tr#extra-info-<%= o.uuid %>" style="cursor:pointer">
<td>
<%= o.status %>
</td><td>
</td>
</tr>
- <% if o.info[:ec2_start_command] and !o.first_ping_at %>
- <tr>
+ <% if %>
+ <tr id="extra-info-<%= o.uuid %>" <%= 'data-showhide-default' unless o.info[:ec2_start_command] and !o.first_ping_at %>>
<td colspan="8">
- <%= o.info[:ec2_start_command] %>
- <br />
- <%= o.info[:ec2_start_result] %>
+ <dl>
+ <% o.info.each do |k,v| %>
+ <dt><em><%= k %></em></dt>
+ <dd><%= v %></dd>
+ <% end %>
+ </dl>
</td>
</tr>