.block#block-tables .content %h2.title Status .inner %table.table %thead %tr %th.first Node Name %th Platform %th FQDN %th IP Address %th Uptime %th Last Check-in %th.last Run List %tbody - if @status.empty? %tr %td{:colspan => 7}= "You appear to have no nodes - try connecting one, or creating or editing a #{link_to('client', url(:clients))}" - else - @status.sort.each_with_index do |node, index| %tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"} %td= link_to(node[1].name, url(:node, node[1].name)) %td= "#{node[1]["platform"]} #{node[1]["platform_version"]}" %td= node[1]["fqdn"] %td= node[1]["ipaddress"] %td .accordion -unless node[1]["uptime"].nil? = link_to(node[1]["uptime"].split(" ")[0..1].join(" ") , "#", :class => 'tooltip') .tooltip %table.table.tooltip %tbody %tr %td= node[1]["uptime"] - unless node[1]["ohai_time"].nil? - current_time = Time.now.to_f - ohai_time = Time.at(node[1]["ohai_time"]) - hours, minutes, seconds = time_difference_in_hms(ohai_time) - hours_text = "#{hours} hour#{hours == 1 ? '' : 's'}" - minutes_text = "#{minutes} minute#{minutes == 1 ? '' : 's'}" %td.flash - status_class = "" - if hours > 24 - status_class = "message error" - elsif hours > 1 - status_class = "message warning" %div{ :class => status_class } .accordion - if hours > 48 - status_msg = "> #{hours/24} days ago" - elsif hours > 0 - status_msg = "> #{hours_text} ago" - elsif minutes < 1 - status_msg = "< 1 minute ago" - else - status_msg = "#{minutes_text} ago" = link_to(status_msg, "#", :class=> 'tooltip') .tooltip %table.table.tooltip %tbody %tr %td = ohai_time %br/ - if hours == 0 = "#{minutes_text} ago" - else = "#{hours_text}, #{minutes_text} ago" - else %td Not Checked In - unless node[1].run_list.nil? %td .accordion = link_to("Run List", "#", :class => 'tooltip') .tooltip %table.table.tooltip %thead %tr %th.first Position %th Name %th Version %th.last Type %tbody - if node[1].run_list.empty? %tr %td{:colspan => 2} This node has no roles or recipes applied. - else -node[1].run_list.each_with_index do |run_list_item, i| %tr %td.position= i %td= run_list_item.name %td= run_list_item.version %td= run_list_item.type