06/02 Optimize app 2
This commit is contained in:
@@ -140,12 +140,21 @@
|
||||
<div class="pcard">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<span class="pcard-title mb-0">Net Worth History</span>
|
||||
<form method="POST" action="{{ url_for('reports.manual_snapshot') }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary" style="font-size:11px;" title="Save today's snapshot">
|
||||
<i class="bi bi-camera me-1"></i>Snapshot Now
|
||||
</button>
|
||||
</form>
|
||||
<div class="d-flex gap-2">
|
||||
<form method="POST" action="{{ url_for('reports.manual_snapshot') }}">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-secondary" style="font-size:11px;" title="Save today's snapshot">
|
||||
<i class="bi bi-camera me-1"></i>Snapshot Now
|
||||
</button>
|
||||
</form>
|
||||
<form method="POST" action="{{ url_for('reports.rebuild_snapshot') }}"
|
||||
onsubmit="return confirm('Recalculate all balances and rebuild today\'s snapshot?\nThis fixes the current net worth data point.')">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-warning" style="font-size:11px;" title="Recalculate all balances then rebuild today's snapshot">
|
||||
<i class="bi bi-arrow-repeat me-1"></i>Rebuild
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% if nw_history.count > 1 %}
|
||||
<div style="position:relative;height:200px;"><canvas id="nwChart"></canvas></div>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -84,6 +84,14 @@
|
||||
class="btn btn-sm btn-outline-primary" style="font-size:11px;">
|
||||
<i class="bi bi-cloud-download me-1"></i>Sync
|
||||
</a>
|
||||
<form method="POST" action="{{ url_for('teller.full_resync', teller_account_id=ta.id) }}"
|
||||
style="display:inline;"
|
||||
onsubmit="return confirm('Reset sync cursor for {{ ta.account_name }}?\nThe next Sync will re-fetch the last 90 days. Already-imported transactions will be skipped.')">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
|
||||
<button type="submit" class="btn btn-sm btn-outline-warning" style="font-size:11px;" title="Re-fetch full 90-day history on next sync">
|
||||
<i class="bi bi-arrow-counterclockwise"></i>
|
||||
</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<a href="{{ url_for('teller.map_accounts', enrollment_id=enrollment.enrollment_id) }}"
|
||||
class="btn btn-sm btn-outline-warning" style="font-size:11px;">Map Account</a>
|
||||
|
||||
Reference in New Issue
Block a user