diff --git a/app/models.py b/app/models.py index 58be233..8e033bc 100644 --- a/app/models.py +++ b/app/models.py @@ -36,6 +36,12 @@ class Operation(db.Model): b = cache.get_balances(self.account_idx, atomic=atomic) return b + def get_last_payout(self): + last_payout = Payout.query.filter( + Payout.operation_id == self.id + ).order_by(Payout.create_date.desc()).first() + return last_payout + def get_pricing(self, live=False): if live: droplet_size = cache.show_droplet(self.droplet_id)['size_slug'] diff --git a/app/templates/stats.html b/app/templates/stats.html index 99c8399..4a3df7b 100644 --- a/app/templates/stats.html +++ b/app/templates/stats.html @@ -21,6 +21,7 @@ XMR Account Droplet ID Volume ID + Last Payout Balances {% for op in all_ops['active'] | sort(attribute='create_date', reverse=True) %} @@ -32,8 +33,9 @@ {{ op.codename }} {{ op.account_idx }} {{ op.droplet_id }} - {{ op.volume_id }} - {{ unlocked }} XMR ({{ locked }} locked) + {{ op.volume_id }} + {{ op.get_last_payout().create_date | humanize }} + {{ unlocked }} XMR ({{ locked }} locked) {% endfor %}