mirror of
https://github.com/prometheus/alertmanager
synced 2025-02-17 19:17:07 +00:00
Prepopulate matchers when recreating a silence (#1270)
* Fix #1268 Pre-populate matches list when recreating expired silences. * Update bindata
This commit is contained in:
parent
e67aa8edae
commit
2ecd4d6c3c
@ -98,25 +98,29 @@ matcherButton matcher =
|
|||||||
|
|
||||||
editButton : Silence -> Html Msg
|
editButton : Silence -> Html Msg
|
||||||
editButton silence =
|
editButton silence =
|
||||||
case silence.status.state of
|
let
|
||||||
-- If the silence is expired, do not edit it, but instead create a new
|
matchers =
|
||||||
-- one with the old matchers
|
List.map (\s -> ( s.name, s.value )) silence.matchers
|
||||||
Expired ->
|
in
|
||||||
a
|
case silence.status.state of
|
||||||
[ class "btn btn-outline-info border-0"
|
-- If the silence is expired, do not edit it, but instead create a new
|
||||||
, href (newSilenceFromAlertLabels [])
|
-- one with the old matchers
|
||||||
]
|
Expired ->
|
||||||
[ text "Recreate"
|
a
|
||||||
]
|
[ class "btn btn-outline-info border-0"
|
||||||
|
, href (newSilenceFromAlertLabels matchers)
|
||||||
_ ->
|
|
||||||
let
|
|
||||||
editUrl =
|
|
||||||
String.join "/" [ "#/silences", silence.id, "edit" ]
|
|
||||||
in
|
|
||||||
a [ class "btn btn-outline-info border-0", href editUrl ]
|
|
||||||
[ text "Edit"
|
|
||||||
]
|
]
|
||||||
|
[ text "Recreate"
|
||||||
|
]
|
||||||
|
|
||||||
|
_ ->
|
||||||
|
let
|
||||||
|
editUrl =
|
||||||
|
String.join "/" [ "#/silences", silence.id, "edit" ]
|
||||||
|
in
|
||||||
|
a [ class "btn btn-outline-info border-0", href editUrl ]
|
||||||
|
[ text "Edit"
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
deleteButton : Silence -> Bool -> Html Msg
|
deleteButton : Silence -> Bool -> Html Msg
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user