Commit Graph

37 Commits

Author SHA1 Message Date
Łukasz Mierzwa
487d7bcde8 Use alert status, inhibitedBy & silencedBy fields instead of silenced & inhibited 2017-05-01 22:20:12 +01:00
Łukasz Mierzwa
7f3c414189 Don't leak event listeners in the silence form
Event listeners are setup on the modal div, but that div is not removed when the modal is hidden, only its children. This means that event listeners are stacked every time you show and hide a form. To reproduce this issue:
1. open silence form, click up button above hours, it will increment from 1 to 2
2. hide the form
3. re-open silence form, click up button above hours, it will increment from 1 to 3
4. repeat and every time increment will get a new listener that will cause higher value bump

This PR moves all listeners to the silence form element, which is removed when modal is closed, so all even listeners are destroyed properly and this bug no longer gets triggered.
Same fix is applied to the quick filter modal, it's present there but the effect there isn't as visible
2017-04-26 17:37:13 -07:00
Łukasz Mierzwa
45ba69cf76 Ensure raven-js is loaded first and works if enabled
This moves raven init into a dedicated file where it's configured on load, we no longer load it on /help, but there's only css there so there wasn't anything that could fail anyway. We will also now fail in the most visible way if the value passed to raven is invalid (as in invalid syntax)
2017-04-25 23:05:22 -07:00
Łukasz Mierzwa
46ea7ebc94 Remove dead element
This isn't used by anything
2017-04-25 16:42:52 -07:00
Łukasz Mierzwa
e26bb6e492 Cleanup silence form controls
Drop separators and replace submit button text with an icon
2017-04-25 14:59:44 -07:00
Łukasz Mierzwa
4ba54f5573 Default to duration only UI controls
Instead of showing start & end inputs show duration input element, explicit start & end are still present under tabs, where datatime picker is inlined (so it doesn't require any click to show controls). Tabs will also show desription of relative start and end, so it should be more readable what is the real duration of a silence
2017-04-24 23:02:32 -07:00
Łukasz Mierzwa
14cb221b6a Make the badge clickable
Clicking the badge will toggle select / deselect all values, for easy flipping labels when an alert contains large number of labels
2017-04-24 14:55:15 -07:00
Łukasz Mierzwa
03e793dd74 Add badges to selects
This gives the user a hint when a label contains more than one value in the select
2017-04-24 14:55:05 -07:00
Łukasz Mierzwa
2886421b7a Drop date class from datetime picker input group
Not needed with our setup and it makes the calendar icon clickable, which doesn't really do anything, so it's just confusing
2017-04-23 19:56:16 -07:00
Łukasz Mierzwa
9bbb81212b Default to 1 hour silence 2017-04-23 19:32:21 -07:00
Łukasz Mierzwa
e9af43402e Sort labels 2017-04-23 09:02:29 -07:00
Łukasz Mierzwa
f83660c43d Don't show action box when there's only one value 2017-04-23 09:02:28 -07:00
Łukasz Mierzwa
1e05406a02 Make submit button green 2017-04-23 09:02:28 -07:00
Łukasz Mierzwa
020b1a2728 Show loading placeholder
Form loads after ajax call, so it can take some time on big responses and slow connection
2017-04-23 09:02:27 -07:00
Łukasz Mierzwa
575dc245b1 Enable live search for labels with >10 values 2017-04-23 09:02:27 -07:00
Łukasz Mierzwa
087458b767 Allow selecting multiple label values when creating silence.
This commit turns label checkboxes into multiselect dropdowns that are populated from all labels of all instances of current alert (matched by alertname label). There is also a cocollapsible preview box that allows user to inspect raw silence JSON object we will send to the Alertmanager API. Fixes #69
2017-04-23 09:02:27 -07:00
Łukasz Mierzwa
0ff3861afe Move input element icons to the left and add icons for all inputs
This will provide more consistent look.
2017-04-20 21:54:06 -07:00
Łukasz Mierzwa
0ca17211af Escape silenceID output just in case 2017-04-20 21:32:10 -07:00
Łukasz Mierzwa
b407204aff Add an icon to error messages 2017-04-20 21:30:52 -07:00
Łukasz Mierzwa
6558735751 Drop bogus checkbox classes from outer div
This is breaking checkbox and label alignment.
2017-04-20 21:24:16 -07:00
Łukasz Mierzwa
0417be1cca Drop duplicated classes
Both are already provided by attrs.class
2017-04-20 21:17:57 -07:00
Łukasz Mierzwa
952eb3467c Drop labels above comment and email inputs
They both have placeholder text, so label is redundant
2017-04-20 21:15:05 -07:00
Łukasz Mierzwa
42f2f33084 Add labels above duration datetime picker fileds
Make it more obvious which fields is used for what
2017-04-20 21:14:22 -07:00
Łukasz Mierzwa
d5916c81cf Add support for creating silences directly from unsee UI
It adds a button next to the @silenced filter that shows a modal window with a silence form. API request is send via AJAX call from user browser.
2017-04-20 17:01:52 -07:00
Łukasz Mierzwa
5fe3f706af If we only have silenced or inhibited alerts make the whole alert group green
This will make the UI present inhibited alerts same way as silenced. It also drops unused fields in the model, replacing SilencedCount & UnsilencedCount with only ActiveCount
2017-04-19 15:43:13 -07:00
Łukasz Mierzwa
0a16da7604 Show inhibition status in the UI
Show it the same way as @silenced is being presented
2017-04-17 16:14:26 -07:00
Łukasz Mierzwa
24ac803ee4 Document @inhibited filter 2017-04-17 16:05:24 -07:00
Łukasz Mierzwa
f1e90e054d Rewrite clientside-haml-js templates using underscore
Drop haml templates in favor of underscore. Haml templates are harder to maintain and require extra dependencies, we already have underscore.js included and it provides a fast templating engine. Rewrite all client side templates using it.
Performance with underscore is pretty much the same as with haml (with 10k alerts).
2017-04-10 11:38:34 -07:00
Łukasz Mierzwa
7b22323977 Move label modal setup to a dedicated file 2017-04-08 11:28:00 -07:00
Łukasz Mierzwa
750ce4ed3c Use correct label based on the number of label/alert count 2017-04-08 10:51:09 -07:00
Łukasz Mierzwa
ece7c6a096 alert.silenced is a string now, not an int
This was changed in Alertmanager 0.5, backend code was fixed, but js still uses old condition, relaxed if will work with both
2017-04-08 07:46:10 -07:00
Łukasz Mierzwa
50670d8058 Show version string instead of 'Settings' label
We already have 'Settings' label in the tooltip and it's obvious those are settings, replace it with the version string
2017-04-06 10:23:12 -07:00
Łukasz Mierzwa
1f37ab3fbe Add a clickable link to every alert group
This links to a filter generated from alert group labels, so one can easily share it
2017-04-04 16:37:05 -07:00
Łukasz Mierzwa
1226b32603 Add tooltips to external links
This adds a tooptip for alert source url and all links detected in labels
2017-04-03 17:27:53 -07:00
Łukasz Mierzwa
0d82cffd79 Add -web.prefix / WEB_PREFIX option
This allows people to use unsee with a sub uri setup, which is pretty common usa case, fixes #22
2017-03-30 19:35:52 +01:00
Łukasz Mierzwa
ec08572f0a Use application/json for haml templates
application/javascript was set in commit 5e501844a7 which works, but causes browsers to throw lots of errors in the console, as they try to parse those scripts as javascript, json type still works and doesn't have same issue with browsers
2017-03-26 17:41:17 -07:00
Łukasz Mierzwa
f8420d4632 Use go-bindata-assetfs for static files
This allows unsee to be compiled into a single self-contained binary, without any need to external static files or templates
2017-03-26 17:41:17 -07:00