{% extends 'layouts/master-page' %}
{% block title %}{{hostname}} - Vulns{% endblock %}
{% block head %}
  <!-- javascript -->
  <script type="text/javascript" src="/static/js/custom/pager.js"></script>
  
{% endblock %}
{% block content %}

 <button id="filter-toggle" type="button" class="btn btn-primary btn-xs" data-toggle="collapse" data-target="#filterdiv">
  Hide/Show filter
</button>
  
  <div id="filterdiv" class="collapse well well-small">  
    <form method="POST" id="filter" class="nav form-search">
<!--
      {{ form.csrf_token }}
-->
      
      {{ form.r }}
      {{ form.pageLentgh }}
      {{ form.hostname }}
      <table class="searchTable">
        <tr>
          <td class="text">{{ form.cveid.label }}</td><td>{{ form.cveid(size=20) }}</td>
          <td class="text">{{ form.package.label }}</td><td>{{ form.package(size=30) }}</td>
          <td class="text">{{ form.urgency.label }}</td><td>{{ form.urgency() }}</td>
          <td class="text">{{ form.remotely_exp.label }}</td><td>{{ form.remotely_exp() }}</td>
          <td class="text">{{ form.fixed.label }}</td><td>{{ form.fixed() }}</td>
          <td class="text">{{ form.src.label }}</td><td>{{ form.src() }}</td>
          <td class="text">{{ form.submit.label }}</td><td>{{ form.submit() }}</td>
        </tr>
      </table>
      
      
<!--
      <input name="r" id="r" type="hidden" value=0 />
      <input name="hostname" id="hostname" type="hidden" value="all" /> 
      <input name="pageLength" id="pageLength" type="hidden" value= {% if filters is defined and filters['pageLength'] is defined %}"{{filters['pageLength']}}"{% else %}"50"{% endif %}/>  
      <table class="searchTable">
        <tr>
          <td class="text">CVEID</td>
          <td>
            <input name="cveid" id="cveid" type="text" value={% if filters is defined and filters['cveid'] != "all" %}"{{filters['cveid']}}"{% else %}"all"{% endif %}></input>
          </td>
          <td class="text">Package</td>
          <td>
            <input name="package" id="package" type="text" value={% if filters is defined and filters['package'] != "all" %}"{{filters['package']}}"{% else %}"all"{% endif %}/>
          </td>
          <td class="text">Urgency</td>
          <td>
            <select name="urgency" id="urgency">
              <option value="all">all</option>
              <option value="" {% if filters is defined and filters['urgency'] == "" %}selected{% endif %}>unknown</option>
              <option value="negligible" {% if filters is defined and filters['urgency'] == "negligible" %}selected{% endif %}>negligible</option>
              <option value="low" {% if filters is defined and filters['urgency'] == "low" %}selected{% endif %}>low</option>
              <option value="medium" {% if filters is defined and filters['urgency'] == "medium" %}selected{% endif %}>medium</option>
              <option value="high" {% if filters is defined and filters['urgency'] == "high" %}selected{% endif %}>high</option>
              <option value="critical" {% if filters is defined and filters['urgency'] == "critical" %}selected{% endif %}>critical</option>
            </select>
          </td>
          <td class="text">Remotely exp</td>
          <td>
            <select name="remotely_exp" id="remotely_exp">
              <option value="all">all</option>
              <option value="unknown" {% if filters is defined and filters['remotely_exp'] == "unknown" %}selected{% endif %}>unknown</option>
              <option value="yes" {% if filters is defined and filters['remotely_exp'] == "yes" %}selected{% endif %}>yes</option>
              <option value="no" {% if filters is defined and filters['remotely_exp'] == "no" %}selected{% endif %}>no</option>
            </select>
          </td>
          <td>Fixed</td>
          <td>
            <select name="fixed" id="fixed">
              <option value="all">all</option>
              <option value="yes" {% if filters is defined and filters['fixed'] == "yes" %}selected{% endif %}>yes</option>
              <option value="no" {% if filters is defined and filters['fixed'] == "no" %}selected{% endif %}>no</option>
            </select>
          </td>
          <td>Source</td>
          <td>
            <select name="src" id="src">
              <option value="all">all</option>
              <option value="debsecan" {% if filters is defined and filters['src'] == "debsecan" %}selected{% endif %}>debsecan</option>
              <option value="ubuntu" {% if filters is defined and filters['src'] == "ubuntu" %}selected{% endif %}>ubuntu</option>
              <option value="cve" {% if filters is defined and filters['src'] == "cve" %}selected{% endif %}>cve</option>
            </select>
          </td>
        </tr>
    </table>
    <input type="submit" value="Search"/>
-->
  </form>
</div>

  {% if vulns != None %}
  <!-- Pager -->
  {% include 'subpages/pager.html' %}
  <!-- Search results -->
  {% include 'subpages/vulns_table.html' %}
  <!-- Pager -->
  {% include 'subpages/pager.html' %}
  {% endif %}
  
{% endblock %}
