feat: auto-refresh overview and networth pages (10m for overview and 1h for networth)

Useful if you want to leave WYGIWYH open in a fixed tab
This commit is contained in:
Herculino Trotta
2025-07-12 02:26:15 -03:00
parent 6826cfe79a
commit d81d89d9f6
5 changed files with 9 additions and 8 deletions

View File

@@ -52,7 +52,7 @@
</div>
<div class="row">
<div class="show-loading" hx-get="{% url 'calendar_list' month=month year=year %}"
hx-trigger="load, updated from:window, selective_update from:window"></div>
hx-trigger="load, updated from:window, selective_update from:window, every 10m"></div>
</div>
</div>
<c-ui.transactions_fab></c-ui.transactions_fab>

View File

@@ -104,7 +104,7 @@
<div id="summary"
hx-get="{% url 'monthly_summary' month=month year=year %}"
class="show-loading"
hx-trigger="load, updated from:window, selective_update from:window">
hx-trigger="load, updated from:window, selective_update from:window, every 10m">
</div>
</div>
<div class="tab-pane fade {% if summary_tab == 'currency' %}show active{% endif %}"
@@ -115,7 +115,7 @@
<div id="currency-summary"
hx-get="{% url 'monthly_currency_summary' month=month year=year %}"
class="show-loading"
hx-trigger="load, updated from:window, selective_update from:window">
hx-trigger="load, updated from:window, selective_update from:window, every 10m">
</div>
</div>
<div class="tab-pane fade {% if summary_tab == 'account' %}show active{% endif %}"
@@ -126,7 +126,7 @@
<div id="account-summary"
hx-get="{% url 'monthly_account_summary' month=month year=year %}"
class="show-loading"
hx-trigger="load, updated from:window, selective_update from:window">
hx-trigger="load, updated from:window, selective_update from:window, every 10m">
</div>
</div>
</div>
@@ -191,7 +191,7 @@
<div id="transactions"
class="show-loading"
hx-get="{% url 'monthly_transactions_list' month=month year=year %}"
hx-trigger="load, updated from:window" hx-include="#filter, #order">
hx-trigger="load, updated from:window, every 10m" hx-include="#filter, #order">
</div>
</div>
</div>

View File

@@ -9,6 +9,7 @@
{% block title %}{% if type == "current" %}{% translate 'Current Net Worth' %}{% else %}{% translate 'Projected Net Worth' %}{% endif %}{% endblock %}
{% block content %}
<div hx-trigger="every 60m" class="show-loading" hx-get="" hx-target="body">
<div class="container px-md-3 py-3" _="init call initializeAccountChart() then initializeCurrencyChart() end">
<div class="row gx-xl-4 gy-3 mb-4">
<div class="col-12 col-xl-5">
@@ -318,5 +319,5 @@
call currencyChart.update()
end
</script>
</div>
{% endblock %}

View File

@@ -113,7 +113,7 @@
<div id="data-content"
class="show-loading"
hx-get="{% url 'yearly_overview_account_data' year=year %}"
hx-trigger="load"
hx-trigger="load, every 10m"
hx-include="[name='account'], [name='month']"
hx-swap="innerHTML">
</div>

View File

@@ -115,7 +115,7 @@
<div id="data-content"
class="show-loading"
hx-get="{% url 'yearly_overview_currency_data' year=year %}"
hx-trigger="load"
hx-trigger="load, every 10m"
hx-include="[name='currency'], [name='month']"
hx-swap="innerHTML">
</div>