package components import ( "context" "time" ) // LogEntry represents a log entry for display type LogEntry struct { Timestamp time.Time Level string Message string Source string Details map[string]interface{} } // LogViewerData represents the data for the log viewer component type LogViewerData struct { Logs []LogEntry CurrentFilter string LogFilePath string } // AdminLogs renders the log viewer page templ AdminLogs(ctx context.Context, data LogViewerData) { @LayoutWithContext("Log Viewer", ctx) {
Viewing logs from: { data.LogFilePath }
Real-time log streaming is active, logs are automatically captured and displayed
| Timestamp | Level | Source | Message |
|---|---|---|---|
| Waiting for logs... | |||
| { log.Timestamp.Format("2006-01-02 15:04:05.000") } | { log.Level } | { log.Source } | { log.Message } |