59 lines
2.0 KiB
Elm
59 lines
2.0 KiB
Elm
module Page.Index exposing (view)
|
|
|
|
import Browser exposing (Document)
|
|
import Html exposing (br, h2, img, p, s, span, text)
|
|
import Html.Attributes exposing (height, src, width)
|
|
import Iso8601
|
|
import Layout exposing (basic, template)
|
|
import Model exposing (Model)
|
|
|
|
|
|
view : Model -> Document msg
|
|
view { tokenData, front } =
|
|
case tokenData of
|
|
Nothing ->
|
|
basic "Login Required" []
|
|
|
|
Just data ->
|
|
template "Mi"
|
|
([ h2 [] [ text "Token Info" ]
|
|
, p
|
|
[]
|
|
[ span
|
|
[]
|
|
[ text "Subscriber: "
|
|
, text data.sub
|
|
, br [] []
|
|
, text "Token ID: "
|
|
, text data.jti
|
|
, br [] []
|
|
, text "Issuer: "
|
|
, text data.iss
|
|
]
|
|
]
|
|
]
|
|
++ (case front of
|
|
Just front_data ->
|
|
[ h2 [] [ text "Current Front" ]
|
|
, span
|
|
[]
|
|
[ text "Name: "
|
|
, text front_data.who
|
|
, br [] []
|
|
, text "Started At: "
|
|
, text <| Iso8601.fromTime front_data.started_at
|
|
, br [] []
|
|
, img
|
|
[ src front_data.img_url
|
|
, width 64
|
|
, height 64
|
|
]
|
|
[]
|
|
]
|
|
]
|
|
|
|
Nothing ->
|
|
[]
|
|
)
|
|
)
|