Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion resallocwebui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__':
Expand Down
13 changes: 13 additions & 0 deletions resallocwebui/templates/pools.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,23 @@ <h1 class="resource--title">Resalloc pools</h1>
<th scope="col">Ready</th>
<th scope="col">Taken</th>
<th scope="col">Starting</th>
<th scope="col">Delete Requested</th>
<th scope="col">Deleting</th>
<th scope="col">Releasing</th>
</tr>
</thead>
<tbody>
<tr class="table-primary">
<th>Totals</th>
<td>{{ summary.MAX }}</td>
<td>{{ summary.UP }}</td>
<td>{{ summary.READY }}</td>
<td>{{ summary.TAKEN }}</td>
<td>{{ summary.STARTING }}</td>
<td>{{ summary.DELETE_REQUEST }}</td>
<td>{{ summary.DELETING }}</td>
<td>{{ summary.RELEASING }}</td>
</tr>
{% for pool, info in information.items()|sort(attribute='0') %}
<tr>
<th scope="row" class="col-sm-4">
Expand All @@ -39,6 +51,7 @@ <h1 class="resource--title">Resalloc pools</h1>
<td>{{ info['READY'] }}</td>
<td>{{ info['TAKEN'] }}</td>
<td>{{ info['STARTING'] }}</td>
<td>{{ info['DELETE_REQUEST'] }}</td>
<td>{{ info['DELETING'] }}</td>
<td>{{ info['RELEASING'] }}</td>
</tr>
Expand Down