diff --git a/pkg/srv/interceptor.go b/pkg/srv/interceptor.go index 5e22ccb..1b717fc 100644 --- a/pkg/srv/interceptor.go +++ b/pkg/srv/interceptor.go @@ -41,6 +41,7 @@ func (s *statusInterceptor) Status() int { type dirContents struct { AllPaths []string `xml:"a"` + Base string `xml:"-"` Dirs dirs `xml:"-"` Files files `xml:"-"` } @@ -97,6 +98,7 @@ func (r *responseInterceptor) GetPaths(path string, fs *fs.FS) (dc dirContents, if err != nil { return } + dc.Base = path path = strings.TrimSuffix(path, "/") for _, p := range dc.AllPaths { p = strings.ReplaceAll(p, "&", "&") diff --git a/pkg/srv/templates.go b/pkg/srv/templates.go index a8434c4..862e297 100644 --- a/pkg/srv/templates.go +++ b/pkg/srv/templates.go @@ -6,13 +6,16 @@ import "html/template" var ( index = template.Must(template.New("index").Parse(` - + + + + cachefs | {{.Base}}