[#137] Add index page support
Signed-off-by: Nikita Zinkevich <n.zinkevich@yadro.com>
This commit is contained in:
parent
7b07002269
commit
0c2f170252
2 changed files with 3 additions and 6 deletions
2
go.mod
2
go.mod
|
@ -8,6 +8,7 @@ require (
|
|||
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240718141740-ce8270568d36
|
||||
git.frostfs.info/TrueCloudLab/zapjournald v0.0.0-20240124114243-cb2e66427d02
|
||||
github.com/bluele/gcache v0.0.2
|
||||
github.com/docker/go-units v0.4.0
|
||||
github.com/fasthttp/router v1.4.1
|
||||
github.com/nspcc-dev/neo-go v0.106.2
|
||||
github.com/prometheus/client_golang v1.19.0
|
||||
|
@ -49,7 +50,6 @@ require (
|
|||
github.com/docker/distribution v2.8.1+incompatible // indirect
|
||||
github.com/docker/docker v20.10.14+incompatible // indirect
|
||||
github.com/docker/go-connections v0.4.0 // indirect
|
||||
github.com/docker/go-units v0.4.0 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/go-logr/logr v1.2.4 // indirect
|
||||
github.com/go-logr/stdr v1.2.2 // indirect
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"cmp"
|
||||
"html/template"
|
||||
"path"
|
||||
"strconv"
|
||||
|
@ -91,11 +92,7 @@ func (h *Handler) browseObjects(c *fasthttp.RequestCtx, bucketName, prefix strin
|
|||
} else if !aIsDir && bIsDir {
|
||||
return 1
|
||||
}
|
||||
|
||||
if a.FileName < b.FileName {
|
||||
return -1
|
||||
}
|
||||
return 1
|
||||
return cmp.Compare(a.FileName, b.FileName)
|
||||
})
|
||||
|
||||
templatePath := h.config.IndexPageTemplatePath()
|
||||
|
|
Loading…
Reference in a new issue