<%= javascript_include_tag "https://www.gstatic.com/charts/loader.js" %>

<%= t('qa_server.monitor_status.title') %>

<%= t('qa_server.monitor_status.summary.title') %>

<%= t('qa_server.monitor_status.summary.summary_table') %>

<%= t('qa_server.monitor_status.summary.authorities') %> <%= t('qa_server.monitor_status.summary.authorities_with_failures') %> <%= t('qa_server.monitor_status.summary.passing_tests') %> <%= t('qa_server.monitor_status.summary.failing_tests') %> <%= t('qa_server.monitor_status.summary.total_tests') %>
<%= @presenter.authorities_count %> <%= @presenter.failing_authorities_count %> <%= @presenter.passing_tests_count%> <%= @presenter.failing_tests_count %> <%= @presenter.tests_count %>

<%= t('qa_server.monitor_status.summary.last_updated', date: @presenter.last_updated) %>

<% if @presenter.failures? %>

<%= t('qa_server.monitor_status.failures.title') %>

<% current_authority = nil %> <% @status_data.each do |status| %> <% unless status[:authority_name] == current_authority %> <% current_authority = status[:authority_name] %> <% end %> <% end %>
<%= t('qa_server.monitor_status.failures.status') %> <%= t('qa_server.monitor_status.failures.subauthority') %> <%= t('qa_server.monitor_status.failures.service') %> <%= t('qa_server.monitor_status.failures.action') %> <%= t('qa_server.monitor_status.failures.url') %> <%= t('qa_server.monitor_status.failures.errmsg') %>
<%= current_authority %>
<%= @presenter.status_label(status) %> <%= status[:subauthority_name] %> <%= status[:service] %> <%= status[:action] %> <%= status[:url] %> <%= status[:err_message] %>
<% end %> <% if @presenter.history? && @presenter.display_history_details?%>

<%= t('qa_server.monitor_status.history.title') %>

<%= t('qa_server.monitor_status.history.since', date: @presenter.first_updated) %>

<%#= column_chart @presenter.historical_summary, stacked: true, colors: ["green", "red"], xtitle: 'Authority', ytitle: 'Pass-Fail', legend: 'bottom' %> <% if @presenter.display_historical_graph? %> <%= image_tag(@presenter.historical_graph, alt: 'History Graph Unavailable') %> <% end %> <% if @presenter.display_historical_datatable? %> <% @presenter.historical_summary.each do |entry| %> <% end %>
<%= t('qa_server.monitor_status.history.authority') %> <%= t('qa_server.monitor_status.history.days_tested') %> <%= t('qa_server.monitor_status.history.days_passing') %> <%= t('qa_server.monitor_status.history.days_failing') %> <%= t('qa_server.monitor_status.history.percent_failing') %>
<%= @presenter.historical_data_authority_name(entry) %> <%= @presenter.days_authority_tested(entry) %> <%= @presenter.days_authority_passing(entry) %> <%= @presenter.days_authority_failing(entry) %> <%= @presenter.percent_authority_failing_str(entry) %>
<% end %>
<% end %>