feat: Admin-Seite mit Passwortaenderung und Regel-Neuanwendung
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
46
finance/app/templates/admin.html
Normal file
46
finance/app/templates/admin.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Admin – Finanzberatung{% endblock %}
|
||||
{% block content %}
|
||||
<h1>Admin</h1>
|
||||
|
||||
<section class="admin-section">
|
||||
<h2>Passwort ändern</h2>
|
||||
<p class="muted">Gilt gemeinsam für GUI- und Grafana-Login. Bestehende Sitzungen bleiben nach der Änderung gültig.</p>
|
||||
{% if error %}<div class="warning">{{ error }}</div>{% endif %}
|
||||
{% if success %}<div class="success">{{ success }}</div>{% endif %}
|
||||
<form method="post" action="/admin/passwort">
|
||||
<label>Altes Passwort
|
||||
<input type="password" name="alt" required>
|
||||
</label>
|
||||
<label>Neues Passwort (mind. 8 Zeichen)
|
||||
<input type="password" name="neu" minlength="8" required>
|
||||
</label>
|
||||
<label>Neues Passwort wiederholen
|
||||
<input type="password" name="neu2" minlength="8" required>
|
||||
</label>
|
||||
<button type="submit">Passwort ändern</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="admin-section">
|
||||
<h2>Regeln neu anwenden</h2>
|
||||
<p class="muted">Wendet die aktuellen Kategorie-Regeln rückwirkend auf noch nicht kategorisierte, bestätigte Buchungen an.</p>
|
||||
<button type="button" hx-post="/api/category-rules/apply" hx-swap="none"
|
||||
hx-on::after-request="handleApplyRulesResult(event)">
|
||||
Regeln neu anwenden
|
||||
</button>
|
||||
<p id="apply-rules-result"></p>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
function handleApplyRulesResult(event) {
|
||||
var result = document.getElementById('apply-rules-result');
|
||||
if (event.detail.successful) {
|
||||
var data = JSON.parse(event.detail.xhr.responseText);
|
||||
result.textContent = data.categorized + ' Buchung(en) neu kategorisiert.';
|
||||
} else {
|
||||
result.textContent = 'Fehler beim Anwenden der Regeln.';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user