feat: add webhook event history UI page
All checks were successful
Check / check (pull_request) Successful in 5s

Add a per-app webhook event history page at /apps/{id}/webhooks that
displays received webhook events with their match/no-match status,
event type, branch, commit SHA (linked to commit URL when available),
and timestamp.

Changes:
- Add webhook_events.html template following existing UI patterns
- Add HandleAppWebhookEvents handler in webhook_events.go
- Register GET /apps/{id}/webhooks route
- Register webhook_events.html in template cache
- Add ShortCommit() method to WebhookEvent model
- Add 'Event History' link to app detail Webhook URL section
This commit is contained in:
clawbot
2026-03-10 04:19:18 -07:00
parent 49ff625ac4
commit e3bd3202bb
6 changed files with 155 additions and 1 deletions

View File

@@ -52,6 +52,20 @@ func (w *WebhookEvent) Reload(ctx context.Context) error {
return w.scan(row)
}
// ShortCommit returns a truncated commit SHA for display.
func (w *WebhookEvent) ShortCommit() string {
if !w.CommitSHA.Valid {
return ""
}
sha := w.CommitSHA.String
if len(sha) > shortCommitLength {
return sha[:shortCommitLength]
}
return sha
}
func (w *WebhookEvent) insert(ctx context.Context) error {
query := `
INSERT INTO webhook_events (