diff --git a/src/App/Container.purs b/src/App/Container.purs index 1e7634b..a0d6edf 100644 --- a/src/App/Container.purs +++ b/src/App/Container.purs @@ -521,6 +521,7 @@ handleAction = case _ of ZoneInterfaceEvent ev -> case ev of ZoneInterface.MessageToSend message -> H.tell _ws_dns unit (WS.ToSend message) ZoneInterface.Log message -> handleAction $ Log message + ZoneInterface.ToDomainList -> handleAction $ Routing DomainList DomainListComponentEvent ev -> case ev of DomainListInterface.MessageToSend message -> H.tell _ws_dns unit (WS.ToSend message) diff --git a/src/App/Page/Navigation.purs b/src/App/Page/Navigation.purs index ad0a07d..6031570 100644 --- a/src/App/Page/Navigation.purs +++ b/src/App/Page/Navigation.purs @@ -192,7 +192,7 @@ render { logged, active, admin, login } = , HE.onClick (\_ -> action) ] [ (HH.text str) ] - dropdown_element classes link str = HH.a [HP.classes (C.navbar_item <> classes), HP.href link] [HH.text str] + dropdown_element classes link str = Bulma.outside_link (C.navbar_item <> classes) link str dropdown_element_primary link str = dropdown_element C.has_background_info_light link str dropdown_element_secondary link str = dropdown_element C.has_background_warning_light link str diff --git a/src/App/Page/Zone.purs b/src/App/Page/Zone.purs index 8baa9fa..776b670 100644 --- a/src/App/Page/Zone.purs +++ b/src/App/Page/Zone.purs @@ -83,6 +83,7 @@ id x = x data Output = MessageToSend ArrayBuffer | Log LogMessage + | ToDomainList -- | `App.ZoneInterface` can receive messages from `dnsmanagerd`. @@ -142,6 +143,9 @@ data Action -- | Change the current tab. | ChangeTab Tab + -- | Return to the domain list. + | ReturnToDomainList + -- | Update new entry form (in the `rr_modal` modal). | UpdateCurrentRR Field @@ -353,7 +357,9 @@ render state NewRRModal _ -> render_current_rr_modal UpdateRRModal -> render_current_rr_modal NoModal -> HH.div_ - [ Bulma.h1 state._domain + [ Bulma.level [ Bulma.btn_ (C.is_large <> C.is_info) "Back to the domain list" ReturnToDomainList + , Bulma.h1 state._domain + ] [] , Bulma.hr , render_resources $ sorted state._resources , Bulma.hr @@ -611,7 +617,7 @@ render state , Bulma.hr , Bulma.div_content [] [Bulma.explanation Explanations.dmarc_pct] - , Bulma.box_input "idDMARCpct" "Sample rate [0..100]" "100" DMARC_pct (maybe "100" show state.dmarc.pct) + , Bulma.box_input "idDMARCpct" "Sample rate (between 0 and 100)" "100" DMARC_pct (maybe "100" show state.dmarc.pct) , Bulma.hr , Bulma.selection_field' "idDMARCfo" "When to send a report" DMARC_fo @@ -635,8 +641,8 @@ render state , render_dmarc_mail_errors , Bulma.box_input "idDMARCmail" "Address to contact" "admin@example.com" DMARC_mail state.dmarc_mail , Bulma.box_input "idDMARCmaillimit" "Report size limit (in KB)" "2000" DMARC_mail_limit (maybe "0" show state.dmarc_mail_limit) - , Bulma.level [ Bulma.btn "New address for aggregated report" DMARC_rua_Add - , Bulma.btn "New address for specific report" DMARC_ruf_Add + , Bulma.level [ Bulma.btn_ C.has_background_info_light "New address for aggregated report" DMARC_rua_Add + , Bulma.btn_ C.has_background_success_light "New address for specific report" DMARC_ruf_Add ] [] , Bulma.hr @@ -686,6 +692,10 @@ handleAction = case _ of DeleteRRModal rr_id -> do H.modify_ _ { rr_modal = RemoveRRModal rr_id } + -- | Return to the domain list. + ReturnToDomainList -> do + H.raise ToDomainList + -- | Change the current tab. ChangeTab new_tab -> do -- Store the current tab we are on and restore it when we reload. diff --git a/src/App/Text/Explanations.purs b/src/App/Text/Explanations.purs index c988e58..9d17f5f 100644 --- a/src/App/Text/Explanations.purs +++ b/src/App/Text/Explanations.purs @@ -2,6 +2,7 @@ module App.Text.Explanations where import Halogen.HTML as HH import Halogen.HTML.Properties as HP import Bulma as Bulma +import CSSClasses as C expl' :: forall w i. String -> HH.HTML w i expl' text = expl [Bulma.p text] @@ -311,8 +312,8 @@ dmarc_introduction = dmarc_policy :: forall w i. Array (HH.HTML w i) dmarc_policy = [ Bulma.p """ - DMARC record enables to tell receivers what to do with a non-conforming message; - a message that wasn't properly secured with SPF and DKIM. + DMARC record enables to tell receivers what to do with a non-conforming message, + i.e. a message that wasn't properly secured with SPF and DKIM. """ , Bulma.p """ This message can either be accepted ("None") or rejected, or even quarantined, meaning to be considered as suspicious. @@ -353,18 +354,21 @@ dmarc_aspf = In strict mode, both fields should be identical. In relaxed mode, they can be different, but in the same Organizational Domain. """ - , Bulma.p """ - From RFC7489: For example, if a message passes an SPF check with an - RFC5321.MailFrom domain of "cbg.bounces.example.com", and the address - portion of the RFC5322.From field contains "payments@example.com", - the Authenticated RFC5321.MailFrom domain identifier and the - RFC5322.From domain are considered to be "in alignment" in relaxed - mode, but not in strict mode. - """ + , HH.p_ [ HH.text "From RFC7489:" + , HH.div [HP.classes C.is_italic] + [ HH.text """For example, if a message passes an SPF check with an + RFC5321.MailFrom domain of "cbg.bounces.example.com", and the address + portion of the RFC5322.From field contains "payments@example.com", + the Authenticated RFC5321.MailFrom domain identifier and the + RFC5322.From domain are considered to be "in alignment" in relaxed + mode, but not in strict mode. + """ + ] + ] , HH.p_ [ HH.text "See " - , HH.a [HP.href "https://publicsuffix.org/"] [ HH.text "publicsuffix.org" ] - , HH.text " for a list of organizational domains." + , Bulma.outside_link [] "https://publicsuffix.org/" "publicsuffix.org" + , HH.text " for a list of Organizational Domains." ] ] diff --git a/src/App/Type/DMARC.purs b/src/App/Type/DMARC.purs index 10ac8b3..e401481 100644 --- a/src/App/Type/DMARC.purs +++ b/src/App/Type/DMARC.purs @@ -108,7 +108,7 @@ report_occasions = [Both, DKIMonly, SPFonly, Any] report_occasions_txt :: Array String report_occasions_txt - = [ "Do not tell when to send reports (default: when both fail)" + = [ "Do not tell when to send reports" , "When both SPF and DKIM fail" , "Upon a DKIM error" , "Upon an SPF error" @@ -171,7 +171,7 @@ consistency_policies_txt :: Array String consistency_policies_txt = [ "Do not provide policy advice" , "Strict: same domain" - , "Relaxed: same organizational domain" + , "Relaxed: same Organizational Domain" ] consistency_policies_raw :: Array String diff --git a/src/Bulma.purs b/src/Bulma.purs index 4c630a4..54571cb 100644 --- a/src/Bulma.purs +++ b/src/Bulma.purs @@ -16,6 +16,9 @@ import Halogen.HTML.Core (AttrName(..)) -- import Web.Event.Event (type_, Event, EventType(..)) -- import Web.UIEvent.MouseEvent (MouseEvent) -- package web-uievents +outside_link :: forall w i. Array HH.ClassName -> String -> String -> HH.HTML w i +outside_link classes url title = HH.a [ HP.classes classes, HP.target "_blank", HP.href url ] [ HH.text title ] + columns :: forall (w :: Type) (i :: Type). Array HH.ClassName -> Array (HH.HTML w i) -> HH.HTML w i columns classes = HH.div [ HP.classes (C.columns <> classes) ] @@ -304,42 +307,42 @@ dmarc_table_header name_soa_header :: forall w i. HH.HTML w i name_soa_header = HH.abbr - [ HP.title "Your actual domain name (technical term: \"fully qualified domain name\")" ] + [ HP.title "Your actual domain name (technical term: \"fully qualified domain name\")." ] [ HH.text "Name" ] mname_soa_header :: forall w i. HH.HTML w i mname_soa_header = HH.abbr - [ HP.title "Domain name of the primary authoritative DNS server for the zone (SOA \"MNAME\" field)" ] + [ HP.title "Domain name of the primary authoritative DNS server for the zone (SOA \"MNAME\" field)." ] [ HH.text "Primary NS" ] rname_soa_header :: forall w i. HH.HTML w i rname_soa_header = HH.abbr - [ HP.title "The email address of the person responsible for managing the zone (the \"@\" is replaced by \".\" for some reason, this is the SOA \"RNAME\" field)" ] + [ HP.title "The email address of the person responsible for managing the zone (the \"@\" is replaced by \".\" for some reason). This is the SOA \"RNAME\" field." ] [ HH.text "Contact" ] serial_soa_header :: forall w i. HH.HTML w i serial_soa_header = HH.abbr - [ HP.title "A number that is incremented every time the zone is updated. Secondary DNS servers use this number to check for updates" ] + [ HP.title "A number that is incremented every time the zone is updated. Secondary DNS servers use this number to check for updates." ] [ HH.text "Serial" ] refresh_soa_header :: forall w i. HH.HTML w i refresh_soa_header = HH.abbr - [ HP.title "The interval (in seconds) at which secondary DNS servers should check the primary server for changes to the zone" ] + [ HP.title "The interval (in seconds) at which secondary DNS servers should check the primary server for changes to the zone." ] [ HH.text "Refresh" ] retry_soa_header :: forall w i. HH.HTML w i retry_soa_header = HH.abbr - [ HP.title "The time in seconds that secondary servers should wait before retrying a failed attempt to contact the primary DNS server" ] + [ HP.title "The time in seconds that secondary servers should wait before retrying a failed attempt to contact the primary DNS server." ] [ HH.text "Retry" ] expire_soa_header :: forall w i. HH.HTML w i expire_soa_header = HH.abbr - [ HP.title "The time in seconds that secondary DNS servers will keep the zone data before discarding it if they cannot contact the primary server" ] + [ HP.title "The time in seconds that secondary DNS servers will keep the zone data before discarding it if they cannot contact the primary server." ] [ HH.text "Expire" ] minttl_soa_header :: forall w i. HH.HTML w i minttl_soa_header = HH.abbr - [ HP.title "The minimum time (in seconds) that other DNS servers should cache negative responses (e.g., for non-existent domain names)" ] + [ HP.title "The minimum time (in seconds) that other DNS servers should cache negative responses (e.g., for non-existent domain names)." ] [ HH.text "Minimum TTL" ] soa_table_header :: forall w i. HH.HTML w i diff --git a/src/CSSClasses.purs b/src/CSSClasses.purs index cf8dc54..0b6c144 100644 --- a/src/CSSClasses.purs +++ b/src/CSSClasses.purs @@ -67,6 +67,7 @@ is_dark = [HH.ClassName "is-dark"] :: is_horizontal = [HH.ClassName "is-horizontal"] :: Array HH.ClassName is_hoverable = [HH.ClassName "is-hoverable"] :: Array HH.ClassName is_info = [HH.ClassName "is-info"] :: Array HH.ClassName +is_italic = [HH.ClassName "is-italic"] :: Array HH.ClassName is_large = [HH.ClassName "is-large"] :: Array HH.ClassName is_light = [HH.ClassName "is-light"] :: Array HH.ClassName is_medium = [HH.ClassName "is-medium"] :: Array HH.ClassName