80 lines
3.4 KiB
HTML
80 lines
3.4 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Servers — VPN Control Panel{% endblock %}
|
|
{% block content %}
|
|
<h2>Servers</h2>
|
|
|
|
<div class="card" style="margin-bottom:20px;padding:16px;">
|
|
<form action="/admin/servers/create" method="post" style="display:flex;gap:8px;align-items:end;flex-wrap:wrap;">
|
|
<div>
|
|
<label style="font-size:11px;color:#888;display:block;margin-bottom:2px;">Name</label>
|
|
<input type="text" name="name" required style="padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:13px;">
|
|
</div>
|
|
<div>
|
|
<label style="font-size:11px;color:#888;display:block;margin-bottom:2px;">Host</label>
|
|
<input type="text" name="host" required style="padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:13px;">
|
|
</div>
|
|
<div>
|
|
<label style="font-size:11px;color:#888;display:block;margin-bottom:2px;">Port</label>
|
|
<input type="number" name="port" required value="443" style="padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:13px;width:70px;">
|
|
</div>
|
|
<div>
|
|
<label style="font-size:11px;color:#888;display:block;margin-bottom:2px;">Protocol</label>
|
|
<select name="protocol" style="padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:13px;">
|
|
{% for p in protocols %}
|
|
<option value="{{ p }}">{{ p }}</option>
|
|
{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label style="font-size:11px;color:#888;display:block;margin-bottom:2px;">Location</label>
|
|
<input type="text" name="location" required style="padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:13px;width:100px;">
|
|
</div>
|
|
<div>
|
|
<label style="font-size:11px;color:#888;display:block;margin-bottom:2px;">Country</label>
|
|
<input type="text" name="country_code" required maxlength="2" style="padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:13px;width:50px;">
|
|
</div>
|
|
<button type="submit" style="padding:7px 16px;background:#1a1a2e;color:#fff;border:none;border-radius:4px;font-size:13px;cursor:pointer;">+ Add Server</button>
|
|
</form>
|
|
</div>
|
|
|
|
{% if error %}<div style="color:#c53030;font-size:13px;margin-bottom:12px;">{{ error }}</div>{% endif %}
|
|
|
|
<div class="count">{{ servers|length }} total</div>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Name</th>
|
|
<th>Host</th>
|
|
<th>Port</th>
|
|
<th>Protocol</th>
|
|
<th>Location</th>
|
|
<th>Load</th>
|
|
<th>Status</th>
|
|
<th>Created</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for s in servers %}
|
|
<tr>
|
|
<td>{{ s.id }}</td>
|
|
<td>{{ s.name }}</td>
|
|
<td>{{ s.host }}</td>
|
|
<td>{{ s.port }}</td>
|
|
<td><span class="badge badge-blue">{{ s.protocol.value }}</span></td>
|
|
<td>{{ s.location }} ({{ s.country_code }})</td>
|
|
<td>{{ s.load_percent }}%</td>
|
|
<td>
|
|
{% if s.is_active %}
|
|
<span class="badge badge-green">Active</span>
|
|
{% else %}
|
|
<span class="badge badge-red">Offline</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ s.created_at.strftime("%Y-%m-%d") }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endblock %}
|