From e8c6a7d58933dbc0566826e9de4dbff6b6a3627a Mon Sep 17 00:00:00 2001 From: Lou Knauer Date: Thu, 3 Feb 2022 10:42:15 +0100 Subject: [PATCH] Add /monitoring/analysis route --- server.go | 6 ++++++ templates/home.tmpl | 4 ++-- templates/monitoring/analysis.tmpl | 15 +++++++++++++++ templates/templates.go | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 templates/monitoring/analysis.tmpl diff --git a/server.go b/server.go index cf6c745..8ec2770 100644 --- a/server.go +++ b/server.go @@ -160,6 +160,11 @@ func setupNodeRoute(i InfoType, r *http.Request) InfoType { return i } +func setupAnalysisRoute(i InfoType, r *http.Request) InfoType { + i["cluster"] = mux.Vars(r)["cluster"] + return i +} + var routes []Route = []Route{ {"/monitoring/jobs/", "monitoring/jobs.tmpl", "Jobs - ClusterCockpit", true, func(i InfoType, r *http.Request) InfoType { return i }}, {"/monitoring/job/{id:[0-9]+}", "monitoring/job.tmpl", "Job - ClusterCockpit", false, setupJobRoute}, @@ -168,6 +173,7 @@ var routes []Route = []Route{ {"/monitoring/user/{id}", "monitoring/user.tmpl", "User - ClusterCockpit", true, setupUserRoute}, {"/monitoring/systems/{cluster}", "monitoring/systems.tmpl", "Cluster - ClusterCockpit", false, setupClusterRoute}, {"/monitoring/node/{cluster}/{hostname}", "monitoring/node.tmpl", "Node - ClusterCockpit", false, setupNodeRoute}, + {"/monitoring/analysis/{cluster}", "monitoring/analysis.tmpl", "Analaysis - ClusterCockpit", true, setupAnalysisRoute}, } func main() { diff --git a/templates/home.tmpl b/templates/home.tmpl index c093a91..07c7bd1 100644 --- a/templates/home.tmpl +++ b/templates/home.tmpl @@ -39,7 +39,7 @@ Name Jobs System View - + Analysis View @@ -48,7 +48,7 @@ {{.Name}} Jobs System View - + Analysis View {{end}} diff --git a/templates/monitoring/analysis.tmpl b/templates/monitoring/analysis.tmpl new file mode 100644 index 0000000..af34f8e --- /dev/null +++ b/templates/monitoring/analysis.tmpl @@ -0,0 +1,15 @@ +{{define "content"}} +
+{{end}} + +{{define "stylesheets"}} + +{{end}} +{{define "javascript"}} + + +{{end}} diff --git a/templates/templates.go b/templates/templates.go index 57e7355..aa7ea5e 100644 --- a/templates/templates.go +++ b/templates/templates.go @@ -33,6 +33,7 @@ func init() { "monitoring/user.tmpl", "monitoring/systems.tmpl", "monitoring/node.tmpl", + "monitoring/analysis.tmpl", } for _, file := range files {