dynamicweb/hosting/templates/hosting/managevms.html

47 lines
857 B
HTML
Raw Normal View History

{% extends "admin/base_site.html" %}
{% load staticfiles bootstrap3 i18n %}
{% block content %}
<a href="{% url 'admin:createvm' %}">Create VM</a>
{% if vms %}
<section>
<table class="table table-striped">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>Memory</th>
<th>Status</th>
<th>User Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for vm in vms %}
<tr>
<td>{{vm.id}}</td>
<td>{{vm.name}}</td>
<td>{{vm.template.memory}}</td>
<td>{{vm.str_state}}</td>
<td>{{vm.uname}}</td>
<td>
{% if vm.str_state == 'ACTIVE' %}
<a href="{% url 'admin:stopvm' vm.id %}">Stop VM</a>
{% elif vm.str_state == 'STOPPED' %}
&nbsp;&nbsp;&nbsp;<a href="{% url 'admin:startvm' vm.id %}">Start VM</a>
{% endif %}
&nbsp;&nbsp;&nbsp;<a href="{% url 'admin:deletevm' vm.id %}">Delete VM</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</section>
{% endif %}
{% endblock %}