{% extends 'layout.html' %}
{% block content %}
<div class="ui fluid icon input hide" style="margin-bottom:20px">
  <input autofocus="autofocus" class="filter-table" placeholder="Type here to filter...">
</div>
<h1>Summary</h1>
<table class='ui very basic very compact table'>
  <thead>
    <tr>
      <th>Certname</th>
      <th>Version</th>
      <th>Transaction UUID</th>
      <th>Code ID</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a href="{{url_for('node', env=current_env, node_name=catalog.node)}}">{{catalog.node}}</a></td>
      <td>{{catalog.version}}</td>
      <td>{{catalog.transaction_uuid}}</td>
      <td>{{catalog.code_id}}</td>
    </tr>
  </tbody>
</table>

<h1>Resources</h1>
<table class='ui basic table compact catalog'>
  <thead>
    <tr>
      <th>Resource</th>
      <th>Location</th>
    </tr>
  </thead>
  <tbody class='searchable'>
    {% for resource in catalog.get_resources() %}
    <tr>
      <td>{{resource.type_}}[{{resource.name}}]</td>
      <td>{{resource.sourcefile}}:{{resource.sourceline}}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>

<h1>Edges</h1>
<table class="ui basic table compact catalog">
  <thead>
    <tr>
      <th>Source</th>
      <th>Relationship</th>
      <th>Target</th>
    </tr>
  </thead>
  <tbody class='searchable'>
    {% for edge in catalog.get_edges() %}
    <tr>
      <td>{{edge.source}}</td>
      <td>{{edge.relationship}}</td>
      <td>{{edge.target}}</td>
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endblock content %}
