Btn Zone to Domain List, links to other websites, rephrasing, etc.

This commit is contained in:
Philippe Pittoli 2024-11-14 00:44:58 +01:00
parent 2ac56d4880
commit 15bb4c1526
7 changed files with 46 additions and 27 deletions

View File

@ -521,6 +521,7 @@ handleAction = case _ of
ZoneInterfaceEvent ev -> case ev of ZoneInterfaceEvent ev -> case ev of
ZoneInterface.MessageToSend message -> H.tell _ws_dns unit (WS.ToSend message) ZoneInterface.MessageToSend message -> H.tell _ws_dns unit (WS.ToSend message)
ZoneInterface.Log message -> handleAction $ Log message ZoneInterface.Log message -> handleAction $ Log message
ZoneInterface.ToDomainList -> handleAction $ Routing DomainList
DomainListComponentEvent ev -> case ev of DomainListComponentEvent ev -> case ev of
DomainListInterface.MessageToSend message -> H.tell _ws_dns unit (WS.ToSend message) DomainListInterface.MessageToSend message -> H.tell _ws_dns unit (WS.ToSend message)

View File

@ -192,7 +192,7 @@ render { logged, active, admin, login } =
, HE.onClick (\_ -> action) , HE.onClick (\_ -> action)
] [ (HH.text str) ] ] [ (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_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 dropdown_element_secondary link str = dropdown_element C.has_background_warning_light link str

View File

@ -83,6 +83,7 @@ id x = x
data Output data Output
= MessageToSend ArrayBuffer = MessageToSend ArrayBuffer
| Log LogMessage | Log LogMessage
| ToDomainList
-- | `App.ZoneInterface` can receive messages from `dnsmanagerd`. -- | `App.ZoneInterface` can receive messages from `dnsmanagerd`.
@ -142,6 +143,9 @@ data Action
-- | Change the current tab. -- | Change the current tab.
| ChangeTab Tab | ChangeTab Tab
-- | Return to the domain list.
| ReturnToDomainList
-- | Update new entry form (in the `rr_modal` modal). -- | Update new entry form (in the `rr_modal` modal).
| UpdateCurrentRR Field | UpdateCurrentRR Field
@ -353,7 +357,9 @@ render state
NewRRModal _ -> render_current_rr_modal NewRRModal _ -> render_current_rr_modal
UpdateRRModal -> render_current_rr_modal UpdateRRModal -> render_current_rr_modal
NoModal -> HH.div_ 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 , Bulma.hr
, render_resources $ sorted state._resources , render_resources $ sorted state._resources
, Bulma.hr , Bulma.hr
@ -611,7 +617,7 @@ render state
, Bulma.hr , Bulma.hr
, Bulma.div_content [] [Bulma.explanation Explanations.dmarc_pct] , 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.hr
, Bulma.selection_field' "idDMARCfo" "When to send a report" DMARC_fo , Bulma.selection_field' "idDMARCfo" "When to send a report" DMARC_fo
@ -635,8 +641,8 @@ render state
, render_dmarc_mail_errors , render_dmarc_mail_errors
, Bulma.box_input "idDMARCmail" "Address to contact" "admin@example.com" DMARC_mail state.dmarc_mail , 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.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.level [ Bulma.btn_ C.has_background_info_light "New address for aggregated report" DMARC_rua_Add
, Bulma.btn "New address for specific report" DMARC_ruf_Add , Bulma.btn_ C.has_background_success_light "New address for specific report" DMARC_ruf_Add
] [] ] []
, Bulma.hr , Bulma.hr
@ -686,6 +692,10 @@ handleAction = case _ of
DeleteRRModal rr_id -> do DeleteRRModal rr_id -> do
H.modify_ _ { rr_modal = RemoveRRModal rr_id } H.modify_ _ { rr_modal = RemoveRRModal rr_id }
-- | Return to the domain list.
ReturnToDomainList -> do
H.raise ToDomainList
-- | Change the current tab. -- | Change the current tab.
ChangeTab new_tab -> do ChangeTab new_tab -> do
-- Store the current tab we are on and restore it when we reload. -- Store the current tab we are on and restore it when we reload.

View File

@ -2,6 +2,7 @@ module App.Text.Explanations where
import Halogen.HTML as HH import Halogen.HTML as HH
import Halogen.HTML.Properties as HP import Halogen.HTML.Properties as HP
import Bulma as Bulma import Bulma as Bulma
import CSSClasses as C
expl' :: forall w i. String -> HH.HTML w i expl' :: forall w i. String -> HH.HTML w i
expl' text = expl [Bulma.p text] expl' text = expl [Bulma.p text]
@ -311,8 +312,8 @@ dmarc_introduction =
dmarc_policy :: forall w i. Array (HH.HTML w i) dmarc_policy :: forall w i. Array (HH.HTML w i)
dmarc_policy = dmarc_policy =
[ Bulma.p """ [ Bulma.p """
DMARC record enables to tell receivers what to do with a non-conforming message; 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. i.e. a message that wasn't properly secured with SPF and DKIM.
""" """
, Bulma.p """ , Bulma.p """
This message can either be accepted ("None") or rejected, or even quarantined, meaning to be considered as suspicious. 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 strict mode, both fields should be identical.
In relaxed mode, they can be different, but in the same Organizational Domain. In relaxed mode, they can be different, but in the same Organizational Domain.
""" """
, Bulma.p """ , HH.p_ [ HH.text "From RFC7489:"
From RFC7489: For example, if a message passes an SPF check with an , HH.div [HP.classes C.is_italic]
RFC5321.MailFrom domain of "cbg.bounces.example.com", and the address [ HH.text """For example, if a message passes an SPF check with an
portion of the RFC5322.From field contains "payments@example.com", RFC5321.MailFrom domain of "cbg.bounces.example.com", and the address
the Authenticated RFC5321.MailFrom domain identifier and the portion of the RFC5322.From field contains "payments@example.com",
RFC5322.From domain are considered to be "in alignment" in relaxed the Authenticated RFC5321.MailFrom domain identifier and the
mode, but not in strict mode. RFC5322.From domain are considered to be "in alignment" in relaxed
""" mode, but not in strict mode.
"""
]
]
, HH.p_ , HH.p_
[ HH.text "See " [ HH.text "See "
, HH.a [HP.href "https://publicsuffix.org/"] [ HH.text "publicsuffix.org" ] , Bulma.outside_link [] "https://publicsuffix.org/" "publicsuffix.org"
, HH.text " for a list of organizational domains." , HH.text " for a list of Organizational Domains."
] ]
] ]

