Merge branch 'master' into hotfix: Bring branch up to date

This commit is contained in:
Christoph Kluge
2023-06-23 10:41:59 +02:00
18 changed files with 113 additions and 92 deletions

View File

@@ -90,8 +90,8 @@ type Build struct {
type Page struct {
Title string // Page title
Error string // For generic use (e.g. the exact error message on /login)
Info string // For generic use (e.g. "Logout successfull" on /login)
MsgType string // For generic use in message boxes
Message string // For generic use in message boxes
User auth.User // Information about the currently logged in user (Full User Info)
Roles map[string]auth.Role // Available roles for frontend render checks
Build Build // Latest information about the application
@@ -104,8 +104,7 @@ type Page struct {
func RenderTemplate(rw http.ResponseWriter, r *http.Request, file string, page *Page) {
t, ok := templates[file]
if !ok {
log.Fatalf("WEB/WEB > template '%s' not found", file)
panic("template not found")
log.Errorf("WEB/WEB > template '%s' not found", file)
}
if page.Clusters == nil {
@@ -114,7 +113,7 @@ func RenderTemplate(rw http.ResponseWriter, r *http.Request, file string, page *
}
}
log.Infof("Page config : %v\n", page.Config)
log.Debugf("Page config : %v\n", page.Config)
if err := t.Execute(rw, page); err != nil {
log.Errorf("Template error: %s", err.Error())
}