ActiveAdmin.register_page "Current Scoring Load" do
  menu :parent => 'Misc'

  content :title => "Current Scoring Load" do
    table_for GetWork.summary do
      column "Work", :work_count
      column "Who", Proc.new { |connection| "#{connection.first_name} #{connection.last_name} - #{connection.email}" }
      column "Errors", Proc.new { |connection| "#{connection.udp_reachable != false ? "" : "No STUN,"} #{connection.is_network_testing != false ? "NETWORK TESTING" : ""} #{connection.in_timeout != 'f' ? "Timeout," : ""} #{connection.in_session != 'f' ? "In-Session," : ""}" }
      column "Total Timeouts", :scoring_timeout_occurrences
      column "Current Scoring Failures", :scoring_failures
      column "Offset", :scoring_failures_offset
    end
  end

end