ui: slim 4-card strip, admin-only system log, HTMX apply, title cleanup

* Wohnungen header: single slim row with Alert status · Filter summary ·
  Auto-Bewerben toggle · Trockenmodus toggle. Big filter panel removed —
  filters live only in /einstellungen/filter.
* Alert status: 'nicht eingerichtet' until the user has actual filters (+
  valid notification creds if telegram/email). 'aktiv' otherwise.
* Logs tab: admin-only (gated both in layout and server-side). Shows merged
  audit + errors across all users, sorted newest-first, capped at 300.
* Apply, auto-apply, trockenmodus and circuit reset buttons post via HTMX and
  swap the Wohnungen body. While any application is still running for the
  user the poll interval drops from 30s to 3s so status flips to 'beworben'
  or 'fehlgeschlagen' almost immediately.
* Browser tab title is now always 'lazyflat'.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Moritz 2026-04-21 11:25:59 +02:00
parent 332d9eea19
commit 04b591fa9e
9 changed files with 204 additions and 136 deletions

View file

@ -1,23 +1,27 @@
{% extends "_layout.html" %}
{% block title %}Logs — lazyflat{% endblock %}
{% block content %}
<section class="card">
<div class="px-4 py-3 border-b border-soft"><h2 class="font-semibold">Meine Aktionen (Audit-Log)</h2></div>
<div class="px-4 py-3 border-b border-soft flex items-center justify-between">
<h2 class="font-semibold">System-Log</h2>
<span class="text-xs text-slate-500">{{ events|length }} Einträge (max 300, letzte 14 Tage)</span>
</div>
<div class="divide-y divide-soft">
{% for e in events %}
<div class="px-4 py-2 mono">
<span class="text-slate-500">{{ e.timestamp|de_dt }}</span>
<span class="text-slate-400">{{ e.actor }}</span>
<div class="px-4 py-2 mono flex items-start gap-3 flex-wrap">
<span class="text-slate-500 shrink-0">{{ e.ts|de_dt }}</span>
{% if e.kind == 'error' %}
<span class="chip chip-bad">{{ e.source }}</span>
{% else %}
<span class="chip chip-info">{{ e.source }}</span>
{% endif %}
<span class="text-slate-700">{{ e.action }}</span>
{% if e.user %}<span class="text-slate-500">user={{ e.user }}</span>{% endif %}
{% if e.details %}<span class="text-slate-500">— {{ e.details }}</span>{% endif %}
{% if e.ip %}<span class="text-slate-400"> [{{ e.ip }}]</span>{% endif %}
{% if e.ip %}<span class="text-slate-400">[{{ e.ip }}]</span>{% endif %}
</div>
{% else %}
<div class="px-4 py-8 text-center text-slate-500">Keine Log-Einträge.</div>
<div class="px-4 py-8 text-center text-slate-500">Keine Einträge.</div>
{% endfor %}
</div>
<div class="px-4 py-3 border-t border-soft text-xs text-slate-500">
Einträge werden nach 14 Tagen automatisch gelöscht.
</div>
</section>
{% endblock %}