feat(api): always provide color information for foo=bar filters

This commit is contained in:
Łukasz Mierzwa
2018-09-09 11:46:45 +01:00
parent 58cb661701
commit 440354de89

View File

@@ -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