2018-06-10 01:31:13 +00:00
<!doctype html>
< html lang = "en" >
< head >
< meta charset = "utf-8" >
2018-06-26 07:01:41 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1, shrink-to-fit=no, maximum-scale=1.0, user-scalable=0" >
2018-07-07 05:02:47 +00:00
{{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 }}
2018-06-10 01:31:13 +00:00
< link rel = "stylesheet" href = "/css/bootstrap.min.css" >
< link rel = "stylesheet" href = "/css/base.css" >
2018-07-07 05:02:47 +00:00
{{end}}
2018-06-10 03:44:47 +00:00
< title > Statup | Services< / title >
2018-06-10 01:31:13 +00:00
< / head >
< body >
2018-06-24 11:51:07 +00:00
< div class = "container col-md-7 col-sm-12 mt-md-5 bg-light" >
2018-06-10 01:31:13 +00:00
2018-06-11 03:41:02 +00:00
{{template "nav"}}
2018-06-10 01:31:13 +00:00
2018-06-22 04:02:57 +00:00
< div class = "col-12" >
2018-06-10 01:31:13 +00:00
2018-06-10 03:44:47 +00:00
< h3 > Services< / h3 >
2018-06-10 01:31:13 +00:00
2018-08-22 05:41:15 +00:00
< table class = "table" >
2018-06-10 01:31:13 +00:00
< thead >
< tr >
2018-06-10 03:44:47 +00:00
< th scope = "col" > Name< / th >
2018-08-22 05:41:15 +00:00
< th scope = "col" class = "d-none d-md-table-cell" > Status< / th >
2018-06-11 00:20:42 +00:00
< th scope = "col" > < / th >
2018-06-10 01:31:13 +00:00
< / tr >
< / thead >
2018-08-22 05:41:15 +00:00
< tbody class = "sortable" >
2018-06-10 01:31:13 +00:00
{{range .}}
2018-08-22 05:41:15 +00:00
< tr id = "{{.Id}}" >
2018-08-23 07:28:48 +00:00
< td > < span class = "drag_icon d-none d-md-inline" > ☰ < / span > {{.Name}}< / td >
2018-08-22 05:41:15 +00:00
< 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 >
2018-06-11 00:20:42 +00:00
< td class = "text-right" >
2018-06-19 04:48:25 +00:00
< div class = "btn-group" >
2018-08-22 05:41:15 +00:00
< a href = "/service/{{.Id}}" class = "btn btn-primary" > View< / a >
< a href = "/service/{{.Id}}/delete" class = "btn btn-danger confirm-btn" > Delete< / a >
2018-06-10 03:44:47 +00:00
< / div >
< / td >
2018-06-10 01:31:13 +00:00
< / tr >
{{end}}
< / tbody >
< / table >
2018-06-10 03:44:47 +00:00
< h3 > Create Service< / h3 >
2018-06-11 03:41:02 +00:00
< form action = "/services" method = "POST" >
2018-06-10 03:44:47 +00:00
< div class = "form-group row" >
2018-06-22 04:02:57 +00:00
< label for = "service_name" class = "col-sm-4 col-form-label" > Service Name< / label >
< div class = "col-sm-8" >
2018-07-22 22:17:38 +00:00
< input type = "text" name = "name" class = "form-control" id = "service_name" placeholder = "Name" required spellcheck = "false" >
2018-06-22 04:02:57 +00:00
< / div >
< / div >
< div class = "form-group row" >
< label for = "service_type" class = "col-sm-4 col-form-label" > Service Check Type< / label >
2018-06-11 00:20:42 +00:00
< div class = "col-sm-8" >
2018-06-22 04:02:57 +00:00
< 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" >
2018-06-23 00:10:37 +00:00
< label for = "service_url" class = "col-sm-4 col-form-label" > Application Endpoint (URL)< / label >
< div class = "col-sm-8" >
2018-07-22 22:17:38 +00:00
< input type = "text" name = "domain" class = "form-control" id = "service_url" placeholder = "https://google.com" required autocapitalize = "false" spellcheck = "false" >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
< div class = "form-group row" >
2018-06-22 04:02:57 +00:00
< label for = "service_check_type" class = "col-sm-4 col-form-label" > Service Check Type< / label >
2018-06-10 03:44:47 +00:00
< div class = "col-sm-8" >
2018-06-22 04:02:57 +00:00
< select name = "method" class = "form-control" id = "service_check_type" >
< option value = "GET" selected > GET< / option >
< option value = "POST" > POST< / option >
2018-08-23 07:28:48 +00:00
< option value = "DELETE" > DELETE< / option >
< option value = "PATCH" > PATCH< / option >
< option value = "PUT" > PUT< / option >
2018-06-22 04:02:57 +00:00
< / select >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
2018-07-22 22:17:38 +00:00
< div class = "form-group row d-none" >
2018-07-01 10:24:35 +00:00
< label for = "post_data" class = "col-sm-4 col-form-label" > Post Data (JSON)< / label >
< div class = "col-sm-8" >
2018-07-22 22:17:38 +00:00
< textarea name = "post_data" class = "form-control" id = "post_data" rows = "3" autocapitalize = "false" spellcheck = "false" > < / textarea >
2018-07-01 10:24:35 +00:00
< / div >
< / div >
2018-06-10 03:44:47 +00:00
< div class = "form-group row" >
2018-06-22 04:02:57 +00:00
< label for = "service_response" class = "col-sm-4 col-form-label" > Expected Response (Regex)< / label >
2018-06-10 03:44:47 +00:00
< div class = "col-sm-8" >
2018-07-22 22:17:38 +00:00
< textarea name = "expected" class = "form-control" id = "service_response" rows = "3" autocapitalize = "false" spellcheck = "false" > < / textarea >
2018-07-17 09:18:20 +00:00
< 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 >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
< div class = "form-group row" >
2018-06-22 04:02:57 +00:00
< label for = "service_response_code" class = "col-sm-4 col-form-label" > Expected Status Code< / label >
2018-06-10 03:44:47 +00:00
< div class = "col-sm-8" >
2018-08-22 00:41:16 +00:00
< input type = "number" name = "expected_status" class = "form-control" id = "service_response_code" value = "200" >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
2018-07-18 23:01:24 +00:00
< div class = "form-group row d-none" >
2018-06-22 04:02:57 +00:00
< label for = "service_port" class = "col-sm-4 col-form-label" > TCP Port< / label >
2018-06-10 03:44:47 +00:00
< div class = "col-sm-8" >
2018-06-22 04:02:57 +00:00
< input type = "number" name = "port" class = "form-control" id = "service_port" placeholder = "8080" >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
< div class = "form-group row" >
2018-06-22 04:02:57 +00:00
< label for = "service_interval" class = "col-sm-4 col-form-label" > Check Interval (Seconds)< / label >
2018-06-10 03:44:47 +00:00
< div class = "col-sm-8" >
2018-08-22 00:41:16 +00:00
< input type = "number" name = "interval" class = "form-control" id = "service_interval" min = "1" value = "60" required >
2018-08-21 06:54:39 +00:00
< small id = "emailHelp" class = "form-text text-muted" > 10,000+ will be checked in Microseconds (1 millisecond = 1000 microseconds).< / small >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
2018-07-18 23:01:24 +00:00
< 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" >
2018-08-22 00:41:16 +00:00
< input type = "number" name = "timeout" class = "form-control" id = "service_timeout" min = "1" value = "30" >
2018-07-18 23:01:24 +00:00
< / div >
< / div >
2018-08-21 06:54:39 +00:00
< 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 >
2018-06-10 03:44:47 +00:00
< div class = "form-group row" >
2018-06-24 11:51:07 +00:00
< div class = "col-sm-12" >
< button type = "submit" class = "btn btn-success btn-block" > Create Service< / button >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
< / form >
< / div >
2018-06-10 01:31:13 +00:00
< / div >
2018-06-22 04:02:57 +00:00
{{template "footer"}}
2018-06-10 01:31:13 +00:00
2018-07-07 05:02:47 +00:00
{{if USE_CDN}}
2018-08-22 05:41:15 +00:00
< script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js" > < / script >
2018-08-22 07:16:24 +00:00
< script src = "https://assets.statup.io/sortable.min.js" > < / script >
2018-07-07 05:02:47 +00:00
< 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 }}
2018-08-22 05:41:15 +00:00
< script src = "/js/jquery-3.3.1.min.js" > < / script >
< script src = "/js/sortable.min.js" > < / script >
2018-06-15 04:30:10 +00:00
< script src = "/js/bootstrap.min.js" > < / script >
2018-07-07 05:02:47 +00:00
< script src = "/js/main.js" > < / script >
{{end}}
2018-08-22 05:41:15 +00:00
< script >
sortable('.sortable', {
forcePlaceholderSize: true,
2018-08-23 07:28:48 +00:00
hoverClass: 'sortable_drag',
handle: '.drag_icon'
2018-08-22 05:41:15 +00:00
});
sortable('.sortable')[0].addEventListener('sortupdate', function(e) {
var i = 0;
var newOrder = [];
var dest = e.detail.destination.items;
dest.forEach(function(d) {
i++;
var o = {service: parseInt(d.id), order: i}
newOrder.push(o);
});
$.post("/services/reorder", JSON.stringify(newOrder), function(data, status){
});
});
< / script >
2018-06-10 01:31:13 +00:00
< / body >
< / html >