48 lines
1.8 KiB
HTML
48 lines
1.8 KiB
HTML
{% extends 'base.html' %}
|
|
{% block content %}
|
|
<h2>Клиенты</h2>
|
|
<p>Интерфейс: <b>{{ meta.get('WG_INTERFACE','wg0') }}</b> | Сеть: <b>{{ meta.get('WG_NETWORK','-') }}</b> | Endpoint: <b>{{ meta.get('SERVER_PUBLIC_IP','-') }}:{{ meta.get('WG_PORT','-') }}</b></p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>Имя</th><th>Статус</th><th>IP</th><th>Роуты</th><th>AllowedIPs</th><th>Endpoint</th><th>Handshake</th><th>RX</th><th>TX</th><th>PubKey</th><th>Действие</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for p in peers %}
|
|
<tr>
|
|
<td>{{ p.name }}</td>
|
|
<td><span class="badge {{ p.status }}">{{ p.status }}</span></td>
|
|
<td>{{ p.client_address }}</td>
|
|
<td>{{ p.routes }}</td>
|
|
<td>{{ p.allowed_ips }}</td>
|
|
<td>{{ p.endpoint }}</td>
|
|
<td>{{ p.latest_handshake }}</td>
|
|
<td>{{ p.rx }}</td>
|
|
<td>{{ p.tx }}</td>
|
|
<td class="mono">{{ p.public_key }}</td>
|
|
<td>
|
|
{% if p.id %}
|
|
<a href="{{ url_for('peer_view', peer_id=p.id) }}">QR/Config</a>
|
|
{% if p.status == 'online' %}
|
|
<form method="post" action="{{ url_for('peer_disable', peer_id=p.id) }}" style="display:inline">
|
|
<button type="submit">Отключить</button>
|
|
</form>
|
|
{% else %}
|
|
<form method="post" action="{{ url_for('peer_enable', peer_id=p.id) }}" style="display:inline">
|
|
<button type="submit">Включить</button>
|
|
</form>
|
|
{% endif %}
|
|
<form method="post" action="{{ url_for('peer_delete', peer_id=p.id) }}" style="display:inline" onsubmit="return confirm('Удалить peer?')">
|
|
<button type="submit">Удалить</button>
|
|
</form>
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endblock %}
|