<form>
  <label>Schedules</label>
  <fieldset submitButton="false" autoRun="true">
    <input type="dropdown" token="my_schedule_id" searchWhenChanged="true">
      <label>Select Schedule to View</label>
      <fieldForLabel>schedule_description</fieldForLabel>
      <fieldForValue>schedule_id</fieldForValue>
      <search>
        <query>| inputlookup schedules.csv | table schedule_id schedule_description</query>
      </search>
      <default>US</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Schedule ID: $my_schedule_id$</title>
      <table>
        <title>Current Alert Schedule Status</title>
        <search>
          <query>| makeresults 
| `check_alerting_schedule($my_schedule_id$)`
| fields - _time, *_count</query>
          <earliest>0</earliest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">1</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
      <table>
        <title>Schedule</title>
        <search>
          <query>| inputlookup schedules.csv 
| search schedule_id = $my_schedule_id$ | table schedule_id schedule_description schedule_timezone</query>
          <earliest>0</earliest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">1</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
      <table>
        <title>Regular Schedule</title>
        <search>
          <query>| inputlookup schedule_hours.csv 
| search schedule_id = $my_schedule_id$ | sort schedule_id calendar_day_of_week start_time | table schedule_id calendar_day_of_week start_time end_time</query>
          <earliest>0</earliest>
          <latest></latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">14</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
      <table>
        <title>Maintenance Windows</title>
        <search>
          <query>| inputlookup schedule_maintenance_windows.csv 
| search schedule_id = $my_schedule_id$ 
| sort start_time 
| table schedule_id mw_description start_time end_time</query>
          <earliest>0</earliest>
          <latest></latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">10</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
      <table>
        <title>Holidays</title>
        <search>
          <query>| inputlookup schedule_holidays.csv 
| search schedule_id = $my_schedule_id$ 
| sort holiday_date 
| table schedule_id holiday_description holiday_date start_time end_time</query>
          <earliest>0</earliest>
          <latest></latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">15</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">none</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">false</option>
        <option name="totalsRow">false</option>
        <option name="wrap">true</option>
      </table>
    </panel>
  </row>
</form>