mirror of https://github.com/statping/statping
go templates - service chart data API
parent
b24f939541
commit
ed6fb12423
|
@ -534,7 +534,7 @@ func RunServiceHandler(t *testing.T) {
|
|||
assert.Nil(t, err)
|
||||
rr := httptest.NewRecorder()
|
||||
route.ServeHTTP(rr, req)
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "<title>Statup | Google Service</title>"))
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "<title>Google Status</title>"))
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "footer"))
|
||||
}
|
||||
|
||||
|
@ -596,7 +596,7 @@ func RunUserViewHandler(t *testing.T) {
|
|||
assert.Nil(t, err)
|
||||
rr := httptest.NewRecorder()
|
||||
route.ServeHTTP(rr, req)
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "<title>Statup | Users</title>"))
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "<title>Statup | testadmin</title>"))
|
||||
assert.True(t, strings.Contains(rr.Body.String(), "footer"))
|
||||
assert.True(t, handlers.IsAuthenticated(req))
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ func TestApiServiceDataHandler(t *testing.T) {
|
|||
grouping := []string{"minute", "hour", "day"}
|
||||
for _, g := range grouping {
|
||||
params := "?start=0&end=999999999999&group=" + g
|
||||
rr, err := httpRequestAPI(t, "GET", "/api/services/1/data"+params, nil)
|
||||
rr, err := httpRequestAPI(t, "GET", "/api/services/5/data"+params, nil)
|
||||
assert.Nil(t, err)
|
||||
body := rr.Body.String()
|
||||
var obj core.DateScanObj
|
||||
|
|
|
@ -143,9 +143,17 @@ var handlerFuncs = func(w http.ResponseWriter, r *http.Request) template.FuncMap
|
|||
"FromUnix": func(t int64) string {
|
||||
return utils.Timezoner(time.Unix(t, 0), core.CoreApp.Timezone).Format("Monday, January 02")
|
||||
},
|
||||
"NewService": func() *types.Service {
|
||||
return new(types.Service)
|
||||
},
|
||||
"NewUser": func() *types.User {
|
||||
return new(types.User)
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
var mainTmpl = `{{define "main" }} {{ template "base" . }} {{ end }}`
|
||||
|
||||
// executeResponse will render a HTTP response for the front end user
|
||||
func executeResponse(w http.ResponseWriter, r *http.Request, file string, data interface{}, redirect interface{}) {
|
||||
utils.Http(r)
|
||||
|
@ -153,36 +161,49 @@ func executeResponse(w http.ResponseWriter, r *http.Request, file string, data i
|
|||
http.Redirect(w, r, url, http.StatusSeeOther)
|
||||
return
|
||||
}
|
||||
nav, _ := source.TmplBox.String("nav.html")
|
||||
footer, _ := source.TmplBox.String("footer.html")
|
||||
chartIndex, _ := source.JsBox.String("chart_index.js")
|
||||
|
||||
templates := []string{"base.html", "head.html", "nav.html", "footer.html", "scripts.html", "form_service.html", "form_notifier.html", "form_user.html"}
|
||||
|
||||
javascripts := []string{"chart_index.js"}
|
||||
|
||||
render, err := source.TmplBox.String(file)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
}
|
||||
t := template.New("message")
|
||||
|
||||
// setup the main template and handler funcs
|
||||
t := template.New("main")
|
||||
t.Funcs(handlerFuncs(w, r))
|
||||
t, err = t.Parse(nav)
|
||||
t, err = t.Parse(mainTmpl)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
}
|
||||
t, err = t.Parse(footer)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
|
||||
// render all templates
|
||||
for _, temp := range templates {
|
||||
tmp, _ := source.TmplBox.String(temp)
|
||||
t, err = t.Parse(tmp)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
}
|
||||
}
|
||||
|
||||
// render all javascript files
|
||||
for _, temp := range javascripts {
|
||||
tmp, _ := source.JsBox.String(temp)
|
||||
t, err = t.Parse(tmp)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
}
|
||||
}
|
||||
|
||||
// render the page requested
|
||||
_, err = t.Parse(render)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
}
|
||||
_, err = t.Parse(chartIndex)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
}
|
||||
fmt.Println(t.Templates())
|
||||
fmt.Println(t.DefinedTemplates())
|
||||
|
||||
t.Lookup("chartIndex").Funcs(handlerFuncs(w, r))
|
||||
|
||||
// execute the template
|
||||
err = t.Execute(w, data)
|
||||
if err != nil {
|
||||
utils.Log(4, err)
|
||||
|
|
|
@ -108,7 +108,7 @@ func TestServicesViewHandler(t *testing.T) {
|
|||
Router().ServeHTTP(rr, req)
|
||||
body := rr.Body.String()
|
||||
assert.Equal(t, 200, rr.Code)
|
||||
assert.Contains(t, body, "<title>Statup | Google Service</title>")
|
||||
assert.Contains(t, body, "<title>Google Status</title>")
|
||||
assert.Contains(t, body, "Statup made with ❤️")
|
||||
}
|
||||
|
||||
|
@ -252,7 +252,7 @@ func TestUsersEditHandler(t *testing.T) {
|
|||
Router().ServeHTTP(rr, req)
|
||||
body := rr.Body.String()
|
||||
assert.Equal(t, 200, rr.Code)
|
||||
assert.Contains(t, body, "<title>Statup | Users</title>")
|
||||
assert.Contains(t, body, "<title>Statup | admin</title>")
|
||||
assert.Contains(t, body, "<h3>User admin</h3>")
|
||||
assert.Contains(t, body, "value=\"info@statup.io\"")
|
||||
assert.Contains(t, body, "value=\"##########\"")
|
||||
|
@ -347,7 +347,7 @@ func TestViewHTTPServicesHandler(t *testing.T) {
|
|||
Router().ServeHTTP(rr, req)
|
||||
body := rr.Body.String()
|
||||
assert.Equal(t, 200, rr.Code)
|
||||
assert.Contains(t, body, "<title>Statup | Crystal Castles - Kept Service</title>")
|
||||
assert.Contains(t, body, "<title>Crystal Castles - Kept Status</title>")
|
||||
assert.Contains(t, body, "Statup made with ❤️")
|
||||
}
|
||||
|
||||
|
@ -358,7 +358,7 @@ func TestViewTCPServicesHandler(t *testing.T) {
|
|||
Router().ServeHTTP(rr, req)
|
||||
body := rr.Body.String()
|
||||
assert.Equal(t, 200, rr.Code)
|
||||
assert.Contains(t, body, "<title>Statup | Local Postgres Service</title>")
|
||||
assert.Contains(t, body, "<title>Local Postgres Status</title>")
|
||||
assert.Contains(t, body, "Statup made with ❤️")
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,7 @@ func TestServicesUpdateHandler(t *testing.T) {
|
|||
Router().ServeHTTP(rr, req)
|
||||
body := rr.Body.String()
|
||||
assert.Equal(t, 200, rr.Code)
|
||||
assert.Contains(t, body, "<title>Statup | The Bravery - An Honest Mistake Service</title>")
|
||||
assert.Contains(t, body, "<title>The Bravery - An Honest Mistake Status</title>")
|
||||
assert.Contains(t, body, "Statup made with ❤️")
|
||||
}
|
||||
|
||||
|
|
|
@ -1,21 +1,11 @@
|
|||
{{ define "base" }}
|
||||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="https://assets.statup.io/favicon.ico">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
|
||||
<title>{{.Name}} Status</title>
|
||||
</head>
|
||||
{{block "head" .}} {{end}}
|
||||
<body>
|
||||
|
||||
{{template "content" .}}
|
||||
</body>
|
||||
<footer>{{template "footer" .}}</footer>
|
||||
{{template "scripts" .}}
|
||||
</html>
|
||||
{{end}}
|
||||
|
|
|
@ -1,97 +1,57 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
|
||||
<title>Statup | Dashboard</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup | Dashboard{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{template "nav" }}
|
||||
|
||||
<div class="col-12 mt-3">
|
||||
|
||||
<div class="row stats_area mb-5">
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{ CoreApp.ServicesCount }}</span>
|
||||
Total Services
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{ CoreApp.Count24HFailures }}</span>
|
||||
Failures last 24 Hours
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{ CoreApp.CountOnline }}</span>
|
||||
Online Services
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-4">
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<h3>Services</h3>
|
||||
|
||||
<div class="list-group mb-5 mt-3">
|
||||
{{ range Services }}
|
||||
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{.Name}}</h5>
|
||||
<small>{{if .Online}} <span class="badge badge-success">ONLINE</span> {{else}} <span class="badge badge-danger">OFFLINE</span> {{end}}</small>
|
||||
</div>
|
||||
<p class="mb-1">{{.SmallText}}</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
<div class="row stats_area mb-5">
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{ CoreApp.ServicesCount }}</span>
|
||||
Total Services
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{ CoreApp.Count24HFailures }}</span>
|
||||
Failures last 24 Hours
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{ CoreApp.CountOnline }}</span>
|
||||
Online Services
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col-12">
|
||||
<h3>Services</h3>
|
||||
<div class="list-group mb-5 mt-3">
|
||||
{{ range Services }}
|
||||
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{.Name}}</h5>
|
||||
<small>{{if .Online}} <span class="badge badge-success">ONLINE</span> {{else}} <span class="badge badge-danger">OFFLINE</span> {{end}}</small>
|
||||
</div>
|
||||
<p class="mb-1">{{.SmallText}}</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
{{ range Services }}
|
||||
{{ if .LimitedFailures }}
|
||||
<h4 class="text-truncate">{{.Name}} Failures</h4>
|
||||
<div class="list-group mt-3 mb-4">
|
||||
{{ range .LimitedFailures }}
|
||||
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{.ParseError}}</h5>
|
||||
<small>{{.Ago}}</small>
|
||||
</div>
|
||||
<p class="mb-1">{{.Issue}}</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{{ range Services }}
|
||||
{{ if .LimitedFailures }}
|
||||
<h4 class="text-truncate">{{.Name}} Failures</h4>
|
||||
<div class="list-group mt-3 mb-4">
|
||||
{{ range .LimitedFailures }}
|
||||
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{.ParseError}}</h5>
|
||||
<small>{{.Ago}}</small>
|
||||
</div>
|
||||
<p class="mb-1">{{.Issue}}</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,44 +1,10 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
|
||||
<title>Statup | Page Not Found</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup Page Not Found{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
<div class="col-12 mt-3">
|
||||
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Sorry, this page doesn't seem to exist.
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Sorry, this page doesn't seem to exist.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,9 +1,9 @@
|
|||
{{ define "footer"}}
|
||||
<div class="footer text-center mb-4">
|
||||
{{ if ne CoreApp.Footer "" }}
|
||||
{{ safe CoreApp.Footer }}
|
||||
{{ else }}
|
||||
<a href="https://github.com/hunterlong/statup" target="_blank">Statup {{VERSION}} made with ❤️</a> | <a href="/dashboard">Dashboard</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="footer text-center mb-4">
|
||||
{{ if CoreApp.Footer}}
|
||||
{{ CoreApp.Footer }}
|
||||
{{ else }}
|
||||
<a href="https://github.com/hunterlong/statup" target="_blank">Statup {{VERSION}} made with ❤️</a> | <a href="/dashboard">Dashboard</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
{{define "form_notifier"}}
|
||||
{{$n := .Select}}
|
||||
<form method="POST" class="{{underscore $n.Method }}" action="/settings/notifier/{{ $n.Method }}">
|
||||
{{if $n.Title}}<h4>{{$n.Title}}</h4>{{end}}
|
||||
{{if $n.Description}}<p class="small text-muted">{{safe $n.Description}}</p>{{end}}
|
||||
|
||||
{{range .Form}}
|
||||
<div class="form-group">
|
||||
<label class="text-capitalize" for="{{underscore .Title}}">{{.Title}}</label>
|
||||
<input type="{{.Type}}" name="{{underscore .DbField}}" class="form-control" value="{{ $n.GetValue .DbField }}" id="{{underscore .Title}}" placeholder="{{.Placeholder}}" {{if .Required}}required{{end}}>
|
||||
{{if .SmallText}}<small class="form-text text-muted">{{safe .SmallText}}</small>{{end}}
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-9 col-sm-6">
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">Limit</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="limits" min="1" max="60" id="limits_per_hour_{{underscore $n.Method }}" value="{{$n.Limits}}" placeholder="7">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">Per Minute</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-3 col-sm-2 mt-1">
|
||||
<span class="switch">
|
||||
<input type="checkbox" name="enable" class="switch" id="switch-{{ $n.Method }}" {{if $n.Enabled}}checked{{end}}>
|
||||
<label for="switch-{{ $n.Method }}"></label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="notifier" value="{{underscore $n.Method }}">
|
||||
|
||||
<div class="col-12 col-sm-4 mb-2 mb-sm-0 mt-2 mt-sm-0">
|
||||
<button type="submit" class="btn btn-primary btn-block text-capitalize">Save</button>
|
||||
</div>
|
||||
|
||||
{{if $n.CanTest}}
|
||||
<div class="col-12 col-sm-12">
|
||||
<button class="test_notifier btn btn-secondary btn-block text-capitalize col-12 float-right">Test</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-12 mt-2">
|
||||
<div class="alert alert-danger d-none" id="{{underscore $n.Method}}-error" role="alert">
|
||||
{{$n.Method}} has an error!
|
||||
</div>
|
||||
|
||||
<div class="alert alert-success d-none" id="{{underscore $n.Method}}-success" role="alert">
|
||||
The {{$n.Method}} notifier is working correctly!
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
|
||||
{{if $n.Author}}
|
||||
<span class="d-block small text-center mt-3 mb-5">
|
||||
{{$n.Title}} Notifier created by <a href="{{$n.AuthorUrl}}" target="_blank">{{$n.Author}}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</form>
|
||||
{{end}}
|
|
@ -0,0 +1,93 @@
|
|||
{{define "form_service"}}
|
||||
{{$url := "/service"}}
|
||||
{{if .}}
|
||||
{{$url = "/service/{{.Id}}"}}
|
||||
{{end}}
|
||||
<form action="{{$url}}" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="service_name" class="col-sm-4 col-form-label">Service Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" id="service_name" value="{{.Name}}" placeholder="Name" required spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_type" class="col-sm-4 col-form-label">Service Check Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="check_type" class="form-control" id="service_type" value="{{.Type}}">
|
||||
<option value="http" {{if eq .Type "http"}}selected{{end}}>HTTP Service</option>
|
||||
<option value="tcp" {{if eq .Type "tcp"}}selected{{end}}>TCP Service</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_url" class="col-sm-4 col-form-label">Application Endpoint (URL)</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="domain" class="form-control" id="service_url" value="{{.Domain}}" placeholder="https://google.com" required autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq .Type "tcp"}} d-none{{end}}">
|
||||
<label for="service_check_type" class="col-sm-4 col-form-label">Service Check Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="method" class="form-control" id="service_check_type" value="{{.Method}}">
|
||||
<option value="GET" {{if eq .Method "GET"}}selected{{end}}>GET</option>
|
||||
<option value="POST" {{if eq .Method "POST"}}selected{{end}}>POST</option>
|
||||
<option value="DELETE" {{if eq .Method "DELETE"}}selected{{end}}>DELETE</option>
|
||||
<option value="PATCH" {{if eq .Method "PATCH"}}selected{{end}}>PATCH</option>
|
||||
<option value="PUT" {{if eq .Method "PUT"}}selected{{end}}>PUT</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if ne .Method "POST"}} d-none{{end}}">
|
||||
<label for="post_data" class="col-sm-4 col-form-label">Optional Post Data (JSON)</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="post_data" class="form-control" id="post_data" rows="3" autocapitalize="false" spellcheck="false">{{.PostData}}</textarea>
|
||||
<small id="emailHelp" class="form-text text-muted">You can insert <a target="_blank" href="https://regex101.com/r/I5bbj9/1">Regex</a> to validate the response</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq .Type "tcp"}} d-none{{end}}">
|
||||
<label for="service_response" class="col-sm-4 col-form-label">Expected Response (Regex)</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="expected" class="form-control" id="service_response" rows="3" autocapitalize="false" spellcheck="false">{{.Expected}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq .Type "tcp"}} d-none{{end}}">
|
||||
<label for="service_response_code" class="col-sm-4 col-form-label">Expected Status Code</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="expected_status" class="form-control" value="{{.ExpectedStatus}}" id="service_response_code">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq .Type "http"}} d-none{{end}}">
|
||||
<label for="service_port" class="col-sm-4 col-form-label">TCP Port</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="port" class="form-control" value="{{.Port}}" id="service_port" placeholder="8080">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_interval" class="col-sm-4 col-form-label">Check Interval (Seconds)</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="interval" class="form-control" value="{{.Interval}}" min="1" id="service_interval" required>
|
||||
<small id="emailHelp" class="form-text text-muted">10,000+ will be checked in Microseconds (1 millisecond = 1000 microseconds).</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_timeout" class="col-sm-4 col-form-label">Timeout in Seconds</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="timeout" class="form-control" value="{{.Timeout}}" id="service_timeout" min="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="order" class="col-sm-4 col-form-label">List Order</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="order" class="form-control" min="0" value="{{.Order}}" id="order">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-6">
|
||||
<button type="submit" class="btn btn-success btn-block">Update Service</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<a href="/service/{{ .Id }}/delete_failures" class="btn btn-danger btn-block confirm-btn">Delete All Failures</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{{end}}
|
|
@ -0,0 +1,43 @@
|
|||
{{define "form_user"}}
|
||||
{{$url := "/user"}}
|
||||
{{if .}}
|
||||
{{$url = "/user/{{.Id}}"}}
|
||||
{{end}}
|
||||
<form action="{{$url}}" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="username" class="col-sm-4 col-form-label">Username</label>
|
||||
<div class="col-6 col-md-4">
|
||||
<input type="text" name="username" class="form-control" value="{{.Username}}" id="username" placeholder="Username" required>
|
||||
</div>
|
||||
<div class="col-6 col-md-4">
|
||||
<span class="switch">
|
||||
<input type="checkbox" name="admin" class="switch" id="switch-normal"{{if .Admin}} checked{{end}}>
|
||||
<label for="switch-normal">Administrator</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-sm-4 col-form-label">Email Address</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="email" name="email" class="form-control" id="email" value="{{.Email}}" placeholder="user@domain.com" required autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-sm-4 col-form-label">Password</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" name="password" class="form-control" id="password" value="##########" placeholder="Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password_confirm" class="col-sm-4 col-form-label">Confirm Password</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" name="password_confirm" class="form-control" id="password_confirm" value="##########" placeholder="Confirm Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<button type="submit" class="btn btn-primary btn-block">Update User</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{{end}}
|
|
@ -0,0 +1,17 @@
|
|||
{{ define "head"}}
|
||||
<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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="https://assets.statup.io/favicon.ico">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
{{block "extra_css" .}} {{end}}
|
||||
<title>{{block "title" .}} {{end}}</title>
|
||||
</head>
|
||||
{{end}}
|
|
@ -1,31 +1,15 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
<title>Statup | Help</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{{define "title"}}Statup | Help{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{if Auth}}
|
||||
{{template "nav"}}
|
||||
{{end}}
|
||||
|
||||
<div class="col-12">
|
||||
{{ safe . }}
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
{{ safe . }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
{{define "extra_css"}}
|
||||
<style>
|
||||
pre {
|
||||
background-color: white;
|
||||
|
@ -37,18 +21,4 @@
|
|||
color: #d87e1a;
|
||||
}
|
||||
</style>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,29 +1,11 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="https://assets.statup.io/favicon.ico">
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
|
||||
<title>{{.Name}} Status</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{{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 }}
|
||||
{{ 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">
|
||||
|
@ -40,8 +22,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12 full-col-12">
|
||||
<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>
|
||||
|
@ -50,79 +31,58 @@
|
|||
<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>
|
||||
{{ 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 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>
|
||||
{{ 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>
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/Chart.bundle.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
{{ if .Style }}
|
||||
<style>
|
||||
{{ safe .Style }}
|
||||
</style>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
{{define "extra_scripts"}}
|
||||
<script>
|
||||
{{ range Services }}
|
||||
{{template "chartIndex" .}}
|
||||
{{end}}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
|
|
@ -1,69 +1,34 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
<title>Statup | Login</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup Login{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
<div class="col-10 offset-1 col-md-8 offset-md-2 mt-md-2">
|
||||
|
||||
<div class="col-12 col-md-8 offset-md-2 mb-4">
|
||||
<img class="col-12 mt-5 mt-md-0" src="/statup.png">
|
||||
</div>
|
||||
|
||||
{{ if .Error }}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Incorrect login information submitted, try again.
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<form action="/dashboard" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="username" class="col-sm-2 col-form-label">Username</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="username" class="form-control" id="username" placeholder="Username" autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-sm-2 col-form-label">Password</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" name="password" class="form-control" id="password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<button type="submit" class="btn btn-primary btn-block">Sign in</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="col-10 offset-1 col-md-8 offset-md-2 mt-md-2">
|
||||
<div class="col-12 col-md-8 offset-md-2 mb-4">
|
||||
<img class="col-12 mt-5 mt-md-0" src="/statup.png">
|
||||
</div>
|
||||
|
||||
{{ if .Error }}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
Incorrect login information submitted, try again.
|
||||
</div>
|
||||
{{ end }}
|
||||
<form action="/dashboard" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="username" class="col-sm-2 col-form-label">Username</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="username" class="form-control" id="username" placeholder="Username" autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-sm-2 col-form-label">Password</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="password" name="password" class="form-control" id="password" placeholder="Password">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<button type="submit" class="btn btn-primary btn-block">Sign in</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,45 +1,15 @@
|
|||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
<title>Statup | Logs</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
{{define "title"}}Statup | Logs{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{if Auth}}
|
||||
{{template "nav"}}
|
||||
{{end}}
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<textarea id="live_logs" class="form-control" rows="40" readonly>{{range .}}{{.}}{{end}}</textarea>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<textarea id="live_logs" class="form-control" rows="40" readonly>{{range .}}{{.}}{{end}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
{{define "extra_css"}}
|
||||
<style>
|
||||
@media (max-width: 767px) {
|
||||
#live_logs {
|
||||
|
@ -47,6 +17,4 @@
|
|||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
{{define "scripts"}}
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/Chart.bundle.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
{{block "extra_scripts" .}} {{end}}
|
||||
{{end}}
|
|
@ -1,22 +1,6 @@
|
|||
{{define "title"}}{{.Service.Name}} Status{{end}}
|
||||
{{ define "content" }}
|
||||
{{$s := .Service}}
|
||||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script>
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
<script src="/js/Chart.bundle.min.js"></script>
|
||||
{{end}}
|
||||
|
||||
<title>Statup | {{$s.Name}} Service</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
|
@ -24,228 +8,130 @@
|
|||
{{template "nav"}}
|
||||
{{end}}
|
||||
|
||||
<div class="col-12 mb-4">
|
||||
<div class="col-12 mb-4">
|
||||
|
||||
{{if $s.Online }}
|
||||
<span class="mt-3 mb-3 text-white d-md-none btn bg-success d-block d-md-none">ONLINE</span>
|
||||
{{ else }}
|
||||
<span class="mt-3 mb-3 text-white d-md-none btn bg-danger d-block d-md-none">OFFLINE</span>
|
||||
{{end}}
|
||||
{{if $s.Online }}
|
||||
<span class="mt-3 mb-3 text-white d-md-none btn bg-success d-block d-md-none">ONLINE</span>
|
||||
{{ else }}
|
||||
<span class="mt-3 mb-3 text-white d-md-none btn bg-danger d-block d-md-none">OFFLINE</span>
|
||||
{{end}}
|
||||
|
||||
<h4 class="mt-2">{{ $s.Name }}
|
||||
{{if $s.Online }}
|
||||
<span class="badge bg-success float-right d-none d-md-block">ONLINE</span>
|
||||
{{ else }}
|
||||
<span class="badge bg-danger float-right d-none d-md-block">OFFLINE</span>
|
||||
{{end}}</h4>
|
||||
<h4 class="mt-2">{{ $s.Name }}
|
||||
{{if $s.Online }}
|
||||
<span class="badge bg-success float-right d-none d-md-block">ONLINE</span>
|
||||
{{ else }}
|
||||
<span class="badge bg-danger float-right d-none d-md-block">OFFLINE</span>
|
||||
{{end}}</h4>
|
||||
|
||||
<div class="row stats_area mt-5 mb-5">
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{$s.Online24}}%</span>
|
||||
Online last 24 Hours
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{$s.AvgTime}}ms</span>
|
||||
Average Response
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{$s.TotalUptime}}%</span>
|
||||
Total Uptime
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="service-chart-container">
|
||||
<canvas id="service"></canvas>
|
||||
</div>
|
||||
|
||||
<form id="service_date_form" class="col-12 mt-2 mb-3">
|
||||
<span id="start_date" class="text-muted small float-left pointer">{{FromUnix .Start}}</span>
|
||||
<span id="end_date" class="text-muted small float-right pointer" style="position: absolute;right: 0;">{{FromUnix .End}}</span>
|
||||
<input type="hidden" name="start" class="form-control" id="service_start" spellcheck="false">
|
||||
<input type="hidden" name="end" class="form-control" id="service_end" spellcheck="false">
|
||||
<button type="submit" class="btn btn-light btn-block btn-sm mt-2">Set Timeframe</button>
|
||||
<div id="start_container"></div>
|
||||
<div id="end_container"></div>
|
||||
</form>
|
||||
|
||||
{{if not $s.Online}}
|
||||
<div class="col-12 small text-center mt-3 text-muted">{{$s.DowntimeText}}</div>
|
||||
{{end}}
|
||||
|
||||
{{ if $s.LimitedFailures }}
|
||||
<div class="list-group mt-3 mb-4">
|
||||
{{ range $s.LimitedFailures }}
|
||||
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{.ParseError}}</h5>
|
||||
<small>{{.Ago}}</small>
|
||||
</div>
|
||||
<p class="mb-1">{{.Issue}}</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="row stats_area mt-5 mb-5">
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{$s.Online24}}%</span>
|
||||
Online last 24 Hours
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{$s.AvgTime}}ms</span>
|
||||
Average Response
|
||||
</div>
|
||||
|
||||
<div class="col-4">
|
||||
<span class="lg_number">{{$s.TotalUptime}}%</span>
|
||||
Total Uptime
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="service-chart-container">
|
||||
<canvas id="service"></canvas>
|
||||
</div>
|
||||
|
||||
<form id="service_date_form" class="col-12 mt-2 mb-3">
|
||||
<span id="start_date" class="text-muted small float-left pointer">{{FromUnix .Start}}</span>
|
||||
<span id="end_date" class="text-muted small float-right pointer" style="position: absolute;right: 0;">{{FromUnix .End}}</span>
|
||||
<input type="hidden" name="start" class="form-control" id="service_start" spellcheck="false">
|
||||
<input type="hidden" name="end" class="form-control" id="service_end" spellcheck="false">
|
||||
<button type="submit" class="btn btn-light btn-block btn-sm mt-2">Set Timeframe</button>
|
||||
<div id="start_container"></div>
|
||||
<div id="end_container"></div>
|
||||
</form>
|
||||
|
||||
{{if not $s.Online}}
|
||||
<div class="col-12 small text-center mt-3 text-muted">{{$s.DowntimeText}}</div>
|
||||
{{end}}
|
||||
|
||||
{{ if $s.LimitedFailures }}
|
||||
<div class="list-group mt-3 mb-4">
|
||||
{{ range $s.LimitedFailures }}
|
||||
<a href="#" class="list-group-item list-group-item-action flex-column align-items-start">
|
||||
<div class="d-flex w-100 justify-content-between">
|
||||
<h5 class="mb-1">{{.ParseError}}</h5>
|
||||
<small>{{.Ago}}</small>
|
||||
</div>
|
||||
<p class="mb-1">{{.Issue}}</p>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
|
||||
{{if Auth}}
|
||||
|
||||
<div class="col-12 mt-4">
|
||||
<div class="col-12 mt-4">
|
||||
|
||||
<h3>Edit Service</h3>
|
||||
<h3>Edit Service</h3>
|
||||
|
||||
<form action="/service/{{$s.Id}}" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="service_name" class="col-sm-4 col-form-label">Service Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" id="service_name" value="{{$s.Name}}" placeholder="Name" required spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_type" class="col-sm-4 col-form-label">Service Check Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="check_type" class="form-control" id="service_type" value="{{$s.Type}}">
|
||||
<option value="http" {{if eq $s.Type "http"}}selected{{end}}>HTTP Service</option>
|
||||
<option value="tcp" {{if eq $s.Type "tcp"}}selected{{end}}>TCP Service</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_url" class="col-sm-4 col-form-label">Application Endpoint (URL)</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="domain" class="form-control" id="service_url" value="{{$s.Domain}}" placeholder="https://google.com" required autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq $s.Type "tcp"}} d-none{{end}}">
|
||||
<label for="service_check_type" class="col-sm-4 col-form-label">Service Check Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="method" class="form-control" id="service_check_type" value="{{$s.Method}}">
|
||||
<option value="GET" {{if eq $s.Method "GET"}}selected{{end}}>GET</option>
|
||||
<option value="POST" {{if eq $s.Method "POST"}}selected{{end}}>POST</option>
|
||||
<option value="DELETE" {{if eq $s.Method "DELETE"}}selected{{end}}>DELETE</option>
|
||||
<option value="PATCH" {{if eq $s.Method "PATCH"}}selected{{end}}>PATCH</option>
|
||||
<option value="PUT" {{if eq $s.Method "PUT"}}selected{{end}}>PUT</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if ne $s.Method "POST"}} d-none{{end}}">
|
||||
<label for="post_data" class="col-sm-4 col-form-label">Optional Post Data (JSON)</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="post_data" class="form-control" id="post_data" rows="3" autocapitalize="false" spellcheck="false">{{$s.PostData}}</textarea>
|
||||
<small id="emailHelp" class="form-text text-muted">You can insert <a target="_blank" href="https://regex101.com/r/I5bbj9/1">Regex</a> to validate the response</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq $s.Type "tcp"}} d-none{{end}}">
|
||||
<label for="service_response" class="col-sm-4 col-form-label">Expected Response (Regex)</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="expected" class="form-control" id="service_response" rows="3" autocapitalize="false" spellcheck="false">{{$s.Expected}}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq $s.Type "tcp"}} d-none{{end}}">
|
||||
<label for="service_response_code" class="col-sm-4 col-form-label">Expected Status Code</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="expected_status" class="form-control" value="{{$s.ExpectedStatus}}" id="service_response_code">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row{{if eq $s.Type "http"}} d-none{{end}}">
|
||||
<label for="service_port" class="col-sm-4 col-form-label">TCP Port</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="port" class="form-control" value="{{$s.Port}}" id="service_port" placeholder="8080">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_interval" class="col-sm-4 col-form-label">Check Interval (Seconds)</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="interval" class="form-control" value="{{$s.Interval}}" min="1" id="service_interval" required>
|
||||
<small id="emailHelp" class="form-text text-muted">10,000+ will be checked in Microseconds (1 millisecond = 1000 microseconds).</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_timeout" class="col-sm-4 col-form-label">Timeout in Seconds</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="timeout" class="form-control" value="{{$s.Timeout}}" id="service_timeout" min="1">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="order" class="col-sm-4 col-form-label">List Order</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="order" class="form-control" min="0" value="{{$s.Order}}" id="order">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-6">
|
||||
<button type="submit" class="btn btn-success btn-block">Update Service</button>
|
||||
</div>
|
||||
<div class="col-6">
|
||||
<a href="/service/{{ $s.Id }}/delete_failures" class="btn btn-danger btn-block confirm-btn">Delete All Failures</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{{template "form_service" $s}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12 mt-4{{if eq $s.Type "tcp"}} d-none{{end}}">
|
||||
<h3>Last Response</h3>
|
||||
<textarea rows="8" class="form-control" readonly>{{ $s.LastResponse }}</textarea>
|
||||
<div class="form-group row mt-2">
|
||||
<label for="last_status_code" class="col-sm-3 col-form-label">HTTP Status Code</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" id="last_status_code" class="form-control" value="{{ $s.LastStatusCode }}" readonly>
|
||||
<div class="col-12 mt-4{{if eq $s.Type "tcp"}} d-none{{end}}">
|
||||
<h3>Last Response</h3>
|
||||
<textarea rows="8" class="form-control" readonly>{{ $s.LastResponse }}</textarea>
|
||||
<div class="form-group row mt-2">
|
||||
<label for="last_status_code" class="col-sm-3 col-form-label">HTTP Status Code</label>
|
||||
<div class="col-sm-2">
|
||||
<input type="text" id="last_status_code" class="form-control" value="{{ $s.LastStatusCode }}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-12 mt-4{{if eq $s.Type "tcp"}} d-none{{end}}">
|
||||
<h3>Service Checkins</h3>
|
||||
{{ range $s.Checkins }}
|
||||
<h5>Check #{{.Id}} <span class="badge online_badge float-right">Checked in {{.Ago}}</span></h5>
|
||||
<input type="text" class="form-control" value="https://domainhere.com/api/checkin/{{.Api}}">
|
||||
{{ end }}
|
||||
<div class="col-12 mt-4{{if eq $s.Type "tcp"}} d-none{{end}}">
|
||||
<h3>Service Checkins</h3>
|
||||
{{ range $s.Checkins }}
|
||||
<h5>Check #{{.Id}} <span class="badge online_badge float-right">Checked in {{.Ago}}</span></h5>
|
||||
<input type="text" class="form-control" value="https://domainhere.com/api/checkin/{{.Api}}">
|
||||
{{ end }}
|
||||
|
||||
<form action="/service/{{$s.Id}}/checkin" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="service_name" class="col-sm-4 col-form-label">Check Interval (in seconds)</label>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<input type="number" name="name" class="form-control" id="checkin_interval" value="30" placeholder="Name">
|
||||
<form action="/service/{{$s.Id}}/checkin" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="service_name" class="col-sm-4 col-form-label">Check Interval (in seconds)</label>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<input type="number" name="name" class="form-control" id="checkin_interval" value="30" placeholder="Name">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-success d-none d-md-block float-right">Save Checkin</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-success d-none d-md-block float-right">Save Checkin</button>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button type="submit" class="btn btn-success d-block d-md-none btn-block">Save Checkin</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-10">
|
||||
<button type="submit" class="btn btn-success d-block d-md-none btn-block">Save Checkin</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{{end}}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{end}}
|
||||
{{define "extra_scripts"}}
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.2/Chart.bundle.min.js"></script>
|
||||
<script src="https://assets.statup.io/pikaday.js"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/Chart.bundle.min.js"></script>
|
||||
<script src="/js/pikaday.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
{{$s := .Service}}
|
||||
<script>
|
||||
|
||||
var ctx = document.getElementById("service").getContext('2d');
|
||||
|
@ -318,8 +204,8 @@
|
|||
container: $("#start_container")[0],
|
||||
maxDate: new Date(),
|
||||
onSelect: function(date) {
|
||||
$('#service_start')[0].value = Math.round(date.getTime() / 1000);
|
||||
this.hide();
|
||||
$('#service_start')[0].value = Math.round(date.getTime() / 1000);
|
||||
this.hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -330,8 +216,8 @@
|
|||
container: $("#end_container")[0],
|
||||
maxDate: new Date(),
|
||||
onSelect: function(date) {
|
||||
$('#service_end')[0].value = Math.round(date.getTime() / 1000);
|
||||
this.hide();
|
||||
$('#service_end')[0].value = Math.round(date.getTime() / 1000);
|
||||
this.hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -352,6 +238,4 @@
|
|||
AjaxChart(chartdata,{{$s.Id}},{{.Start}},{{.End}},"hour");
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
|
|
@ -1,157 +1,49 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
<title>Statup | Services</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup | Services{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{template "nav"}}
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<h3>Services</h3>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col" class="d-none d-md-table-cell">Status</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sortable">
|
||||
{{range .}}
|
||||
<tr id="{{.Id}}">
|
||||
<td><span class="drag_icon d-none d-md-inline">☰</span> {{.Name}}</td>
|
||||
<td class="d-none d-md-table-cell">{{if .Online}}<span class="badge badge-success">ONLINE</span>{{else}}<span class="badge badge-danger">OFFLINE</span>{{end}} </td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<a href="/service/{{.Id}}" class="btn btn-primary">View</a>
|
||||
<a href="/service/{{.Id}}/delete" class="btn btn-danger confirm-btn">Delete</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col" class="d-none d-md-table-cell">Status</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="sortable">
|
||||
{{range .}}
|
||||
<tr id="{{.Id}}">
|
||||
<td><span class="drag_icon d-none d-md-inline">☰</span> {{.Name}}</td>
|
||||
<td class="d-none d-md-table-cell">{{if .Online}}<span class="badge badge-success">ONLINE</span>{{else}}<span class="badge badge-danger">OFFLINE</span>{{end}} </td>
|
||||
<td class="text-right">
|
||||
<div class="btn-group">
|
||||
<a href="/service/{{.Id}}" class="btn btn-primary">View</a>
|
||||
<a href="/service/{{.Id}}/delete" class="btn btn-danger confirm-btn">Delete</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<h3>Create Service</h3>
|
||||
<h3>Create Service</h3>
|
||||
|
||||
<form action="/services" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="service_name" class="col-sm-4 col-form-label">Service Name</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="name" class="form-control" id="service_name" placeholder="Name" required spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_type" class="col-sm-4 col-form-label">Service Check Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="check_type" class="form-control" id="service_type">
|
||||
<option value="http" selected>HTTP Service</option>
|
||||
<option value="tcp">TCP Service</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_url" class="col-sm-4 col-form-label">Application Endpoint (URL)</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="domain" class="form-control" id="service_url" placeholder="https://google.com" required autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_check_type" class="col-sm-4 col-form-label">Service Check Type</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="method" class="form-control" id="service_check_type">
|
||||
<option value="GET" selected>GET</option>
|
||||
<option value="POST">POST</option>
|
||||
<option value="DELETE">DELETE</option>
|
||||
<option value="PATCH">PATCH</option>
|
||||
<option value="PUT">PUT</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row d-none">
|
||||
<label for="post_data" class="col-sm-4 col-form-label">Post Data (JSON)</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="post_data" class="form-control" id="post_data" rows="3" autocapitalize="false" spellcheck="false"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_response" class="col-sm-4 col-form-label">Expected Response (Regex)</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="expected" class="form-control" id="service_response" rows="3" autocapitalize="false" spellcheck="false"></textarea>
|
||||
<small id="emailHelp" class="form-text text-muted">You can insert <a target="_blank" href="https://regex101.com/r/I5bbj9/1">Regex</a> to validate the response</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_response_code" class="col-sm-4 col-form-label">Expected Status Code</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="expected_status" class="form-control" id="service_response_code" value="200">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row d-none">
|
||||
<label for="service_port" class="col-sm-4 col-form-label">TCP Port</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="port" class="form-control" id="service_port" placeholder="8080">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_interval" class="col-sm-4 col-form-label">Check Interval (Seconds)</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="interval" class="form-control" id="service_interval" min="1" value="60" required>
|
||||
<small id="emailHelp" class="form-text text-muted">10,000+ will be checked in Microseconds (1 millisecond = 1000 microseconds).</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="service_timeout" class="col-sm-4 col-form-label">Timeout in Seconds</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="timeout" class="form-control" id="service_timeout" min="1" value="30">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="order" class="col-sm-4 col-form-label">List Order</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="number" name="order" class="form-control" min="0" value="0" id="order">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<button type="submit" class="btn btn-success btn-block">Create Service</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{{template "form_service" NewService}}
|
||||
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://assets.statup.io/sortable.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/sortable.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
</div>
|
||||
{{end}}
|
||||
{{define "extra_scripts"}}
|
||||
{{if USE_CDN}}
|
||||
<script src="https://assets.statup.io/sortable.min.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/sortable.min.js"></script>
|
||||
{{end}}
|
||||
|
||||
<script>
|
||||
sortable('.sortable', {
|
||||
forcePlaceholderSize: true,
|
||||
|
@ -171,6 +63,4 @@
|
|||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
{{end}}
|
||||
|
|
|
@ -1,265 +1,182 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
<link rel="stylesheet" href="https://assets.statup.io/codemirror.css">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/codemirror-colorpicker.css"/>
|
||||
|
||||
<title>Statup | Settings</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup | Settings{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{template "nav"}}
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-3 col-sm-12 mb-4 mb-md-0">
|
||||
|
||||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
||||
<a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Settings</a>
|
||||
<a class="nav-link" id="v-pills-style-tab" data-toggle="pill" href="#v-pills-style" role="tab" aria-controls="v-pills-style" aria-selected="false">Theme Editor</a>
|
||||
{{ range .Notifications }}
|
||||
<a class="nav-link text-capitalize" id="v-pills-{{underscore .Select.Method}}-tab" data-toggle="pill" href="#v-pills-{{underscore .Select.Method}}" role="tab" aria-controls="v-pills-{{underscore .Select.Method}}" aria-selected="false">{{.Select.Method}} <span class="badge badge-pill badge-secondary"></span></a>
|
||||
{{ end }}
|
||||
<a class="nav-link" id="v-pills-browse-tab" data-toggle="pill" href="#v-pills-browse" role="tab" aria-controls="v-pills-home" aria-selected="false">Browse Plugins</a>
|
||||
<a class="nav-link d-none" id="v-pills-backups-tab" data-toggle="pill" href="#v-pills-backups" role="tab" aria-controls="v-pills-backups" aria-selected="false">Backups</a>
|
||||
{{ range .Plugins }}
|
||||
<a class="nav-link text-capitalize" id="v-pills-{{underscore .Name}}-tab" data-toggle="pill" href="#v-pills-{{underscore .Name}}" role="tab" aria-controls="v-pills-profile" aria-selected="false">{{.Name}}</a>
|
||||
{{end}}
|
||||
<div class="col-md-3 col-sm-12 mb-4 mb-md-0">
|
||||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
||||
<a class="nav-link active" id="v-pills-home-tab" data-toggle="pill" href="#v-pills-home" role="tab" aria-controls="v-pills-home" aria-selected="true">Settings</a>
|
||||
<a class="nav-link" id="v-pills-style-tab" data-toggle="pill" href="#v-pills-style" role="tab" aria-controls="v-pills-style" aria-selected="false">Theme Editor</a>
|
||||
{{ range .Notifications }}
|
||||
<a class="nav-link text-capitalize" id="v-pills-{{underscore .Select.Method}}-tab" data-toggle="pill" href="#v-pills-{{underscore .Select.Method}}" role="tab" aria-controls="v-pills-{{underscore .Select.Method}}" aria-selected="false">{{.Select.Method}} <span class="badge badge-pill badge-secondary"></span></a>
|
||||
{{ end }}
|
||||
<a class="nav-link" id="v-pills-browse-tab" data-toggle="pill" href="#v-pills-browse" role="tab" aria-controls="v-pills-home" aria-selected="false">Browse Plugins</a>
|
||||
<a class="nav-link d-none" id="v-pills-backups-tab" data-toggle="pill" href="#v-pills-backups" role="tab" aria-controls="v-pills-backups" aria-selected="false">Backups</a>
|
||||
{{ range .Plugins }}
|
||||
<a class="nav-link text-capitalize" id="v-pills-{{underscore .Name}}-tab" data-toggle="pill" href="#v-pills-{{underscore .Name}}" role="tab" aria-controls="v-pills-profile" aria-selected="false">{{.Name}}</a>
|
||||
{{end}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8 col-sm-12">
|
||||
<div class="col-md-8 col-sm-12">
|
||||
{{if Error}}
|
||||
<div class="alert alert-danger" role="alert">{{Error}}</div>
|
||||
{{end}}
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
|
||||
<h3>Settings</h3>
|
||||
<div class="tab-content" id="v-pills-tabContent">
|
||||
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
|
||||
<h3>Settings</h3>
|
||||
|
||||
<form method="POST" action="/settings">
|
||||
<form method="POST" action="/settings">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="project">Project Name</label>
|
||||
<input type="text" name="project" class="form-control" value="{{ .Name }}" id="project" placeholder="Great Uptime">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Project Description</label>
|
||||
<input type="text" name="description" class="form-control" value="{{ .Description }}" id="description" placeholder="Great Uptime">
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-8 col-sm-9">
|
||||
<label for="domain">Domain</label>
|
||||
<input type="text" name="domain" class="form-control" value="{{ .Domain }}" id="domain">
|
||||
<div class="form-group">
|
||||
<label for="project">Project Name</label>
|
||||
<input type="text" name="project" class="form-control" value="{{ .Name }}" id="project" placeholder="Great Uptime">
|
||||
</div>
|
||||
<div class="col-4 col-sm-3 mt-sm-1 mt-0">
|
||||
<label for="enable_cdn" class="d-inline d-sm-none">Enable CDN</label>
|
||||
<label for="enable_cdn" class="d-none d-sm-block">Enable CDN</label>
|
||||
<span class="switch">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Project Description</label>
|
||||
<input type="text" name="description" class="form-control" value="{{ .Description }}" id="description" placeholder="Great Uptime">
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<div class="col-8 col-sm-9">
|
||||
<label for="domain">Domain</label>
|
||||
<input type="text" name="domain" class="form-control" value="{{ .Domain }}" id="domain">
|
||||
</div>
|
||||
<div class="col-4 col-sm-3 mt-sm-1 mt-0">
|
||||
<label for="enable_cdn" class="d-inline d-sm-none">Enable CDN</label>
|
||||
<label for="enable_cdn" class="d-none d-sm-block">Enable CDN</label>
|
||||
<span class="switch">
|
||||
<input type="checkbox" name="enable_cdn" class="switch" id="switch-normal" {{if USE_CDN}}checked{{end}}{{if .UsingAssets}} disabled{{end}}>
|
||||
<label for="switch-normal" class="mt-2 mt-sm-0"></label>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="footer">Custom Footer</label>
|
||||
<textarea rows="4" name="footer" class="form-control" id="footer">{{ .Footer }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="timezone">Timezone</label><span class="mt-1 small float-right">Current: {{.CurrentTime}}</span>
|
||||
<select class="form-control" name="timezone" id="timezone">
|
||||
<option value="-12.0" {{if eq (ToString .Timezone) "-12"}}selected{{end}}>(GMT -12:00) Eniwetok, Kwajalein</option>
|
||||
<option value="-11.0" {{if eq (ToString .Timezone) "-11"}}selected{{end}}>(GMT -11:00) Midway Island, Samoa</option>
|
||||
<option value="-10.0" {{if eq (ToString .Timezone) "-10"}}selected{{end}}>(GMT -10:00) Hawaii</option>
|
||||
<option value="-9.0" {{if eq (ToString .Timezone) "-9"}}selected{{end}}>(GMT -9:00) Alaska</option>
|
||||
<option value="-8.0" {{if eq (ToString .Timezone) "-8"}}selected{{end}}>(GMT -8:00) Pacific Time (US & Canada)</option>
|
||||
<option value="-7.0" {{if eq (ToString .Timezone) "-7"}}selected{{end}}>(GMT -7:00) Mountain Time (US & Canada)</option>
|
||||
<option value="-6.0" {{if eq (ToString .Timezone) "-6"}}selected{{end}}>(GMT -6:00) Central Time (US & Canada), Mexico City</option>
|
||||
<option value="-5.0" {{if eq (ToString .Timezone) "-5"}}selected{{end}}>(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option>
|
||||
<option value="-4.0" {{if eq (ToString .Timezone) "-4"}}selected{{end}}>(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
|
||||
<option value="-3.5" {{if eq (ToString .Timezone) "-3.5"}}selected{{end}}>(GMT -3:30) Newfoundland</option>
|
||||
<option value="-3.0" {{if eq (ToString .Timezone) "-3"}}selected{{end}}>(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
|
||||
<option value="-2.0" {{if eq (ToString .Timezone) "-2"}}selected{{end}}>(GMT -2:00) Mid-Atlantic</option>
|
||||
<option value="-1.0" {{if eq (ToString .Timezone) "-1"}}selected{{end}}>(GMT -1:00 hour) Azores, Cape Verde Islands</option>
|
||||
<option value="0.0" {{if eq (ToString .Timezone) "0"}}selected{{end}}>(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
|
||||
<option value="1.0" {{if eq (ToString .Timezone) "1"}}selected{{end}}>(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
|
||||
<option value="2.0" {{if eq (ToString .Timezone) "2"}}selected{{end}}>(GMT +2:00) Kaliningrad, South Africa</option>
|
||||
<option value="3.0" {{if eq (ToString .Timezone) "3"}}selected{{end}}>(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
|
||||
<option value="3.5" {{if eq (ToString .Timezone) "3.5"}}selected{{end}}>(GMT +3:30) Tehran</option>
|
||||
<option value="4.0" {{if eq (ToString .Timezone) "4"}}selected{{end}}>(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
|
||||
<option value="4.5" {{if eq (ToString .Timezone) "4.5"}}selected{{end}}>(GMT +4:30) Kabul</option>
|
||||
<option value="5.0" {{if eq (ToString .Timezone) "5"}}selected{{end}}>(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
|
||||
<option value="5.5" {{if eq (ToString .Timezone) "5.5"}}selected{{end}}>(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
|
||||
<option value="5.75" {{if eq (ToString .Timezone) "5.75"}}selected{{end}}>(GMT +5:45) Kathmandu</option>
|
||||
<option value="6.0" {{if eq (ToString .Timezone) "6"}}selected{{end}}>(GMT +6:00) Almaty, Dhaka, Colombo</option>
|
||||
<option value="7.0" {{if eq (ToString .Timezone) "7"}}selected{{end}}>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
|
||||
<option value="8.0" {{if eq (ToString .Timezone) "8"}}selected{{end}}>(GMT +8:00) Beijing, Perth, Singapore, Hong Kong</option>
|
||||
<option value="9.0" {{if eq (ToString .Timezone) "9"}}selected{{end}}>(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
|
||||
<option value="9.5" {{if eq (ToString .Timezone) "9.5"}}selected{{end}}>(GMT +9:30) Adelaide, Darwin</option>
|
||||
<option value="10.0" {{if eq (ToString .Timezone) "10.5"}}selected{{end}}>(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
|
||||
<option value="11.0" {{if eq (ToString .Timezone) "11"}}selected{{end}}>(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
|
||||
<option value="12.0" {{if eq (ToString .Timezone) "12"}}selected{{end}}>(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary btn-block">Save Settings</button>
|
||||
|
||||
<div class="form-group row mt-3">
|
||||
<label for="api_key" class="col-sm-3 col-form-label">API Key</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control select-input" value="{{ .ApiKey }}" id="api_key" readonly>
|
||||
<div class="form-group">
|
||||
<label for="footer">Custom Footer</label>
|
||||
<textarea rows="4" name="footer" class="form-control" id="footer">{{ .Footer }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label for="api_secret" class="col-sm-3 col-form-label">API Secret</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control select-input" value="{{ .ApiSecret }}" id="api_secret" readonly>
|
||||
<small class="form-text text-muted">You can <a href="/api/renew">Regenerate API Keys</a> if you need to.</small>
|
||||
<div class="form-group">
|
||||
<label for="timezone">Timezone</label><span class="mt-1 small float-right">Current: {{.CurrentTime}}</span>
|
||||
<select class="form-control" name="timezone" id="timezone">
|
||||
<option value="-12.0" {{if eq (ToString .Timezone) "-12"}}selected{{end}}>(GMT -12:00) Eniwetok, Kwajalein</option>
|
||||
<option value="-11.0" {{if eq (ToString .Timezone) "-11"}}selected{{end}}>(GMT -11:00) Midway Island, Samoa</option>
|
||||
<option value="-10.0" {{if eq (ToString .Timezone) "-10"}}selected{{end}}>(GMT -10:00) Hawaii</option>
|
||||
<option value="-9.0" {{if eq (ToString .Timezone) "-9"}}selected{{end}}>(GMT -9:00) Alaska</option>
|
||||
<option value="-8.0" {{if eq (ToString .Timezone) "-8"}}selected{{end}}>(GMT -8:00) Pacific Time (US & Canada)</option>
|
||||
<option value="-7.0" {{if eq (ToString .Timezone) "-7"}}selected{{end}}>(GMT -7:00) Mountain Time (US & Canada)</option>
|
||||
<option value="-6.0" {{if eq (ToString .Timezone) "-6"}}selected{{end}}>(GMT -6:00) Central Time (US & Canada), Mexico City</option>
|
||||
<option value="-5.0" {{if eq (ToString .Timezone) "-5"}}selected{{end}}>(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option>
|
||||
<option value="-4.0" {{if eq (ToString .Timezone) "-4"}}selected{{end}}>(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option>
|
||||
<option value="-3.5" {{if eq (ToString .Timezone) "-3.5"}}selected{{end}}>(GMT -3:30) Newfoundland</option>
|
||||
<option value="-3.0" {{if eq (ToString .Timezone) "-3"}}selected{{end}}>(GMT -3:00) Brazil, Buenos Aires, Georgetown</option>
|
||||
<option value="-2.0" {{if eq (ToString .Timezone) "-2"}}selected{{end}}>(GMT -2:00) Mid-Atlantic</option>
|
||||
<option value="-1.0" {{if eq (ToString .Timezone) "-1"}}selected{{end}}>(GMT -1:00 hour) Azores, Cape Verde Islands</option>
|
||||
<option value="0.0" {{if eq (ToString .Timezone) "0"}}selected{{end}}>(GMT) Western Europe Time, London, Lisbon, Casablanca</option>
|
||||
<option value="1.0" {{if eq (ToString .Timezone) "1"}}selected{{end}}>(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option>
|
||||
<option value="2.0" {{if eq (ToString .Timezone) "2"}}selected{{end}}>(GMT +2:00) Kaliningrad, South Africa</option>
|
||||
<option value="3.0" {{if eq (ToString .Timezone) "3"}}selected{{end}}>(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option>
|
||||
<option value="3.5" {{if eq (ToString .Timezone) "3.5"}}selected{{end}}>(GMT +3:30) Tehran</option>
|
||||
<option value="4.0" {{if eq (ToString .Timezone) "4"}}selected{{end}}>(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option>
|
||||
<option value="4.5" {{if eq (ToString .Timezone) "4.5"}}selected{{end}}>(GMT +4:30) Kabul</option>
|
||||
<option value="5.0" {{if eq (ToString .Timezone) "5"}}selected{{end}}>(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option>
|
||||
<option value="5.5" {{if eq (ToString .Timezone) "5.5"}}selected{{end}}>(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option>
|
||||
<option value="5.75" {{if eq (ToString .Timezone) "5.75"}}selected{{end}}>(GMT +5:45) Kathmandu</option>
|
||||
<option value="6.0" {{if eq (ToString .Timezone) "6"}}selected{{end}}>(GMT +6:00) Almaty, Dhaka, Colombo</option>
|
||||
<option value="7.0" {{if eq (ToString .Timezone) "7"}}selected{{end}}>(GMT +7:00) Bangkok, Hanoi, Jakarta</option>
|
||||
<option value="8.0" {{if eq (ToString .Timezone) "8"}}selected{{end}}>(GMT +8:00) Beijing, Perth, Singapore, Hong Kong</option>
|
||||
<option value="9.0" {{if eq (ToString .Timezone) "9"}}selected{{end}}>(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option>
|
||||
<option value="9.5" {{if eq (ToString .Timezone) "9.5"}}selected{{end}}>(GMT +9:30) Adelaide, Darwin</option>
|
||||
<option value="10.0" {{if eq (ToString .Timezone) "10.5"}}selected{{end}}>(GMT +10:00) Eastern Australia, Guam, Vladivostok</option>
|
||||
<option value="11.0" {{if eq (ToString .Timezone) "11"}}selected{{end}}>(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option>
|
||||
<option value="12.0" {{if eq (ToString .Timezone) "12"}}selected{{end}}>(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<a href="/settings/export" class="btn btn-sm btn-secondary float-right">Export Settings</a>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-block">Save Settings</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="v-pills-style" role="tabpanel" aria-labelledby="v-pills-style-tab">
|
||||
|
||||
{{if not .UsingAssets }}
|
||||
<a href="/settings/build" class="btn btn-primary btn-block"{{if USE_CDN}} disabled{{end}}>Enable Local Assets</a>
|
||||
{{ else }}
|
||||
<form method="POST" action="/settings/css">
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item col text-center">
|
||||
<a class="nav-link active" id="pills-vars-tab" data-toggle="pill" href="#pills-vars" role="tab" aria-controls="pills-vars" aria-selected="true">Variables</a>
|
||||
</li>
|
||||
<li class="nav-item col text-center">
|
||||
<a class="nav-link" id="pills-theme-tab" data-toggle="pill" href="#pills-theme" role="tab" aria-controls="pills-theme" aria-selected="false">Base Theme</a>
|
||||
</li>
|
||||
<li class="nav-item col text-center">
|
||||
<a class="nav-link" id="pills-mobile-tab" data-toggle="pill" href="#pills-mobile" role="tab" aria-controls="pills-mobile" aria-selected="false">Mobile</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane show active" id="pills-vars" role="tabpanel" aria-labelledby="pills-vars-tab">
|
||||
<textarea name="variables" id="sass_vars">{{ .SassVars }}</textarea>
|
||||
<div class="form-group row mt-3">
|
||||
<label for="api_key" class="col-sm-3 col-form-label">API Key</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control select-input" value="{{ .ApiKey }}" id="api_key" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane" id="pills-theme" role="tabpanel" aria-labelledby="pills-theme-tab">
|
||||
<textarea name="theme" id="theme_css">{{ .BaseSASS }}</textarea>
|
||||
</div>
|
||||
<div class="tab-pane" id="pills-mobile" role="tabpanel" aria-labelledby="pills-mobile-tab">
|
||||
<textarea name="mobile" id="mobile_css">{{ .MobileSASS }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-block mt-2">Save Style</button>
|
||||
<a href="/settings/delete_assets" class="btn btn-danger btn-block confirm-btn">Delete All Assets</a>
|
||||
</form>
|
||||
{{end}}
|
||||
</div>
|
||||
|
||||
{{ range .Notifications }}
|
||||
{{$n := .Select}}
|
||||
<div class="tab-pane" id="v-pills-{{underscore $n.Method}}" role="tabpanel" aria-labelledby="v-pills-{{underscore $n.Method }}-tab">
|
||||
<form method="POST" class="{{underscore $n.Method }}" action="/settings/notifier/{{ $n.Method }}">
|
||||
{{if $n.Title}}<h4>{{$n.Title}}</h4>{{end}}
|
||||
{{if $n.Description}}<p class="small text-muted">{{safe $n.Description}}</p>{{end}}
|
||||
<div class="form-group row">
|
||||
<label for="api_secret" class="col-sm-3 col-form-label">API Secret</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control select-input" value="{{ .ApiSecret }}" id="api_secret" readonly>
|
||||
<small class="form-text text-muted">You can <a href="/api/renew">Regenerate API Keys</a> if you need to.</small>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{range .Form}}
|
||||
<div class="form-group">
|
||||
<label class="text-capitalize" for="{{underscore .Title}}">{{.Title}}</label>
|
||||
<input type="{{.Type}}" name="{{underscore .DbField}}" class="form-control" value="{{ $n.GetValue .DbField }}" id="{{underscore .Title}}" placeholder="{{.Placeholder}}" {{if .Required}}required{{end}}>
|
||||
{{if .SmallText}}<small class="form-text text-muted">{{safe .SmallText}}</small>{{end}}
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="/settings/export" class="btn btn-sm btn-secondary float-right">Export Settings</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane" id="v-pills-style" role="tabpanel" aria-labelledby="v-pills-style-tab">
|
||||
|
||||
{{if not .UsingAssets }}
|
||||
<a href="/settings/build" class="btn btn-primary btn-block"{{if USE_CDN}} disabled{{end}}>Enable Local Assets</a>
|
||||
{{ else }}
|
||||
<form method="POST" action="/settings/css">
|
||||
<ul class="nav nav-pills mb-3" id="pills-tab" role="tablist">
|
||||
<li class="nav-item col text-center">
|
||||
<a class="nav-link active" id="pills-vars-tab" data-toggle="pill" href="#pills-vars" role="tab" aria-controls="pills-vars" aria-selected="true">Variables</a>
|
||||
</li>
|
||||
<li class="nav-item col text-center">
|
||||
<a class="nav-link" id="pills-theme-tab" data-toggle="pill" href="#pills-theme" role="tab" aria-controls="pills-theme" aria-selected="false">Base Theme</a>
|
||||
</li>
|
||||
<li class="nav-item col text-center">
|
||||
<a class="nav-link" id="pills-mobile-tab" data-toggle="pill" href="#pills-mobile" role="tab" aria-controls="pills-mobile" aria-selected="false">Mobile</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tab-content" id="pills-tabContent">
|
||||
<div class="tab-pane show active" id="pills-vars" role="tabpanel" aria-labelledby="pills-vars-tab">
|
||||
<textarea name="variables" id="sass_vars">{{ .SassVars }}</textarea>
|
||||
</div>
|
||||
<div class="tab-pane" id="pills-theme" role="tabpanel" aria-labelledby="pills-theme-tab">
|
||||
<textarea name="theme" id="theme_css">{{ .BaseSASS }}</textarea>
|
||||
</div>
|
||||
<div class="tab-pane" id="pills-mobile" role="tabpanel" aria-labelledby="pills-mobile-tab">
|
||||
<textarea name="mobile" id="mobile_css">{{ .MobileSASS }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-block mt-2">Save Style</button>
|
||||
<a href="/settings/delete_assets" class="btn btn-danger btn-block confirm-btn">Delete All Assets</a>
|
||||
</form>
|
||||
{{end}}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-9 col-sm-6">
|
||||
<div class="input-group mb-2">
|
||||
<div class="input-group-prepend">
|
||||
<div class="input-group-text">Limit</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="limits" min="1" max="60" id="limits_per_hour_{{underscore $n.Method }}" value="{{$n.Limits}}" placeholder="7">
|
||||
<div class="input-group-append">
|
||||
<div class="input-group-text">Per Minute</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-3 col-sm-2 mt-1">
|
||||
<span class="switch">
|
||||
<input type="checkbox" name="enable" class="switch" id="switch-{{ $n.Method }}" {{if $n.Enabled}}checked{{end}}>
|
||||
<label for="switch-{{ $n.Method }}"></label>
|
||||
</span>
|
||||
</div>
|
||||
{{ range .Notifications }}
|
||||
{{$n := .Select}}
|
||||
<div class="tab-pane" id="v-pills-{{underscore $n.Method}}" role="tabpanel" aria-labelledby="v-pills-{{underscore $n.Method }}-tab">
|
||||
|
||||
<input type="hidden" name="notifier" value="{{underscore $n.Method }}">
|
||||
{{template "form_notifier" .}}
|
||||
|
||||
<div class="col-12 col-sm-4 mb-2 mb-sm-0 mt-2 mt-sm-0">
|
||||
<button type="submit" class="btn btn-primary btn-block text-capitalize">Save</button>
|
||||
</div>
|
||||
|
||||
{{if $n.CanTest}}
|
||||
<div class="col-12 col-sm-12">
|
||||
<button class="test_notifier btn btn-secondary btn-block text-capitalize col-12 float-right">Test</button>
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-sm-12 mt-2">
|
||||
<div class="alert alert-danger d-none" id="{{underscore $n.Method}}-error" role="alert">
|
||||
{{$n.Method}} has an error!
|
||||
</div>
|
||||
|
||||
<div class="alert alert-success d-none" id="{{underscore $n.Method}}-success" role="alert">
|
||||
The {{$n.Method}} notifier is working correctly!
|
||||
</div>
|
||||
</div>
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
|
||||
{{if $n.Author}}
|
||||
<span class="d-block small text-center mt-3 mb-5">
|
||||
{{$n.Title}} Notifier created by <a href="{{$n.AuthorUrl}}" target="_blank">{{$n.Author}}</a>
|
||||
</span>
|
||||
{{ end }}
|
||||
</form>
|
||||
|
||||
{{ if $n.Logs }}
|
||||
Sent {{$n.SentLastHour}} in the last hour<br>
|
||||
{{ if $n.Logs }}
|
||||
Sent {{$n.SentLastHour}} in the last hour<br>
|
||||
{{ range $n.Logs }}
|
||||
<div class="card mt-1">
|
||||
<div class="card-body">
|
||||
{{.Message}}
|
||||
<p class="card-text"><small class="text-muted">Sent {{.Time.Ago}}</small></p>
|
||||
{{.Message}}
|
||||
<p class="card-text"><small class="text-muted">Sent {{.Time.Ago}}</small></p>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="tab-pane fade" id="v-pills-browse" role="tabpanel" aria-labelledby="v-pills-browse-tab">
|
||||
{{ range .Repos }}
|
||||
<div class="tab-pane fade" id="v-pills-browse" role="tabpanel" aria-labelledby="v-pills-browse-tab">
|
||||
{{ range .Repos }}
|
||||
<div class="card col-6" style="width: 18rem;">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">{{ .Name }}</h5>
|
||||
|
@ -267,13 +184,13 @@
|
|||
<a href="/plugins/download/{{ .Name }}" class="card-link">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-pane fade" id="v-pills-backups" role="tabpanel" aria-labelledby="v-pills-backups-tab">
|
||||
<a href="/backups/create" class="btn btn-primary btn-block">Backup Database</a>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-backups" role="tabpanel" aria-labelledby="v-pills-backups-tab">
|
||||
<a href="/backups/create" class="btn btn-primary btn-block">Backup Database</a>
|
||||
</div>
|
||||
|
||||
{{ range .Plugins }}
|
||||
|
||||
|
@ -289,32 +206,19 @@
|
|||
</div>
|
||||
{{end}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
{{end}}
|
||||
|
||||
{{define "extra_css"}}
|
||||
<link rel="stylesheet" href="https://assets.statup.io/codemirror.css">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/codemirror-colorpicker.css"/>
|
||||
{{end}}
|
||||
{{define "extra_scripts"}}
|
||||
<script src="https://assets.statup.io/codemirror.js"></script>
|
||||
<script src="https://assets.statup.io/css.js"></script>
|
||||
<script src="https://assets.statup.io/codemirror-colorpicker.min.js"></script>
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{else}}
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,131 +1,93 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
|
||||
<title>Statup | Setup</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup | Setup{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
<div class="col-4 offset-4 mt-2 mb-5"><img width="100%" src="/statup.png"></div>
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
{{ if .Error }}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ .Error }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<form method="POST" id="setup_form" action="/setup">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-6">
|
||||
<div class="form-group">
|
||||
<label for="inputState">Database Connection</label>
|
||||
<select id="database_type" name="db_connection" class="form-control">
|
||||
<option selected value="postgres">Postgres</option>
|
||||
<option value="sqlite">Sqlite</option>
|
||||
<option value="mysql">MySQL</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="db_host">
|
||||
<label for="db_host_in">Host</label>
|
||||
<input type="text" name="db_host" id="db_host_in" class="form-control" value="{{.DbHost}}" placeholder="localhost">
|
||||
</div>
|
||||
<div class="form-group" id="db_port">
|
||||
<label for="db_port_in">Database Port</label>
|
||||
<input type="text" name="db_port" id="db_port_in" class="form-control" value="{{.DbPort}}" placeholder="localhost">
|
||||
</div>
|
||||
<div class="form-group" id="db_user">
|
||||
<label for="db_user_in">Username</label>
|
||||
<input type="text" name="db_user" id="db_user_in" class="form-control" value="{{.DbUser}}" placeholder="root">
|
||||
</div>
|
||||
<div class="form-group" id="db_password">
|
||||
<label for="db_password">Password</label>
|
||||
<input type="password" name="db_password" class="form-control" value="{{.DbPass}}" id="db_password" placeholder="password123">
|
||||
</div>
|
||||
<div class="form-group" id="db_database">
|
||||
<label for="db_database">Database</label>
|
||||
<input type="text" name="db_database" class="form-control" value="{{.DbData}}" id="db_database" placeholder="Database name">
|
||||
{{ if .Error }}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
{{ .Error }}
|
||||
</div>
|
||||
{{ end }}
|
||||
<form method="POST" id="setup_form" action="/setup">
|
||||
<div class="row">
|
||||
<div class="col-6">
|
||||
<div class="form-group">
|
||||
<label for="inputState">Database Connection</label>
|
||||
<select id="database_type" name="db_connection" class="form-control">
|
||||
<option selected value="postgres">Postgres</option>
|
||||
<option value="sqlite">Sqlite</option>
|
||||
<option value="mysql">MySQL</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group" id="db_host">
|
||||
<label for="db_host_in">Host</label>
|
||||
<input type="text" name="db_host" id="db_host_in" class="form-control" value="{{.DbHost}}" placeholder="localhost">
|
||||
</div>
|
||||
<div class="form-group" id="db_port">
|
||||
<label for="db_port_in">Database Port</label>
|
||||
<input type="text" name="db_port" id="db_port_in" class="form-control" value="{{.DbPort}}" placeholder="localhost">
|
||||
</div>
|
||||
<div class="form-group" id="db_user">
|
||||
<label for="db_user_in">Username</label>
|
||||
<input type="text" name="db_user" id="db_user_in" class="form-control" value="{{.DbUser}}" placeholder="root">
|
||||
</div>
|
||||
<div class="form-group" id="db_password">
|
||||
<label for="db_password">Password</label>
|
||||
<input type="password" name="db_password" class="form-control" value="{{.DbPass}}" id="db_password" placeholder="password123">
|
||||
</div>
|
||||
<div class="form-group" id="db_database">
|
||||
<label for="db_database">Database</label>
|
||||
<input type="text" name="db_database" class="form-control" value="{{.DbData}}" id="db_database" placeholder="Database name">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<div class="col-6">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="project">Project Name</label>
|
||||
<input type="text" name="project" class="form-control" value="{{.Project}}" id="project" placeholder="Great Uptime" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="project">Project Name</label>
|
||||
<input type="text" name="project" class="form-control" value="{{.Project}}" id="project" placeholder="Great Uptime" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="description">Project Description</label>
|
||||
<input type="text" name="description" class="form-control" value="{{.Description}}" id="description" placeholder="Great Uptime">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="description">Project Description</label>
|
||||
<input type="text" name="description" class="form-control" value="{{.Description}}" id="description" placeholder="Great Uptime">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="domain_input">Domain URL</label>
|
||||
<input type="text" name="domain" class="form-control" value="{{.Domain}}" id="domain_input" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="domain_input">Domain URL</label>
|
||||
<input type="text" name="domain" class="form-control" value="{{.Domain}}" id="domain_input" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="username">Admin Username</label>
|
||||
<input type="text" name="username" class="form-control" value="{{.Username}}" id="username" value="admin" placeholder="admin" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="username">Admin Username</label>
|
||||
<input type="text" name="username" class="form-control" value="{{.Username}}" id="username" value="admin" placeholder="admin" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="email">Admin Email Address</label>
|
||||
<input type="email" name="email" class="form-control" value="{{.Email}}" id="email" placeholder="info@admin.com" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Admin Email Address</label>
|
||||
<input type="email" name="email" class="form-control" value="{{.Email}}" id="email" placeholder="info@admin.com" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="password">Admin Password</label>
|
||||
<input type="password" name="password" class="form-control" value="{{.Password}}" id="password" placeholder="password" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">Admin Password</label>
|
||||
<input type="password" name="password" class="form-control" value="{{.Password}}" id="password" placeholder="password" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<span class="switch">
|
||||
<input type="checkbox" name="sample_data" class="switch" id="switch-normal" checked>
|
||||
<label for="switch-normal">Load Sample Data</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<button id="setup_button" type="submit" class="btn btn-primary btn-block disable_click">Save Settings</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<button id="setup_button" type="submit" class="btn btn-primary btn-block disable_click">Save Settings</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/setup.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
{{end}}
|
||||
{{define "extra_scripts"}}
|
||||
<script src="/js/setup.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,81 +1,10 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
|
||||
<title>Statup | Users</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup | {{.Username}}{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{template "nav"}}
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<h3>User {{.Username}}</h3>
|
||||
<form action="/user/{{.Id}}" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="username" class="col-sm-4 col-form-label">Username</label>
|
||||
<div class="col-6 col-md-4">
|
||||
<input type="text" name="username" class="form-control" value="{{.Username}}" id="username" placeholder="Username" required>
|
||||
</div>
|
||||
<div class="col-6 col-md-4">
|
||||
<span class="switch">
|
||||
<input type="checkbox" name="admin" class="switch" id="switch-normal"{{if .Admin}} checked{{end}}>
|
||||
<label for="switch-normal">Administrator</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-sm-4 col-form-label">Email Address</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="email" name="email" class="form-control" id="email" value="{{.Email}}" placeholder="user@domain.com" required autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-sm-4 col-form-label">Password</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" name="password" class="form-control" id="password" value="##########" placeholder="Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password_confirm" class="col-sm-4 col-form-label">Confirm Password</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" name="password_confirm" class="form-control" id="password_confirm" value="##########" placeholder="Confirm Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<button type="submit" class="btn btn-primary btn-block">Update User</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{template "form_user" .}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,105 +1,35 @@
|
|||
<!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">
|
||||
{{if USE_CDN}}
|
||||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" integrity="sha384-WskhaSGFgHYWDcbwN70/dfYBj47jz9qbsMId/iRN3ewGhXQFZCSftd1LZCfmhktB" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://assets.statup.io/base.css">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/css/base.css">
|
||||
{{end}}
|
||||
|
||||
<title>Statup | Users</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
{{define "title"}}Statup | Users{{end}}
|
||||
{{define "content"}}
|
||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||
|
||||
{{template "nav"}}
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<div class="col-12">
|
||||
<h3>Users</h3>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Username</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .}}
|
||||
<tr>
|
||||
<td>{{.Username}}</td>
|
||||
<td class="text-right" id="user_{{.Id}}">
|
||||
<div class="btn-group">
|
||||
<a href="/user/{{.Id}}" class="btn btn-primary">Edit</a>
|
||||
<a href="/user/{{.Id}}/delete" class="btn btn-danger confirm-btn" data-id="user_{{.Id}}">Delete</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Username</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{range .}}
|
||||
<tr>
|
||||
<td>{{.Username}}</td>
|
||||
<td class="text-right" id="user_{{.Id}}">
|
||||
<div class="btn-group">
|
||||
<a href="/user/{{.Id}}" class="btn btn-primary">Edit</a>
|
||||
<a href="/user/{{.Id}}/delete" class="btn btn-danger confirm-btn" data-id="user_{{.Id}}">Delete</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{end}}
|
||||
</tbody>
|
||||
</table>
|
||||
<h3>Create User</h3>
|
||||
|
||||
<h3>Create User</h3>
|
||||
<form action="/users" method="POST">
|
||||
<div class="form-group row">
|
||||
<label for="username" class="col-sm-4 col-form-label">Username</label>
|
||||
<div class="col-6 col-md-4">
|
||||
<input type="text" name="username" class="form-control" id="username" placeholder="Username" required autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
<div class="col-6 col-md-4">
|
||||
<span class="switch">
|
||||
<input type="checkbox" name="admin" class="switch" id="switch-normal">
|
||||
<label for="switch-normal">Administrator</label>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="email" class="col-sm-4 col-form-label">Email Address</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="email" name="email" class="form-control" id="email" placeholder="user@domain.com" required autocapitalize="false" spellcheck="false">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password" class="col-sm-4 col-form-label">Password</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" name="password" class="form-control" id="password" placeholder="Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label for="password_confirm" class="col-sm-4 col-form-label">Confirm Password</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="password" name="password_confirm" class="form-control" id="password_confirm" placeholder="Confirm Password" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<div class="col-sm-12">
|
||||
<button type="submit" class="btn btn-primary btn-block">Create User</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
{{template "form_user" NewUser}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{template "footer"}}
|
||||
|
||||
{{if USE_CDN}}
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script>
|
||||
<script src="https://assets.statup.io/main.js"></script>
|
||||
{{ else }}
|
||||
<script src="/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="/js/bootstrap.min.js"></script>
|
||||
<script src="/js/main.js"></script>
|
||||
{{end}}
|
||||
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue