Files
patrickandClaude Sonnet 5.5 347f55cf7c
test / pytest (3.11) (push) Canceled after 0s
test / pytest (3.13) (push) Canceled after 0s
feat: Phase 6c baseline, ack, host alarms, outage notice, send limit, privacy mode, UI link
Includes atomic migrations, per-rule reminder semantics, first-run helper script
and the note on the undecided UI chat idea.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 03:06:23 +01:00

53 lines
3.5 KiB
HTML

{% extends "base.html" %}
{% block title %}Regeln{% endblock %}
{% block content %}
<h1>Regeln</h1>
<section class="card">
<p class="muted">Regeln werden von oben nach unten ausgewertet. Jede passende Regel fügt ihre Ziele hinzu. Regeln steuern Ziele, Verzögerung, KI, Erinnerung und Lautstärke. Passt keine Regel, gehen Alarme an die Standardziele aller aktivierten Backends mit der Standard-Verzögerung.</p>
<div class="table-wrap">
<table>
<thead><tr><th>#</th><th>Name</th><th>Host / Service</th><th>Ab Status</th><th>Arten</th><th>Ziele</th><th>Optionen</th><th>Status</th>{% if user.is_admin %}<th>Aktionen</th>{% endif %}</tr></thead>
<tbody>
{% for r in routes %}
<tr>
<td>{{ loop.index }}</td>
<td>{{ r.name }}{% if r.stop_on_match %} <span class="badge info">stoppt</span>{% endif %}</td>
<td>{{ r.match_host or '*' }} / {{ r.match_service or '*' }}</td>
<td>{{ state_names.get(r.min_state, r.min_state) }}</td>
<td>{% for k in r.kinds %}{{ kind_labels.get(k, k) }}{% if not loop.last %}, {% endif %}{% endfor %}</td>
<td>{% for t in r.targets %}<div>{{ t.backend }}: {{ t.target }}</div>{% else %}{% if not r.use_default_targets %}<span class="muted">keine</span>{% endif %}{% endfor %}{% if r.use_default_targets %}<div>Standardziele</div>{% endif %}</td>
<td>
{% if r.output_contains %}<div>Ausgabe enthält „{{ r.output_contains }}“</div>{% endif %}
<div>Verzögerung: {{ (r.delay_minutes ~ ' min') if r.delay_minutes is not none else 'Standard' }}</div>
<div>KI: {{ 'an' if r.ai_enabled else 'aus' }}{% if r.ai_hint %} (mit Hinweis){% endif %}</div>
{% if r.reminder_hours is not none %}<div>Erinnerung: {{ ('alle ' ~ r.reminder_hours ~ ' h') if r.reminder_hours > 0 else 'aus' }}</div>{% endif %}
{% if not r.loud %}<div>leise</div>{% endif %}
</td>
<td><span class="badge {{ 'ok' if r.enabled else 'warn' }}">{{ 'aktiv' if r.enabled else 'aus' }}</span></td>
{% if user.is_admin %}
<td>
<div class="row">
<form method="post" action="/routing/{{ r.id }}/move" class="inline">{{ csrf_input }}<input type="hidden" name="direction" value="up"><button type="submit" class="secondary" {% if loop.first %}disabled{% endif %} aria-label="Nach oben">↑</button></form>
<form method="post" action="/routing/{{ r.id }}/move" class="inline">{{ csrf_input }}<input type="hidden" name="direction" value="down"><button type="submit" class="secondary" {% if loop.last %}disabled{% endif %} aria-label="Nach unten">↓</button></form>
<form method="post" action="/routing/{{ r.id }}/toggle" class="inline">{{ csrf_input }}<input type="hidden" name="enabled" value="{{ '0' if r.enabled else '1' }}"><button type="submit" class="secondary">{{ 'Deaktivieren' if r.enabled else 'Aktivieren' }}</button></form>
<a href="/routing/{{ r.id }}">Bearbeiten</a>
<form method="post" action="/routing/{{ r.id }}/delete" class="inline" data-confirm="Regel wirklich löschen?">{{ csrf_input }}<button type="submit" class="danger">Löschen</button></form>
</div>
</td>
{% endif %}
</tr>
{% else %}
<tr><td colspan="9" class="muted">Keine Regeln. Alarme gehen an die Standardziele.</td></tr>
{% endfor %}
</tbody>
</table>
</div>
</section>
{% if user.is_admin %}
<section class="card">
<h2>Regel anlegen</h2>
{% with action="/routing", submit_label="Anlegen" %}{% include "_route_form.html" %}{% endwith %}
</section>
{% endif %}
{% endblock %}