From a74149f4ef1a6bc7cb8bb09b4e606d1761326f90 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Wed, 7 Dec 2022 11:02:57 +0100 Subject: [PATCH] home: Hide specific instances from home page --- internal/dis/component/control/home/home.html | 2 +- internal/status/wisski.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/dis/component/control/home/home.html b/internal/dis/component/control/home/home.html index 7202932..99519a8 100644 --- a/internal/dis/component/control/home/home.html +++ b/internal/dis/component/control/home/home.html @@ -20,7 +20,7 @@ {{range .Instances}} - {{ if .Running }} + {{ if and .Running (not .NoPrefixes) }}

{{.Slug}}

diff --git a/internal/status/wisski.go b/internal/status/wisski.go index c494cd3..7974a18 100644 --- a/internal/status/wisski.go +++ b/internal/status/wisski.go @@ -87,6 +87,10 @@ type LastEdit struct { func (bs BundleStatistics) LastEdit() (le LastEdit) { for _, bundle := range bs.Bundles { time := bundle.LastEdit.Time() + // skip invalid times + if time.Unix() <= 0 { + continue + } if time.After(le.Time) { le.Valid = true le.Time = time