mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
filer: UI ensure a correct foler link
This commit is contained in:
parent
4cba32d1d0
commit
1f400489c6
|
@ -14,10 +14,14 @@ func ToBreadcrumb(fullpath string) (crumbs []Breadcrumb) {
|
||||||
parts := strings.Split(fullpath, "/")
|
parts := strings.Split(fullpath, "/")
|
||||||
|
|
||||||
for i := 0; i < len(parts); i++ {
|
for i := 0; i < len(parts); i++ {
|
||||||
crumbs = append(crumbs, Breadcrumb{
|
crumb := Breadcrumb{
|
||||||
Name: parts[i] + "/",
|
Name: parts[i] + " /",
|
||||||
Link: "/" + filepath.ToSlash(filepath.Join(parts[0:i+1]...)),
|
Link: "/" + filepath.ToSlash(filepath.Join(parts[0:i+1]...)),
|
||||||
})
|
}
|
||||||
|
if !strings.HasSuffix(crumb.Link, "/") {
|
||||||
|
crumb.Link += "/"
|
||||||
|
}
|
||||||
|
crumbs = append(crumbs, crumb)
|
||||||
}
|
}
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
|
@ -50,7 +50,7 @@ var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`<!DOC
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div>
|
<div>
|
||||||
{{ range $entry := .Breadcrumbs }}
|
{{ range $entry := .Breadcrumbs }}
|
||||||
<a href={{ $entry.Link }} >
|
<a href="{{ $entry.Link }}" >
|
||||||
{{ $entry.Name }}
|
{{ $entry.Name }}
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in a new issue