From c08623277ed1a6438d27874098e59a4b8b4bf75f Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Mon, 17 Feb 2025 14:30:16 +0200 Subject: [PATCH] Chart polish (#2973) --- lnbits/core/services/payments.py | 2 + lnbits/core/templates/core/account.html | 51 +++++++------ lnbits/core/templates/core/wallet.html | 52 ++++++++----- lnbits/core/templates/payments/index.html | 93 +++++++++++------------ lnbits/static/js/payments.js | 61 ++++++++------- lnbits/static/js/wallet.js | 39 +++++++--- lnbits/templates/base.html | 2 +- 7 files changed, 170 insertions(+), 130 deletions(-) diff --git a/lnbits/core/services/payments.py b/lnbits/core/services/payments.py index 069298fe..5ad3389b 100644 --- a/lnbits/core/services/payments.py +++ b/lnbits/core/services/payments.py @@ -440,6 +440,8 @@ async def get_payments_daily_stats( balance_total: float = 0 _none = PaymentDailyStats(date=datetime.now(timezone.utc)) + if len(data_in) == 0 and len(data_out) == 0: + return [] if len(data_in) == 0: data_in = [_none] if len(data_out) == 0: diff --git a/lnbits/core/templates/core/account.html b/lnbits/core/templates/core/account.html index 3df72ef8..21d1e7fc 100644 --- a/lnbits/core/templates/core/account.html +++ b/lnbits/core/templates/core/account.html @@ -4,34 +4,43 @@ {% block scripts %} {{ window_vars(user) }}{% endblock %} {% block page %} +
+
+ +
+
+ + + + + +
+
+
+
+
+
- - - - -
- -
@@ -132,11 +141,10 @@
- +
- {% endfor %} {% endif %} - - -
- -
-
-
- - -
- -
-
-
- - -
- -
-
-
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+ + +
+ +
+
+
+
+
+ + No chart data available + +
diff --git a/lnbits/core/templates/payments/index.html b/lnbits/core/templates/payments/index.html index f12ecaab..bfa1e20c 100644 --- a/lnbits/core/templates/payments/index.html +++ b/lnbits/core/templates/payments/index.html @@ -8,52 +8,7 @@
-
-
- - - - - - -
- -
-
- -
- -
-
-
-
- - -
-
+
- + + + +
+
+ +
+
+ +
+
+
+ +
+