mirror of https://github.com/statping/statping
UI fixes - slack updates - allow notification bool - checkin updates
parent
ded00ddaa7
commit
c09001c6f6
2
Makefile
2
Makefile
|
@ -1,4 +1,4 @@
|
||||||
VERSION=0.79.9
|
VERSION=0.79.91
|
||||||
BINARY_NAME=statup
|
BINARY_NAME=statup
|
||||||
GOPATH:=$(GOPATH)
|
GOPATH:=$(GOPATH)
|
||||||
GOCMD=go
|
GOCMD=go
|
||||||
|
|
|
@ -150,8 +150,8 @@ func (c *CheckinHit) AfterFind() (err error) {
|
||||||
func (u *Message) AfterFind() (err error) {
|
func (u *Message) AfterFind() (err error) {
|
||||||
u.CreatedAt = utils.Timezoner(u.CreatedAt, CoreApp.Timezone)
|
u.CreatedAt = utils.Timezoner(u.CreatedAt, CoreApp.Timezone)
|
||||||
u.UpdatedAt = utils.Timezoner(u.UpdatedAt, CoreApp.Timezone)
|
u.UpdatedAt = utils.Timezoner(u.UpdatedAt, CoreApp.Timezone)
|
||||||
u.StartOn = utils.Timezoner(u.StartOn, CoreApp.Timezone)
|
u.StartOn = utils.Timezoner(u.StartOn.UTC(), CoreApp.Timezone)
|
||||||
u.EndOn = utils.Timezoner(u.EndOn, CoreApp.Timezone)
|
u.EndOn = utils.Timezoner(u.EndOn.UTC(), CoreApp.Timezone)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,6 +78,13 @@ func (s *Service) LimitedFailures(amount int64) []*failure {
|
||||||
return failArr
|
return failArr
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LimitedFailures will return the last amount of failures from a service
|
||||||
|
func (s *Service) LimitedCheckinFailures(amount int64) []*failure {
|
||||||
|
var failArr []*failure
|
||||||
|
failuresDB().Where("service = ?", s.Id).Where("method = 'checkin'").Order("id desc").Limit(amount).Find(&failArr)
|
||||||
|
return failArr
|
||||||
|
}
|
||||||
|
|
||||||
// Ago returns a human readable timestamp for a failure
|
// Ago returns a human readable timestamp for a failure
|
||||||
func (f *failure) Ago() string {
|
func (f *failure) Ago() string {
|
||||||
got, _ := timeago.TimeAgoWithTime(time.Now(), f.CreatedAt)
|
got, _ := timeago.TimeAgoWithTime(time.Now(), f.CreatedAt)
|
||||||
|
|
|
@ -31,6 +31,9 @@ func OnSave(method string) {
|
||||||
|
|
||||||
// OnFailure will be triggered when a service is failing - BasicEvents interface
|
// OnFailure will be triggered when a service is failing - BasicEvents interface
|
||||||
func OnFailure(s *types.Service, f *types.Failure) {
|
func OnFailure(s *types.Service, f *types.Failure) {
|
||||||
|
if !s.AllowNotifications.Bool {
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, comm := range AllCommunications {
|
for _, comm := range AllCommunications {
|
||||||
if isType(comm, new(BasicEvents)) && isEnabled(comm) && inLimits(comm) {
|
if isType(comm, new(BasicEvents)) && isEnabled(comm) && inLimits(comm) {
|
||||||
comm.(BasicEvents).OnFailure(s, f)
|
comm.(BasicEvents).OnFailure(s, f)
|
||||||
|
@ -40,6 +43,9 @@ func OnFailure(s *types.Service, f *types.Failure) {
|
||||||
|
|
||||||
// OnSuccess will be triggered when a service is successful - BasicEvents interface
|
// OnSuccess will be triggered when a service is successful - BasicEvents interface
|
||||||
func OnSuccess(s *types.Service) {
|
func OnSuccess(s *types.Service) {
|
||||||
|
if !s.AllowNotifications.Bool {
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, comm := range AllCommunications {
|
for _, comm := range AllCommunications {
|
||||||
if isType(comm, new(BasicEvents)) && isEnabled(comm) && inLimits(comm) {
|
if isType(comm, new(BasicEvents)) && isEnabled(comm) && inLimits(comm) {
|
||||||
comm.(BasicEvents).OnSuccess(s)
|
comm.(BasicEvents).OnSuccess(s)
|
||||||
|
@ -58,6 +64,9 @@ func OnNewService(s *types.Service) {
|
||||||
|
|
||||||
// OnUpdatedService is triggered when a service is updated - ServiceEvents interface
|
// OnUpdatedService is triggered when a service is updated - ServiceEvents interface
|
||||||
func OnUpdatedService(s *types.Service) {
|
func OnUpdatedService(s *types.Service) {
|
||||||
|
if !s.AllowNotifications.Bool {
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, comm := range AllCommunications {
|
for _, comm := range AllCommunications {
|
||||||
if isType(comm, new(ServiceEvents)) && isEnabled(comm) && inLimits(comm) {
|
if isType(comm, new(ServiceEvents)) && isEnabled(comm) && inLimits(comm) {
|
||||||
comm.(ServiceEvents).OnUpdatedService(s)
|
comm.(ServiceEvents).OnUpdatedService(s)
|
||||||
|
@ -67,6 +76,9 @@ func OnUpdatedService(s *types.Service) {
|
||||||
|
|
||||||
// OnDeletedService is triggered when a service is deleted - ServiceEvents interface
|
// OnDeletedService is triggered when a service is deleted - ServiceEvents interface
|
||||||
func OnDeletedService(s *types.Service) {
|
func OnDeletedService(s *types.Service) {
|
||||||
|
if !s.AllowNotifications.Bool {
|
||||||
|
return
|
||||||
|
}
|
||||||
for _, comm := range AllCommunications {
|
for _, comm := range AllCommunications {
|
||||||
if isType(comm, new(ServiceEvents)) && isEnabled(comm) && inLimits(comm) {
|
if isType(comm, new(ServiceEvents)) && isEnabled(comm) && inLimits(comm) {
|
||||||
comm.(ServiceEvents).OnDeletedService(s)
|
comm.(ServiceEvents).OnDeletedService(s)
|
||||||
|
|
|
@ -29,7 +29,7 @@ import (
|
||||||
|
|
||||||
const (
|
const (
|
||||||
slackMethod = "slack"
|
slackMethod = "slack"
|
||||||
failingTemplate = `{ "attachments": [ { "fallback": "Service {{.Service.Name}} - is currently failing", "text": "Your Statup service <{{.Service.Domain}}|{{.Service.Name}}> has just received a Failure notification based on your expected results. {{.Service.Name}} responded with a HTTP Status code of {{.Service.LastStatusCode}}.", "fields": [ { "title": "Expected", "value": "{{.Service.Expected}}", "short": true }, { "title": "Status Code", "value": "{{.Service.LastStatusCode}}", "short": true } ], "color": "#FF0000", "thumb_url": "https://statup.io", "footer": "Statup", "footer_icon": "https://img.cjx.io/statuplogo32.png" } ] }`
|
failingTemplate = `{ "attachments": [ { "fallback": "Service {{.Service.Name}} - is currently failing", "text": "Your Statup service <{{.Service.Domain}}|{{.Service.Name}}> has just received a Failure notification based on your expected results. {{.Service.Name}} responded with a HTTP Status code of {{.Service.LastStatusCode}}.", "fields": [ { "title": "Expected Status Code", "value": "{{.Service.ExpectedStatus}}", "short": true }, { "title": "Received Status Code", "value": "{{.Service.LastStatusCode}}", "short": true } ], "color": "#FF0000", "thumb_url": "https://statup.io", "footer": "Statup", "footer_icon": "https://img.cjx.io/statuplogo32.png" } ] }`
|
||||||
successTemplate = `{ "attachments": [ { "fallback": "Service {{.Service.Name}} - is now back online", "text": "Your Statup service <{{.Service.Domain}}|{{.Service.Name}}> is now back online and meets your expected responses.", "color": "#00FF00", "thumb_url": "https://statup.io", "footer": "Statup", "footer_icon": "https://img.cjx.io/statuplogo32.png" } ] }`
|
successTemplate = `{ "attachments": [ { "fallback": "Service {{.Service.Name}} - is now back online", "text": "Your Statup service <{{.Service.Domain}}|{{.Service.Name}}> is now back online and meets your expected responses.", "color": "#00FF00", "thumb_url": "https://statup.io", "footer": "Statup", "footer_icon": "https://img.cjx.io/statuplogo32.png" } ] }`
|
||||||
slackText = `{"text":"{{.}}"}`
|
slackText = `{"text":"{{.}}"}`
|
||||||
)
|
)
|
||||||
|
|
|
@ -138,6 +138,10 @@ function PingAjaxChart(chart, service, start=0, end=9999999999, group="hour") {
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.ajax_delete').on('click', function() {
|
$('.ajax_delete').on('click', function() {
|
||||||
|
var r = confirm('Are you sure you want to delete?');
|
||||||
|
if (r !== true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
let obj = $(this);
|
let obj = $(this);
|
||||||
let id = obj.attr('data-id');
|
let id = obj.attr('data-id');
|
||||||
let element = obj.attr('data-obj');
|
let element = obj.attr('data-obj');
|
||||||
|
@ -204,6 +208,7 @@ $('form.ajax_form').on('submit', function() {
|
||||||
data: sendData,
|
data: sendData,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
|
setTimeout(function () {
|
||||||
if (data.status === 'error') {
|
if (data.status === 'error') {
|
||||||
let alerter = form.find('#alerter');
|
let alerter = form.find('#alerter');
|
||||||
alerter.html(data.error);
|
alerter.html(data.error);
|
||||||
|
@ -219,6 +224,7 @@ $('form.ajax_form').on('submit', function() {
|
||||||
window.location.href = redirect;
|
window.location.href = redirect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}, 1000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{{define "form_checkin"}}
|
{{define "form_checkin"}}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
<form class="ajax_form" action="/api/checkin" data-redirect="/service/{{.Id}}" method="POST">
|
<form class="ajax_form" action="/api/checkin" data-redirect="/service/{{.Id}}" method="POST">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
|
@ -6,7 +8,7 @@
|
||||||
<input type="text" name="name" class="form-control" id="checkin_name" placeholder="New Checkin">
|
<input type="text" name="name" class="form-control" id="checkin_name" placeholder="New Checkin">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<label for="checkin_interval" class="col-form-label">Interval</label>
|
<label for="checkin_interval" class="col-form-label">Interval (seconds)</label>
|
||||||
<input type="number" name="interval" class="form-control" id="checkin_interval" placeholder="60">
|
<input type="number" name="interval" class="form-control" id="checkin_interval" placeholder="60">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
|
@ -16,8 +18,10 @@
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<label for="submit" class="col-form-label"></label>
|
<label for="submit" class="col-form-label"></label>
|
||||||
<input type="hidden" name="service_id" class="form-control" id="service_id" value="{{.Id}}">
|
<input type="hidden" name="service_id" class="form-control" id="service_id" value="{{.Id}}">
|
||||||
<button type="submit" id="submit" class="btn btn-success d-block">Save Checkin</button>
|
<button type="submit" id="submit" class="btn btn-success d-block" style="margin-top: 14px;">Save Checkin</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{{define "form_message"}}
|
{{define "form_message"}}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
{{$message := .}}
|
{{$message := .}}
|
||||||
{{if ne .Id 0}}
|
{{if ne .Id 0}}
|
||||||
<form class="ajax_form" action="/api/messages/{{.Id}}" data-redirect="/messages" method="POST">
|
<form class="ajax_form" action="/api/messages/{{.Id}}" data-redirect="/messages" method="POST">
|
||||||
|
@ -52,7 +54,10 @@
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="notify_method" class="col-sm-4 col-form-label">Notify Users</label>
|
<label for="notify_method" class="col-sm-4 col-form-label">Notify Users</label>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<input type="text" name="notify_users" class="form-control" id="notify_method" value="{{.NotifyUsers.Bool}}" placeholder="">
|
<span class="switch">
|
||||||
|
<input type="checkbox" name="notify_users" class="switch" id="switch-normal"{{if .NotifyUsers.Bool}} checked{{end}}>
|
||||||
|
<label for="switch-normal">Notify Users Before Scheduled Time</label>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -77,4 +82,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-danger d-none" id="alerter" role="alert"></div>
|
<div class="alert alert-danger d-none" id="alerter" role="alert"></div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{{define "form_service"}}
|
{{define "form_service"}}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
{{if ne .Id 0}}
|
{{if ne .Id 0}}
|
||||||
<form class="ajax_form" action="/api/services/{{.Id}}" data-redirect="/services" method="POST">
|
<form class="ajax_form" action="/api/services/{{.Id}}" data-redirect="/services" method="POST">
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -111,4 +113,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-danger d-none" id="alerter" role="alert"></div>
|
<div class="alert alert-danger d-none" id="alerter" role="alert"></div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{{define "form_user"}}
|
{{define "form_user"}}
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body">
|
||||||
{{if ne .Id 0}}
|
{{if ne .Id 0}}
|
||||||
<form class="ajax_form" action="/api/users/{{.Id}}" data-redirect="/users" method="POST">
|
<form class="ajax_form" action="/api/users/{{.Id}}" data-redirect="/users" method="POST">
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -41,4 +43,6 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="alert alert-danger d-none" id="alerter" role="alert"></div>
|
<div class="alert alert-danger d-none" id="alerter" role="alert"></div>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
{{end}}
|
{{end}}
|
|
@ -8,22 +8,7 @@
|
||||||
<h5 class="col-12 text-center mb-5 header-desc">{{ .Description }}</h5>
|
<h5 class="col-12 text-center mb-5 header-desc">{{ .Description }}</h5>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{ if .Messages }}
|
<div class="col-12 full-col-12">
|
||||||
<div class="col-12">
|
|
||||||
{{range .Messages}}
|
|
||||||
<div class="alert alert-warning" role="alert">
|
|
||||||
<h3>{{.Title}}</h3>
|
|
||||||
<span class="mb-3">{{safe .Description}}</span>
|
|
||||||
<div class="d-block mt-2 mb-4">
|
|
||||||
<span class="float-left small">Starts at {{.StartOn}}</span>
|
|
||||||
<span class="float-right small">Ends on {{.EndOn}}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
</div>
|
|
||||||
{{end}}
|
|
||||||
|
|
||||||
<div class="col-12 full-col-12 mb-5">
|
|
||||||
|
|
||||||
<div class="list-group online_list">
|
<div class="list-group online_list">
|
||||||
{{ range Services }}
|
{{ range Services }}
|
||||||
|
@ -39,6 +24,21 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{{ if .Messages }}
|
||||||
|
<div class="col-12 mt-3">
|
||||||
|
{{range .Messages}}
|
||||||
|
<div class="alert alert-primary" role="alert">
|
||||||
|
<h3>{{.Title}}</h3>
|
||||||
|
<span class="mb-3">{{safe .Description}}</span>
|
||||||
|
<div class="d-block mt-2 mb-4">
|
||||||
|
<span class="float-left small">Starts at {{.StartOn}}</span>
|
||||||
|
<span class="float-right small">Ends on {{.EndOn}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
<div class="col-12 full-col-12">
|
<div class="col-12 full-col-12">
|
||||||
{{ if not Services }}
|
{{ if not Services }}
|
||||||
<div class="alert alert-danger" role="alert">
|
<div class="alert alert-danger" role="alert">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
<div class="container col-md-7 col-sm-12 mt-md-5 bg-light">
|
||||||
{{template "nav"}}
|
{{template "nav"}}
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h3>Message {{.Title}}</h3>
|
<h3>{{.Title}}</h3>
|
||||||
{{template "form_message" .}}
|
{{template "form_message" .}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -34,7 +34,6 @@
|
||||||
{{end}}
|
{{end}}
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<h3>Create Message</h3>
|
<h3>Create Message</h3>
|
||||||
|
|
||||||
{{template "form_message" NewMessage}}
|
{{template "form_message" NewMessage}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -74,6 +74,15 @@
|
||||||
<div class="col-12 small text-center mt-3 text-muted">{{$s.DowntimeText}}</div>
|
<div class="col-12 small text-center mt-3 text-muted">{{$s.DowntimeText}}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
{{if Auth}}
|
||||||
|
<nav class="nav nav-pills flex-column flex-sm-row mt-3" id="service_tabs" role="serviceLists">
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link active" id="failures-tab" data-toggle="tab" href="#failures" role="tab" aria-controls="failures" aria-selected="true">Failures</a>
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link" id="checkins-tab" data-toggle="tab" href="#checkins" role="tab" aria-controls="checkins" aria-selected="false">Checkins</a>
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link" id="response-tab" data-toggle="tab" href="#response" role="tab" aria-controls="response" aria-selected="false">Response</a>
|
||||||
|
<a class="flex-sm-fill text-sm-center nav-link" id="edit-tab" data-toggle="tab" href="#edit" role="tab" aria-controls="edit" aria-selected="false">Edit Service</a>
|
||||||
|
</nav>
|
||||||
|
<div class="tab-content" id="myTabContent">
|
||||||
|
<div class="tab-pane fade show active" id="failures" role="serviceLists" aria-labelledby="failures-tab">
|
||||||
{{$failures := $s.LimitedFailures 16}}
|
{{$failures := $s.LimitedFailures 16}}
|
||||||
{{ if $failures }}
|
{{ if $failures }}
|
||||||
<div class="list-group mt-3 mb-4">
|
<div class="list-group mt-3 mb-4">
|
||||||
|
@ -88,29 +97,8 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane fade" id="checkins" role="serviceLists" aria-labelledby="checkins-tab">
|
||||||
{{if Auth}}
|
|
||||||
|
|
||||||
<div class="col-12 mt-4{{if ne $s.Type "http"}} 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 class="col-12 mt-4">
|
|
||||||
<h3>Edit Service</h3>
|
|
||||||
{{template "form_service" $s}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-12 mt-4">
|
|
||||||
<h3>Service Checkin</h3>
|
|
||||||
{{if $s.LimitedCheckins}}
|
{{if $s.LimitedCheckins}}
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -148,8 +136,40 @@
|
||||||
</table>
|
</table>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{template "form_checkin" $s}}
|
{{template "form_checkin" $s}}
|
||||||
|
|
||||||
|
{{$failures := $s.LimitedCheckinFailures 16}}
|
||||||
|
{{ if $failures }}
|
||||||
|
<div class="list-group mt-3 mb-4">
|
||||||
|
{{ range $failures }}
|
||||||
|
<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>
|
||||||
|
<div class="tab-pane fade" id="response" role="serviceLists" aria-labelledby="response-tab">
|
||||||
|
<div class="col-12 mt-4{{if ne $s.Type "http"}} 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="tab-pane fade" id="edit" role="serviceLists" aria-labelledby="edit-tab">
|
||||||
|
{{template "form_service" $s}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a href="/service/{{.Id}}" class="btn btn-outline-secondary"><i class="fas fa-chart-area"></i> View</a>
|
<a href="/service/{{.Id}}" class="btn btn-outline-secondary"><i class="fas fa-chart-area"></i> View</a>
|
||||||
<a href="/api/services/{{.Id}}" class="ajax_delete btn btn-danger confirm-btn" data-method="DELETE" data-obj="service_{{.Id}}" data-id="{{.Id}}"><i class="fas fa-times"></i></a>
|
<a href="/api/services/{{.Id}}" class="ajax_delete btn btn-danger" data-method="DELETE" data-obj="service_{{.Id}}" data-id="{{.Id}}"><i class="fas fa-times"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<td class="text-right">
|
<td class="text-right">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<a href="/user/{{.Id}}" class="btn btn-outline-secondary"><i class="fas fa-user-edit"></i> Edit</a>
|
<a href="/user/{{.Id}}" class="btn btn-outline-secondary"><i class="fas fa-user-edit"></i> Edit</a>
|
||||||
<a href="/api/users/{{.Id}}" class="ajax_delete btn btn-danger confirm-btn" data-method="DELETE" data-obj="user_{{.Id}}" data-id="{{.Id}}"><i class="fas fa-times"></i></a>
|
<a href="/api/users/{{.Id}}" class="ajax_delete btn btn-danger" data-method="DELETE" data-obj="user_{{.Id}}" data-id="{{.Id}}"><i class="fas fa-times"></i></a>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in New Issue