mirror of https://github.com/statping/statping
parent
359c00c250
commit
355e7e325b
|
@ -196,13 +196,13 @@ func (s *Service) lastFailure() *Failure {
|
||||||
// // Online since Monday 3:04:05PM, Jan _2 2006
|
// // Online since Monday 3:04:05PM, Jan _2 2006
|
||||||
func (s *Service) SmallText() string {
|
func (s *Service) SmallText() string {
|
||||||
last := s.LimitedFailures(1)
|
last := s.LimitedFailures(1)
|
||||||
hits, _ := s.LimitedHits(1)
|
//hits, _ := s.LimitedHits(1)
|
||||||
zone := CoreApp.Timezone
|
zone := CoreApp.Timezone
|
||||||
if s.Online {
|
if s.Online {
|
||||||
if len(last) == 0 {
|
if len(last) == 0 {
|
||||||
return fmt.Sprintf("Online since %v", utils.Timezoner(s.CreatedAt, zone).Format("Monday 3:04:05PM, Jan _2 2006"))
|
return fmt.Sprintf("Online since %v", utils.Timezoner(s.CreatedAt, zone).Format("Monday 3:04:05PM, Jan _2 2006"))
|
||||||
} else {
|
} else {
|
||||||
return fmt.Sprintf("Online, last Failure was %v", utils.Timezoner(hits[0].CreatedAt, zone).Format("Monday 3:04:05PM, Jan _2 2006"))
|
return fmt.Sprintf("Online, last Failure was %v", utils.Timezoner(last[0].CreatedAt, zone).Format("Monday 3:04:05PM, Jan _2 2006"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if len(last) > 0 {
|
if len(last) > 0 {
|
||||||
|
|
|
@ -159,12 +159,12 @@ func commaToService(s []string) (*types.Service, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
allowNotifications, err := strconv.ParseBool(s[10])
|
allowNotifications, err := strconv.ParseBool(s[11])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
public, err := strconv.ParseBool(s[11])
|
public, err := strconv.ParseBool(s[12])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -182,9 +182,9 @@ func commaToService(s []string) (*types.Service, error) {
|
||||||
Timeout: int(utils.ToInt(timeout.Seconds())),
|
Timeout: int(utils.ToInt(timeout.Seconds())),
|
||||||
AllowNotifications: types.NewNullBool(allowNotifications),
|
AllowNotifications: types.NewNullBool(allowNotifications),
|
||||||
Public: types.NewNullBool(public),
|
Public: types.NewNullBool(public),
|
||||||
GroupId: int(utils.ToInt(s[12])),
|
GroupId: int(utils.ToInt(s[13])),
|
||||||
Headers: types.NewNullString(s[13]),
|
Headers: types.NewNullString(s[14]),
|
||||||
Permalink: types.NewNullString(s[14]),
|
Permalink: types.NewNullString(s[15]),
|
||||||
}
|
}
|
||||||
|
|
||||||
return newService, nil
|
return newService, nil
|
||||||
|
|
|
@ -90,7 +90,7 @@ $('.toggle-service').on('click',function(e) {
|
||||||
let obj = $(this);
|
let obj = $(this);
|
||||||
let serviceId = obj.attr("data-id");
|
let serviceId = obj.attr("data-id");
|
||||||
let online = obj.attr("data-online");
|
let online = obj.attr("data-online");
|
||||||
let d = confirm("Do you want to "+online ? "stop" : "start"+" checking this service?");
|
let d = confirm("Do you want to "+(online ? "stop" : "start")+" checking this service?");
|
||||||
if (d) {
|
if (d) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/api/services/" + serviceId + "/running",
|
url: "/api/services/" + serviceId + "/running",
|
||||||
|
@ -150,9 +150,11 @@ async function RenderChart(chart, service, start=0, end=9999999999, group="hour"
|
||||||
chartData = await ChartLatency(service, start, end, "minute", retry);
|
chartData = await ChartLatency(service, start, end, "minute", retry);
|
||||||
}
|
}
|
||||||
chart.render();
|
chart.render();
|
||||||
chart.updateSeries([{
|
if (chartData) {
|
||||||
data: chartData
|
chart.updateSeries([{
|
||||||
}]);
|
data: chartData
|
||||||
|
}]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
{{if not .Domain}}
|
{{if not .Domain}}
|
||||||
<div class="alert alert-danger" role="alert">
|
<div class="alert alert-danger" role="alert">
|
||||||
Your Statup server does not have a dedicated URL!
|
Your Statping server does not have a dedicated URL!
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
@ -123,14 +123,31 @@
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<h3>Additional Settings</h3>
|
<h3 class="mt-4">Bulk Import Services</h3>
|
||||||
|
You can import multiple services based on a CSV file with the format shown on the <a href="https://github.com/hunterlong/statping/wiki/Bulk-Import-Services" target="_blank">Bulk Import Wiki</a>.
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
|
<form action="/settings/bulk_import" method="POST" enctype="multipart/form-data" class="form-inline">
|
||||||
|
<div class="form-group col-10">
|
||||||
|
<input type="file" name="file" class="form-control-file" accept=".csv">
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<button type="submit" class="btn btn-outline-success right">Import</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<h3 class="mt-4">Additional Settings</h3>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<a href="/settings/export" class="btn btn-sm btn-secondary float-right">Export Settings</a>
|
<div class="col-12">
|
||||||
|
<a href="/settings/export" class="btn btn-sm btn-secondary float-right">Export Settings</a>
|
||||||
{{if .Domain}}
|
{{if .Domain}}
|
||||||
<a href="#" class="btn btn-sm btn-secondary float-right ml-1">Authentication QR Code</a>
|
<a href="#" class="btn btn-sm btn-secondary float-right ml-1">Authentication QR Code</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
|
||||||
|
|
||||||
{{if .Domain}}
|
{{if .Domain}}
|
||||||
<div class="row align-content-center">
|
<div class="row align-content-center">
|
||||||
|
@ -139,19 +156,8 @@
|
||||||
<a class="btn btn-sm btn-primary" href={{safeURL QrAuth}}>Open in Statping App</a>
|
<a class="btn btn-sm btn-primary" href={{safeURL QrAuth}}>Open in Statping App</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
</div>
|
||||||
<h3 class="mt-3">Bulk Import Services</h3>
|
</div>
|
||||||
You can import multiple services based on a CSV file with the format shown on the <a href="https://github.com/hunterlong/statping/wiki/Bulk-Import-Services" target="_blank">Bulk Import Wiki</a>.
|
|
||||||
|
|
||||||
<form action="/settings/bulk_import" method="POST" enctype="multipart/form-data" class="form-inline">
|
|
||||||
<div class="form-group">
|
|
||||||
<input type="file" name="file" class="form-control-file" accept=".csv">
|
|
||||||
</div>
|
|
||||||
<div class="form-group">
|
|
||||||
<button type="submit" class="btn btn-success ml-3">Upload</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane" id="v-pills-style" role="tabpanel" aria-labelledby="v-pills-style-tab">
|
<div class="tab-pane" id="v-pills-style" role="tabpanel" aria-labelledby="v-pills-style-tab">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Code generated by go generate; DO NOT EDIT.
|
// Code generated by go generate; DO NOT EDIT.
|
||||||
// This file was generated by robots at
|
// This file was generated by robots at
|
||||||
// 2019-05-14 12:12:36.365798 -0700 PDT m=+0.459353534
|
// 2019-05-14 12:39:30.867402 -0700 PDT m=+0.544240003
|
||||||
//
|
//
|
||||||
// This contains the most recently Markdown source for the Statping Wiki.
|
// This contains the most recently Markdown source for the Statping Wiki.
|
||||||
package source
|
package source
|
||||||
|
|
Loading…
Reference in New Issue