Authentication Daemon Administrative Interface.

This commit is contained in:
Philippe Pittoli 2024-02-17 07:15:51 +01:00
parent c9bbe81d09
commit abf03de8c9

View File

@ -112,17 +112,22 @@ initialState _ = { addUserForm: { login: "", admin: false, email: "", pass: "
render :: forall m. State -> H.ComponentHTML Action () m
render { addUserForm, searchUserForm, page, wsUp }
= case page of
Home -> Bulma.modal "Hello lol" [Bulma.h3 "This is the body lol"] [routing_search_button, routing_add_button]
Search -> Bulma.columns_ [ Bulma.column (C.is_size 3) [ Bulma.h3 "Search users", render_searchuser_form ]
, Bulma.column_ [ Bulma.h3 "Result", Bulma.subtitle "TODO" ]
]
Add -> Bulma.columns_ [ Bulma.column_ [ Bulma.h3 "Add a new user", render_adduser_form ] ]
= HH.div_
[ Bulma.box [routing_search_button, routing_add_button]
, case page of
Home -> Bulma.section_small [Bulma.h3 "Select an action"]
Search -> Bulma.columns_
[ Bulma.column (C.is_size 3) [Bulma.article (Bulma.p "Search users") render_searchuser_form]
, Bulma.column_ [ Bulma.h3 "Result", Bulma.subtitle "TODO" ]
]
Add -> Bulma.columns_
[ Bulma.column (C.is_size 5) [Bulma.article (Bulma.p "Add a new user") render_adduser_form] ]
]
where
active = (if wsUp then (HP.enabled true) else (HP.disabled true))
render_adduser_form = Bulma.box [
render_adduser_form =
HH.form
[ HE.onSubmit PreventSubmit ]
[ Bulma.box_input "login" "User login" "login" (up ADDUSER_INP_login) addUserForm.login active
@ -131,10 +136,10 @@ render { addUserForm, searchUserForm, page, wsUp }
, Bulma.box_password "password" "User password" "password" (up ADDUSER_INP_pass) addUserForm.pass active
, Bulma.btn "Send" AddUserAttempt
]
]
up x = HandleAddUserInput <<< x
render_searchuser_form = Bulma.box [
render_searchuser_form =
HH.form
[ HE.onSubmit PreventSubmit ]
[ Bulma.box_input "login" "Login" "login" (up SEARCHUSER_INP_login) searchUserForm.login active
@ -144,7 +149,6 @@ render { addUserForm, searchUserForm, page, wsUp }
-- (up SEARCHUSER_INP_domain) searchUserForm.email active
, Bulma.btn "Send" SearchUserAttempt
]
]
routing_search_button = Bulma.btn "Search" $ Routing Search
routing_add_button = Bulma.btn "Add" $ Routing Add