statping/source/tmpl/index.html

85 lines
3.5 KiB
HTML

{{define "title"}}{{CoreApp.Name}} Status{{end}}
{{define "content"}}
<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">{{.Name}}</h1>
{{ if .Description }}
<h5 class="col-12 text-center mb-5 header-desc">{{ .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">
{{ if not Services }}
<div class="alert alert-danger" role="alert">
<h4 class="alert-heading">No Services to Monitor!</h4>
<p>Your Statup Status Page is working correctly, but you don't have any services to monitor. Go to the <b>Dashboard</b> and add a website to begin really using your status page!</p>
<hr>
<p class="mb-0">If this is a bug, please make an issue in the Statup Github Repo. <a href="https://github.com/hunterlong/statup" class="btn btn-sm btn-outline-danger float-right">Statup Github Repo</a></p>
</div>
{{end}}
{{ 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">{{.AvgUptime24}}%</span>
Uptime last 24 Hours
</div>
</div>
</div>
</div>
{{ if .AvgUptime24 }}
<div class="chart-container">
<canvas id="service_{{ .Id }}"></canvas>
</div>
{{ end }}
<div class="row lower_canvas full-col-12 text-white{{if not .Online}} bg-danger{{end}}">
<div class="col-10 text-truncate">
<span class="d-none d-md-inline">{{.SmallText}}</span>
</div>
<div class="col-sm-12 col-md-2">
<a href="/service/{{ .Id }}" class="btn {{if .Online}}btn-success{{else}}btn-danger{{end}} btn-sm float-right dyn-dark btn-block">View Service</a>
</div>
</div>
</div>
</div>
{{ end }}
</div>
</div>
{{end}}
{{define "extra_scripts"}}
<script src="/charts.js"></script>
{{end}}