From dd20e00672ecebaef0871026d0b65f96127f7ad7 Mon Sep 17 00:00:00 2001 From: Chris Hager Date: Sat, 15 Jun 2024 11:14:50 +0200 Subject: [PATCH] Website: show time since last data (#44) * website: time since fix * website: time since in new line * pre-render time since --- services/website/html.go | 2 + services/website/templates/index.html | 84 +++++++++++++++------------ 2 files changed, 48 insertions(+), 38 deletions(-) diff --git a/services/website/html.go b/services/website/html.go index daa013a..e19dc0f 100644 --- a/services/website/html.go +++ b/services/website/html.go @@ -5,6 +5,7 @@ import ( "text/template" "time" + "github.com/dustin/go-humanize" "github.com/flashbots/relayscan/database" ) @@ -63,6 +64,7 @@ var funcMap = template.FuncMap{ "relayTable": relayTable, "builderTable": builderTable, "builderProfitTable": builderProfitTable, + "humanTime": humanize.Time, } func ParseIndexTemplate() (*template.Template, error) { diff --git a/services/website/templates/index.html b/services/website/templates/index.html index 0eb008f..6d88c81 100644 --- a/services/website/templates/index.html +++ b/services/website/templates/index.html @@ -6,10 +6,12 @@

MEV-Boost Analytics

- -

- Updated {{ .LastDataTimeString }} UTC / Slot {{ .LastUpdateSlot }} / 7 minutes ago
+

+ + Updated {{ .LastDataTimeString }} UTC / Slot {{ .LastUpdateSlot }}
+ ({{ .LastDataTime | humanTime }}) +

Overview @@ -170,6 +172,47 @@

MEV-Boost Analytics