06/02 Optimize app 2

This commit is contained in:
2026-06-02 16:34:16 -04:00
parent de948156b9
commit c9eb1b89fc
6 changed files with 131 additions and 7 deletions
+47
View File
@@ -52,6 +52,53 @@
</div>
</div>
<!-- Maintenance + Email Alerts -->
<div class="row g-3 mt-1">
<div class="col-12 col-md-6">
<div class="pcard h-100">
<div class="pcard-title mb-3">Maintenance</div>
<p style="font-size:13px;color:var(--muted);">
Recalculate every account balance from scratch using all recorded transactions.
Run this after bulk imports or manual adjustments to make sure balances are correct.
</p>
<form method="POST" action="{{ url_for('settings.recalc_balances') }}"
onsubmit="return confirm('Recalculate all account balances now?')">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="btn btn-sm btn-outline-primary">
<i class="bi bi-arrow-repeat me-1"></i>Recalculate All Balances
</button>
</form>
</div>
</div>
<div class="col-12 col-md-6">
<div class="pcard h-100">
<div class="pcard-title mb-3">Budget Alert Emails</div>
{% if smtp_ok %}
<div class="d-flex align-items-center gap-2 mb-2">
<i class="bi bi-check-circle-fill text-success"></i>
<span style="font-size:13px;">Email alerts enabled → <strong>{{ alert_email }}</strong></span>
</div>
<p style="font-size:12px;color:var(--muted);">
An email is sent automatically when a budget category hits 80% or 100% of its monthly limit.
</p>
{% else %}
<div class="d-flex align-items-center gap-2 mb-2">
<i class="bi bi-x-circle-fill text-danger"></i>
<span style="font-size:13px;color:var(--muted);">Email alerts not configured</span>
</div>
<p style="font-size:12px;color:var(--muted);">
Add these to your <code>.env</code> file to enable budget alert emails:
</p>
<pre style="font-size:11px;background:#f8fafc;padding:10px;border-radius:6px;margin:0;overflow-x:auto;">SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=you@gmail.com
SMTP_PASSWORD=your-app-password
ALERT_EMAIL=you@gmail.com</pre>
{% endif %}
</div>
</div>
</div>
<!-- Upcoming recurring -->
{% if upcoming %}
<div class="pcard mt-4">