Event log: show attempt and delivery times, label replays, zone event times (closes #386)
check / check (push) Successful in 3m19s
check / check (push) Successful in 3m19s
Each attempt shows when it was recorded and each delivery when it was created, in the event log and on the event's page. The event log's event times read as the recent events list does: how long ago, with the full UTC time on hover. A delivery records whether Replay created it, in a new replay column added to the delivery model in place. Such a delivery is labelled a replay in the event's summary line and in both pages' delivery lists. Model: opus-5-5
This commit is contained in:
@@ -3,6 +3,8 @@ package handlers
|
||||
import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/dustin/go-humanize"
|
||||
)
|
||||
|
||||
// eventLogColumns is the event log's projection. The casts to
|
||||
@@ -28,10 +30,14 @@ const eventColumns = "id, created_at, method, content_type, " +
|
||||
// DeliveryView and TargetView.
|
||||
type EventLogView struct {
|
||||
ID string
|
||||
CreatedAt time.Time
|
||||
Method string
|
||||
ContentType string
|
||||
|
||||
// Received is how long ago the event arrived, and ReceivedUTC
|
||||
// the full timestamp.
|
||||
Received string
|
||||
ReceivedUTC string
|
||||
|
||||
Body BodyView
|
||||
|
||||
// ResubmittedFromID names the event this one was copied
|
||||
@@ -77,9 +83,10 @@ func (r *eventLogRow) view(webhookID string) EventLogView {
|
||||
|
||||
return EventLogView{
|
||||
ID: r.ID,
|
||||
CreatedAt: r.CreatedAt,
|
||||
Method: r.Method,
|
||||
ContentType: r.ContentType,
|
||||
Received: humanize.Time(r.CreatedAt),
|
||||
ReceivedUTC: r.CreatedAt.UTC().Format(time.DateTime) + " UTC",
|
||||
Body: newBodyView(
|
||||
"/hook/"+webhookID+"/events/"+r.ID, r.Body, r.BodyBytes,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user