Skip to content

Commit

Permalink
improve host az dist page (#1490)
Browse files Browse the repository at this point in the history
  • Loading branch information
knguyen100000010 authored Mar 4, 2024
1 parent 0d13631 commit 281e546
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
15 changes: 11 additions & 4 deletions deploy-board/deploy_board/templates/groups/host_az_dist.tmpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
{% load utils %}
{% extends 'groups/group_base.html' %}

{% block content %}
{% block breadcrumb-items %}
<ul class="breadcrumb">
<li><a href="/">Home</a></li>
<li><a href="/groups/">Groups</a></li>
<li><a href="/groups/{{ group_name }}/">{{ group_name }}</a></li>
<li>Host Distribution Among Availability Zones</li>
</ul>
{% endblock %}

{% block main %}
<div id="container" style="width: 100%;">
<h2>Host Distribution Among Availability Zones</h2>
<canvas id="pie-chart"></canvas>
</div>

Expand All @@ -27,7 +35,6 @@
</tr>
{% endfor%}
</table>
<p>==============================</p>
<b>Total:</b> {{ total }} hosts
</div>

Expand Down
1 change: 1 addition & 0 deletions deploy-board/deploy_board/webapp/group_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,7 @@ def get_host_az_dist(request, group_name):
percentages = map(lambda x: round((x / total) * 100, 1), data)

return render(request, 'groups/host_az_dist.tmpl', {
"group_name": group_name,
'labels': labels,
'data': data,
'label_data_percentage': list(zip(labels, data, percentages)),
Expand Down

0 comments on commit 281e546

Please sign in to comment.