View File

@ -108,7 +108,7 @@ report_occasions = [Both, DKIMonly, SPFonly, Any]
report_occasions_txt :: Array String report_occasions_txt :: Array String
report_occasions_txt 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" , "When both SPF and DKIM fail"
, "Upon a DKIM error" , "Upon a DKIM error"
, "Upon an SPF error" , "Upon an SPF error"
@ -171,7 +171,7 @@ consistency_policies_txt :: Array String
consistency_policies_txt consistency_policies_txt
= [ "Do not provide policy advice" = [ "Do not provide policy advice"
, "Strict: same domain" , "Strict: same domain"
, "Relaxed: same organizational domain" , "Relaxed: same Organizational Domain"
] ]
consistency_policies_raw :: Array String consistency_policies_raw :: Array String

View File

@ -16,6 +16,9 @@ import Halogen.HTML.Core (AttrName(..))
-- import Web.Event.Event (type_, Event, EventType(..)) -- import Web.Event.Event (type_, Event, EventType(..))
-- import Web.UIEvent.MouseEvent (MouseEvent) -- package web-uievents -- 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). columns :: forall (w :: Type) (i :: Type).
Array HH.ClassName -> Array (HH.HTML w i) -> HH.HTML w i Array HH.ClassName -> Array (HH.HTML w i) -> HH.HTML w i
columns classes = HH.div [ HP.classes (C.columns <> classes) ] 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 :: forall w i. HH.HTML w i
name_soa_header = HH.abbr 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" ] [ HH.text "Name" ]
mname_soa_header :: forall w i. HH.HTML w i mname_soa_header :: forall w i. HH.HTML w i
mname_soa_header = HH.abbr 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" ] [ HH.text "Primary NS" ]
rname_soa_header :: forall w i. HH.HTML w i rname_soa_header :: forall w i. HH.HTML w i
rname_soa_header = HH.abbr 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" ] [ HH.text "Contact" ]
serial_soa_header :: forall w i. HH.HTML w i serial_soa_header :: forall w i. HH.HTML w i
serial_soa_header = HH.abbr 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" ] [ HH.text "Serial" ]
refresh_soa_header :: forall w i. HH.HTML w i refresh_soa_header :: forall w i. HH.HTML w i
refresh_soa_header = HH.abbr 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" ] [ HH.text "Refresh" ]
retry_soa_header :: forall w i. HH.HTML w i retry_soa_header :: forall w i. HH.HTML w i
retry_soa_header = HH.abbr 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" ] [ HH.text "Retry" ]
expire_soa_header :: forall w i. HH.HTML w i expire_soa_header :: forall w i. HH.HTML w i
expire_soa_header = HH.abbr 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" ] [ HH.text "Expire" ]
minttl_soa_header :: forall w i. HH.HTML w i minttl_soa_header :: forall w i. HH.HTML w i
minttl_soa_header = HH.abbr 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" ] [ HH.text "Minimum TTL" ]
soa_table_header :: forall w i. HH.HTML w i soa_table_header :: forall w i. HH.HTML w i

View File

@ -67,6 +67,7 @@ is_dark = [HH.ClassName "is-dark"] ::
is_horizontal = [HH.ClassName "is-horizontal"] :: Array HH.ClassName is_horizontal = [HH.ClassName "is-horizontal"] :: Array HH.ClassName
is_hoverable = [HH.ClassName "is-hoverable"] :: Array HH.ClassName is_hoverable = [HH.ClassName "is-hoverable"] :: Array HH.ClassName
is_info = [HH.ClassName "is-info"] :: 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_large = [HH.ClassName "is-large"] :: Array HH.ClassName
is_light = [HH.ClassName "is-light"] :: Array HH.ClassName is_light = [HH.ClassName "is-light"] :: Array HH.ClassName
is_medium = [HH.ClassName "is-medium"] :: Array HH.ClassName is_medium = [HH.ClassName "is-medium"] :: Array HH.ClassName