| 1 |
{{define "head"}} |
| 2 |
<link type="text/css" rel="stylesheet" href="{{ pathPrefix }}/classic/static/css/targets.css?v={{ buildVersion }}"> |
| 3 |
<script src="{{ pathPrefix }}/classic/static/js/targets.js?v={{ buildVersion }}"></script> |
| 4 |
{{end}} |
| 5 |
|
| 6 |
|
| 7 |
{{define "content"}} |
| 8 |
<div class="container-fluid"> |
| 9 |
<h1>Targets</h1> |
| 10 |
<div class="options-container"> |
| 11 |
<div id="showTargets" class="btn-group btn-group-toggle" data-toggle="buttons"> |
| 12 |
<label class="btn btn-primary"> |
| 13 |
<input type="radio" name="targets" id="all-targets" autocomplete="off" checked> All |
| 14 |
</label> |
| 15 |
<label class="btn btn-primary"> |
| 16 |
<input type="radio" name="targets" id="unhealthy-targets" autocomplete="off"> Unhealthy |
| 17 |
</label> |
| 18 |
<br /> |
| 19 |
</div> |
| 20 |
<button type="button" class="collapse-all btn btn-primary">Collapse All</button> |
| 21 |
</div> |
| 22 |
|
| 23 |
{{- $builder := .Builder}} |
| 24 |
{{- range $job, $pool := .TargetPools}} |
| 25 |
{{- $healthy := numHealthy $pool}} |
| 26 |
{{- $total := len $pool}} |
| 27 |
|
| 28 |
<div class="table-container"> |
| 29 |
<h2 class="job_header{{if lt $healthy $total}} danger{{end}}"> |
| 30 |
<a id="job-{{$job}}" href="#job-{{$job}}">{{$job}} ({{$healthy}}/{{$total}} up)</a> |
| 31 |
<button type="button" class="targets expanded-table btn btn-primary">show less</button> |
| 32 |
</h2> |
| 33 |
<table class="table table-sm table-bordered table-striped table-hover"> |
| 34 |
<thead class="job_details"> |
| 35 |
<tr> |
| 36 |
<th>Endpoint</th> |
| 37 |
<th>State</th> |
| 38 |
<th>Labels</th> |
| 39 |
<th>Last Scrape</th> |
| 40 |
<th>Scrape Duration</th> |
| 41 |
<th>Error</th> |
| 42 |
</tr> |
| 43 |
</thead> |
| 44 |
<tbody> |
| 45 |
{{- range $pool}} |
| 46 |
<tr> |
| 47 |
<td class="endpoint"> |
| 48 |
<a href="{{.URL | globalURL}}">{{.URL.Scheme}}://{{.URL.Host}}{{.URL.Path}}</a><br> |
| 49 |
{{- range $label, $values := .URL.Query }} |
| 50 |
{{- range $i, $value := $values}} |
| 51 |
<span class="badge badge-primary">{{$label}}="{{$value}}"</span> |
| 52 |
{{- end}} |
| 53 |
{{- end}} |
| 54 |
</td> |
| 55 |
<td class="state"> |
| 56 |
<span class="alert alert-{{ .Health | targetHealthToClass }} state_indicator text-uppercase">{{.Health}}</span> |
| 57 |
</td> |
| 58 |
<td class="labels"> |
| 59 |
<span class="cursor-pointer" data-toggle="tooltip" title="" data-html=true data-original-title="<b>Before relabeling:</b>{{range $k, $v := .DiscoveredLabels.Map}}<br>{{$ev := $v | html}}{{$k}}="{{$ev}}"{{end}}"> |
| 60 |
{{- $builtLabels := .Labels $builder}} |
| 61 |
{{- range $label, $value := $builtLabels.Map}} |
| 62 |
<span class="badge badge-primary">{{$label}}="{{$value}}"</span> |
| 63 |
{{- else -}} |
| 64 |
<span class="badge badge-default">none</span> |
| 65 |
{{- end}} |
| 66 |
</span> |
| 67 |
</td> |
| 68 |
<td class="last-scrape">{{- if .LastScrape.IsZero}}Never{{else}}{{since .LastScrape}} ago{{end}}</td> |
| 69 |
<td class="scrape-duration">{{- humanizeDuration .LastScrapeDuration.Seconds}}</td> |
| 70 |
<td class="errors">{{- if .LastError}}<span class="alert alert-danger state_indicator">{{.LastError}}</span>{{end}}</td> |
| 71 |
</tr> |
| 72 |
{{- end}} |
| 73 |
</tbody> |
| 74 |
</table> |
| 75 |
</div> |
| 76 |
{{- end }} |
| 77 |
</div> |
| 78 |
{{end}} |