mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-23 12:51:40 +02:00
Add Tag view including required changes.
This commit is contained in:
@@ -58,6 +58,14 @@
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
{{block "navitem_tags" .}}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link fs-5" href="/monitoring/tags/">
|
||||
<span class="cc-nav-text">Tags</span>
|
||||
<i class="bi-tag-fill"></i>
|
||||
</a>
|
||||
</li>
|
||||
{{end}}
|
||||
{{else}}
|
||||
{{block "navitem_stats" .}}
|
||||
<li class="nav-item">
|
||||
|
17
templates/monitoring/taglist.tmpl
Normal file
17
templates/monitoring/taglist.tmpl
Normal file
@@ -0,0 +1,17 @@
|
||||
{{define "content"}}
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-10">
|
||||
{{ range $tagType, $tagList := .Infos.tagmap }}
|
||||
<div class="my-3 p-2 bg-secondary text-white text-capitalize">
|
||||
{{ $tagType }}
|
||||
</div>
|
||||
{{ range $tagList }}
|
||||
<a class="btn btn-lg btn-warning" href="/monitoring/jobs/?tag={{ .id }}" role="button">
|
||||
{{ .name }} <span class="badge bg-light text-dark">{{ .count }}</span> </a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
@@ -22,13 +22,20 @@ type Page struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
templatesDir = "./templates/"
|
||||
bp := "./"
|
||||
ebp := os.Getenv("BASEPATH")
|
||||
|
||||
if ebp != "" {
|
||||
bp = ebp
|
||||
}
|
||||
templatesDir = bp + "templates/"
|
||||
base := template.Must(template.ParseFiles(templatesDir + "base.tmpl"))
|
||||
files := []string{
|
||||
"home.tmpl", "404.tmpl", "login.tmpl",
|
||||
"imprint.tmpl", "privacy.tmpl",
|
||||
"monitoring/jobs.tmpl",
|
||||
"monitoring/job.tmpl",
|
||||
"monitoring/taglist.tmpl",
|
||||
"monitoring/list.tmpl",
|
||||
"monitoring/user.tmpl",
|
||||
"monitoring/systems.tmpl",
|
||||
|
Reference in New Issue
Block a user