@@ -58,7 +58,22 @@
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="bi bi-display me-2 text-secondary fs-5"></i>
|
||||
<div>
|
||||
<div class="text-truncate" style="max-width: 150px" title="{{ s.user_agent }}">{{ s.user_agent.split(' ')[0] if s.user_agent else _('Unknown Device') }}</div>
|
||||
{% set device_name = _('Unknown Device') %}
|
||||
{% if s.user_agent %}
|
||||
{% set ua = s.user_agent|lower %}
|
||||
{% if 'windows' in ua %}
|
||||
{% set device_name = 'Windows' %}
|
||||
{% elif 'android' in ua %}
|
||||
{% set device_name = 'Android' %}
|
||||
{% elif 'iphone' in ua or 'ipad' in ua %}
|
||||
{% set device_name = 'iOS' %}
|
||||
{% elif 'mac' in ua or 'darwin' in ua %}
|
||||
{% set device_name = 'macOS' %}
|
||||
{% elif 'linux' in ua %}
|
||||
{% set device_name = 'Linux' %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
<div class="text-truncate" style="max-width: 150px; cursor: help;" title="{{ s.user_agent or _('Unknown Device') }}">{{ device_name }}</div>
|
||||
{% if s.session_token == current_token %}
|
||||
<span class="badge bg-primary mt-1">{{ _('This Device') }}</span>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user