{% extends "config/base.html" %} {% import "site_shell/_macros.html" as ui %} {% block title %}Sessions - Pychestrate Configuration{% endblock %} {% block extra_css %} {% endblock %} {% block content %} {#- The list view (filter, page, page size) every terminate form posts, so the redirect returns to the same view. -#} {% macro list_state_fields() -%} {%- endmacro %}
{% if filter_username %} Clear {% endif %}
{% for group in sessions | groupby('username') %} {% set group_user_id = group.list[0].user_id %} {% set group_total = sessions_by_user.get(group_user_id, group.list | length) %} {% set group_is_me = group.list | selectattr('is_current') | list | length > 0 %} {% for session in group.list %} {% endfor %} {% else %} {{ ui.empty_state("No active sessions found", colspan=6) }} {% endfor %}
Browser Client address Signed in Last active Ends Actions
{{ group.grouper }} {{ group_total }} session{{ '' if group_total == 1 else 's' }}{% if group_total > group.list | length %} ({{ group.list | length }} on this page){% endif %} {% if group_is_me %} {% if group_total > 1 %}
{{ list_state_fields() }}
{% endif %} {% elif group_total > 1 %}
{{ list_state_fields() }}
{% endif %}
{% if session.user_agent %}{{ session.user_agent }}{% else %}Not recorded{% endif %} {% if session.is_current %} This session {% endif %} {% if session.client_ip %}{{ session.client_ip }}{% else %}Not recorded{% endif %} {% if session.created_at %}{{ session.created_ago }}{{ session.created_at | format_datetime('%H:%M') }}{% else %}—{% endif %} {% if session.last_activity %}{{ session.last_activity_ago }}{{ session.last_activity | format_datetime('%H:%M') }}{% else %}—{% endif %} {% if session.expires_at %}{{ session.expires_in }}{{ session.expires_at | format_datetime('%H:%M') }}{% else %}—{% endif %}
{{ list_state_fields() }} {% if session.is_current %} {% else %} {% endif %}
{{ ui.pagination('config.session_list', page, total_pages, {'username': filter_username, 'per_page': per_page}, total=total) }}

Total: {{ total }} active session{{ '' if total == 1 else 's' }}

{% endblock %}