mirror of
https://github.com/prymitive/karma
synced 2026-05-13 03:56:59 +00:00
feat(api): always provide color information for foo=bar filters
This commit is contained in:
7
views.go
7
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
|
||||
|
||||
Reference in New Issue
Block a user