diff --git a/Makefile b/Makefile index b8f740e40..e1679d57f 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ run: $(NAME) COLOR_LABELS_UNIQUE="instance cluster" \ COLOR_LABELS_STATIC="job" \ DEBUG="$(GIN_DEBUG)" \ - FILTER_DEFAULT="@inhibited=false" \ + FILTER_DEFAULT="@status=active" \ PORT=$(PORT) \ ./$(NAME) diff --git a/assets/static/autocomplete.js b/assets/static/autocomplete.js index ddaeb491a..ecca05a4a 100644 --- a/assets/static/autocomplete.js +++ b/assets/static/autocomplete.js @@ -30,14 +30,14 @@ var Autocomplete = (function() { // this is used to generate quick filters for label modal var generateHints = function(label_key, label_val) { var hints = []; - if (label_key == "@silenced") { + if (label_key == "@status") { // static list of hints for @silenced label - hints.push("@silenced=true"); - hints.push("@silenced=false"); - } else if (label_key == "@inhibited") { - // static list of hints for @inhibited label - hints.push("@inhibited=true"); - hints.push("@inhibited=false"); + hints.push("@status=active"); + hints.push("@status=suppressed"); + hints.push("@status=unprocessed"); + hints.push("@status!=active"); + hints.push("@status!=suppressed"); + hints.push("@status!=unprocessed"); } else { // equal and non-equal hints for everything else hints.push(label_key + "=" + label_val); diff --git a/assets/static/base.css b/assets/static/base.css index 702d449c4..5e651e764 100644 --- a/assets/static/base.css +++ b/assets/static/base.css @@ -223,12 +223,15 @@ input#filter:focus { /* make silence description smaller */ .silence-comment { font-size: smaller; - margin-top: 6px; margin-bottom: 0; border-left-color: #18bc9c; padding-top: 5px; padding-bottom: 5px; } +.silence-comment-title { + margin-top: 6px; + display: block; +} .incident .panel { margin-bottom: 0; diff --git a/assets/static/colors.js b/assets/static/colors.js index cd0be3835..297d357f0 100644 --- a/assets/static/colors.js +++ b/assets/static/colors.js @@ -5,10 +5,9 @@ var Colors = (function() { staticColorLabels; var specialLabels = { - "@silenced: false": "label-danger", - "@silenced: true": "label-success", - "@inhibited: false": "label-danger", - "@inhibited: true": "label-success" + "@status: unprocessed": "label-default", + "@status: active": "label-danger", + "@status: suppressed": "label-success", }; var update = function(colorData) { diff --git a/assets/templates/alertgroup.html b/assets/templates/alertgroup.html index 497c6dce7..b096a71ad 100644 --- a/assets/templates/alertgroup.html +++ b/assets/templates/alertgroup.html @@ -74,15 +74,9 @@ <%- text %> <% }) %> - <% if (alert.inhibitedBy.length) { %> - <%= Templates.Render('buttonLabel', {elem: 'span', elemClass: 'label label-list label-success', label: {key: '@inhibited', value: 'true', text: '@inhibited: true'}}) %> - <% } else { %> - <%= Templates.Render('buttonLabel', {elem: 'span', elemClass: 'label label-list label-danger', label: {key: '@inhibited', value: 'false', text: '@inhibited: false'}}) %> - <% } %> - <% if (alert.silencedBy.length) { %> - <%= Templates.Render('buttonLabel', {elem: 'span', elemClass: 'label label-list label-success', label: {key: '@silenced', value: 'true', text: '@silenced: true'}}) %> - <% } else { %> - <%= Templates.Render('buttonLabel', {elem: 'span', elemClass: 'label label-list label-danger', label: {key: '@silenced', value: 'false', text: '@silenced: false'}}) %> + <% var attrs = Alerts.GetLabelAttrs("@status", alert.status) %> + <%= Templates.Render('buttonLabel', {elem: 'span', attrs: attrs, label: {key: '@status', value: alert.status, text: '@status: ' + alert.status}}) %> + <% if (alert.silencedBy.length == 0) { %> <% var labels = [] %> <% _.each(Alerts.SortMapByKey(alert.labels), function(label) { %> <% labels.push(label.key + '=' + label.value) %> @@ -110,6 +104,9 @@