36 lines
2.4 KiB
HTML
36 lines
2.4 KiB
HTML
{% extends 'base.html' %}
|
|
{% block title %}Routines{% endblock %}
|
|
{% block content %}
|
|
<div class="head">
|
|
<div><div class="kicker">Beheer</div><h1>Routines</h1></div>
|
|
<div class="actions">
|
|
<div class="dropdown">
|
|
<button class="btn btn-primary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">Nieuwe routine</button>
|
|
<ul class="dropdown-menu dropdown-menu-end">{% for k, t in TYPES.items() %}<li><a class="dropdown-item" href="{{ url_for('routine_edit', kind=k) }}">{{ t.label }}</a></li>{% endfor %}</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="card"><div class="card-body">
|
|
{% if rows %}
|
|
<div class="table-responsive"><table class="table table-hover table-stack">
|
|
<thead><tr><th>Naam</th><th>Soort</th><th>Elke</th><th>Laatst</th><th>Volgende</th><th>Resultaat</th><th></th></tr></thead>
|
|
<tbody>
|
|
{% for j in rows %}
|
|
<tr class="link" onclick="location='{{ url_for('routine_edit', jid=j.id) }}'">
|
|
<td class="stack-title"><a href="{{ url_for('routine_edit', jid=j.id) }}">{{ j.name }}</a>{% if not j.active %} <span class="chip verloren">Uit</span>{% endif %}{% if j.running_since %} <span class="chip nieuw">Bezig</span>{% endif %}</td>
|
|
<td data-label="Soort">{{ TYPES[j.kind].label if j.kind in TYPES else j.kind }}</td>
|
|
<td data-label="Elke">{{ interval_text(j.interval_minutes) }}</td>
|
|
<td data-label="Laatst" class="muted">{{ j.last_run|dt if j.last_run else '—' }}</td>
|
|
<td data-label="Volgende" class="muted">{{ (j.next_run|dt if j.next_run else 'zo snel mogelijk') if j.active else '—' }}</td>
|
|
<td data-label="Resultaat">{% if j.last_status == 'fout' %}<span class="chip nieuw">Fout</span> {% endif %}<span class="muted">{{ j.last_message|truncate(80) }}</span></td>
|
|
<td class="num"><form method="post" action="{{ url_for('routine_run', jid=j.id) }}" class="inline" onclick="event.stopPropagation()"><button class="btn btn-outline-primary btn-sm">Nu uitvoeren</button></form></td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table></div>
|
|
{% else %}<p class="empty">Nog geen routines.</p>{% endif %}
|
|
</div></div>
|
|
<p class="muted">Routines draaien op de achtergrond (Docker: container <code>crm-routines</code>; zonder Docker: cron elke minuut
|
|
<code>python app.py tick</code>). Elke halve minuut wordt gekeken welke aan de beurt zijn; een routine draait nooit twee keer tegelijk.</p>
|
|
{% endblock %}
|