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

[% PROCESS _infobox.tt %]

<h1 class="mt-5">Host and Service State Trends</h1>

<div class="card mx-auto min-w-[420px] max-w-[800px] w-full mt-5 overflow-hidden">
  <div class="head p-0">
    <span class="tabs w-40 px-2"><a class="flex" href="trends.cgi">1. Report Type</a></span>
    <i class="fa-solid fa-angle-right text-sm"></i>
    <span class="tabs w-40 px-2"><a class="flex" href="trends.cgi?[% IF ! service %]input=gethost[% ELSE %]input=getservice[% END %]">2. Select [% IF ! service %]Host[% ELSE %]Service[% END %]</a></span>
    <i class="fa-solid fa-angle-right text-sm"></i>
    <span class="tabs w-40 px-2 active"><a class="flex" href="#">3. Report Options</a></span>
  </div>

  <form method="get" action="trends.cgi" class="overflow-x-auto">
    [% IF host %]<input type='hidden' name='host' value="[% host | html %]">[% END %]
    [% IF service %]<input type='hidden' name='service' value="[% service | html %]">[% END %]
    <div class="body">
      <table class="cellspacing-x">
        <tr>
          <th class="text-right w-1/2 align-top">Report period</th>
          <td class="w-1/2">
            [% t1 = date.now - 86400 %]
            [% t2 = date.now %]
            [% PROCESS _timeperiods_select_options.tt selected_timeperiod="" custom=1 name="timeperiod" t1=t1 t2=t2 current=0 show_hint=0 width="w-56" %]
          </td>
        </tr>
        <tr>
          <td colspan="2" class="h-5"></td>
        </tr>
        <tr>
          <th class="text-right">Report time Period</th>
          <td class="align-top">
            <select name='rpttimeperiod' class="w-56">
              <option value="">None</option>
              [% FOREACH t = timeperiods %]
                <option value="[% t.name | html %]">[% t.name | html %]</option>
              [% END %]
            </select>
          </td>
        </tr>
        <tr>
          <th class="text-right">Assume Initial States</th>
          <td>
            <select name='assumeinitialstates'>
              <option value="yes">Yes</option>
              <option value="no">No</option>
            </select>
          </td>
        </tr>
        <tr>
          <th class="text-right">Assume State Retention</th>
          <td>
            <select name='assumestateretention'>
              <option value="yes">Yes</option>
              <option value="no">No</option>
            </select>
          </td>
        </tr>
        <tr>
          <th class="text-right">Assume States During Program Downtime</th>
          <td>
            <select name='assumestatesduringnotrunning'>
              <option value="yes">Yes</option>
              <option value="no">No</option>
            </select>
          </td>
        </tr>
        <tr>
          <th class="text-right">Include Soft States</th>
          <td>
            <select name='includesoftstates'>
              <option value="yes">Yes</option>
              <option value="no" selected>No</option>
            </select>
          </td>
        </tr>
        <tr>
          <th class="text-right">First Assumed Service State</th>
          <td>
            <select name='initialassumedservicestate' class="w-56">
              <option value="0">Unspecified</option>
              <option value="-1">Current State</option>
              <option value="6">Service Ok</option>
              <option value="8">Service Warning</option>
              <option value="7">Service Unknown</option>
              <option value="9">Service Critical</option>
            </select>
          </td>
        </tr>
        <tr>
          <th class="text-right">Backtracked Archives (To Scan For Initial States)</th>
          <td><input type='text' name='backtrack' size='2' maxlength='2' value='4'></td>
        </tr>
        <tr>
          <th class="text-right">Suppress image map</th>
          <td><input type='checkbox' name='nomap'></td>
        </tr>
      </table>
    </div>
    <div class="footer justify-center">
      <input class="green" type='submit' value='Create Report'>
    </div>
  </form>
</div>

[% PROCESS _footer.tt %]
