statping/html/tmpl/index.html

157 lines
4.9 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-11 00:20:42 +00:00
<title>{{.Project}} Status</title>
2018-06-10 01:31:13 +00:00
</head>
<body>
2018-06-15 04:30:10 +00:00
<h1 class="text-center mb-4 mt-sm-3">{{.Project}}</h1>
2018-06-10 01:31:13 +00:00
<div class="container">
2018-06-15 04:30:10 +00:00
<div class="col-12 mb-5">
<div class="list-group online_list">
{{ range .Services }}
<a href="#" class="list-group-item list-group-item-action {{if .Online}}{{ end }}">
{{ .Name }}
{{if .Online}}
<span class="badge online_badge float-right">ONLINE</span>
{{ else }}
<span class="badge offline_badge float-right">OFFLINE</span>
{{end}}
</a>
{{ end }}
</div>
</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-11 03:41:02 +00:00
<h3 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>
{{end}}</h3>
<div class="row stats_area mt-5 mb-5">
2018-06-10 01:31:13 +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>
<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>
<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
{{ range .Failures }}
<blockquote class="blockquote text-right mt-3">
2018-06-11 03:41:02 +00:00
<p class="mb-0">{{.ParseError}}</p>
2018-06-11 00:20:42 +00:00
<footer class="blockquote-footer">Reported <cite title="Source Title">{{.Ago}}</cite></footer>
</blockquote>
{{ end }}
2018-06-10 01:31:13 +00:00
</div>
</div>
</div>
{{ end }}
</div>
</div>
2018-06-10 04:16:04 +00:00
<div class="footer text-center">
2018-06-11 00:20:42 +00:00
<a href="https://statup.io" target="_blank">Created with Statup.io</a> | <a href="/dashboard">Dashboard</a>
2018-06-10 04:16:04 +00:00
</div>
2018-06-10 01:31:13 +00:00
<script>
{{ range .Services }}
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: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
],
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 }}
</script>
<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>