morozovka-portal/app/templates/sessions.html

52 lines
2.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Активные сессии — Morozovka Portal</title>
<style>
body { background: #0d1117; color: #e6edf3; font-family: sans-serif; padding: 40px; }
.container { max-width: 800px; margin: 0 auto; }
h2 { color: #58a6ff; }
table { width: 100%; border-collapse: collapse; background: #161b22; margin-top: 20px; }
th, td { padding: 12px; text-align: left; border-bottom: 1px solid #30363d; }
th { background: #21262d; color: #8b949e; }
.current { background: rgba(35, 134, 54, 0.2); }
.btn-danger { background: #da3633; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-weight: bold; margin-top: 20px; }
.btn-danger:hover { background: #f85149; }
.back-link { display: block; margin-bottom: 20px; color: #8b949e; text-decoration: none; }
</style>
</head>
<body>
<div class="container">
<a href="/profile" class="back-link">← В профиль</a>
<h2>Управление устройствами</h2>
<p style="color: #8b949e;">Список всех мест, где выполнен вход в ваш аккаунт.</p>
<table>
<thead>
<tr>
<th>Устройство (User-Agent)</th>
<th>IP-адрес</th>
<th>Дата входа</th>
<th>Статус</th>
</tr>
</thead>
<tbody>
{% for s in sessions %}
<tr class="{% if s.session_token == current_token %}current{% endif %}">
<td><small>{{ s.user_agent or 'Неизвестно' }}</small></td>
<td>{{ s.ip_address }}</td>
<td>{{ s.created_at.strftime('%d.%m.%Y %H:%M') }}</td>
<td>{% if s.session_token == current_token %}<b style="color: #3fb950;">Текущая</b>{% else %}-{% endif %}</td>
</tr>
{% endfor %}
</tbody>
</table>
<form action="/sessions/logout_all" method="POST" onsubmit="return confirm('Вы уверены, что хотите выйти на всех устройствах?');">
<button type="submit" class="btn-danger">Выйти везде</button>
</form>
</div>
</body>
</html>