From adf6850853197651c46bf1b1dd9f92cd31666537 Mon Sep 17 00:00:00 2001 From: Julius Volz Date: Mon, 8 Jun 2015 16:10:48 +0200 Subject: [PATCH] Improve display of target labels on status page. Instead of a "{...}"-style list, show key/value pairs as Bootstrap labels. --- web/static/css/prometheus.css | 4 ++++ web/templates/status.html | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/web/static/css/prometheus.css b/web/static/css/prometheus.css index d801925ac..623fd743c 100644 --- a/web/static/css/prometheus.css +++ b/web/static/css/prometheus.css @@ -17,3 +17,7 @@ th.job_header { .literal_output td { font-family: monospace; } + +.cursor-pointer { + cursor: pointer; +} diff --git a/web/templates/status.html b/web/templates/status.html index c532fc924..9c12cd7e6 100644 --- a/web/templates/status.html +++ b/web/templates/status.html @@ -56,9 +56,16 @@ - - {{or (stripLabels .BaseLabels "job" "instance") "{}"}} - + + {{$baseLabels := stripLabels .BaseLabels "job" "instance"}} + {{if $baseLabels}} + {{range $label, $value := $baseLabels}} + {{$label}}="{{$value}}" + {{end}} + {{else}} + none + {{end}} + {{if .Status.LastScrape.IsZero}}Never{{else}}{{since .Status.LastScrape}} ago{{end}}