Browse Source

filer: UI ensure a correct foler link

pull/1158/head
Chris Lu 5 years ago
parent
commit
1f400489c6
  1. 10
      weed/server/filer_ui/breadcrumb.go
  2. 2
      weed/server/filer_ui/templates.go

10
weed/server/filer_ui/breadcrumb.go

@ -14,10 +14,14 @@ func ToBreadcrumb(fullpath string) (crumbs []Breadcrumb) {
parts := strings.Split(fullpath, "/")
for i := 0; i < len(parts); i++ {
crumbs = append(crumbs, Breadcrumb{
Name: parts[i] + "/",
crumb := Breadcrumb{
Name: parts[i] + " /",
Link: "/" + filepath.ToSlash(filepath.Join(parts[0:i+1]...)),
})
}
if !strings.HasSuffix(crumb.Link, "/") {
crumb.Link += "/"
}
crumbs = append(crumbs, crumb)
}
return

2
weed/server/filer_ui/templates.go

@ -50,7 +50,7 @@ var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`<!DOC
<div class="row">
<div>
{{ range $entry := .Breadcrumbs }}
<a href={{ $entry.Link }} >
<a href="{{ $entry.Link }}" >
{{ $entry.Name }}
</a>
{{ end }}

Loading…
Cancel
Save