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
< table class = "table table-striped" >
< thead >
< tr >
2018-06-10 03:44:47 +00:00
< th scope = "col" > Name< / th >
2018-06-11 00:20:42 +00:00
< th scope = "col" > Status< / th >
< th scope = "col" > < / th >
2018-06-10 01:31:13 +00:00
< / tr >
< / thead >
< tbody >
{{range .}}
2018-07-14 02:37:39 +00:00
{{ $s := .ToService }}
2018-06-10 01:31:13 +00:00
< tr >
2018-07-14 02:37:39 +00:00
< td > {{$s.Name}}< / td >
< td > {{if $s.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-07-14 02:37:39 +00:00
< a href = "/service/{{$s.Id}}" class = "btn btn-primary" > View< / a >
2018-07-17 09:18:20 +00:00
< a href = "/service/{{$s.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-02 06:21:41 +00:00
< input type = "text" name = "name" class = "form-control" id = "service_name" placeholder = "Name" required >
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-02 06:21:41 +00:00
< input type = "text" name = "domain" class = "form-control" id = "service_url" placeholder = "https://google.com" required >
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 >
< / select >
2018-06-10 03:44:47 +00:00
< / div >
< / div >
2018-07-01 10:24:35 +00:00
< div class = "form-group row" >
< 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" > < / textarea >
< / 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-06-22 04:02:57 +00:00
< textarea name = "expected" class = "form-control" id = "service_response" rows = "3" > < / 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-07-18 23:01:24 +00:00
< input type = "number" name = "expected_status" class = "form-control" id = "service_response_code" placeholder = "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-07-02 06:21:41 +00:00
< input type = "number" name = "interval" class = "form-control" id = "service_interval" value = "60" required >
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" >
< input type = "number" name = "timeout" class = "form-control" id = "service_timeout" placeholder = "30" >
< / 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}}
< script src = "https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity = "sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin = "anonymous" > < / 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 }}
2018-06-10 01:31:13 +00:00
< script src = "/js/jquery-3.3.1.slim.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-06-10 01:31:13 +00:00
< / body >
< / html >