From 5f12b4914575d7f3f5589211a9695cb355a81e8e Mon Sep 17 00:00:00 2001 From: Lou Knauer Date: Thu, 3 Mar 2022 13:45:41 +0100 Subject: [PATCH] Fix monitoring routes titles Fixes ClusterCockpit/cc-frontend#19 --- routes.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/routes.go b/routes.go index 1d12f4d..0caeae2 100644 --- a/routes.go +++ b/routes.go @@ -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.(string), 1) + title = strings.Replace(route.Title, "", 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,