diff --git a/TODO.md b/TODO.md index 8c97087..1525022 100644 --- a/TODO.md +++ b/TODO.md @@ -19,7 +19,6 @@ Minor modifications: About zone records: -- allow '*' in record names - allow '@' in record names (replaced by the fqdn, the "root" domain, such as "example.netlib.re.") - enable to change NS records, but after a accepting the consequences diff --git a/src/App/Page/Zone.purs b/src/App/Page/Zone.purs index 05a69f8..97671eb 100644 --- a/src/App/Page/Zone.purs +++ b/src/App/Page/Zone.purs @@ -5,9 +5,6 @@ -- | - provide dedicated interfaces for SPF, DKIM and DMARC -- | - add, modify, remove resource records -- | --- | **WIP**: Display relevant information for each record type in the (add/mod) modal. --- | This includes explaining use cases and displaying an appropriate interface for the task at hand. --- | -- | TODO: display errors not only for a record but for the whole zone. -- | A DNS zone is bound by a set of rules, the whole zone must be consistent. -- | For example, a CNAME `target` has to point to the `name` of an existing record. @@ -401,6 +398,7 @@ render state "DMARC" -> template modal_content_dmarc (foot_content DMARC) _ -> Bulma.p $ "Invalid type: " <> state._currentRR.rrtype where + side_text_for_name_input name_id = Bulma.side_text_above_input name_id "Name" (HH.text $ "Empty name = root domain (" <> state._domain <> ".)") -- DRY updateForm x = UpdateCurrentRR <<< x render_errors = if A.length state._currentRR_errors > 0 @@ -410,7 +408,8 @@ render state modal_content_simple x = [ render_errors , render_introduction_text x - , Bulma.input_with_side_text ("domain" <> state._currentRR.rrtype) "Name" "www" + , side_text_for_name_input ("domain" <> state._currentRR.rrtype) + , Bulma.input_with_side_text ("domain" <> state._currentRR.rrtype) "" "www" (updateForm Field_Domain) state._currentRR.name display_domain_side @@ -444,7 +443,8 @@ render state modal_content_mx = [ render_errors , Bulma.div_content [] [Bulma.explanation Explanations.mx_introduction] - , Bulma.input_with_side_text "domainMX" "Name" "www" + , side_text_for_name_input "domainMX" + , Bulma.input_with_side_text "domainMX" "" "www" (updateForm Field_Domain) state._currentRR.name display_domain_side @@ -462,7 +462,8 @@ render state modal_content_caa = [ render_errors , Bulma.div_content [] [Bulma.explanation Explanations.caa_introduction] - , Bulma.input_with_side_text "domainCAA" "Name" "www" + , side_text_for_name_input "domainCAA" + , Bulma.input_with_side_text "domainCAA" "" "www" (updateForm Field_Domain) state._currentRR.name display_domain_side @@ -514,7 +515,8 @@ render state modal_content_spf = [ Bulma.div_content [] [Bulma.explanation Explanations.spf_introduction] , render_errors - , Bulma.input_with_side_text "domainSPF" "Name" "Let this alone." + , side_text_for_name_input "domainSPF" + , Bulma.input_with_side_text "domainSPF" "" "Let this alone." (updateForm Field_Domain) state._currentRR.name display_domain_side @@ -567,7 +569,8 @@ render state modal_content_dkim = [ Bulma.div_content [] [Bulma.explanation Explanations.dkim_introduction] , render_errors - , Bulma.input_with_side_text "domainDKIM" "Name" "default._domainkey" + , side_text_for_name_input "domainDKIM" + , Bulma.input_with_side_text "domainDKIM" "" "default._domainkey" (updateForm Field_Domain) state._currentRR.name display_domain_side @@ -592,7 +595,8 @@ render state modal_content_dmarc = [ Bulma.div_content [] [Bulma.explanation Explanations.dmarc_introduction] , render_errors - , Bulma.input_with_side_text "domainDMARC" "Name" "_dmarc" + , side_text_for_name_input "domainDMARC" + , Bulma.input_with_side_text "domainDMARC" "" "_dmarc" (updateForm Field_Domain) state._currentRR.name display_domain_side diff --git a/src/Bulma.purs b/src/Bulma.purs index d8c7a35..ca196b1 100644 --- a/src/Bulma.purs +++ b/src/Bulma.purs @@ -825,6 +825,18 @@ input_with_side_text id title placeholder action value sidetext ] ] +side_text_above_input :: forall w i. + String -> String -> HH.HTML w i -> HH.HTML w i +side_text_above_input id title sidetext + = HH.div [HP.classes [C.field, C.is_horizontal]] + [ HH.div [ HP.classes [C.field_label, C.normal] ] + [HH.label [ HP.classes [C.label], HP.for id ] [ HH.text title ]] + , HH.div [ HP.classes [C.field_body] ] + [ HH.div [ HP.classes [C.has_addons, C.field] ] + [ HH.p [HP.classes [C.control]] [ sidetext ] ] + ] + ] + -- | `modal`: create a modal by providing a few things: -- | - a title (a simple String) -- | - a body (`HTML` content)