diff --git a/src/App/Page/Zone.purs b/src/App/Page/Zone.purs index 50758f7..40360eb 100644 --- a/src/App/Page/Zone.purs +++ b/src/App/Page/Zone.purs @@ -412,35 +412,36 @@ render state ] modal_content_srv :: Array (HH.HTML w Action) modal_content_srv = - [ render_errors - , Bulma.input_with_side_text "domainSRV" "Name" "www" + [ Bulma.div_content [Bulma.explanation Explanations.srv_introduction] + , render_errors + , Bulma.box_input "domainSRV" "Service name" "service name" (updateForm Field_Domain) state._currentRR.name - display_domain_side - , Bulma.box_input ("ttlSRV") "TTL" "600" - (updateForm Field_TTL) - (show state._currentRR.ttl) should_be_disabled - , Bulma.box_input ("targetSRV") "Target" "www" + , Bulma.box_input ("protocolSRV") "Protocol" "tcp" + (updateForm Field_Protocol) + (fromMaybe "tcp" state._currentRR.protocol) + should_be_disabled + , Bulma.box_input ("targetSRV") "Where the server is" "www" (updateForm Field_Target) state._currentRR.target should_be_disabled + , Bulma.box_input ("portSRV") "Port of the service" "5061" + (updateForm Field_Port) + (maybe "" show state._currentRR.port) + should_be_disabled , Bulma.box_input ("prioritySRV") "Priority" "10" (updateForm Field_Priority) (maybe "" show state._currentRR.priority) should_be_disabled - , Bulma.box_input ("portSRV") "Port" "5061" - (updateForm Field_Port) - (maybe "" show state._currentRR.port) + , Bulma.box_input ("ttlSRV") "TTL" "600" + (updateForm Field_TTL) + (show state._currentRR.ttl) should_be_disabled , Bulma.box_input ("weightSRV") "Weight" "100" (updateForm Field_Weight) (maybe "" show state._currentRR.weight) should_be_disabled - , Bulma.box_input ("protocolSRV") "Protocol" "tcp" - (updateForm Field_Protocol) - (fromMaybe "tcp" state._currentRR.protocol) - should_be_disabled ] modal_content_spf :: Array (HH.HTML w Action) modal_content_spf = @@ -574,7 +575,7 @@ handleAction = case _ of default_rr_CNAME = emptyRR { rrtype = "CNAME", name = "blog", target = "www" } default_rr_NS = emptyRR { rrtype = "NS", name = (state._domain <> "."), target = "ns0.example.com." } default_rr_MX = emptyRR { rrtype = "MX", name = "mail", target = "www", priority = Just 10 } - default_rr_SRV = emptyRR { rrtype = "SRV", name = "_sip._tcp", target = "www" + default_rr_SRV = emptyRR { rrtype = "SRV", name = "voip", target = "server1" , port = Just 5061, weight = Just 100, priority = Just 10, protocol = Just "tcp" } default_mechanisms = maybe [] (\x -> [x]) $ to_mechanism "pass" "mx" "" default_rr_SPF = emptyRR { rrtype = "SPF", name = "", target = "" diff --git a/src/App/Text/Explanations.purs b/src/App/Text/Explanations.purs index c5faa1c..962c3f2 100644 --- a/src/App/Text/Explanations.purs +++ b/src/App/Text/Explanations.purs @@ -113,4 +113,24 @@ spf_default_behavior = [Bulma.p """ , HH.text """). The only way for DKIM to be really meaningful is to block any mail not coming from the intended email servers. Otherwise, it's just a statu quo, and the spamming will continue. - """] \ No newline at end of file + """] + +srv_introduction :: forall w i. Array (HH.HTML w i) +srv_introduction = + [ Bulma.p "The SRV record is a DNS RR for specifying the location of services." + , HH.p_ [ HH.text "Given a specific " + , HH.u_ [HH.text "service name"] + , HH.text " (which may be arbitrary) and a " + , HH.u_ [HH.text "protocol"] + , HH.text " (such as TCP or UDP), you can tell where the server is (address name and port). " + , HH.text """ + Both the names of the service and the protocol are used to construct the name of the RR. + """ + ] + , HH.p_ [ HH.text "For example, for a service named " + , HH.u_ [HH.text "voip"] + , HH.text " and given that this service uses the TCP protocol, you can specify that the target is " + , HH.u_ [HH.text "server1.example.com."] + , HH.text "." + ] + ]