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 {
|
func importIndex(args []string, index *fileIndex, formats types.Types) error {
|
||||||
skipIndex := false
|
|
||||||
|
|
||||||
if IndexFile != "" {
|
if IndexFile != "" {
|
||||||
err := index.Import(IndexFile)
|
err := index.Import(IndexFile)
|
||||||
if err == nil {
|
if err != nil {
|
||||||
skipIndex = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !skipIndex {
|
|
||||||
_, err := fileList(args, &filters{}, "", index, formats)
|
_, err := fileList(args, &filters{}, "", index, formats)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
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("<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))
|
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,
|
prevPage,
|
||||||
prevStatus))
|
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,
|
nextPage,
|
||||||
nextStatus))
|
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))
|
lastPage))
|
||||||
|
|
||||||
html.WriteString("</td></tr>\n")
|
html.WriteString("</td></tr>\n")
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ReleaseVersion string = "3.0.0"
|
ReleaseVersion string = "3.0.1"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Reference in New Issue