diff --git a/resallocwebui/app.py b/resallocwebui/app.py index 388b1f5..fb417f7 100644 --- a/resallocwebui/app.py +++ b/resallocwebui/app.py @@ -77,7 +77,15 @@ def pools(): key = "TAKEN" if resource.taken else "READY" result[resource.pool][key] += 1 - return render_template("pools.html", information=result) + summary = {} + for pool_data in result.values(): + for key, count in pool_data.items(): + if not isinstance(count, int): + continue + summary.setdefault(key, 0) + summary[key] += count + + return render_template("pools.html", information=result, summary=summary) if __name__ == '__main__': diff --git a/resallocwebui/templates/pools.html b/resallocwebui/templates/pools.html index ce7b653..16c206a 100644 --- a/resallocwebui/templates/pools.html +++ b/resallocwebui/templates/pools.html @@ -17,11 +17,23 @@

Resalloc pools

Ready Taken Starting + Delete Requested Deleting Releasing + + Totals + {{ summary.MAX }} + {{ summary.UP }} + {{ summary.READY }} + {{ summary.TAKEN }} + {{ summary.STARTING }} + {{ summary.DELETE_REQUEST }} + {{ summary.DELETING }} + {{ summary.RELEASING }} + {% for pool, info in information.items()|sort(attribute='0') %} @@ -39,6 +51,7 @@

Resalloc pools

{{ info['READY'] }} {{ info['TAKEN'] }} {{ info['STARTING'] }} + {{ info['DELETE_REQUEST'] }} {{ info['DELETING'] }} {{ info['RELEASING'] }}