Some more explanations, better UX for SPF dedicated interfaces.

caa
Philippe Pittoli 2024-11-11 07:09:13 +01:00
parent f6feb4fa95
commit eff7261b1d
2 changed files with 22 additions and 11 deletions

View File

@ -408,7 +408,7 @@ render state
(updateForm Field_Domain) (updateForm Field_Domain)
state._currentRR.name state._currentRR.name
display_domain_side display_domain_side
, Bulma.box_input ("ttl" <> state._currentRR.rrtype) "TTL" "600" , Bulma.box_input ("ttl" <> state._currentRR.rrtype) "TTL" "1800"
(updateForm Field_TTL) (updateForm Field_TTL)
(show state._currentRR.ttl) (show state._currentRR.ttl)
, case state._currentRR.rrtype of , case state._currentRR.rrtype of
@ -442,7 +442,7 @@ render state
(updateForm Field_Domain) (updateForm Field_Domain)
state._currentRR.name state._currentRR.name
display_domain_side display_domain_side
, Bulma.box_input ("ttlMX") "TTL" "600" , Bulma.box_input ("ttlMX") "TTL" "1800"
(updateForm Field_TTL) (updateForm Field_TTL)
(show state._currentRR.ttl) (show state._currentRR.ttl)
, Bulma.box_input ("targetMX") "Target" "www" , Bulma.box_input ("targetMX") "Target" "www"
@ -460,7 +460,7 @@ render state
(updateForm Field_Domain) (updateForm Field_Domain)
state._currentRR.name state._currentRR.name
display_domain_side display_domain_side
, Bulma.box_input ("ttlCAA") "TTL" "600" , Bulma.box_input ("ttlCAA") "TTL" "1800"
(updateForm Field_TTL) (updateForm Field_TTL)
(show state._currentRR.ttl) (show state._currentRR.ttl)
, Bulma.hr , Bulma.hr
@ -477,6 +477,9 @@ render state
modal_content_srv = modal_content_srv =
[ Bulma.div_content [] [Bulma.explanation Explanations.srv_introduction] [ Bulma.div_content [] [Bulma.explanation Explanations.srv_introduction]
, render_errors , render_errors
, Bulma.box_input ("ttlSRV") "TTL" "1800"
(updateForm Field_TTL)
(show state._currentRR.ttl)
, Bulma.box_input "domainSRV" "Service name" "service name" , Bulma.box_input "domainSRV" "Service name" "service name"
(updateForm Field_Domain) (updateForm Field_Domain)
state._currentRR.name state._currentRR.name
@ -488,12 +491,12 @@ render state
, Bulma.box_input ("portSRV") "Port of the service" "5061" , Bulma.box_input ("portSRV") "Port of the service" "5061"
(updateForm Field_Port) (updateForm Field_Port)
(maybe "" show state._currentRR.port) (maybe "" show state._currentRR.port)
, Bulma.div_content [] [Bulma.explanation [Bulma.p "The priority field is a numeric value that indicates the preference of the server (lower values indicate higher priority)."]]
, Bulma.box_input ("prioritySRV") "Priority" "10" , Bulma.box_input ("prioritySRV") "Priority" "10"
(updateForm Field_Priority) (updateForm Field_Priority)
(maybe "" show state._currentRR.priority) (maybe "" show state._currentRR.priority)
, Bulma.box_input ("ttlSRV") "TTL" "600" -- Bulma.div_content [] [Bulma.explanation Explanations.spf_introduction], Bulma.p "Modifiers provide additional instructions, such as explanations for SPF failures or redirecting SPF checks to another domain."
(updateForm Field_TTL) , Bulma.div_content [] [Bulma.explanation [Bulma.p "The weight field is a relative weight used when multiple servers have the same priority, determining how often they should be used."]]
(show state._currentRR.ttl)
, Bulma.box_input ("weightSRV") "Weight" "100" , Bulma.box_input ("weightSRV") "Weight" "100"
(updateForm Field_Weight) (updateForm Field_Weight)
(maybe "" show state._currentRR.weight) (maybe "" show state._currentRR.weight)
@ -506,7 +509,7 @@ render state
(updateForm Field_Domain) (updateForm Field_Domain)
state._currentRR.name state._currentRR.name
display_domain_side display_domain_side
, Bulma.box_input "ttlSPF" "TTL" "600" , Bulma.box_input "ttlSPF" "TTL" "1800"
(updateForm Field_TTL) (updateForm Field_TTL)
(show state._currentRR.ttl) (show state._currentRR.ttl)
--, case state._currentRR.v of --, case state._currentRR.v of
@ -515,7 +518,8 @@ render state
, Bulma.hr , Bulma.hr
, Bulma.box_with_tag C.has_background_info_light tag_mechanisms , Bulma.box_with_tag C.has_background_info_light tag_mechanisms
[ maybe (Bulma.p "You don't have any mechanism.") display_mechanisms state._currentRR.mechanisms [ maybe (Bulma.p "You don't have any mechanism.") display_mechanisms state._currentRR.mechanisms
, Bulma.h3 "New mechanism" , Bulma.hr
, Bulma.h4 "New mechanism"
, Bulma.selection_field "idMechanismQ" "Policy" SPF_Mechanism_q qualifier_types state.spf_mechanism_q , Bulma.selection_field "idMechanismQ" "Policy" SPF_Mechanism_q qualifier_types state.spf_mechanism_q
, Bulma.selection_field "idMechanismT" "Type" SPF_Mechanism_t mechanism_types state.spf_mechanism_t , Bulma.selection_field "idMechanismT" "Type" SPF_Mechanism_t mechanism_types state.spf_mechanism_t
, Bulma.box_input "valueNewMechanismSPF" "Value" "" , Bulma.box_input "valueNewMechanismSPF" "Value" ""
@ -526,7 +530,8 @@ render state
, Bulma.hr , Bulma.hr
, Bulma.box_with_tag C.has_background_success_light tag_modifiers , Bulma.box_with_tag C.has_background_success_light tag_modifiers
[ maybe (Bulma.p "You don't have any modifier.") display_modifiers state._currentRR.modifiers [ maybe (Bulma.p "You don't have any modifier.") display_modifiers state._currentRR.modifiers
, Bulma.h3 "New modifier" , Bulma.hr
, Bulma.h4 "New modifier"
, Bulma.selection_field "idModifierT" "Modifier" SPF_Modifier_t modifier_types state.spf_modifier_t , Bulma.selection_field "idModifierT" "Modifier" SPF_Modifier_t modifier_types state.spf_modifier_t
, Bulma.box_input "valueNewModifierSPF" "Value" "" , Bulma.box_input "valueNewModifierSPF" "Value" ""
SPF_Modifier_v SPF_Modifier_v
@ -555,7 +560,7 @@ render state
(updateForm Field_Domain) (updateForm Field_Domain)
state._currentRR.name state._currentRR.name
display_domain_side display_domain_side
, Bulma.box_input "ttlDKIM" "TTL" "600" , Bulma.box_input "ttlDKIM" "TTL" "1800"
(updateForm Field_TTL) (updateForm Field_TTL)
(show state._currentRR.ttl) (show state._currentRR.ttl)
, Bulma.hr , Bulma.hr
@ -580,7 +585,7 @@ render state
(updateForm Field_Domain) (updateForm Field_Domain)
state._currentRR.name state._currentRR.name
display_domain_side display_domain_side
, Bulma.box_input "ttlDMARC" "TTL" "600" (updateForm Field_TTL) (show state._currentRR.ttl) , Bulma.box_input "ttlDMARC" "TTL" "1800" (updateForm Field_TTL) (show state._currentRR.ttl)
, Bulma.hr , Bulma.hr
, Bulma.div_content [] [Bulma.explanation Explanations.dmarc_policy] , Bulma.div_content [] [Bulma.explanation Explanations.dmarc_policy]

View File

@ -36,6 +36,9 @@ h1 title = HH.h1 [ HP.classes (C.title) ] [ HH.text title ]
h3 :: forall (w :: Type) (a :: Type). String -> HH.HTML w a h3 :: forall (w :: Type) (a :: Type). String -> HH.HTML w a
h3 title = HH.h3 [ HP.classes (C.title <> C.is5) ] [ HH.text title ] h3 title = HH.h3 [ HP.classes (C.title <> C.is5) ] [ HH.text title ]
h4 :: forall (w :: Type) (a :: Type). String -> HH.HTML w a
h4 title = HH.h4 [ HP.classes (C.title <> C.is5) ] [ HH.text title ]
zone_rr_title :: forall (w :: Type) (a :: Type). String -> HH.HTML w a zone_rr_title :: forall (w :: Type) (a :: Type). String -> HH.HTML w a
zone_rr_title title zone_rr_title title
= HH.h3 [ HP.classes (C.title <> C.is5 <> C.has_text_light <> C.has_background_dark) ] = HH.h3 [ HP.classes (C.title <> C.is5 <> C.has_text_light <> C.has_background_dark) ]
@ -819,6 +822,9 @@ btn_validation :: forall w i. HH.HTML w i
btn_validation = btn_validation_ "Validate" btn_validation = btn_validation_ "Validate"
-- | Box with tags. -- | Box with tags.
-- |```
-- |box_with_tag C.has_background_danger_light some_tag [Bulma.p "Hello"]
-- |```
box_with_tag :: forall w action. box_with_tag :: forall w action.
Array HH.ClassName -- css classes (like the color) Array HH.ClassName -- css classes (like the color)
-> HH.HTML w action -- tag (title for the box) -> HH.HTML w action -- tag (title for the box)