From 69003d0e906e098cf6db11da05d915d0718a5eba Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 2 Jul 2024 21:36:01 -0700 Subject: [PATCH] directory can paginate --- weed/server/filer_ui/filer.html | 3 ++- weed/server/filer_ui/templates.go | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/weed/server/filer_ui/filer.html b/weed/server/filer_ui/filer.html index 28425f180..95de799d8 100644 --- a/weed/server/filer_ui/filer.html +++ b/weed/server/filer_ui/filer.html @@ -116,13 +116,14 @@ {{ else }} {{ $path := .Path }} + {{ $limit := .Limit }} {{ $showDirDel := .ShowDirectoryDelete }} {{ range $entry_index, $entry := .Entries }}
{{ if $entry.IsDirectory }}   - + {{ $entry.Name }} {{ else }} diff --git a/weed/server/filer_ui/templates.go b/weed/server/filer_ui/templates.go index f9ef064bc..4a1822d7e 100644 --- a/weed/server/filer_ui/templates.go +++ b/weed/server/filer_ui/templates.go @@ -9,9 +9,15 @@ import ( ) func printpath(parts ...string) string { - concat := strings.Join(parts, "") - escaped := url.PathEscape(concat) - return strings.ReplaceAll(escaped, "%2F", "/") + var escapedParts []string + for _, p := range parts { + if len(p) == 1 { + escapedParts = append(escapedParts, p) + } else { + escapedParts = append(escapedParts, url.PathEscape(p)) + } + } + return strings.Join(escapedParts, "") } var funcMap = template.FuncMap{