2017-03-15 12:02:55 +00:00
|
|
|
{% extends "admin/base_site.html" %}
|
2017-03-16 19:12:27 +00:00
|
|
|
{% load staticfiles bootstrap3 i18n %}
|
2017-03-15 12:02:55 +00:00
|
|
|
{% block content %}
|
2017-04-10 19:14:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-15 12:02:55 +00:00
|
|
|
<a href="{% url 'admin:createvm' %}">Create VM</a>
|
|
|
|
|
|
|
|
{% if vms %}
|
|
|
|
<section>
|
2017-03-16 19:12:27 +00:00
|
|
|
<table class="table table-striped">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>ID</th>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Memory</th>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>User Name</th>
|
2017-04-10 19:14:55 +00:00
|
|
|
<th>Actions</th>
|
2017-03-16 19:12:27 +00:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2017-03-15 12:02:55 +00:00
|
|
|
{% for vm in vms %}
|
2017-03-16 19:12:27 +00:00
|
|
|
<tr>
|
|
|
|
<td>{{vm.id}}</td>
|
|
|
|
<td>{{vm.name}}</td>
|
|
|
|
<td>{{vm.template.memory}}</td>
|
|
|
|
<td>{{vm.str_state}}</td>
|
|
|
|
<td>{{vm.uname}}</td>
|
2017-04-10 19:14:55 +00:00
|
|
|
<td>
|
|
|
|
{% if vm.str_state == 'ACTIVE' %}
|
|
|
|
<a href="{% url 'admin:stopvm' vm.id %}">Stop VM</a>
|
|
|
|
{% elif vm.str_state == 'STOPPED' %}
|
|
|
|
<a href="{% url 'admin:startvm' vm.id %}">Start VM</a>
|
|
|
|
{% endif %}
|
|
|
|
<a href="{% url 'admin:deletevm' vm.id %}">Delete VM</a>
|
|
|
|
|
|
|
|
|
|
|
|
</td>
|
2017-03-16 19:12:27 +00:00
|
|
|
</tr>
|
2017-03-15 12:02:55 +00:00
|
|
|
{% endfor %}
|
2017-03-16 19:12:27 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2017-03-15 12:02:55 +00:00
|
|
|
</section>
|
|
|
|
{% endif %}
|
|
|
|
{% endblock %}
|