Files
docker_flask/templates/containers.table.html
2018-03-09 10:33:19 +01:00

103 lines
3.5 KiB
HTML

{% extends "layout.html" %}
{% block body %}
<h1><a href="/">Dashboard</a> &raquo; {{ client_name }} &raquo; Containers</h1>
<a class="button--link" href="/{{ client_name }}/containers/all">All Containers</a>
<a class="button--link" href="/{{ client_name }}/containers/paused">Paused Containers</a>
<a class="button--link" href="/{{ client_name }}/containers">Running Containers</a>
<a class="button--link" href="/{{ client_name }}/containers/exited">Stopped Containers</a>
<input type="text" class="search_table" placeholder="search">
<h2>{{ currentComposerProject }}</h2>
{% for container in containers %}
{% if (loop.first) or (loop.previtem.attrs.Config.Labels['com.docker.compose.project'] != container.attrs.Config.Labels['com.docker.compose.project']) %}
{% if (loop.previtem is defined) and (loop.previtem.attrs.Config.Labels['com.docker.compose.project'] != container.attrs.Config.Labels['com.docker.compose.project'])%}
</tbody>
</table>
{% endif %}
<h2>{{ container.attrs.Config.Labels['com.docker.compose.project'] }}</h2>
<table>
<thead>
<tr>
<th>COMPOSE PROJECT</th>
<th>CONTAINER ID</th>
<th>NAME</th>
<th>COMMAND</th>
<th>CREATED</th>
<th>STATUS</th>
<th>PORTS</th>
<th>IMAGE</th>
</tr>
</thead>
<tbody>
{% endif%}
<tr>
<td>
{% if container.attrs.Config.Labels|length and container.attrs.Config.Labels['com.docker.compose.config-hash'] %}
<a href="{{ url_for('containers_compose_action', client_name=client_name, compose_project=container.attrs.Config.Labels['com.docker.compose.project']) }}">{{ container.attrs.Config.Labels['com.docker.compose.project'] }}</a>
{% endif%}
</td>
<td><span title="{{ container.id }}">{{ container.short_id }}</span></td>
<td><a href="/{{ client_name }}/containers/id/{{ container.short_id }}">{{ container.name }}</a></td>
<td>{{ container.attrs['Config']['Entrypoint'][0] }}</td>
<td>{{ container.attrs['Created'][0:19] }}</td>
<td>{{ container.status }}</td>
<td>
{% for port in container.attrs['NetworkSettings']['Ports'] %}
{{ port }}
{% if container.attrs['NetworkSettings']['Ports'][port] is not none %}
{% if container.attrs['NetworkSettings']['Ports'][port] is not none and
container.attrs['NetworkSettings']['Ports'][port]|length > 0 %}
{% for port_exposed in container.attrs['NetworkSettings']['Ports'][port] %}
->{{ port_exposed['HostIp'] }}:{{ port_exposed['HostPort'] }}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
</td>
<td>{{ container.attrs['Config']['Image'] }}</td>
<td>
<a href="/{{ client_name }}/containers/log/{{ container.short_id }}">log</a>
<a href="/{{ client_name }}/containers/export/{{ container.short_id }}">export</a>
<a href="/{{ client_name }}/containers/stop/{{ container.short_id }}">stop</a>
<a href="/{{ client_name }}/containers/remove/{{ container.short_id }}">remove</a>
{% if container.status == 'running' %}
<a href="/{{ client_name }}/containers/top/{{ container.short_id }}">top</a>
{% endif %}
</td>
</tr>
{% else %}
<tr>
<td colspan="9">
no containers
</td>
</tr>
{% endfor %}
{% endblock %}