{% set valid_users = {} %} {% for user, user_data in grouped_connections.items() %} {% if user and user != "-" and user != "Anónimo" %} {% set _ = valid_users.update({user: user_data}) %} {% endif %} {% endfor %}
{# Tarjetas de estadísticas #}
{# --- MODIFICADO: Tarjeta de información del Servidor Squid --- #}

Servidor Squid (v{{ squid_version }})

{{ squid_ip }}

{# --- MODIFICADO: Tarjeta de estado del Proxy Padre --- #} {% if parent_proxy_ip %} {# Estado Con Padre #}

Proxy Padre Activo

{{ parent_proxy_ip }}

{% else %} {# Estado Sin Padre #}

Sin Proxy Padre

Conexión Directa

{% endif %} {# Tarjeta de Usuarios Activos #}

Usuarios Activos

{{ valid_users|length }}

{# Tarjeta de Conexiones Totales #}

Conexiones Totales

{% set total = namespace(value=0) %} {% for user_data in valid_users.values() %} {% set total.value = total.value + user_data.connections|length %} {% endfor %} {{ total.value }}

{# Nueva Tarjeta: Tiempo de Actividad de Squid #} {% if squid_info_stats and squid_info_stats.elapsed_hours %}

Tiempo Activo

{{ squid_info_stats.elapsed_hours }}h

{% endif %} {# Nueva Tarjeta: Clientes Conectados a Squid #} {% if squid_info_stats and squid_info_stats.clients %}

Clientes Squid

{{ squid_info_stats.clients }}

{% endif %} {# Nueva Tarjeta: Peticiones HTTP Totales #} {% if squid_info_stats and squid_info_stats.requests_received %}

Peticiones HTTP

{{ "{:,}"|format(squid_info_stats.requests_received) }}

{% endif %} {# Nueva Tarjeta: Promedio de Peticiones por Minuto #} {% if squid_info_stats and squid_info_stats.avg_requests_per_minute %}

Pet./Min Promedio

{{ squid_info_stats.avg_requests_per_minute|round(1) }}

{% endif %} {# Nueva Tarjeta: Estado de Conexión de Squid #} {% if squid_info_stats %}

Estado Squid Info

{% if squid_info_stats.connection_status == 'connected' %}Conectado {% elif squid_info_stats.connection_status == 'connected_but_parse_error' %}Error Parsing {% elif squid_info_stats.connection_status == 'timeout' %}Timeout {% elif squid_info_stats.connection_status == 'connection_refused' %}Conexión Rechazada {% elif squid_info_stats.connection_status == 'dns_error' %}Error DNS {% else %}Error Desconocido{% endif %}

{% endif %}
{% if valid_users|length > 0 %}
{% endif %}
{% for user, user_data in valid_users.items() %} {% set connections = user_data.connections %} {% set client_ip = user_data.client_ip %}

{{ user }}

{{ client_ip }}
{{ connections|length }} conexiones
{% set total_data = namespace(value=0) %} {% set total_requests = namespace(value=0) %} {% for connection in connections %} {% if connection.fd_total != "N/A" %} {% set total_data.value = total_data.value + connection.fd_total %} {% endif %} {% set total_requests.value = total_requests.value + connection.nrequests %} {% endfor %}
{{ (total_data.value / 1024 / 1024)|round(2) }} MB
{{ total_requests.value }} solicitudes
{% for connection in connections %} {% endfor %}
Duración Método URL Datos Delay Pool Solicitudes Dir. Remota
{% set seconds = connection.elapsed_time|float %} {% if seconds >= 3600 %}{{ "%.2f"|format(seconds/3600) }} h {% elif seconds >= 60 %}{{ "%.2f"|format(seconds/60) }} min {% else %}{{ "%.2f"|format(seconds) }} seg{% endif %} {% set method = connection.logType|lower %} {{ connection.logType }}
{{ connection.uri }}
{% if connection.fd_total != "N/A" %}{{ (connection.fd_total / 1024 / 1024)|round(2) }} MB {% else %}N/A{% endif %} {% if connection.delay_pool != "N/A" %} {% set pool = connection.delay_pool|string %} Pool {{ connection.delay_pool }} {% else %}N/A{% endif %} {{ connection.nrequests }} {{ connection.proxy_local_ip }}
{% endfor %}