mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 08:57:25 +01:00
Add /monitoring/analysis route
This commit is contained in:
parent
efc3e1735b
commit
e8c6a7d589
@ -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 <ID> - ClusterCockpit", false, setupJobRoute},
|
||||
@ -168,6 +173,7 @@ var routes []Route = []Route{
|
||||
{"/monitoring/user/{id}", "monitoring/user.tmpl", "User <ID> - ClusterCockpit", true, setupUserRoute},
|
||||
{"/monitoring/systems/{cluster}", "monitoring/systems.tmpl", "Cluster <ID> - ClusterCockpit", false, setupClusterRoute},
|
||||
{"/monitoring/node/{cluster}/{hostname}", "monitoring/node.tmpl", "Node <ID> - ClusterCockpit", false, setupNodeRoute},
|
||||
{"/monitoring/analysis/{cluster}", "monitoring/analysis.tmpl", "Analaysis - ClusterCockpit", true, setupAnalysisRoute},
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -39,7 +39,7 @@
|
||||
<th>Name</th>
|
||||
<th>Jobs</th>
|
||||
<th>System View</th>
|
||||
<!-- <th>Analysis View</th> -->
|
||||
<th>Analysis View</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -48,7 +48,7 @@
|
||||
<td>{{.Name}}</td>
|
||||
<td><a href="/monitoring/jobs/?cluster={{.Name}}">Jobs</a></td>
|
||||
<td><a href="/monitoring/systems/{{.Name}}">System View</a></td>
|
||||
<!-- <td><a href="/monitoring/analysis/?cluster={{.Name}}">Analysis View</a></td> -->
|
||||
<td><a href="/monitoring/analysis/{{.Name}}">Analysis View</a></td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
|
15
templates/monitoring/analysis.tmpl
Normal file
15
templates/monitoring/analysis.tmpl
Normal file
@ -0,0 +1,15 @@
|
||||
{{define "content"}}
|
||||
<div id="svelte-app"></div>
|
||||
{{end}}
|
||||
|
||||
{{define "stylesheets"}}
|
||||
<link rel='stylesheet' href='/build/analysis.css'>
|
||||
{{end}}
|
||||
{{define "javascript"}}
|
||||
<script>
|
||||
const cluster = {{ .Infos.cluster }};
|
||||
const filterPresets = {{ .FilterPresets }};
|
||||
const clusterCockpitConfig = {{ .Config }};
|
||||
</script>
|
||||
<script src='/build/analysis.js'></script>
|
||||
{{end}}
|
@ -33,6 +33,7 @@ func init() {
|
||||
"monitoring/user.tmpl",
|
||||
"monitoring/systems.tmpl",
|
||||
"monitoring/node.tmpl",
|
||||
"monitoring/analysis.tmpl",
|
||||
}
|
||||
|
||||
for _, file := range files {
|
||||
|
Loading…
Reference in New Issue
Block a user