Comments.

beta
Philippe Pittoli 2023-08-17 23:52:21 +02:00
parent 8786af38a7
commit ab654ddbe7
1 changed files with 17 additions and 5 deletions

View File

@ -32,10 +32,23 @@ data Action
| AuthenticationDaemonEvent WS.Output | AuthenticationDaemonEvent WS.Output
| DNSManagerDaemonEvent WS.Output | DNSManagerDaemonEvent WS.Output
| ZoneInterfaceEvent ZoneInterface.Output | ZoneInterfaceEvent ZoneInterface.Output
-- | Disconnect from both `authd` and `dnsmanagerd` (remove sockets).
| Disconnection | Disconnection
-- | Try to authenticate the user to `dnsmanagerd`.
| AuthenticateToDNSManager | AuthenticateToDNSManager
-- | Change the displayed page.
| Routing Page | Routing Page
| DNSMessageReceived DNSManager.AnswerMessage
-- | DispatchDNSMessage: a DNS message (from `dnsmanagerd`) was received and decoded through the
-- | `DNSRawMessageReceived` action.
-- | The message is provided to the right component.
| DispatchDNSMessage DNSManager.AnswerMessage
-- | DNSRawMessageReceived is the action when receiving a message, which is decoded in the handler.
-- | Then, the message will be provided to the `DispatchDNSMessage` action.
| DNSRawMessageReceived ArrayBuffer | DNSRawMessageReceived ArrayBuffer
type State = { token :: Maybe String type State = { token :: Maybe String
@ -96,7 +109,6 @@ render state
] ]
where where
-- TODO
render_home = Bulma.box [ HH.slot_ _ho unit HomeInterface.component unit] render_home = Bulma.box [ HH.slot_ _ho unit HomeInterface.component unit]
render_zone domain = Bulma.box [ HH.slot _zi unit ZoneInterface.component domain ZoneInterfaceEvent] render_zone domain = Bulma.box [ HH.slot _zi unit ZoneInterface.component domain ZoneInterfaceEvent]
@ -258,10 +270,10 @@ handleAction = case _ of
handleAction Log $ SimpleLog $ "Failed! The domain already exists." handleAction Log $ SimpleLog $ "Failed! The domain already exists."
m@(DNSManager.MkUnacceptableDomain _) -> do m@(DNSManager.MkUnacceptableDomain _) -> do
handleAction Log $ SimpleLog $ "Failed! The domain is not acceptable (not in the list of accepted domains)." handleAction Log $ SimpleLog $ "Failed! The domain is not acceptable (not in the list of accepted domains)."
handleAction $ DNSMessageReceived m handleAction $ DispatchDNSMessage m
m@(DNSManager.MkAcceptedDomains _) -> do m@(DNSManager.MkAcceptedDomains _) -> do
handleAction Log $ SimpleLog $ "Received the list of accepted domains!" handleAction Log $ SimpleLog $ "Received the list of accepted domains!"
handleAction $ DNSMessageReceived m handleAction $ DispatchDNSMessage m
(DNSManager.MkLogged _) -> do (DNSManager.MkLogged _) -> do
handleAction Log $ SimpleLog $ "[TODO] Authenticated to dnsmanagerd!" handleAction Log $ SimpleLog $ "[TODO] Authenticated to dnsmanagerd!"
(DNSManager.MkDomainAdded response) -> do (DNSManager.MkDomainAdded response) -> do
@ -288,7 +300,7 @@ handleAction = case _ of
handleAction Log $ SimpleLog $ "[🎉] Success!" handleAction Log $ SimpleLog $ "[🎉] Success!"
-- Send a received DNS manager message to a component. -- Send a received DNS manager message to a component.
DNSMessageReceived message -> do DispatchDNSMessage message -> do
handleAction Log $ SimpleLog "should send a DNS message to a component" handleAction Log $ SimpleLog "should send a DNS message to a component"
--{ current_page } <- H.get --{ current_page } <- H.get
--case current_page of --case current_page of