diff --git a/internal/endpoint/incidents_test.go b/internal/endpoint/incidents_test.go index a3ad2d51..5d592685 100644 --- a/internal/endpoint/incidents_test.go +++ b/internal/endpoint/incidents_test.go @@ -5,7 +5,7 @@ import ( ) func TestIncidentsHTMLEndpoint(t *testing.T) { - AssertEndpoint(t, "/incidents.html", "./testdata/incidents.html", `Reported by Ayd \(.+\)`) + AssertEndpoint(t, "/incidents.html", "./testdata/incidents.html", `Reported by Ayd \(.+\)|[0-9] years? ago`) } func TestIncidentsRSSEndpoint(t *testing.T) { diff --git a/internal/endpoint/log_test.go b/internal/endpoint/log_test.go index 7c334519..a6d4fdff 100644 --- a/internal/endpoint/log_test.go +++ b/internal/endpoint/log_test.go @@ -492,5 +492,5 @@ func TestLogCSVEndpoint(t *testing.T) { } func TestLogHTMLEndpoint(t *testing.T) { - AssertEndpoint(t, "/log.html?since=2021-01-01T00%3A00%3A00Z&until=2021-01-03T00%3A00%3A00Z", "./testdata/log.html", "") + AssertEndpoint(t, "/log.html?since=2021-01-01T00%3A00%3A00Z&until=2021-01-03T00%3A00%3A00Z", "./testdata/log.html", "[0-9] years? ago") } diff --git a/internal/endpoint/templates.go b/internal/endpoint/templates.go index 38d682fd..3d4ef9af 100644 --- a/internal/endpoint/templates.go +++ b/internal/endpoint/templates.go @@ -157,6 +157,7 @@ var ( type statusSummary struct { Status api.Status + Count int Percent float32 Cumulative float32 IsLast bool @@ -188,7 +189,7 @@ func (b *statusSummaryBuilder) Build() []statusSummary { result := make([]statusSummary, len(b.Count)) i := 0 for s, c := range b.Count { - result[i] = statusSummary{s, float32(c) * 100 / float32(b.Total), 0, false} + result[i] = statusSummary{s, c, float32(c) * 100 / float32(b.Total), 0, false} i++ } sort.Slice(result, func(i, j int) bool { diff --git a/internal/endpoint/templates/base.html b/internal/endpoint/templates/base.html index 7069e3e2..afa02092 100644 --- a/internal/endpoint/templates/base.html +++ b/internal/endpoint/templates/base.html @@ -7,12 +7,12 @@