seaweedfs/weed/server/master_ui/templates.go

29 lines
579 B
Go
Raw Normal View History

2015-03-20 01:39:22 +08:00
package master_ui
import (
_ "embed"
2015-03-20 01:39:22 +08:00
"html/template"
"strings"
2015-03-20 01:39:22 +08:00
)
//go:embed master.html
var masterHtml string
2015-03-20 01:39:22 +08:00
2022-04-07 22:37:40 +08:00
//go:embed masterNewRaft.html
var masterNewRaftHtml string
var templateFunctions = template.FuncMap{
"url": func(input string) string {
if !strings.HasPrefix(input, "http://") && !strings.HasPrefix(input, "https://") {
return "http://" + input
}
return input
},
}
var StatusTpl = template.Must(template.New("status").Funcs(templateFunctions).Parse(masterHtml))
2022-04-07 22:37:40 +08:00
var StatusNewRaftTpl = template.Must(template.New("status").Parse(masterNewRaftHtml))