From 14939090d50d8d6a2dd80dee31d55aff60e61d28 Mon Sep 17 00:00:00 2001 From: whoswhip Date: Sat, 5 Dec 2026 16:40:42 -0500 Subject: [PATCH] show inf when displaying storage limit and there is no limit --- internal/pages/pages.go | 1 + readme.md | 2 +- web/templates/home.html | 10 +++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/internal/pages/pages.go b/internal/pages/pages.go index a04502b..cddc929 100644 --- a/internal/pages/pages.go +++ b/internal/pages/pages.go @@ -117,6 +117,7 @@ func HomeHandler(pages *Pages, cfg config.Config) http.HandlerFunc { } if cfg.DisplayStorageLimit { + data["DisplayStorageLimit"] = true data["StorageLimit"] = humanize.Bytes(uint64(cfg.MaxStorageUsage)) } if cfg.DisplayStorageUsage { diff --git a/readme.md b/readme.md index 85c9379..bb9759f 100644 --- a/readme.md +++ b/readme.md @@ -23,7 +23,7 @@ goals: - [ ] on startup - [ ] on upload failure - [ ] on admin action - - [ ] display inf/unlimited/∞ on the home page when 0 + - [x] display inf/unlimited/∞ on the home page when 0 - [ ] size based expiry - exclusions if below a certain size (like 5mb) - [ ] prometheus metrics diff --git a/web/templates/home.html b/web/templates/home.html index 279922b..5bbbab5 100644 --- a/web/templates/home.html +++ b/web/templates/home.html @@ -30,7 +30,15 @@ {{if or .StorageUsage .StorageLimit}} - {{.StorageUsage}}{{if .StorageLimit}} / {{.StorageLimit}}{{end}} used + + {{.StorageUsage}} + {{if .DisplayStorageLimit}} / + {{if .StorageLimit}} + inf + {{else}} + {{.StorageLimit}} + {{end}} + {{end}} used {{end}}