2022-03-26 13:23:39 +05:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2022-03-30 21:06:55 +05:00
|
|
|
"embed"
|
2022-03-26 13:23:39 +05:00
|
|
|
"html/template"
|
|
|
|
|
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
)
|
|
|
|
|
2022-03-30 21:06:55 +05:00
|
|
|
//go:embed webui/*
|
|
|
|
var siteFS embed.FS
|
2022-03-26 13:23:39 +05:00
|
|
|
|
2022-03-30 21:06:55 +05:00
|
|
|
var templates *template.Template
|
2022-03-26 13:23:39 +05:00
|
|
|
|
|
|
|
func initTemplate() {
|
|
|
|
var err error
|
2022-03-30 21:06:55 +05:00
|
|
|
templates, err = template.ParseFS(siteFS, "webui/*.htm")
|
2022-03-26 13:23:39 +05:00
|
|
|
if err != nil {
|
|
|
|
log.Fatalln("init template error:", err)
|
|
|
|
}
|
|
|
|
}
|