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 @@