ui: Pass parameterized api url down to status logic (#1637)

Previously the api url was hardcoded in the elm logic fetching the
status of an Alertmanager. Instead it is now being passed down like we
already did for /alerts, /silences and /receivers.

Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
This commit is contained in:
Max Inden 2018-11-27 15:33:19 +01:00 committed by stuart nelson
parent 37e019017b
commit 218b8fb1f4
4 changed files with 7 additions and 6 deletions

File diff suppressed because one or more lines are too long

View File

@ -36,7 +36,7 @@ update msg ({ basePath, apiUrl } as model) =
)
NavigateToStatus ->
( { model | route = StatusRoute }, Task.perform identity (Task.succeed <| MsgForStatus InitStatusView) )
( { model | route = StatusRoute }, Task.perform identity (Task.succeed <| MsgForStatus <| InitStatusView apiUrl) )
NavigateToSilenceView silenceId ->
let

View File

@ -7,7 +7,8 @@ import Utils.Types exposing (ApiData(..))
type StatusMsg
= NewStatus (ApiData AlertmanagerStatus)
| InitStatusView
-- String carries the api url.
| InitStatusView String
type alias StatusModel =

View File

@ -11,5 +11,5 @@ update msg model basePath =
NewStatus apiResponse ->
( { model | status = { statusInfo = apiResponse } }, Cmd.none )
InitStatusView ->
( model, getStatus "/api/v2/" (NewStatus >> MsgForStatus) )
InitStatusView apiUrl ->
( model, getStatus apiUrl (NewStatus >> MsgForStatus) )