@ -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']
@ -21,6 +21,7 @@
<th>XMR Account</th>
<th>Droplet ID</th>
<th>Volume ID</th>
<th>Last Payout</th>
<th>Balances</th>
</tr>
{% for op in all_ops['active'] | sort(attribute='create_date', reverse=True) %}
@ -33,6 +34,7 @@
<td>{{ op.account_idx }}</td>
<td>{{ op.droplet_id }}</td>
<td>{{ op.volume_id }}</td>
<td>{{ op.get_last_payout().create_date | humanize }}</td>
<td>{{ unlocked }} XMR ({{ locked }} locked)</td>
{% endfor %}