Add buildInfo to frontend footer

This commit is contained in:
Christoph Kluge
2022-09-27 09:56:17 +02:00
parent d1fefe16a3
commit 24f9d4f934
5 changed files with 46 additions and 11 deletions

View File

@@ -253,7 +253,7 @@ func buildFilterPresets(query url.Values) map[string]interface{} {
return filterPresets
}
func SetupRoutes(router *mux.Router) {
func SetupRoutes(router *mux.Router, version string, hash string, buildTime string) {
userCfgRepo := repository.GetUserCfgRepo()
for _, route := range routes {
route := route
@@ -271,7 +271,7 @@ func SetupRoutes(router *mux.Router) {
}
username, isAdmin, isSupporter := "", true, true
if user := auth.GetUser(r.Context()); user != nil {
username = user.Username
isAdmin = user.HasRole(auth.RoleAdmin)
@@ -281,6 +281,7 @@ func SetupRoutes(router *mux.Router) {
page := web.Page{
Title: title,
User: web.User{Username: username, IsAdmin: isAdmin, IsSupporter: isSupporter},
Build: web.Build{Version: version, Hash: hash, Buildtime: buildTime},
Config: conf,
Infos: infos,
}