| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <!DOCTYPE html>
- <html lang="{{ get_locale() }}">
- <head>
- <meta charset="UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>{{ _("Auditoría -") }} {{ audit_type }}</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: 0.75; margin-bottom: 16px; }
- .box { border: 1px solid #d1d5db; border-radius: 8px; padding: 14px; margin-bottom: 10px; }
- .table { width: 100%; border-collapse: collapse; margin-top: 8px; }
- .table th, .table td { border: 1px solid #d1d5db; padding: 6px; text-align: left; }
- .table th { background: #f3f4f6; }
- </style>
- </head>
- <body>
- <h1>{{ _("Auditoría:") }} {{ audit_type | replace('_',' ') | title }}</h1>
- <div class="meta">{{ _("Generado:") }} {{ generated_at }} {{ _("| Filtros:") }} {% for k,v in params.items() if v %}{{ k }}={{ v }}{% if not loop.last %}, {% endif %}{% endfor %}</div>
- {% if data.error %}
- <div class="box"><strong>{{ _("Error:") }}</strong> {{ data.error }}</div>
- {% else %}
- {% set has_results = data.results is defined and data.results %}
- {% if audit_type == 'user_summary' %}
- <div class="box">
- <h2>{{ _("Resumen de Usuario") }}</h2>
- <p>{{ _("Total solicitudes:") }} {{ data.total_requests | default(0) }}</p>
- <p>{{ _("Datos totales (GB):") }} {{ data.total_data_gb | default(0) }}</p>
- </div>
- {% if data.top_domains %}
- <div class="box"><h2>{{ _("Top dominios") }}</h2><table class="table"><tr><th>{{ _("Dominio") }}</th><th>{{ _("Conteo") }}</th></tr>{% for row in data.top_domains %}<tr><td>{{ row.domain }}</td><td>{{ row.count }}</td></tr>{% endfor %}</table></div>
- {% endif %}
- {% if data.response_summary %}
- <div class="box"><h2>{{ _("Resumen de respuestas") }}</h2><table class="table"><tr><th>{{ _("Código") }}</th><th>{{ _("Conteo") }}</th></tr>{% for row in data.response_summary %}<tr><td>{{ row.code }}</td><td>{{ row.count }}</td></tr>{% endfor %}</table></div>
- {% endif %}
- {% elif audit_type == 'daily_activity' %}
- <div class="box"><h2>{{ _("Actividad diaria") }}</h2><p>{{ _("Total solicitudes:") }} {{ data.total_requests | default(0) }}</p><table class="table"><tr><th>{{ _("Hora") }}</th><th>{{ _("Requests") }}</th></tr>{% for value in data.hourly_activity %}<tr><td>{{ loop.index0 }}:00</td><td>{{ value }}</td></tr>{% endfor %}</table></div>
- {% elif audit_type == 'total_data_consumed' %}
- <div class="box"><h2>{{ _("Consumo total") }}</h2><p>{{ _("Datos totales (GB):") }} {{ data.total_data_gb | default(0) }}</p><p>{{ _("Total peticiones:") }} {{ data.total_requests | default(0) }}</p><p>{{ _("Rango:") }} {{ data.date_range | default('n/a') }}</p></div>
- {% elif audit_type == 'top_users_data' %}
- {% set rows = data.top_users %}
- <div class="box"><h2>{{ _("Top usuarios por datos") }}</h2></div>
- {% elif audit_type == 'top_users_requests' %}
- {% set rows = data.top_users_requests %}
- <div class="box"><h2>{{ _("Top usuarios por solicitudes") }}</h2></div>
- {% elif audit_type == 'top_urls_data' %}
- {% set rows = data.top_urls %}
- <div class="box"><h2>{{ _("Top URLs por datos") }}</h2></div>
- {% elif audit_type == 'top_ips_data' %}
- {% set rows = data.top_ips %}
- <div class="box"><h2>{{ _("Top IPs por datos") }}</h2></div>
- {% elif has_results %}
- {% set rows = data.results %}
- <div class="box"><h2>{{ _("Resultados") }}</h2></div>
- {% else %}
- <div class="box"><p>{{ _("No hay datos disponibles para esta auditoría.") }}</p></div>
- {% endif %}
- {% if rows is defined and rows %}
- <div class="box">
- <table class="table">
- <thead>
- <tr>{% for key in rows[0].keys() %}<th>{{ key }}</th>{% endfor %}</tr>
- </thead>
- <tbody>
- {% for row in rows %}
- <tr>{% for key, val in row.items() %}<td>{{ val }}</td>{% endfor %}</tr>
- {% endfor %}
- </tbody>
- </table>
- </div>
- {% endif %}
- {% endif %}
- </body>
- </html>
|