{% extends "layout/base.twig" %} {% set title = 'Notifications' %} {% set pageTitle = 'Notifications' %} {% set pageDescription = 'View and manage your notifications' %} {% set pageIcon = 'fas fa-bell' %} {% block content %} {% set filterType = filters.type ?? '' %} {% set filterStatus = filters.status ?? '' %} {% set filterDateRange = filters.date_range ?? '' %} {% set page = pagination.current_page %} {% set totalPages = pagination.total_pages %} {% set perPage = pagination.per_page %} {% set totalNotifications = pagination.total %} {% set offset = pagination.showing_from - 1 %}
Clear
Showing {{ offset + 1 }} to {{ min(offset + perPage, totalNotifications) }} of {{ totalNotifications }} notification(s) {% if unreadCount > 0 %} {{ unreadCount }} unread {% endif %}
{% if notifications is not empty %}
{% for notification in notifications %} {% set bgClass = notification.is_read ? '' : 'bg-blue-50 dark:bg-blue-500/10' %} {% set iconBgClass = 'bg-' ~ notification.color ~ '-100' %} {% set iconTextClass = 'text-' ~ notification.color ~ '-600' %} {% set hasDomain = notification.domain_id is not empty %} {% set domainUrl = hasDomain ? '/domains/' ~ notification.domain_id : null %} {% set clickUrl = null %} {% if notification.type == 'update_available' %} {% set clickUrl = '/notifications/' ~ notification.id ~ '/mark-read?redirect=settings' %} {% elseif hasDomain and not notification.is_read %} {% set clickUrl = '/notifications/' ~ notification.id ~ '/mark-read?redirect=domain&domain_id=' ~ notification.domain_id %} {% elseif hasDomain %} {% set clickUrl = domainUrl %} {% endif %} {% set loginData = notification.login_data ?? null %} {% set isLogin = (notification.type == 'session_new' and loginData) %} {% set isFailedLogin = (notification.type == 'session_failed' and loginData) %}
{% if isFailedLogin %}
{% elseif isLogin %}
{% elseif clickUrl %} {% else %}
{% endif %}
{% if clickUrl %} {{ notification.title }} {% else %}

{{ notification.title }}

{% endif %} {% if not notification.is_read %} {% endif %} {{ notification.time_ago }}
{% if isFailedLogin %}
Location: {% if (loginData.country_code ?? 'xx') != 'xx' %} {% endif %} {{ loginData.location ?? 'Unknown' }}
IP: {{ loginData.ip ?? 'unknown' }}
Browser: {{ loginData.browser ?? 'Unknown' }}
Device: {{ loginData.device ?? 'Unknown' }}
OS: {{ loginData.os ?? 'Unknown' }}
ISP: {{ loginData.isp ?? 'Unknown' }}
Reason: {{ loginData.reason ?? 'Unknown' }}
{% elseif isLogin %}
Location: {% if loginData.country_code != 'xx' %} {% endif %} {{ loginData.location ?? 'Unknown' }}
IP: {{ loginData.ip ?? 'unknown' }}
Browser: {{ loginData.browser ?? 'Unknown' }}
Device: {{ loginData.device ?? 'Unknown' }}
OS: {{ loginData.os ?? 'Unknown' }}
ISP: {{ loginData.isp ?? 'Unknown' }}
Method: {{ loginData.method ?? 'Login' }}
{% else %}

{{ notification.message }}

{% if hasDomain and clickUrl %} View domain {% endif %} {% endif %}
{% if not notification.is_read %} {% endif %}
{{ csrf_field() }}
{% endfor %}
{% else %}

No notifications found

Try adjusting your filters

{% endif %}
{% if totalPages > 1 %}
Page {{ page }} of {{ totalPages }}
{% if page > 1 %} {% endif %} {% if page > 1 %} Previous {% endif %} {% set range = 2 %} {% set startPage = max(1, page - range) %} {% set endPage = min(totalPages, page + range) %} {% if startPage > 1 %} 1 {% if startPage > 2 %} ... {% endif %} {% endif %} {% for i in startPage..endPage %} {% if i == page %} {{ i }} {% else %} {{ i }} {% endif %} {% endfor %} {% if endPage < totalPages %} {% if endPage < totalPages - 1 %} ... {% endif %} {{ totalPages }} {% endif %} {% if page < totalPages %} Next {% endif %} {% if page < totalPages %} {% endif %}
{% endif %} {% endblock %}