Merge "Bug #1018560 Adding quota display to Overview template"
This commit is contained in:
commit
fbb33d1b49
|
@ -7,6 +7,7 @@
|
||||||
{% endblock page_header %}
|
{% endblock page_header %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
|
{% include "horizon/common/_quota_summary.html" %}
|
||||||
{% include "horizon/common/_usage_summary.html" %}
|
{% include "horizon/common/_usage_summary.html" %}
|
||||||
{{ table.render }}
|
{{ table.render }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
{% load i18n horizon humanize sizeformat %}
|
||||||
|
|
||||||
|
<div class="quota-dynamic">
|
||||||
|
<h3>{% trans "Quota Summary" %}</h3>
|
||||||
|
<strong>{% trans "Used" %}<span> {{ usage.quota.instances.used|intcomma }} </span> {% trans "of" %} <span> {{ usage.quota.instances.quota|intcomma }} </span>{% trans "Available Instances" %} </strong>
|
||||||
|
{% horizon_progress_bar usage.quota.instances.used usage.quota.instances.quota %}
|
||||||
|
|
||||||
|
<strong>{% trans "Used" %} <span> {{ usage.quota.cores.used|intcomma }} </span>{% trans "of" %}<span> {{ usage.quota.cores.quota|intcomma }} </span>{% trans "Available vCPUs" %} </strong>
|
||||||
|
{% horizon_progress_bar usage.quota.cores.used usage.quota.cores.quota %}
|
||||||
|
|
||||||
|
<strong>{% trans "Used" %} <span> {{ usage.quota.ram.used|intcomma }} MB </span>{% trans "of" %}<span> {{ usage.quota.ram.quota|intcomma }} MB </span>{% trans "Available Memory" %} </strong>
|
||||||
|
{% horizon_progress_bar usage.quota.ram.used usage.quota.ram.quota %}
|
||||||
|
</div>
|
|
@ -104,6 +104,10 @@ class BaseUsage(object):
|
||||||
self.summary.setdefault(key, 0)
|
self.summary.setdefault(key, 0)
|
||||||
self.summary[key] += value
|
self.summary[key] += value
|
||||||
|
|
||||||
|
def quota(self):
|
||||||
|
quotas = api.nova.tenant_quota_usages(self.request)
|
||||||
|
return quotas
|
||||||
|
|
||||||
def csv_link(self):
|
def csv_link(self):
|
||||||
form = self.get_form()
|
form = self.get_form()
|
||||||
if hasattr(form, "cleaned_data"):
|
if hasattr(form, "cleaned_data"):
|
||||||
|
|
Loading…
Reference in New Issue