Add lamassu-admin-elm to this repo (#185)
This commit is contained in:
parent
5ee7e40872
commit
f4fc9d6328
134 changed files with 28171 additions and 83 deletions
29
lamassu-admin-elm/src/StatusDecoder.elm
Normal file
29
lamassu-admin-elm/src/StatusDecoder.elm
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
module StatusDecoder exposing (..)
|
||||
|
||||
import StatusTypes exposing (..)
|
||||
import Json.Decode exposing (..)
|
||||
|
||||
|
||||
rateDecoder : Decoder Rate
|
||||
rateDecoder =
|
||||
map3 Rate
|
||||
(field "crypto" string)
|
||||
(field "bid" float)
|
||||
(field "ask" float)
|
||||
|
||||
|
||||
serverDecoder : Decoder ServerRec
|
||||
serverDecoder =
|
||||
map5 ServerRec
|
||||
(field "up" bool)
|
||||
(field "lastPing" (nullable string))
|
||||
(field "rates" (list rateDecoder))
|
||||
(field "machineStatus" string)
|
||||
(field "wasConfigured" bool)
|
||||
|
||||
|
||||
statusDecoder : Decoder StatusRec
|
||||
statusDecoder =
|
||||
map2 StatusRec
|
||||
(field "server" serverDecoder)
|
||||
(field "invalidConfigGroups" (list string))
|
||||
Loading…
Add table
Add a link
Reference in a new issue