Added file count to HTML debug endpoint
This commit is contained in:
parent
4679208eae
commit
99ad647614
|
@ -74,5 +74,5 @@ func init() {
|
||||||
})
|
})
|
||||||
|
|
||||||
rootCmd.SetVersionTemplate("roulette v{{.Version}}\n")
|
rootCmd.SetVersionTemplate("roulette v{{.Version}}\n")
|
||||||
rootCmd.Version = "0.49.0"
|
rootCmd.Version = "0.49.1"
|
||||||
}
|
}
|
||||||
|
|
|
@ -631,6 +631,8 @@ func serveDebugHtml(args []string, index *Index) http.HandlerFunc {
|
||||||
|
|
||||||
indexDump := index.Index()
|
indexDump := index.Index()
|
||||||
|
|
||||||
|
fileCount := strconv.Itoa(len(indexDump))
|
||||||
|
|
||||||
sort.SliceStable(indexDump, func(p, q int) bool {
|
sort.SliceStable(indexDump, func(p, q int) bool {
|
||||||
return indexDump[p] < indexDump[q]
|
return indexDump[p] < indexDump[q]
|
||||||
})
|
})
|
||||||
|
@ -639,7 +641,9 @@ func serveDebugHtml(args []string, index *Index) http.HandlerFunc {
|
||||||
|
|
||||||
htmlBody.WriteString(`<!DOCTYPE html><html lang="en"><head>`)
|
htmlBody.WriteString(`<!DOCTYPE html><html lang="en"><head>`)
|
||||||
htmlBody.WriteString(`<style>a{display:block;height:100%;width:100%;text-decoration:none;color:inherit;cursor:auto;}</style>`)
|
htmlBody.WriteString(`<style>a{display:block;height:100%;width:100%;text-decoration:none;color:inherit;cursor:auto;}</style>`)
|
||||||
htmlBody.WriteString(`<title>Debug</title></head><body>`)
|
htmlBody.WriteString(`<title>Listing `)
|
||||||
|
htmlBody.WriteString(fileCount)
|
||||||
|
htmlBody.WriteString(` files</title></head><body>`)
|
||||||
for _, v := range indexDump {
|
for _, v := range indexDump {
|
||||||
var shouldSort = ""
|
var shouldSort = ""
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue