Merge "Bug #1018560 Adding quota display to Overview template"
This commit is contained in:
commit
fbb33d1b49
@ -7,6 +7,7 @@
|
||||
{% endblock page_header %}
|
||||
|
||||
{% block main %}
|
||||
{% include "horizon/common/_quota_summary.html" %}
|
||||
{% include "horizon/common/_usage_summary.html" %}
|
||||
{{ table.render }}
|
||||
{% endblock %}
|
||||
|
13
horizon/templates/horizon/common/_quota_summary.html
Normal file
13
horizon/templates/horizon/common/_quota_summary.html
Normal file
@ -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[key] += value
|
||||
|
||||
def quota(self):
|
||||
quotas = api.nova.tenant_quota_usages(self.request)
|
||||
return quotas
|
||||
|
||||
def csv_link(self):
|
||||
form = self.get_form()
|
||||
if hasattr(form, "cleaned_data"):
|
||||
|
Loading…
x
Reference in New Issue
Block a user