diff --git a/src/Api.elm b/src/Api.elm index 26de6bb9..ad92da6a 100644 --- a/src/Api.elm +++ b/src/Api.elm @@ -39,11 +39,15 @@ getSilence id = Task.perform FetchFail SilenceFetchSucceed (Http.get showResponseDecoder url) + -- Make these generic when I've gotten to Alerts + + showResponseDecoder : Json.Decoder Silence showResponseDecoder = (Json.at [ "data" ] silenceDecoder) + listResponseDecoder : Json.Decoder (List Silence) listResponseDecoder = Json.at [ "data", "silences" ] (Json.list silenceDecoder) diff --git a/src/Views.elm b/src/Views.elm index c9518592..a0145957 100644 --- a/src/Views.elm +++ b/src/Views.elm @@ -36,7 +36,7 @@ view model = Debug.log "view: name" name in div [] - (silenceView model.silence :: (List.map matcherView model.silence.matchers)) + (silenceView model.silence :: (List.map matcherView model.silence.matchers)) _ -> notFoundView model @@ -102,9 +102,11 @@ silenceView silence = ] ] + matcherView : Matcher -> Html msg matcherView matcher = - dt [ class "m10 black w-100" ] [ text (String.join " " [matcher.name, "=", matcher.value]) ] + dt [ class "m10 black w-100" ] [ text (String.join " " [ matcher.name, "=", matcher.value ]) ] + objectData : String -> Html msg objectData data =