[#137] Add index page support
Some checks failed
/ DCO (pull_request) Successful in 57s
/ Builds (pull_request) Successful in 57s
/ Vulncheck (pull_request) Successful in 1m9s
/ Lint (pull_request) Failing after 1m33s
/ Tests (pull_request) Successful in 1m6s

Signed-off-by: Nikita Zinkevich <n.zinkevich@yadro.com>
This commit is contained in:
Nikita Zinkevich 2024-09-20 15:20:46 +03:00
parent 7b07002269
commit 21d9946f76
2 changed files with 4 additions and 6 deletions

2
go.mod
View file

@ -8,6 +8,7 @@ require (
git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240718141740-ce8270568d36 git.frostfs.info/TrueCloudLab/frostfs-sdk-go v0.0.0-20240718141740-ce8270568d36
git.frostfs.info/TrueCloudLab/zapjournald v0.0.0-20240124114243-cb2e66427d02 git.frostfs.info/TrueCloudLab/zapjournald v0.0.0-20240124114243-cb2e66427d02
github.com/bluele/gcache v0.0.2 github.com/bluele/gcache v0.0.2
github.com/docker/go-units v0.4.0
github.com/fasthttp/router v1.4.1 github.com/fasthttp/router v1.4.1
github.com/nspcc-dev/neo-go v0.106.2 github.com/nspcc-dev/neo-go v0.106.2
github.com/prometheus/client_golang v1.19.0 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/distribution v2.8.1+incompatible // indirect
github.com/docker/docker v20.10.14+incompatible // indirect github.com/docker/docker v20.10.14+incompatible // indirect
github.com/docker/go-connections v0.4.0 // 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/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-logr/logr v1.2.4 // indirect github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect

View file

@ -1,6 +1,7 @@
package handler package handler
import ( import (
"cmp"
"html/template" "html/template"
"path" "path"
"strconv" "strconv"
@ -92,10 +93,7 @@ func (h *Handler) browseObjects(c *fasthttp.RequestCtx, bucketName, prefix strin
return 1 return 1
} }
if a.FileName < b.FileName { return cmp.Compare(a.FileName, b.FileName)
return -1
}
return 1
}) })
templatePath := h.config.IndexPageTemplatePath() templatePath := h.config.IndexPageTemplatePath()