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

instances view changed. memory usage converted to progress-bar. some bandi007 changes applied

This commit is contained in:
catborise 2018-07-18 10:08:02 +03:00
parent 6a7f30d4a6
commit 0778116a40
3 changed files with 14 additions and 8 deletions

View file

@ -1,5 +1,6 @@
Django==1.8.11
Django==1.11.14
websockify==0.8.0
gunicorn==19.3.0
libvirt-python==3.10
gunicorn==19.9.0
libvirt-python==4.4.0
libxml2-python3==2.9.5
lxml==4.2.3

View file

@ -41,11 +41,11 @@
<tr>
<th>#</th>
<th>Name<br>Description</th>
<th>Host<br>User</th>
<th>User</th>
<th>Status</th>
<th>VCPU</th>
<th>Memory<br>({% trans "MB" %})</th>
<th data-sortable="false" style="width:205px;">Actions & Usage</th>
<th data-sortable="false" style="width:205px;">Actions & Mem Usage</th>
</tr>
</thead>
<tbody class="searchable">
@ -64,14 +64,19 @@
</td>
<td style="text-align:center;">{{ host.3 }}</td>
<td style="text-align:right;">{{ host.4|filesizeformat }}</td>
<td style="text-align:left;">Mem Usage: {{ host.5 }}%</td>
<td style="text-align:left;">
<div class="progress-bar-success" role="progressbar" style="width: {{ host.5 }}%" aria-valuenow="{{ host.5 }}" aria-valuemin="0" aria-valuemax="100">{{ host.5 }}%</div>
</td>
</tr>
<!-- copied /-->
{% for vm, info in inst.items %}
<tr>
<td></td>
<td>{{ forloop.counter }} &emsp; <a href="{% url 'instance' host.0 vm %}">{{ vm }}</a><br><small><em>{{ info.title }}</em></small></td>
<td><a href="{% url 'overview' host.0 %}">{{ host.1 }}</a><br><small><em>{% if info.userinstances.count > 0 %}{{ info.userinstances.first_user.user.username }}{% if info.userinstances.count > 1 %} (+{{ info.userinstances.count|add:"-1" }}){% endif %}{% endif %}</em></small></td>
<td><small><em>{% if info.userinstances.count > 0 %}{{ info.userinstances.first_user.user.username }}{% if info.userinstances.count > 1 %} (+{{ info.userinstances.count|add:"-1" }}){% endif %}{% endif %}</em></small></td>
<td>{% ifequal info.status 1 %}
<span class="text-success">{% trans "Active" %}</span>
{% endifequal %}

View file

@ -85,7 +85,7 @@ def instances(request):
comp_info["mem_size"],
comp_info["mem_perc"]][vm]['userinstances'] = get_userinstances_info(check_uuid)
except Instance.DoesNotExist:
check_uuid = Instance(compute_id=comp.id, name=vm, uuid=info['uuid'])
check_uuid = Instance(compute_id=comp["id"], name=vm, uuid=info['uuid'])
check_uuid.save()
if not request.user.is_superuser: