diff options
| author | chrislu <chris.lu@gmail.com> | 2024-07-02 21:36:01 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-07-02 21:36:03 -0700 |
| commit | 69003d0e906e098cf6db11da05d915d0718a5eba (patch) | |
| tree | 0565070e635f75a2783c3a56bc2136a6e41df5a2 | |
| parent | f9eedc9c72176e5425409d58adc7cf2adddd0d4e (diff) | |
| download | seaweedfs-69003d0e906e098cf6db11da05d915d0718a5eba.tar.xz seaweedfs-69003d0e906e098cf6db11da05d915d0718a5eba.zip | |
directory can paginate
| -rw-r--r-- | weed/server/filer_ui/filer.html | 3 | ||||
| -rw-r--r-- | 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 }} <table width="100%" class="table table-hover"> {{ $path := .Path }} + {{ $limit := .Limit }} {{ $showDirDel := .ShowDirectoryDelete }} {{ range $entry_index, $entry := .Entries }} <tr> <td> {{ if $entry.IsDirectory }} <span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span> - <a href="{{ printpath $path "/" $entry.Name "/"}}" > + <a href="{{ printpath $path "/" $entry.Name "/" "?" "limit" "=" }}{{ print $limit }}" > {{ $entry.Name }} </a> {{ 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{ |
