mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 10:07:24 +08:00
filer: UI ensure a correct foler link
This commit is contained in:
@@ -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
|
||||
|
@@ -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 }}
|
||||
|
Reference in New Issue
Block a user