statping/source/tmpl/index.gohtml

109 lines
4.4 KiB
Go

{{define "title"}}{{CoreApp.Name}} Status{{end}}
{{define "description"}}{{CoreApp.Name}} is currently monitoring {{len CoreApp.Services}} services with 0 of them offline. {{CoreApp.Name}} is using Statping to monitor applications.{{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 }}
{{ range Groups true }}
{{if ne (len .Services) 0}}
<div class="col-12 full-col-12">
<h4 class="group_header">{{.Name}}</h4>
<div class="list-group online_list mb-3">
{{ range VisibleGroupServices . }}
<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>
{{ end }}
{{end}}
{{ if .Messages }}
<div class="col-12">
{{range .Messages}}
<div class="alert alert-primary" role="alert">
<h3>{{.Title}}</h3>
<span class="mb-3">{{safe .Description}}</span>
<div class="d-block mt-2 mb-4">
<span class="float-left small">Starts on {{ToString .StartOn}}</span>
<span class="float-right small">Ends on {{ToString .EndOn}}</span>
</div>
</div>
{{end}}
</div>
{{end}}
<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 Statping Status Page is working correctly, but you don't have any services to monitor. Go to the <a href="/dashboard">Dashboard</a> 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 Statping Github Repo. <a href="https://github.com/hunterlong/statping" class="btn btn-sm btn-outline-danger float-right">Statping Github Repo</a></p>
</div>
{{end}}
{{ range VisibleServices }}
{{$avgTime := .AvgTime}}
<div class="mb-4" id="service_id_{{.Id}}">
<div class="card">
<div class="card-body">
<div class="col-12">
<h4 class="mt-3"><a href="/service/{{ServiceLink .}}"{{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">
<div class="col-4">
<span class="lg_number">{{$avgTime}}ms</span>
Average Response
</div>
<div class="col-4">
<span class="lg_number">{{.OnlineDaysPercent 1}}%</span>
Uptime last 24 Hours
</div>
<div class="col-4">
<span class="lg_number">{{.OnlineDaysPercent 7}}%</span>
Uptime last 7 Days
</div>
</div>
</div>
</div>
{{ if $avgTime }}
<div class="chart-container">
<div id="service_{{ .Id }}"></div>
</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/{{ServiceLink .}}" 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}}