From 8a77d620fd31ecfe19b12b25b7cc1258dba13048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Tue, 23 May 2017 21:52:08 +0100 Subject: [PATCH] Rename @status to @state Fixes #104 @status filter was added to the master branch to support new status key from Alertmanager >=0.6.1 status ended up being nested in Alertmanager (it was added to solve AM issue 609 and that was a long PR with lots of changes), current unsee implementation ended being slightly off with how Alertmanager is naming this, it should actually be @state rather than @status. --- Makefile | 2 +- assets/static/autocomplete.js | 14 ++-- assets/static/colors.js | 6 +- assets/templates/alertgroup.html | 16 ++-- assets/templates/help.html | 24 +++--- bindata_assetfs.go | 8 +- filters/{filter_status.go => filter_state.go} | 16 ++-- filters/filter_test.go | 78 +++++++++---------- filters/registry.go | 8 +- main.go | 2 +- mapper/v04/alerts.go | 2 +- mapper/v05/alerts.go | 2 +- mapper/v061/alerts.go | 2 +- mapper/v062/alerts.go | 2 +- models/models.go | 18 ++--- timer.go | 4 +- views.go | 14 ++-- views_test.go | 12 +-- 18 files changed, 115 insertions(+), 115 deletions(-) rename filters/{filter_status.go => filter_state.go} (62%) diff --git a/Makefile b/Makefile index 444e9fa6c..3699b3f62 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="@status=active" \ + FILTER_DEFAULT="@state=active" \ PORT=$(PORT) \ ./$(NAME) diff --git a/assets/static/autocomplete.js b/assets/static/autocomplete.js index ecca05a4a..1984a6495 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 == "@status") { + if (label_key == "@state") { // static list of hints for @silenced label - hints.push("@status=active"); - hints.push("@status=suppressed"); - hints.push("@status=unprocessed"); - hints.push("@status!=active"); - hints.push("@status!=suppressed"); - hints.push("@status!=unprocessed"); + hints.push("@state=active"); + hints.push("@state=suppressed"); + hints.push("@state=unprocessed"); + hints.push("@state!=active"); + hints.push("@state!=suppressed"); + hints.push("@state!=unprocessed"); } else { // equal and non-equal hints for everything else hints.push(label_key + "=" + label_val); diff --git a/assets/static/colors.js b/assets/static/colors.js index 297d357f0..9cfd47b76 100644 --- a/assets/static/colors.js +++ b/assets/static/colors.js @@ -5,9 +5,9 @@ var Colors = (function() { staticColorLabels; var specialLabels = { - "@status: unprocessed": "label-default", - "@status: active": "label-danger", - "@status: suppressed": "label-success", + "@state: unprocessed": "label-default", + "@state: active": "label-danger", + "@state: suppressed": "label-success", }; var update = function(colorData) { diff --git a/assets/templates/alertgroup.html b/assets/templates/alertgroup.html index 81ea8b53e..c6219879a 100644 --- a/assets/templates/alertgroup.html +++ b/assets/templates/alertgroup.html @@ -50,7 +50,7 @@