Merge pull request #780 from prometheus/improve-target-label-ui

Improve display of target labels on status page.
This commit is contained in:
Julius Volz 2015-06-08 16:23:54 +02:00
commit 8d8de7adbc
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}}