<%= title %>

System activity and change tracking

<% if (auditLogs && auditLogs.length > 0) { %>
Showing <%= ((pagination.current - 1) * pagination.limit) + 1 %> - <%= Math.min(pagination.current * pagination.limit, pagination.totalCount) %> of <%= pagination.totalCount %> audit logs <% if (pagination.totalCount > pagination.limit) { %> <%= pagination.total %> pages <% } %>
<% auditLogs.forEach((log, index) => { %> <% }); %>
Date/Time Model Action User Changes IP Address Actions
<%= new Date(log.createdAt).toLocaleDateString() %>
<%= new Date(log.createdAt).toLocaleTimeString() %>
<%= log.model %> <% let actionStyle = 'background-color: var(--primary-color); color: white;'; if (log.action.includes('CREATE')) actionStyle = 'background-color: #28a745; color: white;'; else if (log.action.includes('UPDATE')) actionStyle = 'background-color: #ffc107; color: #212529;'; else if (log.action.includes('DELETE')) actionStyle = 'background-color: #dc3545; color: white;'; %> <%= log.action %> <% if (log.performedBy) { %>
<%= log.performedBy.username %>
<%= log.performedBy.email %>
<% } else { %> System <% } %>
<% if (log.changes && log.changes.length > 0) { %> <%= log.changes.length %> field<%= log.changes.length > 1 ? 's' : '' %>
<% log.changes.slice(0, 3).forEach(change => { %> <%= change.field %> <% }); %> <% if (log.changes.length > 3) { %> +<%= log.changes.length - 3 %> more... <% } %>
<% } else { %> - <% } %>
<%= log.ipAddress %>
<% if (pagination && pagination.total > 1) { %> <% } %> <% } else { %>
No Audit Logs Found

No audit logs match your current filters.

Clear Filters
<% } %>