Fix prev/next buttons for info pages, add support for --prefix to the same
This commit is contained in:
parent
81d7e60d0c
commit
dec38c8758
10
cmd/index.go
10
cmd/index.go
|
@ -184,21 +184,15 @@ func registerIndexHandlers(mux *httprouter.Router, args []string, index *fileInd
|
|||
}
|
||||
|
||||
func importIndex(args []string, index *fileIndex, formats types.Types) error {
|
||||
skipIndex := false
|
||||
|
||||
if IndexFile != "" {
|
||||
err := index.Import(IndexFile)
|
||||
if err == nil {
|
||||
skipIndex = true
|
||||
}
|
||||
}
|
||||
|
||||
if !skipIndex {
|
||||
if err != nil {
|
||||
_, err := fileList(args, &filters{}, "", index, formats)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
12
cmd/info.go
12
cmd/info.go
|
@ -57,18 +57,22 @@ func paginate(page int, fileCount int, ending bool) string {
|
|||
html.WriteString("<tr><td>")
|
||||
}
|
||||
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\">First</button>",
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '%s/index/html/%d';\">First</button>",
|
||||
Prefix,
|
||||
firstPage))
|
||||
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\"%s>Prev</button>",
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '%s/index/html/%d';\"%s>Prev</button>",
|
||||
Prefix,
|
||||
prevPage,
|
||||
prevStatus))
|
||||
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\"%s>Next</button>",
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '%s/index/html/%d';\"%s>Next</button>",
|
||||
Prefix,
|
||||
nextPage,
|
||||
nextStatus))
|
||||
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '/html/%d';\">Last</button>",
|
||||
html.WriteString(fmt.Sprintf("<button onclick=\"window.location.href = '%s/index/html/%d';\">Last</button>",
|
||||
Prefix,
|
||||
lastPage))
|
||||
|
||||
html.WriteString("</td></tr>\n")
|
||||
|
|
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
ReleaseVersion string = "3.0.0"
|
||||
ReleaseVersion string = "3.0.1"
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
Loading…
Reference in New Issue