<%- include('../partials/header') %> <% title = 'Panel de Administración'; %> <% const abiertosCount = stats.find(s => s.status === 'abierto') ? stats.find(s => s.status === 'abierto').total : 0; const progresoCount = stats.find(s => s.status === 'en_progreso') ? stats.find(s => s.status === 'en_progreso').total : 0; const cerradosCount = stats.find(s => s.status === 'cerrado') ? stats.find(s => s.status === 'cerrado').total : 0; %> <% if (success_msg && success_msg.length > 0) { %> <% success_msg.forEach(msg => { %> <% }) %> <% } %> <% if (error_msg && error_msg.length > 0) { %> <% error_msg.forEach(msg => { %> <% }) %> <% } %>
Equipo / Usuarios
<%= users.length %>
Cuentas activas en la empresa
Total Tickets
<%= tickets.length %>
Casos registrados
Departamentos
<%= departments.length %>
Áreas de atención configuradas
Tickets Pendientes
<%= abiertosCount %>
Abiertos sin resolución
Últimas Incidencias Registradas
Ver todos
<% if (tickets.length === 0) { %> <% } %> <% tickets.slice(0, 6).forEach(t => { %> <% }) %>
ID Asunto Estado Fecha Acción
No hay tickets registrados
#<%= t.id %>
<%= t.asunto %>
<%= t.usuario_nombre %>
<% if (t.status === 'abierto') { %> Abierto <% } else if (t.status === 'en_progreso') { %> En Progreso <% } else { %> Cerrado <% } %> <%= new Date(t.created_at).toLocaleDateString('es-ES') %>
Departamentos Activos
Gestionar
<% if (departments.length === 0) { %>

No hay departamentos creados aún.

<% } %> <% departments.forEach(dept => { %>
<%= dept.nombre %>
<%= dept.descripcion || 'Sin descripción' %>
Activo
<% }) %>
<%- include('../partials/footer') %>