[% USE date %]
[% PROCESS _header.tt %]

  [% PROCESS _infobox.tt %]

  <h1 class="mt-5">Blocking Outages</h1>

  <div class="card min-w-[420px] w-full mt-2 overflow-hidden">
    <div class="mainTable [% IF main_table_full %]fullsize[% END %] border-t-0">
      <table class="mainTable striped">
        <thead>
          <tr>
            <th>Severity</th>
            <th>Host</th>
            <th class="text-center">State</th>
            <th class="text-center">Notes</th>
            <th class="text-center">State Duration</th>
            <th class="text-center"># Hosts Affected</th>
            <th class="text-center"># Services Affected</th>
            <th class="text-center">Actions</th>
          </tr>
        </thead>
        <tbody>
          [% SET num = 0 %]
          [% FOREACH host = outages %]
            [% SET num = num + 1 %]
            <tr>
              <td>[% host.severity %]</td>
              <td><a href="extinfo.cgi?type=1&amp;host=[% host.name | uri %]&amp;backend=[% host.peer_key %]">[% host.name | html %]</a></td>
              <td class='text-center DOWN'>DOWN</td>
              <td class="text-center">
                [% IF host.comment_count > 0 %]
                <a href="extinfo.cgi?type=1&amp;host=[% host.name | uri %]#comments">
                  <i class="fa-solid fa-comment text-sm" title="This host has [% host.comment_count %] comment associated with it"></i>
                </a>
                [% ELSE %]
                N/A
                [% END %]
              </td>
              <td class="text-center">[% duration(date.now - host.last_state_change, 6) %]</td>
              <td class="text-center">[% host.affected_hosts %]</td>
              <td class="text-center">[% host.affected_services %]</td>
              <td>
                <div class="flex gap-1 justify-center">
                  <a href="status.cgi?host=[% host.name | uri %]">
                    <i class="fa-solid fa-bars small" title='View status detail for this host'></i>
                  </a>
                  [% IF use_feature_trends %]
                    <a href="trends.cgi?host=[% host.name | uri %][% add_request_backend %]">
                      <i class="fa-solid fa-chart-simple" title='View trends for this host'></i>
                    </a>
                  [% END %]
                  <a href="history.cgi?host=[% host.name | uri %]&amp;nosystem=1[% add_request_backend %]">
                    <i class="fa-solid fa-clock-rotate-left small" title='View alert history for this host'></i>
                  </a>
                  <a href="notifications.cgi?host=[% host.name | uri %][% add_request_backend %]">
                    <i class="fa-solid fa-volume-high small" title='View notifications for this host'></i>
                  </a>
                </div>
              </td>
            </tr>
          [% END %]
        </tbody>
      </table>
    </div>

    <div class="mainTableFooter">
      <div class="textPager font-medium leading-7 whitespace-nowrap">
        [% num %] Blocking Outages Displayed
      </div>
    </div>
  </div>

[% PROCESS _footer.tt %]
