2015-03-20 01:39:22 +08:00
|
|
|
package master_ui
|
|
|
|
|
|
|
|
import (
|
2021-07-05 18:09:44 +08:00
|
|
|
_ "embed"
|
2015-03-20 01:39:22 +08:00
|
|
|
"html/template"
|
2024-11-16 03:25:18 +08:00
|
|
|
"strings"
|
2015-03-20 01:39:22 +08:00
|
|
|
)
|
|
|
|
|
2021-07-05 18:09:44 +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
|
|
|
|
|
2024-11-16 03:25:18 +08:00
|
|
|
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))
|