package components import ( "context" "fmt" "time" ) // AuditLogEntry represents an audit log entry for display type AuditLogEntry struct { ID uint Action string EntityType string EntityID uint Username string UserID uint Timestamp time.Time Details map[string]interface{} DetailsSummary string } type AuditLogsData struct { Logs []AuditLogEntry TotalPages int CurrentPage int TotalRecords int FilterAction string FilterEntity string FilterUser string FilterDateFrom string FilterDateTo string } // AdminAuditLogs renders the audit logs page templ AdminAuditLogs(ctx context.Context, data AuditLogsData) { @LayoutWithContext("Audit Logs", ctx) {
| Timestamp | User | Action | Entity | Details |
|---|---|---|---|---|
| No audit logs found matching your filters. | ||||
| {log.Timestamp.Format("2006-01-02 15:04:05")} | {log.Username} | {log.Action} | {log.EntityType} (ID: {fmt.Sprint(log.EntityID)}) | |