| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <div class="w-full space-y-6">
- {% if domain_capped %}
- <div class="flex items-start gap-3 rounded-lg border border-amber-300 bg-amber-50 px-5 py-4 shadow-sm">
- <svg class="mt-0.5 h-5 w-5 flex-shrink-0 text-amber-500" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
- d="M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"/>
- </svg>
- <div>
- <p class="text-sm font-semibold text-amber-800">{{ _("Análisis parcial — límite de dominios activo") }}</p>
- <p class="mt-0.5 text-sm text-amber-700">
- {{ _("La blacklist contiene más de") }} <span class="font-bold">50</span> {{ _("dominios activos. Para evitar un alto consumo de recursos, la consulta se ha limitado a los primeros") }}
- <span class="font-bold">{{ domain_cap }}</span> {{ _("dominios. Es posible que algunos accesos bloqueados no aparezcan en este listado.") }}
- </p>
- </div>
- </div>
- {% endif %}
- <div class="bg-white rounded-lg shadow-md overflow-hidden">
- <div class="px-6 py-4 border-b border-gray-200 bg-gray-50 flex flex-col sm:flex-row justify-between items-center">
- <div class="mb-2 sm:mb-0">
- <span class="text-sm font-medium text-gray-600">
- {{ _("Total usuarios:") }}
- <span class="font-bold text-red-600">{{ pagination.total }}</span>
- </span>
- <span class="text-sm font-medium text-gray-600 ml-4">
- {{ _("Total peticiones:") }}
- <span class="font-bold text-red-600">{{ pagination.total_requests }}</span>
- </span>
- </div>
- <div class="flex items-center gap-2">
- <span class="text-sm font-medium text-gray-600 mr-2">{{ _("Mostrar:") }}</span>
- <select id="per_page" class="border border-gray-300 bg-white text-gray-800 rounded-md px-3 py-1.5 text-sm font-medium shadow-sm transition duration-150 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
- onchange="window.location.href = updateQueryParam('per_page', this.value)">
- <option value="20" {% if pagination.per_page == 20 %}selected{% endif %}>20</option>
- <option value="50" {% if pagination.per_page == 50 %}selected{% endif %}>50</option>
- <option value="100" {% if pagination.per_page == 100 %}selected{% endif %}>100</option>
- </select>
- </div>
- </div>
- <div class="divide-y divide-gray-200">
- {% for user, items in results | groupby('usuario') %}
- {% set user_items = items | list %}
- {% set total_user = user_items | sum(attribute='count') %}
- <div class="user-group">
- <div class="px-6 py-4 bg-white">
- <div class="flex flex-col sm:flex-row sm:justify-between sm:items-center">
- <div class="flex items-center mb-2 sm:mb-0">
- <svg class="h-6 w-6 mr-3 text-blue-500 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"/>
- </svg>
- <h2 class="text-lg font-semibold text-gray-800">{{ user }}</h2>
- </div>
- <div class="flex-shrink-0">
- <span class="px-3 py-1 bg-red-100 text-red-800 text-xs font-bold rounded-full">
- {{ total_user }} {{ _("Intentos Bloqueados") }}
- </span>
- </div>
- </div>
- </div>
- <div class="px-6 py-4 border-t border-gray-200 bg-gray-50/50">
- <div class="space-y-2">
- {% for item in user_items %}
- <div class="flex items-center p-2 bg-white rounded-md shadow-sm">
- <p class="flex-grow font-mono text-sm text-gray-800 truncate pr-4">{{ item.domain }}</p>
- <span class="flex-shrink-0 px-2.5 py-0.5 text-xs font-bold text-red-800 bg-red-100 rounded-full">
- {{ item.count }}
- </span>
- </div>
- {% endfor %}
- </div>
- </div>
- </div>
- {% else %}
- <div class="px-6 py-12 text-center">
- <svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true">
- <path vector-effect="non-scaling-stroke" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
- </svg>
- <h3 class="mt-2 text-sm font-medium text-gray-900">{{ _("No se encontraron registros") }}</h3>
- <p class="mt-1 text-sm text-gray-500">{{ _("No hay actividad en sitios bloqueados para mostrar.") }}</p>
- </div>
- {% endfor %}
- </div>
- <div class="px-6 py-4 border-t border-gray-200 bg-gray-50">
- <div class="flex flex-col sm:flex-row justify-between items-center">
- <span class="text-sm text-gray-600 mb-2 sm:mb-0">
- {{ _("Mostrando") }} {{ results | groupby('usuario') | list | length }} {{ _("usuarios en esta página.") }}
- </span>
- <div class="flex space-x-2">
- {% if pagination.page > 1 %}
- <a href="{{ url_for('logs.blacklist_logs', page=pagination.page-1, per_page=pagination.per_page) }}"
- class="px-4 py-2 bg-white border rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50">
- {{ _("Anterior") }}
- </a>
- {% else %}
- <span class="px-4 py-2 bg-white border rounded-md shadow-sm text-sm font-medium text-gray-300 cursor-not-allowed select-none">
- {{ _("Anterior") }}
- </span>
- {% endif %}
- {% if pagination.page < pagination.total_pages %}
- <a href="{{ url_for('logs.blacklist_logs', page=pagination.page+1, per_page=pagination.per_page) }}"
- class="px-4 py-2 bg-white border rounded-md shadow-sm text-sm font-medium text-gray-700 hover:bg-gray-50">
- {{ _("Siguiente") }}
- </a>
- {% else %}
- <span class="px-4 py-2 bg-white border rounded-md shadow-sm text-sm font-medium text-gray-300 cursor-not-allowed select-none">
- {{ _("Siguiente") }}
- </span>
- {% endif %}
- </div>
- </div>
- </div>
- </div>
- </div>
|