From d34a7d3def91fb614fb657b81ff8265f19e078c8 Mon Sep 17 00:00:00 2001 From: Shulhan Date: Thu, 7 Aug 2025 00:58:33 +0700 Subject: _www: improve the layout a little bit Add a background color for section "Service status" and "Down history" to highlight it with other text. Add background color for service that is down in "Service status". --- _www/index.tmpl | 36 ++++++++++++++++++++---------------- server.go | 6 ++++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/_www/index.tmpl b/_www/index.tmpl index 614b67c..8fcaa9a 100644 --- a/_www/index.tmpl +++ b/_www/index.tmpl @@ -6,7 +6,12 @@ {{.Title}} -

{{.Title}}

+

{{.Title}}

-

Service status

+

Service status

At @@ -44,23 +53,18 @@ Error
{{ range.Services }} -
- {{if .Last.At}}{{.Last.At}}{{ end }} + {{ $status := statusString .Last.Success }} +
+ {{.Last.At}} {{.Name}} - - {{if .Last.Success}} - UP - {{else}} - DOWN - {{ end }} - - {{if .Last.Error}}{{ .Last.Error }}{{ end }} + {{ $status }} + {{ .Last.Error }}
{{ end }}
-

Down history

-
+

Down history

+
At Service diff --git a/server.go b/server.go index 1741c27..ef8fabf 100644 --- a/server.go +++ b/server.go @@ -113,6 +113,12 @@ func (srv *Server) initTemplate() (err error) { } return ver }, + `statusString`: func(success bool) string { + if success { + return "UP" + } + return "DOWN" + }, }) var tmplraw []byte -- cgit v1.3