Disconnection button.

This commit is contained in:
Philippe Pittoli 2023-07-15 18:05:44 +02:00
parent 6705d29dba
commit 576e036501
2 changed files with 10 additions and 5 deletions

View File

@ -32,6 +32,7 @@ data Action
| AuthenticationDaemonEvent WS.Output
| DNSManagerDaemonEvent WS.Output
| ZoneInterfaceEvent ZoneInterface.Output
| Disconnection
| AuthenticateToDNSManager
| Routing Page
@ -106,7 +107,7 @@ render state
admin = true
render_nav :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad
render_nav = Nav.netlibre_navbar authenticated admin (Routing Home) (Routing DomainList) (Routing AuthAdmin) (Routing LoginRegister) (Routing LoginRegister)
render_nav = Nav.netlibre_navbar authenticated admin (Routing Home) (Routing DomainList) (Routing AuthAdmin) (Routing LoginRegister) (Routing LoginRegister) Disconnection
render_header :: forall monad. MonadAff monad => H.ComponentHTML Action ChildSlots monad
render_header = case state.token of
@ -220,3 +221,7 @@ handleAction = case _ of
H.tell _dli unit DomainListInterface.ConnectionIsUp
WS.WSJustClosed -> H.tell _dli unit DomainListInterface.ConnectionIsDown
WS.Log message -> H.tell _log unit (Log.Log message)
Disconnection -> do
H.put $ initialState unit
handleAction $ Routing Home

View File

@ -8,8 +8,8 @@ import Halogen.HTML.Properties as HP
import Halogen.HTML.Properties.ARIA as ARIA
import Bulma as Bulma
netlibre_navbar :: forall w i. Boolean -> Boolean -> i -> i -> i -> i -> i -> HH.HTML w i
netlibre_navbar authenticated admin actionHome actionDomainList actionAuthdAdmin actionRegister actionLogin =
netlibre_navbar :: forall w i. Boolean -> Boolean -> i -> i -> i -> i -> i -> i -> HH.HTML w i
netlibre_navbar authenticated admin actionHome actionDomainList actionAuthdAdmin actionRegister actionLogin actionDisconnection =
main_nav
[ nav_brand [ logo, burger_menu ]
, nav_menu
@ -33,7 +33,7 @@ netlibre_navbar authenticated admin actionHome actionDomainList actionAuthdAdmin
, nav_button C.is_info "Login" actionLogin
, nav_button_code
]
_ -> [ nav_button_code ]
_ -> [ nav_button_disconnection, nav_button_code ]
]
]
]
@ -54,13 +54,13 @@ netlibre_navbar authenticated admin actionHome actionDomainList actionAuthdAdmin
link_home = nav_button C.is_info "Home" actionHome
link_domains = nav_button C.is_info "Domains" actionDomainList
link_authd_admin = nav_button C.is_info "Authd Admin" actionAuthdAdmin
nav_button_disconnection = nav_button C.is_danger "Disconnection" actionDisconnection
--dropdown title dropdown_elements
-- = HH.div [HP.classes (C.navbar_item <> C.has_dropdown <> C.is_hoverable)]
-- [ dropdown_title title, HH.div [HP.classes C.navbar_dropdown] dropdown_elements ]
--dropdown_title str = HH.a [HP.classes C.navbar_link] [HH.text str]
--dropdown_element str = HH.a [HP.classes C.navbar_item] [HH.text str]
--dropdown_separator = HH.hr [HP.classes C.navbar_divider]
nav_button_code = btn_link [] "https://git.baguette.netlib.re/Baguette/dnsmanager" "Code"
nav_button_strong str action = btn C.is_primary action (HH.strong [] [ HH.text str ])
nav_button classes str action = btn classes action (HH.text str)