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:
parent
37e019017b
commit
218b8fb1f4
File diff suppressed because one or more lines are too long
|
@ -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
|
||||
|
|
|
@ -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 =
|
||||
|
|
|
@ -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) )
|
||||
|
|
Loading…
Reference in New Issue