Commit bfb09f0f by Dányi Bence

webui: show personal quota on vm details page

fixes #70
parent 91f6d6df
...@@ -289,6 +289,11 @@ def vm_show(request, iid): ...@@ -289,6 +289,11 @@ def vm_show(request, iid):
ports = inst.firewall_host.list_ports() ports = inst.firewall_host.list_ports()
except: except:
ports = None ports = None
try:
details = UserCloudDetails.objects.get(user=request.user)
except UserCloudDetails.DoesNotExist:
details = UserCloudDetails(user=request.user)
details.save()
return render_to_response("show.html", RequestContext(request,{ return render_to_response("show.html", RequestContext(request,{
'uri': inst.get_connect_uri(), 'uri': inst.get_connect_uri(),
'state': inst.state, 'state': inst.state,
...@@ -299,6 +304,7 @@ def vm_show(request, iid): ...@@ -299,6 +304,7 @@ def vm_show(request, iid):
'i': inst, 'i': inst,
'booting' : not inst.active_since, 'booting' : not inst.active_since,
'ports': ports, 'ports': ports,
'userdetails': details
})) }))
@require_safe @require_safe
......
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