2020-11-16 03:09:53 +00:00
|
|
|
module Page.Login exposing (view)
|
|
|
|
|
|
|
|
import Browser exposing (Document)
|
|
|
|
import Html exposing (button, input, p, text)
|
|
|
|
import Html.Attributes exposing (placeholder, value)
|
|
|
|
import Html.Events exposing (onClick, onInput)
|
|
|
|
import Layout exposing (basic, template)
|
2020-11-16 21:00:55 +00:00
|
|
|
import Model exposing (Msg(..))
|
2020-11-16 03:09:53 +00:00
|
|
|
|
|
|
|
|
2020-11-16 21:00:55 +00:00
|
|
|
type alias Model a =
|
|
|
|
{ a | token : Maybe String }
|
|
|
|
|
|
|
|
|
|
|
|
view : Model a -> Document Msg
|
2020-11-16 03:09:53 +00:00
|
|
|
view model =
|
|
|
|
basic "Login"
|
|
|
|
[ p [] [ text "Enter the secret code. Unauthorized access is prohibited." ]
|
|
|
|
, input [ placeholder "API Token", value (Maybe.withDefault "" model.token), onInput UpdateToken ] []
|
|
|
|
, button [ onClick SubmitToken ] [ text "Login" ]
|
|
|
|
]
|