Abstracts database storage & Status page UI (#88)

This commit is contained in:
Georgios Komninos 2021-08-28 15:10:30 +02:00 committed by GitHub
parent 7bb80c0c2e
commit b7c0990dcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 456 additions and 256 deletions

View file

@ -74,12 +74,18 @@ func New(tmplBox *rice.Box, extraData map[string]string, secret []byte) *echo.Ec
log.Fatal(err)
}
tmplStatusString, err := tmplBox.String("status.html")
if err != nil {
log.Fatal(err)
}
// create template list
templates := make(map[string]*template.Template)
templates["login.html"] = template.Must(template.New("login").Parse(tmplLoginString))
templates["clients.html"] = template.Must(template.New("clients").Parse(tmplBaseString + tmplClientsString))
templates["server.html"] = template.Must(template.New("server").Parse(tmplBaseString + tmplServerString))
templates["global_settings.html"] = template.Must(template.New("global_settings").Parse(tmplBaseString + tmplGlobalSettingsString))
templates["status.html"] = template.Must(template.New("status").Parse(tmplBaseString + tmplStatusString))
e.Logger.SetLevel(log.DEBUG)
e.Pre(middleware.RemoveTrailingSlash())