diff --git a/static/js/index.js b/static/js/index.js index f91c022..ef0aebd 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -94,7 +94,12 @@ window.app = Vue.createApp({ formatSats(amount) { if (!amount) return '0 sats' - return new Intl.NumberFormat('en-US').format(amount) + ' sats' + const formatted = new Intl.NumberFormat('en-US').format(amount) + // Add some excitement for larger amounts + if (amount >= 1000000) return formatted + ' sats 💎' + if (amount >= 100000) return formatted + ' sats 🚀' + if (amount >= 10000) return formatted + ' sats ⚡' + return formatted + ' sats' }, async loadDashboardData() { @@ -126,7 +131,46 @@ window.app = Vue.createApp({ }) } catch (error) { console.error('Error loading transactions:', error) + this.$q.notify({ + type: 'negative', + message: 'Failed to load transactions', + position: 'top' + }) } + }, + + async refreshAllData() { + try { + this.loading = true + await Promise.all([ + this.loadDashboardData(), + this.loadTransactions() + ]) + this.$q.notify({ + type: 'positive', + message: 'Dashboard refreshed!', + icon: 'refresh', + position: 'top' + }) + } catch (error) { + console.error('Error refreshing data:', error) + this.$q.notify({ + type: 'negative', + message: 'Failed to refresh data', + position: 'top' + }) + } finally { + this.loading = false + } + }, + + getSatsMilestoneProgress() { + if (!this.dashboardData) return 0 + const sats = this.dashboardData.total_sats_accumulated + if (sats >= 1000000) return 100 + if (sats >= 100000) return 75 + if (sats >= 10000) return 50 + return Math.min((sats / 10000) * 50, 50) } }, diff --git a/templates/satmachineclient/index.html b/templates/satmachineclient/index.html index 1cddfa4..c431a84 100644 --- a/templates/satmachineclient/index.html +++ b/templates/satmachineclient/index.html @@ -27,71 +27,126 @@
+ Your automated sat stacking journey with {{SITE_TITLE}} +
+- Monitor your Dollar Cost Averaging progress and manage your DCA settings. -
-