From 440354de893b377b57050cc494029b5c44920e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Sun, 9 Sep 2018 11:46:45 +0100 Subject: [PATCH] feat(api): always provide color information for foo=bar filters --- views.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/views.go b/views.go index e01d32b70..14f60b2c2 100644 --- a/views.go +++ b/views.go @@ -12,6 +12,7 @@ import ( "github.com/prymitive/unsee/internal/config" "github.com/prymitive/unsee/internal/models" "github.com/prymitive/unsee/internal/slices" + "github.com/prymitive/unsee/internal/transform" "github.com/gin-gonic/gin" @@ -185,6 +186,12 @@ func alerts(c *gin.Context) { } + for _, filter := range matchFilters { + if filter.GetValue() != "" && filter.GetMatcher() == "=" { + transform.ColorLabel(colors, filter.GetName(), filter.GetValue()) + } + } + resp.AlertGroups = alerts resp.Silences = silences resp.Colors = colors