dynamicweb/hosting/templates/hosting/virtual_machines.html

78 lines
3.2 KiB
HTML
Raw Normal View History

{% extends "hosting/base_short.html" %}
{% load staticfiles bootstrap3 i18n %}
2017-08-11 19:19:20 +00:00
{% block content %}
<div class="dashboard-container">
2017-08-18 17:57:57 +00:00
<div class="dashboard-container-head">
<h3 class="dashboard-title-thin"><img src="{% static 'hosting/img/vm.svg' %}" class="un-icon"> {% trans "Virtual Machines" %}</h3>
{% if messages %}
<div class="alert alert-warning">
{% for message in messages %}
<span>{{ message }}</span>
{% endfor %}
</div>
{% endif %}
{% if not error %}
<div class="dashboard-subtitle">
<p>{% trans 'To create a new virtual machine, click "Create VM"' %}</p>
<div class="text-right">
<a class="btn btn-vm" href="{% url 'hosting:create_virtual_machine' %}"><span class="css-plus"></span> <span>{% trans "CREATE VM" %}</span></a>
</div>
</div>
{% endif %}
</div>
{% if not error %}
<table class="table table-switch">
<thead>
<tr>
<th>ID</th>
2017-08-16 15:11:55 +00:00
<th>IPv4</th>
<th>IPv6</th>
<th>{% trans "Status" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for vm in vms %}
<tr>
<td data-header="ID">{{vm.vm_id}}</td>
{% if vm.ipv6 %}
2017-08-16 15:11:55 +00:00
<td data-header="IPv4">{{vm.ipv4}}</td>
<td data-header="IPv6">{{vm.ipv6}}</td>
{% endif %}
<td data-header="{% trans 'Status' %}">
{% if vm.state == 'ACTIVE' %}
<span class="vm-status-active"><strong>{{vm.state|title}}</strong></span>
{% elif vm.state == 'FAILED' %}
<span class="vm-status-failed"><strong>{{vm.state|title}}</strong></span>
{% else %}
<span class="vm-status"><strong>{{vm.state|title}}</strong></span>
{% endif %}
</td>
<td class="text-right last-td">
2017-08-15 22:56:17 +00:00
<a class="btn btn-vm-detail" href="{% url 'hosting:virtual_machines' vm.vm_id %}">{% trans "View Detail" %}</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% if is_paginated %}
<div class="pagination">
<span class="page-links">
{% if page_obj.has_previous %}
2017-08-15 22:56:17 +00:00
<a href="{{request.path}}?page={{ page_obj.previous_page_number }}">{% trans "previous" %}</a>
{% endif %}
<span class="page-current">
2017-08-15 22:56:17 +00:00
{% trans "Page" %} {{ page_obj.number }} {% trans "of" %} {{ page_obj.paginator.num_pages }}.
</span>
{% if page_obj.has_next %}
2017-08-15 22:56:17 +00:00
<a href="{{request.path}}?page={{ page_obj.next_page_number }}">{% trans "next" %}</a>
{% endif %}
</span>
</div>
{% endif %}
</div>
{%endblock%}