2018-07-30 10:33:09 +00:00
|
|
|
{% load i18n %}
|
2020-06-04 12:22:55 +00:00
|
|
|
<table class="table table-hover sortable-theme-bootstrap" data-sortable>
|
2018-07-30 10:33:09 +00:00
|
|
|
<thead>
|
2020-07-13 09:33:09 +00:00
|
|
|
<tr>
|
|
|
|
<th scope="col">{% trans 'Name' %}<br>{% trans 'Description' %}</th>
|
|
|
|
{% if request.user.is_superuser %}
|
|
|
|
<th scope="col">{% trans 'Host' %}<br>{% trans 'User' %}</th>
|
|
|
|
{% endif %}
|
|
|
|
<th scope="col">{% trans 'Status' %}</th>
|
2022-06-15 11:51:56 +00:00
|
|
|
<th scope="col">{% trans 'Role/Disk' %}</th>
|
2020-07-13 09:33:09 +00:00
|
|
|
<th scope="col">{% trans 'VCPU' %}</th>
|
|
|
|
<th scope="col">{% trans 'Memory' %}</th>
|
|
|
|
<th scope="col" data-sortable="false">{% trans 'Actions' %}</th>
|
|
|
|
</tr>
|
2018-07-30 10:33:09 +00:00
|
|
|
</thead>
|
|
|
|
<tbody class="searchable">
|
2020-07-13 09:33:09 +00:00
|
|
|
{% for instance in instances %}
|
|
|
|
{% if instance.compute.status is True %}
|
|
|
|
<tr>
|
|
|
|
<td>
|
2021-07-07 11:12:38 +00:00
|
|
|
<a class="link-primary" href="{% url 'instances:instance' instance.id %}">
|
2020-07-13 09:33:09 +00:00
|
|
|
{{ instance.name }}
|
2020-12-01 06:46:00 +00:00
|
|
|
</a>
|
|
|
|
<br>
|
|
|
|
<p class="m-0 small font-italic">{{ instance.title }}</p>
|
2020-07-13 09:33:09 +00:00
|
|
|
</td>
|
|
|
|
{% if request.user.is_superuser %}
|
|
|
|
<td>
|
|
|
|
<a href="{% url 'overview' instance.compute.id %}">{{ instance.compute.name }}</a><br>
|
|
|
|
<small><em>
|
|
|
|
{% if instance.userinstance_set.all.count > 0 %}
|
|
|
|
{{ instance.userinstance_set.all.0.user }}
|
|
|
|
{% if instance.userinstance_set.all.count > 1 %}
|
|
|
|
(+{{ instance.userinstance_set.all.count|add:"-1" }})
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
</em></small>
|
|
|
|
</td>
|
|
|
|
{% endif %}
|
|
|
|
<td>
|
|
|
|
{% if instance.proxy.instance.info.0 == 1 %}<span
|
|
|
|
class="text-success">{% trans "Active" %}</span>{% endif %}
|
|
|
|
{% if instance.proxy.instance.info.0 == 5 %}<span
|
|
|
|
class="text-danger">{% trans "Off" %}</span>{% endif %}
|
|
|
|
{% if instance.proxy.instance.info.0 == 3 %}<span
|
|
|
|
class="text-warning">{% trans "Suspended" %}</span>{% endif %}
|
|
|
|
</td>
|
2022-06-15 11:51:56 +00:00
|
|
|
<td>
|
|
|
|
{% if instance.drbd == "Primary/OK" or instance.drbd == "Secondary/OK" %}<span class="text-success">{% else %}<span class="text-danger">{% endif %}{{ instance.drbd }}</span>
|
|
|
|
</td>
|
2020-07-13 09:33:09 +00:00
|
|
|
<td>{{ instance.proxy.instance.info.3 }}</td>
|
|
|
|
<td>{{ instance.cur_memory }} MB</td>
|
|
|
|
<td class="text-nowrap">
|
|
|
|
{% include 'instance_actions.html' %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endif %}
|
2018-07-30 10:33:09 +00:00
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|