Files
seaweedfs/weed/server/filer_ui/templates.go

26 lines
503 B
Go
Raw Normal View History

2021-04-22 14:21:11 -07:00
package filer_ui
2016-07-18 10:28:24 +02:00
import (
_ "embed"
2018-08-10 23:47:31 -07:00
"github.com/dustin/go-humanize"
"html/template"
2020-09-10 19:46:00 -07:00
"net/url"
"strings"
2016-07-18 10:28:24 +02:00
)
2020-09-10 19:46:00 -07:00
func printpath(parts ...string) string {
concat := strings.Join(parts, "")
escaped := url.PathEscape(concat)
return strings.ReplaceAll(escaped, "%2F", "/")
}
2018-08-10 23:47:31 -07:00
var funcMap = template.FuncMap{
"humanizeBytes": humanize.Bytes,
2020-09-10 19:46:00 -07:00
"printpath": printpath,
2018-08-10 23:47:31 -07:00
}
//go:embed filer.html
var filerHtml string
2018-08-19 18:42:40 -07:00
var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(filerHtml))