{% extends "base.html" %} {% block title %}Panel de Administración - TallArt{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

👨‍💼 Panel de Administración

Bienvenido al centro de control de TallArt

Dashboard Usuarios Empresas Productos Eventos Comentarios Categorías Alertas Logins Auditoría

Total Usuarios

{{ stats.get('total_usuarios', 0) }}

{{ stats.get('usuarios_este_mes', 0) }} este mes

Total Empresas

{{ stats.get('total_empresas', 0) }}

{{ stats.get('empresas_activas', 0) }} activas

Total Productos

{{ stats.get('total_productos', 0) }}

{{ stats.get('productos_destacados', 0) }} destacados

Total Eventos

{{ stats.get('total_eventos', 0) }}

{{ stats.get('eventos_proximos', 0) }} próximos

Proyección mensual de usuarios (acumulado)

Histórico + proyección (Clientes vs Empresas)

{% if user_projection and user_projection.labels and user_projection.labels|length > 0 %}
{% else %}
No hay datos suficientes para generar la proyección.
{% endif %}

Gobierno de Datos

Monitoreo y trazabilidad del sistema

Alertas nuevas

{{ governance.get('alertas_nuevas', 0) }}

{{ governance.get('alertas_abiertas', 0) }} abiertas

Ver →

Logins fallidos (24h)

{{ governance.get('logins_fallidos_24h', 0) }}

últimas 24 horas

Ver →

Eventos de auditoría (24h)

{{ governance.get('auditoria_24h', 0) }}

trazabilidad

Ver →

🔔 Alertas recientes

{% if recent_alertas %}
{% for a in recent_alertas %}

{{ a.Titulo }}

{{ a.Severidad }} · {{ a.Estado }} · {{ a.FechaCreacion }}

{{ a.Tipo }}
{% endfor %}
{% else %}

No hay alertas recientes

{% endif %} Ver todas →

🚫 Logins fallidos recientes

{% if recent_failed_logins %}
{% for l in recent_failed_logins %}

{{ l.Email }}

{{ l.IP }} · {{ l.TipoFallo or 'FALLO' }} · {{ l.FechaHora }}

{% endfor %}
{% else %}

No hay fallos recientes

{% endif %} Ver todos →

🧾 Auditoría reciente

{% if recent_audit %}
{% for r in recent_audit %}

{{ r.Accion }}

{{ r.TablaAfectada or '' }} {{ r.RegistroID or '' }} · Usuario {{ r.UsuarioID or '' }} · {{ r.FechaAccion }}

{% endfor %}
{% else %}

No hay auditoría reciente

{% endif %} Ver todo →

Actividad Reciente

{% if recent_activities %} {% for activity in recent_activities[:10] %}

{{ activity.accion }}

{{ activity.descripcion }}

{{ activity.fecha_accion.strftime('%d/%m/%Y %H:%M') if activity.fecha_accion else 'N/A' }}

{{ activity.tipo }}
{% endfor %} {% else %}

No hay actividad reciente

{% endif %}

Comentarios Pendientes

{{ stats.get('comentarios_pendientes', 0) }}

Requieren moderación

Ver todos →

💰 Ingresos del Mes

S/ {{ "{:,.2f}".format(stats.get('ingresos_mes', 0)) }}

Total de pagos

⭐ Calificación Promedio

{{ "{:.1f}".format(stats.get('calificacion_promedio', 0)) }}

De todas las empresas

{% endblock %} {% block scripts %} {{ super() }} {% if user_projection and user_projection.labels and user_projection.labels|length > 0 %} {% endif %} {% endblock %}