Added first/last buttons to debug pages
This commit is contained in:
parent
189b7d269c
commit
c06b536123
15
cmd/debug.go
15
cmd/debug.go
|
@ -68,6 +68,7 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if pageLength != 0 {
|
if pageLength != 0 {
|
||||||
|
var firstPage int = 1
|
||||||
var lastPage int
|
var lastPage int
|
||||||
|
|
||||||
if fileCount%int(pageLength) == 0 {
|
if fileCount%int(pageLength) == 0 {
|
||||||
|
@ -80,11 +81,11 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl
|
||||||
var prevStatus, nextStatus string = "", ""
|
var prevStatus, nextStatus string = "", ""
|
||||||
|
|
||||||
if page <= 1 {
|
if page <= 1 {
|
||||||
prevStatus = "disabled"
|
prevStatus = " disabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
if page >= lastPage {
|
if page >= lastPage {
|
||||||
nextStatus = "disabled"
|
nextStatus = " disabled"
|
||||||
}
|
}
|
||||||
|
|
||||||
prevPage := page - 1
|
prevPage := page - 1
|
||||||
|
@ -97,13 +98,19 @@ func serveDebugHtml(args []string, index *Index, paginate bool) httprouter.Handl
|
||||||
nextPage = fileCount / int(pageLength)
|
nextPage = fileCount / int(pageLength)
|
||||||
}
|
}
|
||||||
|
|
||||||
htmlBody.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\" %s>Prev</button>",
|
htmlBody.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\">First</button>",
|
||||||
|
firstPage))
|
||||||
|
|
||||||
|
htmlBody.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\"%s>Prev</button>",
|
||||||
prevPage,
|
prevPage,
|
||||||
prevStatus))
|
prevStatus))
|
||||||
|
|
||||||
htmlBody.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\" %s>Next</button>",
|
htmlBody.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\"%s>Next</button>",
|
||||||
nextPage,
|
nextPage,
|
||||||
nextStatus))
|
nextStatus))
|
||||||
|
|
||||||
|
htmlBody.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\">Last</button>",
|
||||||
|
lastPage))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Version string = "0.66.1"
|
Version string = "0.66.2"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Reference in New Issue