Comments.
parent
8786af38a7
commit
ab654ddbe7
|
@ -32,10 +32,23 @@ data Action
|
|||
| AuthenticationDaemonEvent WS.Output
|
||||
| DNSManagerDaemonEvent WS.Output
|
||||
| ZoneInterfaceEvent ZoneInterface.Output
|
||||
|
||||
-- | Disconnect from both `authd` and `dnsmanagerd` (remove sockets).
|
||||
| Disconnection
|
||||
|
||||
-- | Try to authenticate the user to `dnsmanagerd`.
|
||||
| AuthenticateToDNSManager
|
||||
|
||||
-- | Change the displayed 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
|
||||
|
||||
type State = { token :: Maybe String
|
||||
|
@ -96,7 +109,6 @@ render state
|
|||
]
|
||||
where
|
||||
|
||||
-- TODO
|
||||
render_home = Bulma.box [ HH.slot_ _ho unit HomeInterface.component unit]
|
||||
|
||||
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."
|
||||
m@(DNSManager.MkUnacceptableDomain _) -> do
|
||||
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
|
||||
handleAction Log $ SimpleLog $ "Received the list of accepted domains!"
|
||||
handleAction $ DNSMessageReceived m
|
||||
handleAction $ DispatchDNSMessage m
|
||||
(DNSManager.MkLogged _) -> do
|
||||
handleAction Log $ SimpleLog $ "[TODO] Authenticated to dnsmanagerd!"
|
||||
(DNSManager.MkDomainAdded response) -> do
|
||||
|
@ -288,7 +300,7 @@ handleAction = case _ of
|
|||
handleAction Log $ SimpleLog $ "[🎉] Success!"
|
||||
|
||||
-- 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"
|
||||
--{ current_page } <- H.get
|
||||
--case current_page of
|
||||
|
|
Loading…
Reference in New Issue