System activity and change tracking
| 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 %>
<% } else { %>
System
<% } %>
<%= log.performedBy.email %> |
<% 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 %> |