service chart updates

pull/78/head
Hunter Long 2018-09-20 21:17:24 -07:00
parent e3c572da75
commit 5d8e810524
8 changed files with 261 additions and 348 deletions

View File

@ -33,7 +33,7 @@ var example = &Example{&Notification{
Description: "Example Notifier", Description: "Example Notifier",
Author: "Hunter Long", Author: "Hunter Long",
AuthorUrl: "https://github.com/hunterlong", AuthorUrl: "https://github.com/hunterlong",
Delay: time.Duration(1 * time.Second), Delay: time.Duration(200 * time.Millisecond),
Limits: 7, Limits: 7,
Form: []NotificationForm{{ Form: []NotificationForm{{
Type: "text", Type: "text",

View File

@ -232,7 +232,7 @@ func TestRunAllQueueAndStop(t *testing.T) {
assert.Equal(t, 16, len(example.Queue)) assert.Equal(t, 16, len(example.Queue))
go Queue(example) go Queue(example)
assert.Equal(t, 16, len(example.Queue)) assert.Equal(t, 16, len(example.Queue))
time.Sleep(15 * time.Second) time.Sleep(6 * time.Second)
assert.Equal(t, 6, len(example.Queue)) assert.Equal(t, 6, len(example.Queue))
example.close() example.close()
assert.False(t, example.IsRunning()) assert.False(t, example.IsRunning())

View File

@ -91,16 +91,16 @@ func InsertSampleData() error {
// InsertSampleHits will create a couple new hits for the sample services // InsertSampleHits will create a couple new hits for the sample services
func InsertSampleHits() error { func InsertSampleHits() error {
since := time.Now().Add(-24 * time.Hour) since := time.Now().Add((-24 * 7) * time.Hour)
for i := int64(1); i <= 5; i++ { for i := int64(1); i <= 5; i++ {
service := SelectService(i) service := SelectService(i)
utils.Log(1, fmt.Sprintf("Adding %v sample hit records to service %v", 360, service.Name)) utils.Log(1, fmt.Sprintf("Adding %v sample hit records to service %v", 360, service.Name))
createdAt := since createdAt := since
for hi := int64(1); hi <= 360; hi++ { for hi := int64(1); hi <= 860; hi++ {
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
latency := rand.Float64() latency := rand.Float64()
createdAt = createdAt.Add(2 * time.Minute) createdAt = createdAt.Add(15 * time.Minute)
hit := &types.Hit{ hit := &types.Hit{
Service: service.Id, Service: service.Id,
CreatedAt: createdAt, CreatedAt: createdAt,

View File

@ -42,7 +42,7 @@ func renderServiceChartHandler(w http.ResponseWriter, r *http.Request) {
var start time.Time var start time.Time
var end time.Time var end time.Time
if startField == "" { if startField == "" {
start = time.Now().Add(-24 * time.Hour).UTC() start = time.Now().Add((-24 * 7) * time.Hour).UTC()
} else { } else {
start = time.Unix(utils.StringInt(startField), 0).UTC() start = time.Unix(utils.StringInt(startField), 0).UTC()
} }
@ -70,7 +70,7 @@ func renderServiceChartsHandler(w http.ResponseWriter, r *http.Request) {
var data []string var data []string
end := time.Now() end := time.Now()
start := end.Add(-24 * time.Hour) start := end.Add(-(24 * 7) * time.Hour)
for _, s := range services { for _, s := range services {
d := core.GraphDataRaw(s, start, end).ToString() d := core.GraphDataRaw(s, start, end).ToString()
data = append(data, d) data = append(data, d)
@ -184,7 +184,7 @@ func servicesViewHandler(w http.ResponseWriter, r *http.Request) {
} }
if startField == 0 || endField == 0 { if startField == 0 || endField == 0 {
startField = time.Now().Add(-24 * time.Hour).UTC().Unix() startField = time.Now().Add((-24 * 7) * time.Hour).UTC().Unix()
endField = time.Now().UTC().Unix() endField = time.Now().UTC().Unix()
} }

View File

@ -106,11 +106,16 @@ func (u *twilio) Send(msg interface{}) error {
func (u *twilio) OnFailure(s *types.Service, f *types.Failure) { func (u *twilio) OnFailure(s *types.Service, f *types.Failure) {
msg := fmt.Sprintf("Your service '%v' is currently offline!", s.Name) msg := fmt.Sprintf("Your service '%v' is currently offline!", s.Name)
u.AddQueue(msg) u.AddQueue(msg)
u.Online = false
} }
// OnSuccess will trigger successful service // OnSuccess will trigger successful service
func (u *twilio) OnSuccess(s *types.Service) { func (u *twilio) OnSuccess(s *types.Service) {
if !u.Online {
msg := fmt.Sprintf("Your service '%v' is back online!", s.Name)
u.AddQueue(msg)
}
u.Online = true
} }
// OnSave triggers when this notifier has been saved // OnSave triggers when this notifier has been saved

View File

@ -39,65 +39,53 @@
/* Mobile Settings */ /* Mobile Settings */
/* Mobile Service Container */ /* Mobile Service Container */
HTML, BODY { HTML, BODY {
background-color: #fcfcfc; background-color: #fcfcfc; }
}
.container { .container {
padding-top: 20px; padding-top: 20px;
padding-bottom: 20px; padding-bottom: 20px;
max-width: 860px; max-width: 860px; }
}
.header-title { .header-title {
color: #464646; color: #464646; }
}
.header-desc { .header-desc {
color: #939393; color: #939393; }
}
.btn { .btn {
border-radius: 0.2rem; border-radius: 0.2rem; }
}
.online_list .badge { .online_list .badge {
margin-top: 0.2rem; margin-top: 0.2rem; }
}
.navbar { .navbar {
margin-bottom: 30px; margin-bottom: 30px; }
}
.btn-sm { .btn-sm {
line-height: 1.3; line-height: 1.3;
font-size: 0.75rem; font-size: 0.75rem; }
}
.view_service_btn { .view_service_btn {
position: absolute; position: absolute;
bottom: -40px; bottom: -40px;
right: 40px; right: 40px; }
}
.service_lower_info { .service_lower_info {
position: absolute; position: absolute;
bottom: -40px; bottom: -40px;
left: 40px; left: 40px;
color: #d1ffca; color: #d1ffca;
font-size: 0.85rem; font-size: 0.85rem; }
}
.lg_number { .lg_number {
font-size: 2.3rem; font-size: 2.3rem;
font-weight: bold; font-weight: bold;
display: block; display: block;
color: #4f4f4f; color: #4f4f4f; }
}
.stats_area { .stats_area {
text-align: center; text-align: center;
color: #a5a5a5; color: #a5a5a5; }
}
.lower_canvas { .lower_canvas {
height: 3.4rem; height: 3.4rem;
@ -105,134 +93,104 @@ HTML, BODY {
background-color: #48d338; background-color: #48d338;
padding: 15px 10px; padding: 15px 10px;
margin-left: 0px !important; margin-left: 0px !important;
margin-right: 0px !important; margin-right: 0px !important; }
}
.lower_canvas SPAN { .lower_canvas SPAN {
font-size: 1rem; font-size: 1rem;
color: #fff; color: #fff; }
}
.footer { .footer {
text-decoration: none; text-decoration: none;
margin-top: 20px; margin-top: 20px; }
}
.footer A { .footer A {
color: #8d8d8d; color: #8d8d8d;
text-decoration: none; text-decoration: none; }
}
.footer A:HOVER { .footer A:HOVER {
color: #6d6d6d; color: #6d6d6d; }
}
.badge { .badge {
color: white; color: white;
border-radius: 0.2rem; border-radius: 0.2rem; }
}
.btn-group { .btn-group {
height: 25px; height: 25px; }
} .btn-group A {
.btn-group A { padding: 0.1rem .75rem;
padding: 0.1rem 0.75rem; font-size: 0.8rem; }
font-size: 0.8rem;
}
.card-body .badge { .card-body .badge {
color: #fff; color: #fff; }
}
.nav-pills .nav-link { .nav-pills .nav-link {
border-radius: 0.2rem; border-radius: 0.2rem; }
}
.form-control { .form-control {
border-radius: 0.2rem; border-radius: 0.2rem; }
}
.card { .card {
background-color: #ffffff; background-color: #ffffff;
border: 1px solid rgba(0, 0, 0, 0.125); border: 1px solid rgba(0, 0, 0, 0.125); }
}
.card-body { .card-body {
overflow: hidden; overflow: hidden; }
}
.card-body H4 A { .card-body H4 A {
color: #444444; color: #444444;
text-decoration: none; text-decoration: none; }
}
.chart-container { .chart-container {
position: relative; position: relative;
height: 170px; height: 170px;
width: 100%; width: 100%; }
}
.btn-primary { .btn-primary {
background-color: #3e9bff; background-color: #3e9bff;
border-color: #006fe6; border-color: #006fe6;
color: white; color: white; }
} .btn-primary.dyn-dark {
.btn-primary.dyn-dark { background-color: #32a825 !important;
background-color: #32a825 !important; border-color: #2c9320 !important; }
border-color: #2c9320 !important; .btn-primary.dyn-light {
} background-color: #75de69 !important;
.btn-primary.dyn-light { border-color: #88e37e !important; }
background-color: #75de69 !important;
border-color: #88e37e !important;
}
.btn-success { .btn-success {
background-color: #47d337; background-color: #47d337; }
} .btn-success.dyn-dark {
.btn-success.dyn-dark { background-color: #32a825 !important;
background-color: #32a825 !important; border-color: #2c9320 !important; }
border-color: #2c9320 !important; .btn-success.dyn-light {
} background-color: #75de69 !important;
.btn-success.dyn-light { border-color: #88e37e !important; }
background-color: #75de69 !important;
border-color: #88e37e !important;
}
.btn-danger { .btn-danger {
background-color: #dd3545; background-color: #dd3545; }
} .btn-danger.dyn-dark {
.btn-danger.dyn-dark { background-color: #b61f2d !important;
background-color: #b61f2d !important; border-color: #a01b28 !important; }
border-color: #a01b28 !important; .btn-danger.dyn-light {
} background-color: #e66975 !important;
.btn-danger.dyn-light { border-color: #e97f89 !important; }
background-color: #e66975 !important;
border-color: #e97f89 !important;
}
.bg-success { .bg-success {
background-color: #47d337 !important; background-color: #47d337 !important; }
}
.bg-danger { .bg-danger {
background-color: #dd3545 !important; background-color: #dd3545 !important; }
}
.bg-success .dyn-dark { .bg-success .dyn-dark {
background-color: #35b027 !important; background-color: #35b027 !important; }
}
.bg-danger .dyn-dark { .bg-danger .dyn-dark {
background-color: #bf202f !important; background-color: #bf202f !important; }
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { .nav-pills .nav-link.active, .nav-pills .show > .nav-link {
background-color: #13a00d; background-color: #13a00d; }
}
.nav-pills A { .nav-pills A {
color: #424242; color: #424242; }
}
.CodeMirror { .CodeMirror {
/* Bootstrap Settings */ /* Bootstrap Settings */
@ -252,26 +210,23 @@ HTML, BODY {
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 4px; border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
/* Code Mirror Settings */ /* Code Mirror Settings */
font-family: monospace; font-family: monospace;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
height: 80vh; height: 80vh; }
}
.CodeMirror-focused { .CodeMirror-focused {
/* Bootstrap Settings */ /* Bootstrap Settings */
border-color: #66afe9; border-color: #66afe9;
outline: 0; outline: 0;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6); box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(102, 175, 233, 0.6);
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; }
}
.switch { .switch {
font-size: 1rem; font-size: 1rem;
position: relative; position: relative; }
}
.switch input { .switch input {
position: absolute; position: absolute;
@ -282,8 +237,7 @@ HTML, BODY {
clip: rect(0 0 0 0); clip: rect(0 0 0 0);
clip-path: inset(50%); clip-path: inset(50%);
overflow: hidden; overflow: hidden;
padding: 0; padding: 0; }
}
.switch input + label { .switch input + label {
position: relative; position: relative;
@ -296,26 +250,23 @@ HTML, BODY {
outline: none; outline: none;
user-select: none; user-select: none;
vertical-align: middle; vertical-align: middle;
text-indent: calc(calc(calc(2.375rem * .8) * 2) + .5rem); text-indent: calc(calc(calc(2.375rem * .8) * 2) + .5rem); }
}
.switch input + label::before, .switch input + label::before,
.switch input + label::after { .switch input + label::after {
content: ""; content: '';
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: calc(calc(2.375rem * .8) * 2); width: calc(calc(2.375rem * .8) * 2);
bottom: 0; bottom: 0;
display: block; display: block; }
}
.switch input + label::before { .switch input + label::before {
right: 0; right: 0;
background-color: #dee2e6; background-color: #dee2e6;
border-radius: calc(2.375rem * .8); border-radius: calc(2.375rem * .8);
transition: 0.2s all; transition: 0.2s all; }
}
.switch input + label::after { .switch input + label::after {
top: 2px; top: 2px;
@ -324,154 +275,120 @@ HTML, BODY {
height: calc(calc(2.375rem * .8) - calc(2px * 2)); height: calc(calc(2.375rem * .8) - calc(2px * 2));
border-radius: 50%; border-radius: 50%;
background-color: white; background-color: white;
transition: 0.2s all; transition: 0.2s all; }
}
.switch input:checked + label::before { .switch input:checked + label::before {
background-color: #08d; background-color: #08d; }
}
.switch input:checked + label::after { .switch input:checked + label::after {
margin-left: calc(2.375rem * .8); margin-left: calc(2.375rem * .8); }
}
.switch input:focus + label::before { .switch input:focus + label::before {
outline: none; outline: none;
box-shadow: 0 0 0 0.2rem rgba(0, 136, 221, 0.25); box-shadow: 0 0 0 0.2rem rgba(0, 136, 221, 0.25); }
}
.switch input:disabled + label { .switch input:disabled + label {
color: #868e96; color: #868e96;
cursor: not-allowed; cursor: not-allowed; }
}
.switch input:disabled + label::before { .switch input:disabled + label::before {
background-color: #e9ecef; background-color: #e9ecef; }
}
.switch.switch-sm { .switch.switch-sm {
font-size: 0.875rem; font-size: 0.875rem; }
}
.switch.switch-sm input + label { .switch.switch-sm input + label {
min-width: calc(calc(1.9375rem * .8) * 2); min-width: calc(calc(1.9375rem * .8) * 2);
height: calc(1.9375rem * .8); height: calc(1.9375rem * .8);
line-height: calc(1.9375rem * .8); line-height: calc(1.9375rem * .8);
text-indent: calc(calc(calc(1.9375rem * .8) * 2) + .5rem); text-indent: calc(calc(calc(1.9375rem * .8) * 2) + .5rem); }
}
.switch.switch-sm input + label::before { .switch.switch-sm input + label::before {
width: calc(calc(1.9375rem * .8) * 2); width: calc(calc(1.9375rem * .8) * 2); }
}
.switch.switch-sm input + label::after { .switch.switch-sm input + label::after {
width: calc(calc(1.9375rem * .8) - calc(2px * 2)); width: calc(calc(1.9375rem * .8) - calc(2px * 2));
height: calc(calc(1.9375rem * .8) - calc(2px * 2)); height: calc(calc(1.9375rem * .8) - calc(2px * 2)); }
}
.switch.switch-sm input:checked + label::after { .switch.switch-sm input:checked + label::after {
margin-left: calc(1.9375rem * .8); margin-left: calc(1.9375rem * .8); }
}
.switch.switch-lg { .switch.switch-lg {
font-size: 1.25rem; font-size: 1.25rem; }
}
.switch.switch-lg input + label { .switch.switch-lg input + label {
min-width: calc(calc(3rem * .8) * 2); min-width: calc(calc(3rem * .8) * 2);
height: calc(3rem * .8); height: calc(3rem * .8);
line-height: calc(3rem * .8); line-height: calc(3rem * .8);
text-indent: calc(calc(calc(3rem * .8) * 2) + .5rem); text-indent: calc(calc(calc(3rem * .8) * 2) + .5rem); }
}
.switch.switch-lg input + label::before { .switch.switch-lg input + label::before {
width: calc(calc(3rem * .8) * 2); width: calc(calc(3rem * .8) * 2); }
}
.switch.switch-lg input + label::after { .switch.switch-lg input + label::after {
width: calc(calc(3rem * .8) - calc(2px * 2)); width: calc(calc(3rem * .8) - calc(2px * 2));
height: calc(calc(3rem * .8) - calc(2px * 2)); height: calc(calc(3rem * .8) - calc(2px * 2)); }
}
.switch.switch-lg input:checked + label::after { .switch.switch-lg input:checked + label::after {
margin-left: calc(3rem * .8); margin-left: calc(3rem * .8); }
}
.switch + .switch { .switch + .switch {
margin-left: 1rem; margin-left: 1rem; }
}
@keyframes pulse_animation { @keyframes pulse_animation {
0% { 0% {
transform: scale(1); transform: scale(1); }
}
30% { 30% {
transform: scale(1); transform: scale(1); }
}
40% { 40% {
transform: scale(1.02); transform: scale(1.02); }
}
50% { 50% {
transform: scale(1); transform: scale(1); }
}
60% { 60% {
transform: scale(1); transform: scale(1); }
}
70% { 70% {
transform: scale(1.05); transform: scale(1.05); }
}
80% { 80% {
transform: scale(1); transform: scale(1); }
}
100% { 100% {
transform: scale(1); transform: scale(1); } }
}
}
.pulse { .pulse {
animation-name: pulse_animation; animation-name: pulse_animation;
animation-duration: 1500ms; animation-duration: 1500ms;
transform-origin: 70% 70%; transform-origin: 70% 70%;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-timing-function: linear; animation-timing-function: linear; }
}
@keyframes glow-grow { @keyframes glow-grow {
0% { 0% {
opacity: 0; opacity: 0;
transform: scale(1); transform: scale(1); }
}
80% { 80% {
opacity: 1; opacity: 1; }
}
100% { 100% {
transform: scale(2); transform: scale(2);
opacity: 0; opacity: 0; } }
}
}
.pulse-glow { .pulse-glow {
animation-name: glow-grown; animation-name: glow-grown;
animation-duration: 100ms; animation-duration: 100ms;
transform-origin: 70% 30%; transform-origin: 70% 30%;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-timing-function: linear; animation-timing-function: linear; }
}
.pulse-glow:before, .pulse-glow:before,
.pulse-glow:after { .pulse-glow:after {
position: absolute; position: absolute;
content: ""; content: '';
height: 0.5rem; height: 0.5rem;
width: 1.75rem; width: 1.75rem;
top: 1.2rem; top: 1.2rem;
right: 2.15rem; right: 2.15rem;
border-radius: 0; border-radius: 0;
box-shadow: 0 0 7px #47d337; box-shadow: 0 0 7px #47d337;
animation: glow-grow 2s ease-out infinite; animation: glow-grow 2s ease-out infinite; }
}
.sortable_drag { .sortable_drag {
background-color: #0000000f; background-color: #0000000f; }
}
.drag_icon { .drag_icon {
cursor: move; cursor: move;
@ -485,38 +402,32 @@ HTML, BODY {
margin-right: 5px; margin-right: 5px;
margin-left: -10px; margin-left: -10px;
text-align: center; text-align: center;
color: #b1b1b1; color: #b1b1b1; }
}
/* (Optional) Apply a "closed-hand" cursor during drag operation. */ /* (Optional) Apply a "closed-hand" cursor during drag operation. */
.drag_icon:active { .drag_icon:active {
cursor: grabbing; cursor: grabbing;
cursor: -moz-grabbing; cursor: -moz-grabbing;
cursor: -webkit-grabbing; cursor: -webkit-grabbing; }
}
.switch_btn { .switch_btn {
float: right; float: right;
margin: -1px 0px 0px 0px; margin: -1px 0px 0px 0px;
display: block; display: block; }
}
#start_container { #start_container {
position: absolute; position: absolute;
z-index: 99999; z-index: 99999;
margin-top: 20px; margin-top: 20px; }
}
#end_container { #end_container {
position: absolute; position: absolute;
z-index: 99999; z-index: 99999;
margin-top: 20px; margin-top: 20px;
right: 0; right: 0; }
}
.pointer { .pointer {
cursor: pointer; cursor: pointer; }
}
/*! /*!
* Pikaday * Pikaday
@ -530,47 +441,38 @@ HTML, BODY {
background: #fff; background: #fff;
border: 1px solid #ccc; border: 1px solid #ccc;
border-bottom-color: #bbb; border-bottom-color: #bbb;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
} .pika-single.is-hidden {
.pika-single.is-hidden { display: none; }
display: none; .pika-single.is-bound {
} position: absolute;
.pika-single.is-bound { box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.5); }
position: absolute;
box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.5);
}
.pika-single { .pika-single {
*zoom: 1; *zoom: 1; }
} .pika-single:before, .pika-single:after {
.pika-single:before, .pika-single:after { content: " ";
content: " "; display: table; }
display: table; .pika-single:after {
} clear: both; }
.pika-single:after {
clear: both;
}
.pika-lendar { .pika-lendar {
float: left; float: left;
width: 240px; width: 240px;
margin: 8px; margin: 8px; }
}
.pika-title { .pika-title {
position: relative; position: relative;
text-align: center; text-align: center; }
} .pika-title select {
.pika-title select { cursor: pointer;
cursor: pointer; position: absolute;
position: absolute; z-index: 9998;
z-index: 9998; margin: 0;
margin: 0; left: 0;
left: 0; top: 5px;
top: 5px; filter: alpha(opacity=0);
filter: alpha(opacity=0); opacity: 0; }
opacity: 0;
}
.pika-label { .pika-label {
display: inline-block; display: inline-block;
@ -584,8 +486,7 @@ HTML, BODY {
line-height: 20px; line-height: 20px;
font-weight: bold; font-weight: bold;
color: #333; color: #333;
background-color: #fff; background-color: #fff; }
}
.pika-prev, .pika-prev,
.pika-next { .pika-next {
@ -604,61 +505,51 @@ HTML, BODY {
background-position: center center; background-position: center center;
background-repeat: no-repeat; background-repeat: no-repeat;
background-size: 75% 75%; background-size: 75% 75%;
opacity: 0.5; opacity: .5;
*position: absolute; *position: absolute;
*top: 0; *top: 0; }
} .pika-prev:hover,
.pika-prev:hover, .pika-next:hover {
.pika-next:hover { opacity: 1; }
opacity: 1; .pika-prev.is-disabled,
} .pika-next.is-disabled {
.pika-prev.is-disabled, cursor: default;
.pika-next.is-disabled { opacity: .2; }
cursor: default;
opacity: 0.2;
}
.pika-prev, .pika-prev,
.is-rtl .pika-next { .is-rtl .pika-next {
float: left; float: left;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg=="); background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAUklEQVR42u3VMQoAIBADQf8Pgj+OD9hG2CtONJB2ymQkKe0HbwAP0xucDiQWARITIDEBEnMgMQ8S8+AqBIl6kKgHiXqQqAeJepBo/z38J/U0uAHlaBkBl9I4GwAAAABJRU5ErkJggg==");
*left: 0; *left: 0; }
}
.pika-next, .pika-next,
.is-rtl .pika-prev { .is-rtl .pika-prev {
float: right; float: right;
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII="); background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAeCAYAAAAsEj5rAAAAU0lEQVR42u3VOwoAMAgE0dwfAnNjU26bYkBCFGwfiL9VVWoO+BJ4Gf3gtsEKKoFBNTCoCAYVwaAiGNQGMUHMkjGbgjk2mIONuXo0nC8XnCf1JXgArVIZAQh5TKYAAAAASUVORK5CYII=");
*right: 0; *right: 0; }
}
.pika-select { .pika-select {
display: inline-block; display: inline-block;
*display: inline; *display: inline; }
}
.pika-table { .pika-table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
border-spacing: 0; border-spacing: 0;
border: 0; border: 0; }
} .pika-table th,
.pika-table th, .pika-table td {
.pika-table td { width: 14.285714285714286%;
width: 14.2857142857%; padding: 0; }
padding: 0; .pika-table th {
} color: #999;
.pika-table th { font-size: 12px;
color: #999; line-height: 25px;
font-size: 12px; font-weight: bold;
line-height: 25px; text-align: center; }
font-weight: bold; .pika-table abbr {
text-align: center; border-bottom: none;
} cursor: help; }
.pika-table abbr {
border-bottom: none;
cursor: help;
}
.pika-button { .pika-button {
cursor: pointer; cursor: pointer;
@ -674,60 +565,49 @@ HTML, BODY {
font-size: 12px; font-size: 12px;
line-height: 15px; line-height: 15px;
text-align: right; text-align: right;
background: #f5f5f5; background: #f5f5f5; }
} .is-today .pika-button {
.is-today .pika-button { color: #33aaff;
color: #33aaff; font-weight: bold; }
font-weight: bold; .is-selected .pika-button {
} color: #fff;
.is-selected .pika-button { font-weight: bold;
color: #fff; background: #33aaff;
font-weight: bold; box-shadow: inset 0 1px 3px #178fe5;
background: #33aaff; border-radius: 3px; }
box-shadow: inset 0 1px 3px #178fe5; .is-disabled .pika-button, .is-outside-current-month .pika-button {
border-radius: 3px; color: #999;
} opacity: .3; }
.is-disabled .pika-button, .is-outside-current-month .pika-button { .is-disabled .pika-button {
color: #999; pointer-events: none;
opacity: 0.3; cursor: default; }
} .pika-button:hover {
.is-disabled .pika-button { color: #fff;
pointer-events: none; background: #ff8000;
cursor: default; box-shadow: none;
} border-radius: 3px; }
.pika-button:hover { .pika-button .is-selection-disabled {
color: #fff; pointer-events: none;
background: #ff8000; cursor: default; }
box-shadow: none;
border-radius: 3px;
}
.pika-button .is-selection-disabled {
pointer-events: none;
cursor: default;
}
.pika-week { .pika-week {
font-size: 11px; font-size: 11px;
color: #999; color: #999; }
}
.is-inrange .pika-button { .is-inrange .pika-button {
background: #D5E9F7; background: #D5E9F7; }
}
.is-startrange .pika-button { .is-startrange .pika-button {
color: #fff; color: #fff;
background: #6CB31D; background: #6CB31D;
box-shadow: none; box-shadow: none;
border-radius: 3px; border-radius: 3px; }
}
.is-endrange .pika-button { .is-endrange .pika-button {
color: #fff; color: #fff;
background: #33aaff; background: #33aaff;
box-shadow: none; box-shadow: none;
border-radius: 3px; border-radius: 3px; }
}
/*! /*!
* Statup * Statup
@ -747,84 +627,67 @@ HTML, BODY {
*/ */
@media (max-width: 767px) { @media (max-width: 767px) {
HTML, BODY { HTML, BODY {
background-color: #fcfcfc; background-color: #fcfcfc; }
}
.sm-container { .sm-container {
margin-top: 40px !important; margin-top: 40px !important;
padding: 0 !important; padding: 0 !important; }
}
.list-group-item H5 { .list-group-item H5 {
font-size: 0.9rem; font-size: 0.9rem; }
}
.container { .container {
padding: 0 !important; padding: 0 !important; }
}
.navbar { .navbar {
margin-left: 0px; margin-left: 0px;
margin-top: 0px; margin-top: 0px;
width: 100%; width: 100%;
margin-bottom: 0; margin-bottom: 0; }
}
.btn-sm { .btn-sm {
line-height: 0.9rem; line-height: 0.9rem;
font-size: 0.65rem; font-size: 0.65rem; }
}
.full-col-12 { .full-col-12 {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px; }
}
.card { .card {
border: 0; border: 0;
border-radius: 0rem; border-radius: 0rem;
padding: 0; padding: 0;
background-color: #ffffff; background-color: #ffffff; }
}
.card-body { .card-body {
font-size: 6pt; font-size: 6pt;
padding: 5px 5px; padding: 5px 5px; }
}
.lg_number { .lg_number {
font-size: 7.8vw; font-size: 7.8vw; }
}
.stats_area { .stats_area {
margin-top: 1.5rem !important; margin-top: 1.5rem !important;
margin-bottom: 1.5rem !important; margin-bottom: 1.5rem !important; }
}
.stats_area .col-4 { .stats_area .col-4 {
padding-left: 0; padding-left: 0;
padding-right: 0; padding-right: 0;
font-size: 0.6rem; font-size: 0.6rem; }
}
.list-group-item { .list-group-item {
border-top: 1px solid #e4e4e4; border-top: 1px solid #e4e4e4;
border: 0px; border: 0px; }
}
.list-group-item:first-child { .list-group-item:first-child {
border-top-left-radius: 0; border-top-left-radius: 0;
border-top-right-radius: 0; border-top-right-radius: 0; }
}
.list-group-item:last-child { .list-group-item:last-child {
border-bottom-right-radius: 0; border-bottom-right-radius: 0;
border-bottom-left-radius: 0; border-bottom-left-radius: 0; }
}
.list-group-item P { .list-group-item P {
font-size: 0.7rem; font-size: 0.7rem; } }
}
}
/*# sourceMappingURL=base.css.map */ /*# sourceMappingURL=base.css.map */

View File

@ -58,7 +58,7 @@
</div> </div>
<div class="chart-container" style="height: 250px"> <div class="chart-container" style="height: 250px">
<canvas id="service_{{ $s.Id }}"></canvas> <canvas id="service"></canvas>
</div> </div>
<form id="service_date_form" class="row mt-2 mb-3"> <form id="service_date_form" class="row mt-2 mb-3">
@ -247,6 +247,54 @@
{{end}} {{end}}
<script> <script>
var ctx = document.getElementById("service").getContext('2d');
var chartdata = new Chart(ctx, {
type: 'line',
data: {
datasets: [{
label: 'Response Time (Milliseconds)',
data: {{js .GraphData}},
backgroundColor: [
'rgba(47, 206, 30, 0.92)'
],
borderColor: [
'rgb(47, 171, 34)'
],
borderWidth: 1
}]
},
options: {
legend: {
display: false
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true
},
gridLines: {
display:false
}
}],
xAxes: [{
type: 'time',
distribution: 'series',
gridLines: {
display:false
}
}]
},
elements: {
point: {
radius: 0
}
}
}
});
var startPick = new Pikaday({ var startPick = new Pikaday({
field: $('#service_start')[0], field: $('#service_start')[0],
bound: false, bound: false,
@ -287,7 +335,5 @@
</script> </script>
<script src="/charts/{{$s.Id}}.js?start={{.Start}}&end={{.End}}"></script>
</body> </body>
</html> </html>

View File

@ -47,7 +47,6 @@ type Service struct {
DnsLookup float64 `gorm:"-" json:"dns_lookup_time"` DnsLookup float64 `gorm:"-" json:"dns_lookup_time"`
Failures []interface{} `gorm:"-" json:"failures,omitempty"` Failures []interface{} `gorm:"-" json:"failures,omitempty"`
Checkins []*Checkin `gorm:"-" json:"checkins,omitempty"` Checkins []*Checkin `gorm:"-" json:"checkins,omitempty"`
Range [2]time.Time `gorm:"-" json:"-"`
} }
type ServiceInterface interface { type ServiceInterface interface {