Commit 27e9e075 by Gabor Gutyan

VM resource volumes

NOVA instance volumes query added to VM detail page, resource view appended with volume list
parent c8461aae
{% load i18n %}
{% load sizefieldtags %}
<i class="fa fa-hdd-o"></i>
{{ v.name }} (#{{ v.id }}) - {{ v.size }}
<span class="operation-wrapper pull-right">
{% if v.is_resizable %}
{% if op.resize_disk %}
<a href="{{ op.resize_disk.get_url }}?disk={{v.pk}}"
class="btn btn-xs btn-{{ op.resize_disk.effect }} operation disk-resize-btn
{% if op.resize_disk.disabled %}disabled{% endif %}">
<i class="fa fa-{{ op.resize_disk.icon }} fa-fw-12"></i> {% trans "Resize" %}
</a>
{% else %}
<a href="{% url "request.views.request-resize" vm_pk=instance.pk disk_pk=v.pk %}" class="btn btn-xs btn-primary operation">
<i class="fa fa-arrows-alt fa-fw-12"></i> {% trans "Request resize" %}
</a>
{% endif %}
{% else %}
<small class="btn-xs">
{% trans "Not resizable" %}
</small>
{% endif %}
{% if op.remove_disk %}
<a href="{{ op.remove_disk.get_url }}?disk={{v.pk}}"
class="btn btn-xs btn-{{ op.remove_disk.effect}} operation disk-remove-btn
{% if op.remove_disk.disabled %}disabled{% endif %}">
<i class="fa fa-{{ op.remove_disk.icon }} fa-fw-12"></i> {% trans "Remove" %}
</a>
{% endif %}
</span>
<div style="clear: both;"></div>
{% if request.user.is_superuser %}
<small>{% trans "File name" %}: {{ v.filename }}</small><br/>
<small>{% trans "Bus" %}: {{ v.device_bus }}</small>
{% endif %}
......@@ -22,14 +22,29 @@
<div id="vm-details-resources-disk">
<h3>
<div class="pull-right">
<div id="volume-ops">
{% include "dashboard/vm-detail/_disk-operations.html" %}
</div>
</div>
{% trans "Volumes" %}
</h3>
<div class="clearfix"></div>
{% for v in volumes %}
<h4 class="list-group-item-heading dashboard-vm-details-network-h3">
{% with long_remove=True %}
{% include "dashboard/_volume-list-element.html" %}
{% endwith %}
</h4>
{% endfor %}
<!--
<h3>
<div class="pull-right">
<div id="disk-ops">
{% include "dashboard/vm-detail/_disk-operations.html" %}
</div>
</div>
{% trans "Disks" %}
</h3>
<div class="clearfix"></div>
{% if not instance.disks.all %}
{% trans "No disks are added." %}
{% endif %}
......@@ -40,6 +55,7 @@
{% endwith %}
</h4>
{% endfor %}
-->
</div>
<hr />
......
......@@ -182,6 +182,10 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
'access_method': 'ssh'
})
context.update({
'volumes': openstack_api.nova.instance_volumes_list(self.request, self.object.id)
})
vm_lease = VmLease.get_or_create_lease(instance.id)
context.update({
......
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