statping/html/tmpl/index.html

169 lines
5.0 KiB
HTML
Raw Normal View History

2018-06-10 01:31:13 +00:00
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/base.css">
<script src="/js/Chart.bundle.min.js"></script>
2018-06-19 04:48:25 +00:00
<title>{{.Core.Name}} Status</title>
2018-06-10 01:31:13 +00:00
</head>
<body>
2018-06-22 04:02:57 +00:00
<div class="container col-md-7 col-sm-12 mt-2">
2018-06-19 04:48:25 +00:00
2018-06-22 04:02:57 +00:00
<h1 class="text-center mb-4 mt-sm-3">{{.Core.Name}}</h1>
2018-06-10 01:31:13 +00:00
2018-06-19 04:48:25 +00:00
{{ if .Core.Description }}
2018-06-22 04:02:57 +00:00
<h5 class="text-center mb-5 text-muted">{{ .Core.Description }}</h5>
2018-06-19 04:48:25 +00:00
{{ end }}
2018-06-22 04:02:57 +00:00
<div class="col-12 mb-5">
2018-06-15 04:30:10 +00:00
2018-06-22 04:02:57 +00:00
<div class="list-group online_list">
{{ range .Services }}
2018-06-22 06:56:44 +00:00
<a href="#" class="list-group-item list-group-item-action {{if not .Online}}bg-danger text-white{{ end }}">
2018-06-22 04:02:57 +00:00
{{ .Name }}
{{if .Online}}
<span class="badge online_badge float-right">ONLINE</span>
{{ else }}
2018-06-22 06:56:44 +00:00
<span class="badge bg-white text-black-50 float-right">OFFLINE</span>
2018-06-22 04:02:57 +00:00
{{end}}
</a>
{{ end }}
2018-06-15 04:30:10 +00:00
</div>
2018-06-22 04:02:57 +00:00
</div>
2018-06-14 06:50:47 +00:00
<div class="col-12">
2018-06-11 00:20:42 +00:00
2018-06-10 01:31:13 +00:00
{{ range .Services }}
2018-06-15 04:30:10 +00:00
<div class="mb-4">
2018-06-10 01:31:13 +00:00
<div class="card">
2018-06-10 04:09:20 +00:00
<div class="card-body{{if .Online}}{{else}} offline_bg{{end}}">
2018-06-10 01:31:13 +00:00
2018-06-11 00:20:42 +00:00
<div class="progress">
<div class="progress-bar {{if .Online24Hours}} bg-success {{else}} bg-danger {{end}}" role="progressbar" style="width: {{.Online24Hours}}%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
</div>
2018-06-22 04:02:57 +00:00
<h4 class="mt-4"><a href="/service/{{.Id}}">{{ .Name }}</a>
2018-06-11 00:20:42 +00:00
{{if .Online}}
<span class="badge online_badge float-right">ONLINE</span>
{{ else }}
<span class="badge offline_badge float-right">OFFLINE</span>
2018-06-22 04:02:57 +00:00
{{end}}</h4>
2018-06-11 00:20:42 +00:00
<div class="row stats_area mt-5 mb-5">
2018-06-10 01:31:13 +00:00
2018-06-22 06:56:44 +00:00
<div class="col-4">
2018-06-15 04:30:10 +00:00
<span class="lg_number">{{.Online24}}%</span>
2018-06-10 01:31:13 +00:00
Online last 24 Hours
</div>
2018-06-22 06:56:44 +00:00
<div class="col-4">
2018-06-15 04:30:10 +00:00
<span class="lg_number">{{.AvgTime}}ms</span>
2018-06-10 01:31:13 +00:00
Average Response
</div>
2018-06-22 06:56:44 +00:00
<div class="col-4">
2018-06-15 04:30:10 +00:00
<span class="lg_number">{{.AvgUptime}}%</span>
2018-06-10 01:31:13 +00:00
Total Uptime
</div>
</div>
<canvas id="service_{{ .Id }}" width="400" height="120"></canvas>
2018-06-11 00:20:42 +00:00
2018-06-22 04:02:57 +00:00
{{ if .LimitedFailures }}
<div class="list-group mt-5">
2018-06-19 04:48:25 +00:00
{{ range .LimitedFailures }}
2018-06-22 04:02:57 +00:00
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{.ParseError}}</h5>
<small>Reported {{.Ago}}</small>
</div>
<p class="mb-1">{{.Issue}}</p>
</a>
{{ end }}
2018-06-22 06:56:44 +00:00
<span class="text-right">{{ .TotalFailures }} Total Failures</span>
2018-06-22 04:02:57 +00:00
</div>
{{ end }}
2018-06-11 00:20:42 +00:00
2018-06-10 01:31:13 +00:00
</div>
</div>
</div>
{{ end }}
</div>
</div>
2018-06-22 04:02:57 +00:00
{{template "footer"}}
2018-06-10 04:16:04 +00:00
2018-06-10 01:31:13 +00:00
<script>
{{ range .Services }}
2018-06-22 04:02:57 +00:00
{{if .GraphData}}
2018-06-10 01:31:13 +00:00
var ctx = document.getElementById("service_{{.Id}}").getContext('2d');
var chartdata = new Chart(ctx, {
type: 'line',
data: {
datasets: [{
label: 'Response Time (Milliseconds)',
2018-06-15 04:30:10 +00:00
data: {{js .GraphData}},
2018-06-10 01:31:13 +00:00
backgroundColor: [
2018-06-22 06:56:44 +00:00
'rgba(47, 206, 30, 0.92)'
2018-06-10 01:31:13 +00:00
],
borderColor: [
2018-06-22 06:56:44 +00:00
'rgb(47, 171, 34)'
2018-06-10 01:31:13 +00:00
],
borderWidth: 1
}]
},
options: {
legend: {
display: false
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true
2018-06-10 04:09:20 +00:00
},
gridLines: {
display:false
2018-06-10 01:31:13 +00:00
}
}],
xAxes: [{
type: 'time',
2018-06-10 04:09:20 +00:00
distribution: 'series',
gridLines: {
display:false
}
2018-06-10 01:31:13 +00:00
}]
},
elements: {
point: {
radius: 0
}
}
}
});
{{ end }}
2018-06-22 04:02:57 +00:00
{{ end }}
2018-06-10 01:31:13 +00:00
</script>
2018-06-19 04:48:25 +00:00
{{ if .Core.Style }}
<style>
{{ safe .Core.Style }}
</style>
{{ end }}
2018-06-10 01:31:13 +00:00
<script src="/js/jquery-3.3.1.slim.min.js"></script>
2018-06-15 04:30:10 +00:00
<script src="/js/bootstrap.min.js"></script>
2018-06-10 01:31:13 +00:00
</body>
</html>