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 { .literal_output td {
font-family: monospace; font-family: monospace;
} }
.cursor-pointer {
cursor: pointer;
}

View file

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