morozovka-portal/app/templates/sessions.html

35 lines
2.3 KiB
HTML
Raw Permalink 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.

{% extends "base.html" %}
{% block title %}Активные сессии — Morozovka Portal{% endblock %}
{% block main_class %}container container-narrow{% endblock %}
{% block content %}
<a href="/profile" style="display:block;margin-bottom:20px;color:#8b949e;text-decoration:none;">← В профиль</a>
<h2 class="page-title">Управление устройствами</h2>
<p style="color: #8b949e;">Список всех мест, где выполнен вход в ваш аккаунт.</p>
<table style="width: 100%; border-collapse: collapse; background: #161b22; margin-top: 20px;">
<thead>
<tr>
<th style="padding:12px;text-align:left;border-bottom:1px solid #30363d;background:#21262d;color:#8b949e;">Устройство (User-Agent)</th>
<th style="padding:12px;text-align:left;border-bottom:1px solid #30363d;background:#21262d;color:#8b949e;">IP-адрес</th>
<th style="padding:12px;text-align:left;border-bottom:1px solid #30363d;background:#21262d;color:#8b949e;">Дата входа</th>
<th style="padding:12px;text-align:left;border-bottom:1px solid #30363d;background:#21262d;color:#8b949e;">Статус</th>
</tr>
</thead>
<tbody>
{% for s in sessions %}
<tr {% if s.session_token == current_token %}style="background: rgba(35,134,54,0.2);"{% endif %}>
<td style="padding:12px;border-bottom:1px solid #30363d;"><small>{{ s.user_agent or 'Неизвестно' }}</small></td>
<td style="padding:12px;border-bottom:1px solid #30363d;">{{ s.ip_address }}</td>
<td style="padding:12px;border-bottom:1px solid #30363d;">{{ s.created_at|msk_strftime('%d.%m.%Y %H:%M') }}</td>
<td style="padding:12px;border-bottom:1px solid #30363d;">{% 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('Вы уверены, что хотите выйти на всех устройствах?');" style="margin-top:20px;">
<button type="submit" style="background:#da3633;color:white;border:none;padding:10px 20px;border-radius:5px;cursor:pointer;font-weight:bold;">Выйти везде</button>
</form>
{% endblock %}