diff --git a/app/models.py b/app/models.py index ec48231..58be233 100644 --- a/app/models.py +++ b/app/models.py @@ -60,6 +60,13 @@ class Operation(db.Model): } return pricing + def has_txes(self): + txes = cache.get_transfers(self.account_idx) + if txes: + return True + else: + return False + def __repr__(self): return self.id diff --git a/app/routes/meta.py b/app/routes/meta.py index 8a82b2b..fa9e8dc 100644 --- a/app/routes/meta.py +++ b/app/routes/meta.py @@ -30,9 +30,15 @@ def info(): @bp.route('/stats') def stats(): token = config.STATS_TOKEN == request.args.get('token') + all_ops = {'active': [], 'inactive': []} ops = Operation.query.all() + for op in ops: + if op.has_txes(): + all_ops['active'].append(op) + else: + all_ops['inactive'].append(op) return render_template( 'stats.html', - ops=ops, + all_ops=all_ops, token=token ) diff --git a/app/templates/stats.html b/app/templates/stats.html index ece9096..99c8399 100644 --- a/app/templates/stats.html +++ b/app/templates/stats.html @@ -13,7 +13,7 @@ {% if token %}
Date | @@ -23,11 +23,10 @@Volume ID | Balances | |
---|---|---|---|
{{ op.create_date }} | {{ op.codename }} | @@ -36,17 +35,13 @@{{ op.volume_id }} | {{ unlocked }} XMR ({{ locked }} locked) |