github.com/google/cloudprober@v0.11.3/probes/probes_status_tmpl.go (about) 1 // Copyright 2018 The Cloudprober Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package probes 16 17 import "html/template" 18 19 // StatusTmpl variable stores the HTML template suitable to generate the 20 // probes' status for cloudprober's /status page. It expects an array of 21 // ProbeInfo objects as input. 22 var StatusTmpl = template.Must(template.New("statusTmpl").Parse(` 23 <table class="status-list"> 24 <tr> 25 <th>Name</th> 26 <th>Type</th> 27 <th>Interval</th> 28 <th>Timeout</th> 29 <th width="20%%">Targets</th> 30 <th width="30%%">Probe Conf</th> 31 <th>Latency Unit</th> 32 <th>Latency Distribution Lower Bounds (if configured) </th> 33 </tr> 34 {{ range . }} 35 <tr> 36 <td>{{.Name}}</td> 37 <td>{{.Type}}</td> 38 <td>{{.Interval}}</td> 39 <td>{{.Timeout}}</td> 40 <td><pre>{{.TargetsDesc}}</pre></td> 41 42 <td> 43 {{if .ProbeConf}} 44 <pre>{{.ProbeConf}}</pre> 45 {{else}} 46 default 47 {{end}} 48 </td> 49 50 <td>{{.LatencyUnit}}</td> 51 <td><pre>{{.LatencyDistLB}}</pre></td> 52 </tr> 53 {{ end }} 54 </table> 55 `))