mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-12-29 20:47:54 +08:00
62c29b2398
This reverts commit 69003d0e90
.
26 lines
503 B
Go
26 lines
503 B
Go
package filer_ui
|
|
|
|
import (
|
|
_ "embed"
|
|
"github.com/dustin/go-humanize"
|
|
"html/template"
|
|
"net/url"
|
|
"strings"
|
|
)
|
|
|
|
func printpath(parts ...string) string {
|
|
concat := strings.Join(parts, "")
|
|
escaped := url.PathEscape(concat)
|
|
return strings.ReplaceAll(escaped, "%2F", "/")
|
|
}
|
|
|
|
var funcMap = template.FuncMap{
|
|
"humanizeBytes": humanize.Bytes,
|
|
"printpath": printpath,
|
|
}
|
|
|
|
//go:embed filer.html
|
|
var filerHtml string
|
|
|
|
var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(filerHtml))
|