| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- <!DOCTYPE html>
- <html lang="{{ get_locale() }}">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>{{ _("Reportes SquidStats -") }} {{ selected_date.isoformat() }}</title>
- <style>
- body { font-family: Arial, Helvetica, sans-serif; color: #1f2937; margin: 24px; }
- h1 { font-size: 22px; margin-bottom: 8px; }
- h2 { font-size: 18px; margin-top: 24px; margin-bottom: 8px; }
- .meta { font-size: 12px; opacity: .8; margin-bottom: 16px; }
- .box { border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; margin-bottom: 12px; }
- .table { width: 100%; border-collapse: collapse; margin-top: 8px; }
- .table th, .table td { border: 1px solid #d1d5db; padding: 8px; text-align: left; }
- .table th { background: #f3f4f6; }
- </style>
- </head>
- <body>
- <h1>{{ _("Reportes SquidStats") }}</h1>
- <div class="meta">{{ _("Fecha del reporte:") }} {{ selected_date.isoformat() }} {{ _("- Generado:") }} {{ generated_at }}</div>
- <div class="box">
- <h2>{{ _("Resumen General") }}</h2>
- <p>{{ _("Total usuarios:") }} {{ metrics.total_stats.total_users | default(0) }}</p>
- <p>{{ _("Total solicitudes:") }} {{ metrics.total_stats.total_requests | default(0) }}</p>
- <p>{{ _("Datos consumidos (MB):") }} {{ ((metrics.total_stats.total_data_transmitted | default(0)) / 1048576) | round(2) }}</p>
- <p>{{ _("Tasa de éxito HTTP:") }} {{ metrics.successful_request_rate | default(0) | round(1) }}%</p>
- <p>{{ _("Errores HTTP:") }} {{ metrics.error_requests | default(0) }} ({{ metrics.error_request_rate | default(0) | round(1) }}%)</p>
- <p>{{ _("Accesos bloqueados:") }} {{ metrics.blocked_requests | default(0) }} ({{ metrics.blocked_request_rate | default(0) | round(1) }}%)</p>
- <p>{{ _("Destinos únicos:") }} {{ metrics.unique_domains | default(0) }}</p>
- <p>{{ _("Hora pico:") }} {{ "%02d:00" | format(metrics.peak_hour.hour | default(0)) }}</p>
- </div>
- <div class="box">
- <h2>{{ _("Top usuarios por actividad") }}</h2>
- <table class="table">
- <thead>
- <tr><th>{{ _("Usuario") }}</th><th>{{ _("Visitas") }}</th></tr>
- </thead>
- <tbody>
- {% for item in metrics.top_users_by_activity %}
- <tr>
- <td>{{ item.username }}</td>
- <td>{{ item.total_visits }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- <div class="box">
- <h2>{{ _("Top URLs por consumo de datos") }}</h2>
- <table class="table">
- <thead>
- <tr><th>{{ _("URL") }}</th><th>{{ _("Datos (MB)") }}</th></tr>
- </thead>
- <tbody>
- {% for item in metrics.top_pages_by_data %}
- <tr>
- <td>{{ item.url }}</td>
- <td>{{ ((item.total_data_bytes | default(0)) / 1048576) | round(2) }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- <div class="box">
- <h2>{{ _("Top dominios de destino") }}</h2>
- <table class="table">
- <thead>
- <tr><th>{{ _("Dominio") }}</th><th>{{ _("Peticiones") }}</th><th>{{ _("Datos (MB)") }}</th></tr>
- </thead>
- <tbody>
- {% for item in metrics.top_domains %}
- <tr>
- <td>{{ item.domain }}</td>
- <td>{{ item.total_requests }}</td>
- <td>{{ ((item.total_data_bytes | default(0)) / 1048576) | round(2) }}</td>
- </tr>
- {% else %}
- <tr><td colspan="3">{{ _("No hay destinos identificables para esta fecha.") }}</td></tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- <div class="box">
- <h2>{{ _("Distribución de códigos HTTP") }}</h2>
- <table class="table">
- <thead>
- <tr><th>{{ _("Código") }}</th><th>{{ _("Conteo") }}</th></tr>
- </thead>
- <tbody>
- {% for code in metrics.http_response_distribution_chart.labels %}
- <tr>
- <td>{{ code }}</td>
- <td>{{ metrics.http_response_distribution_chart.data[loop.index0] }}</td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- </body>
- </html>
|