From c06b5361230f8a09672d5c9a947fd8a5e7becba6 Mon Sep 17 00:00:00 2001 From: Seednode Date: Mon, 11 Sep 2023 14:37:59 -0500 Subject: [PATCH] Added first/last buttons to debug pages --- cmd/debug.go | 15 +++++++++++---- cmd/root.go | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/cmd/debug.go b/cmd/debug.go index e462950..d21071e 100644 --- a/cmd/debug.go +++ b/cmd/debug.go @@ -68,6 +68,7 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl } } if pageLength != 0 { + var firstPage int = 1 var lastPage int if fileCount%int(pageLength) == 0 { @@ -80,11 +81,11 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl var prevStatus, nextStatus string = "", "" if page <= 1 { - prevStatus = "disabled" + prevStatus = " disabled" } if page >= lastPage { - nextStatus = "disabled" + nextStatus = " disabled" } prevPage := page - 1 @@ -97,13 +98,19 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl nextPage = fileCount / int(pageLength) } - htmlBody.WriteString(fmt.Sprintf("", + htmlBody.WriteString(fmt.Sprintf("", + firstPage)) + + htmlBody.WriteString(fmt.Sprintf("", prevPage, prevStatus)) - htmlBody.WriteString(fmt.Sprintf("", + htmlBody.WriteString(fmt.Sprintf("", nextPage, nextStatus)) + + htmlBody.WriteString(fmt.Sprintf("", + lastPage)) } } diff --git a/cmd/root.go b/cmd/root.go index 7a057cd..f1f79b5 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -12,7 +12,7 @@ import ( ) const ( - Version string = "0.66.1" + Version string = "0.66.2" ) var (