Browse Source

directory can paginate

pull/5743/head
chrislu 6 months ago
parent
commit
69003d0e90
  1. 3
      weed/server/filer_ui/filer.html
  2. 12
      weed/server/filer_ui/templates.go

3
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>&nbsp;
<a href="{{ printpath $path "/" $entry.Name "/"}}" >
<a href="{{ printpath $path "/" $entry.Name "/" "?" "limit" "=" }}{{ print $limit }}" >
{{ $entry.Name }}
</a>
{{ else }}

12
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{

Loading…
Cancel
Save