statping/source/tmpl/index.html

118 lines
4.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
{{if .Core.OfflineAssets}}
<link rel="stylesheet" href="https://assets.statup.io/bootstrap.min.css">
{{ else }}
<link rel="stylesheet" href="/css/bootstrap.min.css">
{{end}}
<link rel="stylesheet" href="/css/base.css">
<title>{{.Core.Name}} Status</title>
</head>
<body>
<div class="container col-md-7 col-sm-12 mt-2 sm-container">
<h1 class="col-12 text-center mb-4 mt-sm-3 header-title">{{.Core.Name}}</h1>
{{ if .Core.Description }}
<h5 class="col-12 text-center mb-5 header-desc">{{ .Core.Description }}</h5>
{{ end }}
<div class="col-12 full-col-12 mb-5">
<div class="list-group online_list">
{{ range .Services }}
<a href="#" class="service_li list-group-item list-group-item-action {{if not .Online}}bg-danger text-white{{ end }}" data-id="{{.Id}}">
{{ .Name }}
{{if .Online}}
<span class="badge bg-success float-right pulse-glow">ONLINE</span>
{{ else }}
<span class="badge bg-white text-black-50 float-right pulse">OFFLINE</span>
{{end}}
</a>
{{ end }}
</div>
</div>
<div class="col-12 full-col-12">
{{ range .Services }}
<div class="mt-4" id="service_id_{{.Id}}">
<div class="card">
<div class="card-body">
<div class="col-12">
<h4 class="mt-3"><a href="/service/{{.Id}}"{{if not .Online}} class="text-danger"{{end}}>{{ .Name }}</a>
{{if .Online}}
<span class="badge bg-success float-right">ONLINE</span>
{{ else }}
<span class="badge bg-danger float-right pulse">OFFLINE</span>
{{end}}</h4>
<div class="row stats_area mt-5 mb-5">
<div class="col-4">
<span class="lg_number">{{.Online24}}%</span>
Online last 24 Hours
</div>
<div class="col-4">
<span class="lg_number">{{.AvgTime}}ms</span>
Average Response
</div>
<div class="col-4">
<span class="lg_number">{{.AvgUptime}}%</span>
Total Uptime
</div>
</div>
{{ if .LimitedFailures }}
{{ end }}
</div>
</div>
{{ if .AvgTime }}
<div class="chart-container">
<canvas id="service_{{ .Id }}"></canvas>
</div>
{{ end }}
<div class="lower_canvas full-col-12 text-white{{if not .Online}} bg-danger{{end}}">
<div class="col-12">
<span class="col-10 d-none d-md-inline">{{.SmallText}}</span>
<a href="/service/{{ .Id }}" class="btn {{if .Online}}btn-success{{else}}btn-danger{{end}} btn-sm float-right col-sm-4 col-md-2 dyn-dark">View Service</a>
</div>
</div>
</div>
</div>
{{ end }}
</div>
</div>
{{template "footer"}}
{{if .Core.OfflineAssets}}
<script src="https://assets.statup.io/jquery-3.3.1.slim.min.js"></script>
<script src="https://assets.statup.io/bootstrap.min.js"></script>
<script src="https://assets.statup.io/Chart.bundle.min.js"></script>
{{ else }}
<script src="/js/jquery-3.3.1.slim.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/Chart.bundle.min.js"></script>
{{end}}
<script src="/js/main.js"></script>
<script src="/charts.js"></script>
{{ if .Core.Style }}
<style>
{{ safe .Core.Style }}
</style>
{{ end }}
</body>
</html>