mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-24 23:22:25 +00:00
Improve display of silence labels in index view.
This commit is contained in:
parent
aaf3b8b942
commit
5fabdee4b0
@ -22,8 +22,10 @@ import (
|
||||
type Filters []*Filter
|
||||
|
||||
type Filter struct {
|
||||
Name *regexp.Regexp
|
||||
Value *regexp.Regexp
|
||||
Name *regexp.Regexp
|
||||
Value *regexp.Regexp
|
||||
NamePattern string
|
||||
ValuePattern string
|
||||
|
||||
fingerprint uint64
|
||||
}
|
||||
@ -33,9 +35,11 @@ func NewFilter(namePattern string, valuePattern string) *Filter {
|
||||
fmt.Fprintf(summer, namePattern, valuePattern)
|
||||
|
||||
return &Filter{
|
||||
Name: regexp.MustCompile("^" + namePattern + "$"),
|
||||
Value: regexp.MustCompile("^" + valuePattern + "$"),
|
||||
fingerprint: summer.Sum64(),
|
||||
Name: regexp.MustCompile("^" + namePattern + "$"),
|
||||
Value: regexp.MustCompile("^" + valuePattern + "$"),
|
||||
NamePattern: namePattern,
|
||||
ValuePattern: valuePattern,
|
||||
fingerprint: summer.Sum64(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
<td>
|
||||
{{range $label, $value := .Event.Labels}}
|
||||
{{if not (eq $label "alertname")}}
|
||||
<span class="label label-info"><b>{{$label}}</b>="{{$value}}"</span>
|
||||
<span class="label label-info">{{$label}}="{{$value}}"</span>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<form class="add_silence_form">
|
||||
|
@ -25,7 +25,7 @@
|
||||
<td>{{.Id}}</td>
|
||||
<td>
|
||||
{{range .Filters}}
|
||||
<b>{{.Name}}</b>="{{.Value}}",
|
||||
<span class="label label-info">{{.NamePattern}}="{{.ValuePattern}}"</span>
|
||||
{{end}}
|
||||
</td>
|
||||
<td>{{.CreatedBy}}</td>
|
||||
|
Loading…
Reference in New Issue
Block a user