1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-10-31 19:44:16 +00:00

show instance title in instances view for non superuser

This commit is contained in:
Jan Krcmar 2016-03-24 14:51:29 +01:00
parent e9e62e3c41
commit 6546fa2570
2 changed files with 12 additions and 2 deletions

View file

@ -155,7 +155,7 @@
<tbody class="searchable">
{% for inst, vm in all_user_vms.items %}
<tr>
<td><a href="{% url 'instance' vm.compute_id vm.name %}">{{ vm.name }}</a></td>
<td><a href="{% url 'instance' vm.compute_id vm.name %}">{{ vm.name }}</a><br><small><em>{{ vm.title }}</em></small></td>
<td>{% ifequal vm.status 1 %}
<span class="text-success">{% trans "Active" %}</span>
{% endifequal %}

View file

@ -463,7 +463,17 @@ class wvmConnect(object):
vcpu = cur_vcpu
else:
vcpu = util.get_xml_path(dom.XMLDesc(0), "/domain/vcpu")
return {'name': dom.name(), 'status': dom.info()[0], 'uuid': dom.UUIDString(), 'vcpu': vcpu, 'memory': mem}
title = util.get_xml_path(dom.XMLDesc(0), "/domain/title")
description = util.get_xml_path(dom.XMLDesc(0), "/domain/description")
return {
'name': dom.name(),
'status': dom.info()[0],
'uuid': dom.UUIDString(),
'vcpu': vcpu,
'memory': mem,
'title': title if title else '',
'description': description if description else '',
}
def close(self):
"""Close connection"""