{% extends "tesm_core/base.html" %}
{% block page_title %}Laufendes Protokoll{% endblock %}
{% block page_sub %}{{ path }} &middot; letzte {{ line_count }} Zeilen{% endblock %}

{% block topbar_extra %}
<form method="get" class="row row--tight" data-no-guard>
  <span class="search-input">
    {{ icon('search', size=15) }}
    <input class="input" type="search" name="q" value="{{ query }}" placeholder="Filter ...">
  </span>
  <select class="select" name="lines" style="width:auto">
    {% for option in [200, 400, 1000, 2000] %}
      <option value="{{ option }}" {% if option == line_count %}selected{% endif %}>{{ option }} Zeilen</option>
    {% endfor %}
  </select>
  <button class="btn btn--sm" type="submit">Anwenden</button>
</form>
{% endblock %}

{% block content %}
<section class="card">
  <div class="card__header">
    <div class="flex-1">
      <div class="card__title">{{ icon('terminal', size=17) }} Erreichbarkeit und PoE</div>
      <div class="card__sub">Aktualisiert sich automatisch alle 10 Sekunden</div>
    </div>
  </div>
  <div id="live-log" data-refresh-url="{{ url_for('logs.live_fragment', lines=line_count, q=query) }}"
       data-refresh-interval="10000">
    {% include "tesm_core/_log_lines.html" %}
  </div>
</section>
{% endblock %}
