From 8ccbc067ae0c4e3152ea7974f13d1b670aa239e6 Mon Sep 17 00:00:00 2001 From: Craig Peterson Date: Tue, 16 Feb 2016 16:18:01 -0700 Subject: [PATCH] Implementing purge and forceClose --- cmd/bosun/sched/sched.go | 4 + cmd/bosun/web/static.go | 120 ++++++++++-------- cmd/bosun/web/static/js/bosun.js | 12 ++ cmd/bosun/web/static/js/state.ts | 14 ++ cmd/bosun/web/static/partials/alertstate.html | 2 + cmd/bosun/web/static/partials/forceClose.html | 1 + cmd/bosun/web/static/partials/purge.html | 1 + cmd/bosun/web/web.go | 4 + models/incidents.go | 10 ++ 9 files changed, 118 insertions(+), 50 deletions(-) create mode 100644 cmd/bosun/web/static/partials/forceClose.html create mode 100644 cmd/bosun/web/static/partials/purge.html diff --git a/cmd/bosun/sched/sched.go b/cmd/bosun/sched/sched.go index 92450f05fd..a120a6e1c1 100644 --- a/cmd/bosun/sched/sched.go +++ b/cmd/bosun/sched/sched.go @@ -600,12 +600,16 @@ func (s *Schedule) Action(user, message string, t models.ActionType, ak models.A if st.IsActive() { return fmt.Errorf("cannot close active alert") } + fallthrough + case models.ActionForceClose: st.Open = false st.End = ×tamp case models.ActionForget: if !isUnknown { return fmt.Errorf("can only forget unknowns") } + fallthrough + case models.ActionPurge: return s.DataAccess.State().Forget(ak) default: return fmt.Errorf("unknown action type: %v", t) diff --git a/cmd/bosun/web/static.go b/cmd/bosun/web/static.go index 3f399637c5..88ff683f7f 100644 --- a/cmd/bosun/web/static.go +++ b/cmd/bosun/web/static.go @@ -9099,7 +9099,7 @@ xitlUKAxazlo8/8JAAD//4NB/DtLfAAA "/js/bosun.js": { local: "web/static/js/bosun.js", - size: 108586, + size: 108866, modtime: 0, compressed: ` H4sIAAAJbogA/+z9e3vbRpIoDv+9+RQwx2NCEUVKTpzJyJb9OrZz2YmTrO3MzhxZqwUJkIRFAjQASuLY @@ -9451,7 +9451,7 @@ Xbambpg1kzD966L0W+plEu84v+IjGM1WF0iLWI86O9soPB58uAp3TnZGM9ymDt6u7+/vj213IrjtGzQj 2Ux1Mn8GMp+Kbc6C7ni/UxITueSr9QLlDZKvyTk3w9wSVkqYV9slvCnkIOCOC829aZEvn4u7OlpQ0TkM HFvhr+o1V3r0dvx1vBEXeWxdB9330bMdMSPjDqkUDuXbN8fJM9V1inOjEymQeK1v7wgZrZ6rkUbYEeCr mK26zjExIdhVKJzTnxIqr7YhxWB1SvDTZfPTYdpOz/g9lze6BMHj8XMkgDdIICvXJyFigpi7kvG9CPO4 -fTpYxIhJyP8/AAD//2VI8q8qqAEA +fTpYxEhXQn5bF7NP0x8rxLxFf0ySTzc20xq9SdD/PwAA//+6IDoJQqkBAA== `, }, @@ -12424,37 +12424,37 @@ bNNNMvIm425oAQ2itVF+BNdwA4t/AwAA///HUuwLLBAAAA== "/js/state.ts": { local: "web/static/js/state.ts", - size: 5266, + size: 5502, modtime: 0, compressed: ` -H4sIAAAJbogA/8RYX2/bOBJ/dj8FYwSRhDhKeo/JuYEvzTXFtbdA0z4svMaCkWhZa4k0SMpttvB33xmS -kihLbo12gfWDRZE/zn/ODPXiSaiKzzabOM0lS3S+ZWGg1SxZv5Gi2gQTMg9OC5FQnQsOb8GpzksmKg3j -sFm4JjyL375zb49MbvOETUiNtcsf7Ytbjcj0Ffn6YiSZriTH0UglYsOuzXBEk/U1CabBBF8yFEXhuy8Z -rqhkxdKqYC0WWVKeplS3kzv806zcFDD7SRawcLmhUue0UJfAydCPV7osDLzIOTAPnTiUP08IK1jphlRr -qcy4VsFJHieUg3SPgE00S8mU2GlgQKZTEvyfsVQRQHDxuWBpxkrGdXDT7t9Qzoq7girV7D0FMQHlLRl8 -u+dJC9pD46RHl/FEpKyHstMeTq3EZw6wrztvMhFFQTcKt4f5ntr+vnm+AMhJd8bQMdKO8qWzaAs/O3MS -Wf/CVHy3yosUpIsLxjO9Qru9jCyvUR1N4bLiCcZZWK84OU6fpKBpQpUOx4L/smF8PCF5ZIWAICBX0Q0x -PzOzw/+OqkWOroK4ZlswkP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p1Uw+QPD6SDJo2rdG +DF1TffjvyDBkk3tEEmsZUp8ZLeo1GWNWEKKlfzNcJk/hzHim+3dPL51kcFBI7TPdgOrjEsAksb+9OPBr +HvX6MwOyvA30n494kPzNQFDrrLxpMmsdtZ7b4dnJTSgoaBtT/9KfTz7v/GARXKaYhp7/Wf3v6urJG+hR +tfHe8wr7XJCh4EV7WjqLQVip2GozXFoM/B6vLVhgNlAL3dMZ4t29ZWHeXaodkxhicFlVTVpw6c/7U/V1 +74I8N+nKuS1q2Ex7UTo3KXe63v4Cbnjdm6lGvQFJZnUGGtg+vzJMd/sqvIPbwwdboaELXWbpLSQVTd/T +qftQreowQWBQbztbCl68hPljtqIJtanRW0UE19o/4Hfx9u3Fy5fjoEsTYd9G8+HhuiiAXJMi688tJqDn +i7aX/FLw6K8y/dix1wHdqa1BvPEUT/KmEzZNO/I1T9YO0b1CnSD+0lu/2KrI8G8OF2Bv4lk1e64+lNT2 +McGRDcUsXuMXsoGvXIKiXWMFjcC995UPU01XgNwOM9O3k+9lFyORIxma+8v3clxqKkey/L0C8PdyLJHI +8TrG9IdYdtlQ2mf9bwAAAP//itkeCH4VAAA= `, }, @@ -13026,27 +13026,27 @@ NeZtQ48ZNx5cB0tkPLvkz/bBIAzIu+Vq0mH5U/wNAAD//wJxdrNjAwAA "/partials/alertstate.html": { local: "web/static/partials/alertstate.html", - size: 3849, + size: 3915, modtime: 0, compressed: ` -H4sIAAAJbogA/7RWX2/jNgx/zn0KzQc0CTYnaFcUWGG7uA0dVmx72bV7V2zG1iJLmSS39Xr+7qNkubFT -9/r3Hhqrokj++CNFKsrYNUk51ToOtlQADwugGRN5QEQe9gW/2PUsrZQCYT4baio9/34aruTt1J9l6SYO -jMxzDrN5kHyYRMXx0LZhhoOVTCJKCgVru5xEGqXEyeLgsmCawC2qldQwKQhL8UfBVoFGx5qYghr8AUI5 -KEPwNBME9Wlq2DWQmZAiFFKVlM+JRpiwCDoQOa+3hbXXD+5uer8d9vyGmuVieupN4F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REE/8IE1rTkxp3v +ddBJlN/LF0mp3HMhOs6O2n3SWSR1fWRoqveXzDXSXEWOSSZLtc3a+yCcvAnCiYOgD4Th7E0Yzg6K4fht +iTg+bCZOTt9WjtM9FAcfdJ9ii+89ow5nM403qOcPO3LMpYaG0Rx3LHy4xNAV6BJ6YimYdjunSpZF+8aO +8I1dio2Qd2IcbG2gdEe9KJHQ8Jrji3O4/+T5AzdOk6rXpdfqkUbx7SluW2YHYnZdFVDXe9t0GPDsBt+Q +wXJVkQE7llfXnTfYaIRv18Gl2/VuV++yp/UciD9x1dAUtc6HYHhuH8lXtsb2O1A2945zDn62T7sndszx +iV8ymZo/t49Qtl1wYWZy3re/h8l//g8AAP//YTsmZEsPAAA= `, }, @@ -13188,6 +13188,16 @@ ZRAyfI3v8+rQ3Z8rAduX6nvI4fNPAAAA///3VswxUwkAAA== `, }, + "/partials/forceClose.html": { + local: "web/static/partials/forceClose.html", + size: 83, + modtime: 0, + compressed: ` +H4sIAAAJbogA/7JJVEjOSSwutlVKKslTAGLdlMS89NQiMLOiWEkhL103oyg1zVapujoxuSQzP09DPS2/ +KDnVOSe/OFVds7ZWyc4NxFcAC9joJ9oBAgAA//8blXWUUwAAAA== +`, + }, + "/partials/forget.html": { local: "web/static/partials/forget.html", size: 119, @@ -13316,6 +13326,16 @@ MJVh+Be0VWJZF7KBEVISHwE9le8AAAD//xB1BPYxAwAA `, }, + "/partials/purge.html": { + local: "web/static/partials/purge.html", + size: 72, + modtime: 0, + compressed: ` +H4sIAAAJbogA/7JJVEjOSSwutlVKKslTAGLdlMS89NQiMLOiWEkhL103oyg1zVapujoxuSQzP09DvaC0 +KD1VXbO2VskuAMS00U+0AwQAAP//rcT2g0gAAAA= +`, + }, + "/partials/put.html": { local: "web/static/partials/put.html", size: 2350, diff --git a/cmd/bosun/web/static/js/bosun.js b/cmd/bosun/web/static/js/bosun.js index 00c2a5d520..240b3ddb7f 100644 --- a/cmd/bosun/web/static/js/bosun.js +++ b/cmd/bosun/web/static/js/bosun.js @@ -2861,3 +2861,15 @@ bosunApp.directive('tsForget', function () { templateUrl: '/partials/forget.html' }; }); +bosunApp.directive('tsPurge', function () { + return { + restrict: 'E', + templateUrl: '/partials/purge.html' + }; +}); +bosunApp.directive('tsForceClose', function () { + return { + restrict: 'E', + templateUrl: '/partials/forceClose.html' + }; +}); diff --git a/cmd/bosun/web/static/js/state.ts b/cmd/bosun/web/static/js/state.ts index 466e6457a6..b43b646bcf 100644 --- a/cmd/bosun/web/static/js/state.ts +++ b/cmd/bosun/web/static/js/state.ts @@ -183,3 +183,17 @@ bosunApp.directive('tsForget', () => { templateUrl: '/partials/forget.html', }; }); + +bosunApp.directive('tsPurge', () => { + return { + restrict: 'E', + templateUrl: '/partials/purge.html', + }; +}); + +bosunApp.directive('tsForceClose', () => { + return { + restrict: 'E', + templateUrl: '/partials/forceClose.html', + }; +}); diff --git a/cmd/bosun/web/static/partials/alertstate.html b/cmd/bosun/web/static/partials/alertstate.html index ebf409702c..5e8aedf51e 100644 --- a/cmd/bosun/web/static/partials/alertstate.html +++ b/cmd/bosun/web/static/partials/alertstate.html @@ -65,7 +65,9 @@

+ +
diff --git a/cmd/bosun/web/static/partials/forceClose.html b/cmd/bosun/web/static/partials/forceClose.html new file mode 100644 index 0000000000..18d6eb2d9f --- /dev/null +++ b/cmd/bosun/web/static/partials/forceClose.html @@ -0,0 +1 @@ +Force Close \ No newline at end of file diff --git a/cmd/bosun/web/static/partials/purge.html b/cmd/bosun/web/static/partials/purge.html new file mode 100644 index 0000000000..8fe074d4e0 --- /dev/null +++ b/cmd/bosun/web/static/partials/purge.html @@ -0,0 +1 @@ +Purge \ No newline at end of file diff --git a/cmd/bosun/web/web.go b/cmd/bosun/web/web.go index f4633879f0..21f30220b7 100644 --- a/cmd/bosun/web/web.go +++ b/cmd/bosun/web/web.go @@ -544,6 +544,10 @@ func Action(t miniprofiler.Timer, w http.ResponseWriter, r *http.Request) (inter at = models.ActionClose case "forget": at = models.ActionForget + case "forceClose": + at = models.ActionForceClose + case "purge": + at = models.ActionPurge } errs := make(MultiError) r.ParseForm() diff --git a/models/incidents.go b/models/incidents.go index 8e20c9838c..b52105acb4 100644 --- a/models/incidents.go +++ b/models/incidents.go @@ -196,6 +196,8 @@ const ( ActionAcknowledge ActionClose ActionForget + ActionForceClose + ActionPurge ) func (a ActionType) String() string { @@ -206,6 +208,10 @@ func (a ActionType) String() string { return "Closed" case ActionForget: return "Forgotten" + case ActionForceClose: + return "ForceClosed" + case ActionPurge: + return "Purged" default: return "none" } @@ -223,6 +229,10 @@ func (a *ActionType) UnmarshalJSON(b []byte) error { *a = ActionClose case `"Forgotten"`: *a = ActionForget + case `"Purged"`: + *a = ActionPurge + case `"ForceClosed"`: + *a = ActionForceClose default: *a = ActionNone }