Fix monitoring routes titles

Fixes ClusterCockpit/cc-frontend#19
This commit is contained in:
Lou Knauer 2022-03-03 13:45:41 +01:00
parent 7e468a7b8d
commit 5f12b49145

View File

@ -100,9 +100,10 @@ func setupRoutes(router *mux.Router, routes []Route) {
return
}
title := route.Title
infos := route.Setup(map[string]interface{}{}, r)
if id, ok := infos["id"]; ok {
route.Title = strings.Replace(route.Title, "<ID>", id.(string), 1)
title = strings.Replace(route.Title, "<ID>", id.(string), 1)
}
username, isAdmin := "", true
@ -112,7 +113,7 @@ func setupRoutes(router *mux.Router, routes []Route) {
}
page := templates.Page{
Title: route.Title,
Title: title,
User: templates.User{Username: username, IsAdmin: isAdmin},
Config: conf,
Infos: infos,