Add a clickable link to every alert group

This links to a filter generated from alert group labels, so one can easily share it
This commit is contained in:
Łukasz Mierzwa
2017-04-04 16:37:05 -07:00
parent e65c296ed7
commit 1f37ab3fbe
3 changed files with 17 additions and 2 deletions

View File

@@ -372,3 +372,10 @@ table.table.examples > tbody > tr td:first-child {
.modal-body>table.table>tbody>tr>td.modal-row-actions {
vertical-align: middle;
}
.panel-heading > span.alert-group-link {
margin-left: -8px;
}
span.alert-group-link > a {
color: #fff;
}

View File

@@ -6,6 +6,14 @@
%div.panel{class: cls_panel}
%div.panel-heading.text-center
-if (Object.keys(group.labels).length > 0) {
-var filters = [];
-$.each(group.labels, function(label_key, label_val) {
-filters.push(label_key + '=' + label_val);
-var groupLink = '?q=' + filters.join(',');
%span.pull-left.alert-group-link
%a{href: groupLink, title: 'Link to this alert group', 'data-toggle': 'tooltip', 'data-placement': 'top'}
%i.fa.fa-link
%span.badge.pull-right
=group.alerts.length
%div.panel-title

File diff suppressed because one or more lines are too long