Commit 98118b72 by Szabolcs Gelencser

Add instance quotas to dashboard

parent 484ed29e
......@@ -89,7 +89,7 @@
</div>
<div class="panel-body" id="vm-graph-view" style="display: none">
<p class="pull-right">
<input class="knob" data-fgColor="chartreuse" data-thickness=".4" data-max="#TODO" data-width="100" data-height="100" data-readOnly="true" value="{{ instances|length|add:more_instances }}">
<input class="knob" data-fgColor="chartreuse" data-thickness=".4" data-max="{{ max_instances }}" data-width="100" data-height="100" data-readOnly="true" value="{{ instances|length|add:more_instances }}">
</p>
<span class="bigbig">{% blocktrans with count=running_vm_num %}<span class="big-tag">{{ count }}</span> running{% endblocktrans %}</span>
<ul class="list-inline" style="max-height: 95px; overflow: hidden;">
......
......@@ -42,10 +42,12 @@ class IndexView(LoginRequiredMixin, TemplateView):
context = super(IndexView, self).get_context_data(**kwargs)
instances = openstack_api.nova.server_list(self.request)[0] #TODO: flatten?
quotas = openstack_api.nova.tenant_quota_get(self.request, user.project_id)
context.update({
'instances': instances[:5],
'more_instances': len(instances) - len(instances[:5])
'more_instances': len(instances) - len(instances[:5]),
'max_instances': quotas.get("instances").limit
})
# instances
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment