75 lines
2.8 KiB
HTML
75 lines
2.8 KiB
HTML
{% extends "base.html" %}
|
|
{% block title %}Users — VPN Control Panel{% endblock %}
|
|
{% block content %}
|
|
<h2>Users</h2>
|
|
|
|
<div class="card" style="margin-bottom:20px;padding:16px;">
|
|
<form action="/admin/users/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;">Telegram ID</label>
|
|
<input type="number" name="telegram_id" 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;">Username</label>
|
|
<input type="text" name="username" placeholder="@username"
|
|
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;">Full Name</label>
|
|
<input type="text" name="full_name" placeholder="Name"
|
|
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;">Language</label>
|
|
<select name="language_code" style="padding:6px 10px;border:1px solid #ddd;border-radius:4px;font-size:13px;">
|
|
<option value="ru">RU</option>
|
|
<option value="en">EN</option>
|
|
</select>
|
|
</div>
|
|
<button type="submit"
|
|
style="padding:7px 16px;background:#1a1a2e;color:#fff;border:none;border-radius:4px;font-size:13px;cursor:pointer;">
|
|
+ Add User
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
{% if error %}
|
|
<div style="color:#c53030;font-size:13px;margin-bottom:12px;">{{ error }}</div>
|
|
{% endif %}
|
|
|
|
<div class="count">{{ users|length }} total</div>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>Telegram ID</th>
|
|
<th>Username</th>
|
|
<th>Full Name</th>
|
|
<th>Language</th>
|
|
<th>Status</th>
|
|
<th>Created</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for u in users %}
|
|
<tr>
|
|
<td>{{ u.id }}</td>
|
|
<td>{{ u.telegram_id }}</td>
|
|
<td>{% if u.username %}@{{ u.username }}{% else %}—{% endif %}</td>
|
|
<td>{{ u.full_name }}</td>
|
|
<td>{{ u.language_code }}</td>
|
|
<td>
|
|
{% if u.is_active %}
|
|
<span class="badge badge-green">Active</span>
|
|
{% else %}
|
|
<span class="badge badge-red">Inactive</span>
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ u.created_at.strftime("%Y-%m-%d") }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endblock %}
|