From 99ad647614ebd24db42014ef74016cbeae6e8259 Mon Sep 17 00:00:00 2001 From: Seednode Date: Fri, 2 Jun 2023 21:00:44 -0500 Subject: [PATCH] Added file count to HTML debug endpoint --- cmd/root.go | 2 +- cmd/web.go | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index d57a4ea..93c3d8b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -74,5 +74,5 @@ func init() { }) rootCmd.SetVersionTemplate("roulette v{{.Version}}\n") - rootCmd.Version = "0.49.0" + rootCmd.Version = "0.49.1" } diff --git a/cmd/web.go b/cmd/web.go index ce44c07..4c92a42 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -631,6 +631,8 @@ func serveDebugHtml(args []string, index *Index) http.HandlerFunc { indexDump := index.Index() + fileCount := strconv.Itoa(len(indexDump)) + sort.SliceStable(indexDump, func(p, q int) bool { return indexDump[p] < indexDump[q] }) @@ -639,7 +641,9 @@ func serveDebugHtml(args []string, index *Index) http.HandlerFunc { htmlBody.WriteString(``) htmlBody.WriteString(``) - htmlBody.WriteString(`Debug`) + htmlBody.WriteString(`Listing `) + htmlBody.WriteString(fileCount) + htmlBody.WriteString(` files`) for _, v := range indexDump { var shouldSort = ""