You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
579 B
28 lines
579 B
package master_ui
|
|
|
|
import (
|
|
_ "embed"
|
|
"html/template"
|
|
"strings"
|
|
)
|
|
|
|
//go:embed master.html
|
|
var masterHtml string
|
|
|
|
//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))
|
|
|
|
var StatusNewRaftTpl = template.Must(template.New("status").Parse(masterNewRaftHtml))
|