[% USE date %]

<div class="card min-w-[420px] w-full mt-5 overflow-hidden">
  <div class="mainTable [% IF main_table_full %]fullsize[% END %]">
    <table class="mainTable striped">
      <thead>
        <tr>
          <th>Time</th>
          <th>Alert Type</th>
          <th>Host</th>
          <th>Service</th>
          <th class="text-center">State</th>
          <th class="text-center">State Type</th>
          <th>Information</th>
        </tr>
      </thead>
      <tbody>
        [%  FOREACH d = data %]
        <tr>
          <td>[% format_date(d.time, datetime_format) %]</td>
          [% IF d.service_description %]
          [% SET status = 'OK'       IF d.state == 0 %]
          [% SET status = 'WARNING'  IF d.state == 1 %]
          [% SET status = 'UNKNOWN'  IF d.state == 3 %]
          [% SET status = 'CRITICAL' IF d.state == 2 %]
          <td>Service Alert</td>
          <td><a class="link" href="extinfo.cgi?type=1&amp;host=[% d.host_name | uri %]">[% d.host_name | html %]</a></td>
          <td><a class="link" href="extinfo.cgi?type=2&amp;host=[% d.host_name | uri %]&amp;service=[% d.service_description | uri %]">[% d.service_description | html %]</a></td>
          <td class="text-center [% status %]">[% status %]</td>
          [% ELSE %]
          [% SET status = 'UP'          IF d.state == 0 %]
          [% SET status = 'DOWN'        IF d.state == 1 %]
          [% SET status = 'UNREACHABLE' IF d.state == 2 %]
          <td>Host Alert</td>
          <td><a class="link" href="extinfo.cgi?type=1&amp;host=[% d.host_name | uri %]">[% d.host_name | html %]</a></td>
          <td>N/A</td>
          <td class="text-center [% status %]">[% status %]</td>
          [% END %]
          <td class="text-center">[% d.state_type %]</td>
          <td class="truncate w-1/2 max-w-xs">[% IF escape_html_tags %][% escape_html(log_line_plugin_output(d)) %][% ELSE %][% log_line_plugin_output(d) %][% END %]</td>
        </tr>
        [% END %]
      </tbody>
    </table>
  </div>
  <div class="mainTableFooter">
    <div class="flex-1 self-center">
      [% PROCESS _pager_total_items.tt %]
    </div>
  </div>
</div>