console/app/templates/default/containers/index.html

81 lines
3.6 KiB
HTML
Raw Normal View History

2015-11-30 12:35:57 +03:00
{% extends "default/_layout.html" %}
2016-01-20 08:38:08 +03:00
{% block title %}Контейнеры{% endblock %}
2015-11-30 12:35:57 +03:00
{% block content %}
<div class="row">
<div class="large-12 columns">
<h3>Список <a href="{{ url_for('containers.create') }}">+</a></h3>
</div>
</div>
<div class="row">
<div class="large-12 columns">
<table id="zones" width="100%">
<thead>
<tr>
<th width="45%">ID</th>
<th>IP</th>
2015-12-16 14:54:40 +03:00
<th>Диск</th>
2016-01-21 01:27:11 +03:00
<th>Память</th>
2015-11-30 12:35:57 +03:00
<th>Статус</th>
<th width="10%">&nbsp;</th>
</tr>
</thead>
<tbody>
{% if containers.total == 0 %}
<tr>
<td>Нет ни одного контейнера. <a href="{{ url_for('containers.create') }}">Добавить</a>.</td>
</tr>
{% else %}
{% for container in containers['items'] %}
<tr>
<td>
2015-12-16 14:54:40 +03:00
{{ container['id'] }}
2015-11-30 12:35:57 +03:00
</td>
<td>
{% if container['ipv4'] %}
IPv4: {{ container['ipv4'] }}
{% endif %}
{% if container['ipv6'] %}
IPv6: {{ container['ipv6'] }}
{% endif %}
</td>
2015-12-16 14:54:40 +03:00
<td>
{% set size_gb = (container.size / 1024 / 1024) %}
2015-12-16 14:54:40 +03:00
{{ '%0.2f' | format(size_gb|float) }}GB
</td>
2016-01-21 01:27:11 +03:00
<td>
2016-01-21 01:29:48 +03:00
{% if container['status'] == 1 %}
{% set memory_mb = (container.memory / 1024 / 1024) %}
{{ '%0.2f' | format(memory_mb|float) }}MB
{% else %}
0MB
{% endif %}
2016-01-21 01:27:11 +03:00
</td>
2015-11-30 12:35:57 +03:00
<td>
{% if container['status'] == 0 %}
Неактивно
{% elif container['status'] == 1 %}
Активно
{% elif container['status'] == 2 %}
Процесс активации
{% elif container['status'] == 3 %}
Процесс деактивации
{% elif container['status'] == 4 %}
Создание...
{% elif container['status'] == 5 %}
Удаление...
{% endif %}
</td>
<td>
<a href="{{ url_for('containers.settings', container_id=container.id) }}">Настройки</a>
</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
</div>
{% endblock %}