mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 04:51:39 +02:00
Merge branch 'master' into hotfix: Bring branch up to date
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
Reference in New Issue
Block a user