Improve display of target labels on status page.

Instead of a "{...}"-style list, show key/value pairs as Bootstrap
labels.
This commit is contained in:
Julius Volz 2015-06-08 16:10:48 +02:00
parent 51653e7890
commit adf6850853
2 changed files with 14 additions and 3 deletions

View File

@ -17,3 +17,7 @@ th.job_header {
.literal_output td {
font-family: monospace;
}
.cursor-pointer {
cursor: pointer;
}

View File

@ -56,9 +56,16 @@
</span>
</td>
<td>
<a href="#" data-toggle="tooltip" title="" data-original-title="Before Relabel: {{.MetaLabels}}">
{{or (stripLabels .BaseLabels "job" "instance") "{}"}}
</a>
<span class="cursor-pointer" data-toggle="tooltip" title="" data-original-title="Before relabeling: {{.MetaLabels}}">
{{$baseLabels := stripLabels .BaseLabels "job" "instance"}}
{{if $baseLabels}}
{{range $label, $value := $baseLabels}}
<span class="label label-primary">{{$label}}="{{$value}}"</span>
{{end}}
{{else}}
<span class="label label-default">none</span>
{{end}}
</span>
</td>
<td>
{{if .Status.LastScrape.IsZero}}Never{{else}}{{since .Status.LastScrape}} ago{{end}}