Better tables + SOA display is now okay-ish.
parent
9b674a9d1e
commit
2d31751b09
|
@ -228,6 +228,12 @@ validate_target_MX target
|
||||||
where
|
where
|
||||||
verify_length = lengthIsBetween Target target_min_len target_max_len
|
verify_length = lengthIsBetween Target target_min_len target_max_len
|
||||||
|
|
||||||
|
validate_target_SRV :: String -> V Errors String
|
||||||
|
validate_target_SRV target
|
||||||
|
= verify_length target !> verify_domain Target
|
||||||
|
where
|
||||||
|
verify_length = lengthIsBetween Target target_min_len target_max_len
|
||||||
|
|
||||||
-- Resource-related validations.
|
-- Resource-related validations.
|
||||||
|
|
||||||
validateA :: forall l. SimpleRR (|l) -> V Errors ResourceRecord
|
validateA :: forall l. SimpleRR (|l) -> V Errors ResourceRecord
|
||||||
|
@ -291,7 +297,7 @@ validateSRV :: forall l. SRVRR (|l) -> V Errors ResourceRecord
|
||||||
validateSRV form = ado
|
validateSRV form = ado
|
||||||
name <- validate_name form.name
|
name <- validate_name form.name
|
||||||
ttl <- validate_ttl form.ttl
|
ttl <- validate_ttl form.ttl
|
||||||
target <- validate_target_MX form.target
|
target <- validate_target_SRV form.target
|
||||||
priority <- validate_priority form.priority
|
priority <- validate_priority form.priority
|
||||||
protocol <- validate_protocol form.protocol
|
protocol <- validate_protocol form.protocol
|
||||||
weight <- validate_weight form.weight
|
weight <- validate_weight form.weight
|
||||||
|
|
|
@ -622,19 +622,37 @@ render_soa Nothing = HH.div_ [ HH.text "SOA not loaded, yet" ]
|
||||||
render_soa (Just soa) = Bulma.columns [] [ left_block, right_block ]
|
render_soa (Just soa) = Bulma.columns [] [ left_block, right_block ]
|
||||||
where left_block = Bulma.column class_title_size
|
where left_block = Bulma.column class_title_size
|
||||||
[ Bulma.zone_rr_title "Start Of Authority (SOA)" ]
|
[ Bulma.zone_rr_title "Start Of Authority (SOA)" ]
|
||||||
right_block = Bulma.column_ [ Bulma.p "ALL AVAILABLE DATA"
|
right_block = Bulma.column_ [ table_rr
|
||||||
, Bulma.p $ "rrtype: " <> soa.rrtype
|
]
|
||||||
, Bulma.p $ "rrid: " <> show soa.rrid
|
table_rr = Bulma.table [] [ simple_SOA_table_header, table_content ]
|
||||||
, Bulma.p $ "name: " <> soa.name
|
simple_SOA_table_header
|
||||||
, Bulma.p $ "ttl: " <> soa.ttl
|
= HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "name"]
|
||||||
, Bulma.p $ "target: " <> soa.target
|
, HH.th_ [ HH.text "ttl"]
|
||||||
, Bulma.p $ "mname: " <> soa.mname
|
, HH.th_ [ HH.text "target"]
|
||||||
, Bulma.p $ "rname: " <> soa.rname
|
, HH.th_ [ HH.text "mname"]
|
||||||
, Bulma.p $ "serial: " <> soa.serial
|
, HH.th_ [ HH.text "rname"]
|
||||||
, Bulma.p $ "refresh: " <> soa.refresh
|
, HH.th_ [ HH.text "serial"]
|
||||||
, Bulma.p $ "retry: " <> soa.retry
|
, HH.th_ [ HH.text "refresh"]
|
||||||
, Bulma.p $ "expire: " <> soa.expire
|
, HH.th_ [ HH.text "retry"]
|
||||||
, Bulma.p $ "minttl: " <> soa.minttl
|
, HH.th_ [ HH.text "expire"]
|
||||||
|
, HH.th_ [ HH.text "minttl"]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
table_content
|
||||||
|
= HH.tbody_ $ [ HH.tr_ $ [
|
||||||
|
--, Bulma.p $ "rrtype: " <> soa.rrtype
|
||||||
|
--, Bulma.p $ "rrid: " <> show soa.rrid
|
||||||
|
HH.td_ [ HH.text soa.name ]
|
||||||
|
, HH.td_ [ HH.text soa.ttl ]
|
||||||
|
, HH.td_ [ HH.text soa.target ]
|
||||||
|
, HH.td_ [ HH.text soa.mname ]
|
||||||
|
, HH.td_ [ HH.text soa.rname ]
|
||||||
|
, HH.td_ [ HH.text soa.serial ]
|
||||||
|
, HH.td_ [ HH.text soa.refresh ]
|
||||||
|
, HH.td_ [ HH.text soa.retry ]
|
||||||
|
, HH.td_ [ HH.text soa.expire ]
|
||||||
|
, HH.td_ [ HH.text soa.minttl ]
|
||||||
|
]
|
||||||
]
|
]
|
||||||
|
|
||||||
render_records :: forall (w :: Type). Hash.HashMap RRId Validation.Errors -> Array (SimpleRR ()) -> HH.HTML w Action
|
render_records :: forall (w :: Type). Hash.HashMap RRId Validation.Errors -> Array (SimpleRR ()) -> HH.HTML w Action
|
||||||
|
@ -655,7 +673,7 @@ render_records errors records
|
||||||
subtitle_txt = "and TXT records"
|
subtitle_txt = "and TXT records"
|
||||||
-- subtitle_txt = "Each line is a resource record from your DNS zone."
|
-- subtitle_txt = "Each line is a resource record from your DNS zone."
|
||||||
-- <> " You can edit them, then click on the \"fix\" button to synchronize with the server."
|
-- <> " You can edit them, then click on the \"fix\" button to synchronize with the server."
|
||||||
table_rr = HH.table [] [ Bulma.simple_table_header, table_content ]
|
table_rr = Bulma.table [] [ Bulma.simple_table_header, table_content ]
|
||||||
table_content = HH.tbody_ $ A.concat $ map rows records
|
table_content = HH.tbody_ $ A.concat $ map rows records
|
||||||
|
|
||||||
rows rr
|
rows rr
|
||||||
|
@ -671,7 +689,7 @@ render_records errors records
|
||||||
error_row rr = case Hash.lookup rr.rrid errors of
|
error_row rr = case Hash.lookup rr.rrid errors of
|
||||||
Nothing -> []
|
Nothing -> []
|
||||||
Just error_array -> [ HH.tr_ $
|
Just error_array -> [ HH.tr_ $
|
||||||
[ Bulma.txt_name "-"
|
[ Bulma.txt_name ""
|
||||||
, HH.td_ $ from_error_array_to_td error_array Validation.Name
|
, HH.td_ $ from_error_array_to_td error_array Validation.Name
|
||||||
, HH.td_ $ from_error_array_to_td error_array Validation.TTL
|
, HH.td_ $ from_error_array_to_td error_array Validation.TTL
|
||||||
, HH.td_ $ from_error_array_to_td error_array Validation.Target
|
, HH.td_ $ from_error_array_to_td error_array Validation.Target
|
||||||
|
@ -701,7 +719,7 @@ render_mx_records errors records
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
title_txt = "MX records"
|
title_txt = "MX records"
|
||||||
table_rr = HH.table [] [ Bulma.mx_table_header, table_content ]
|
table_rr = Bulma.table [] [ Bulma.mx_table_header, table_content ]
|
||||||
table_content = HH.tbody_ $ A.concat $ map rows records
|
table_content = HH.tbody_ $ A.concat $ map rows records
|
||||||
|
|
||||||
rows rr = [ HH.tr_ $
|
rows rr = [ HH.tr_ $
|
||||||
|
@ -737,7 +755,7 @@ render_srv_records errors records
|
||||||
, Bulma.column_ [ Bulma.tile [ table_rr ] ] ]
|
, Bulma.column_ [ Bulma.tile [ table_rr ] ] ]
|
||||||
where
|
where
|
||||||
title_txt = "SRV records"
|
title_txt = "SRV records"
|
||||||
table_rr = HH.table [] [ Bulma.srv_table_header, table_content ]
|
table_rr = Bulma.table [] [ Bulma.srv_table_header, table_content ]
|
||||||
table_content = HH.tbody_ $ A.concat $ map rows records
|
table_content = HH.tbody_ $ A.concat $ map rows records
|
||||||
|
|
||||||
rows rr
|
rows rr
|
||||||
|
|
|
@ -56,6 +56,9 @@ input_classes :: Boolean -> Array HH.ClassName
|
||||||
input_classes true = C.input <> C.is_small <> C.is_info
|
input_classes true = C.input <> C.is_small <> C.is_info
|
||||||
input_classes false = C.input <> C.is_small <> C.is_danger
|
input_classes false = C.input <> C.is_small <> C.is_danger
|
||||||
|
|
||||||
|
table :: forall w i. HH.Node DHI.HTMLtable w i
|
||||||
|
table prop xs = HH.table ([ HP.classes $ C.table ] <> prop) xs
|
||||||
|
|
||||||
btn_classes :: Boolean -> Array HH.ClassName
|
btn_classes :: Boolean -> Array HH.ClassName
|
||||||
btn_classes true = C.button <> C.is_small <> C.is_info
|
btn_classes true = C.button <> C.is_small <> C.is_info
|
||||||
btn_classes false = C.button <> C.is_small <> C.is_danger
|
btn_classes false = C.button <> C.is_small <> C.is_danger
|
||||||
|
|
|
@ -112,6 +112,8 @@ select :: Array HH.ClassName
|
||||||
select = [HH.ClassName "select"]
|
select = [HH.ClassName "select"]
|
||||||
subtitle :: Array HH.ClassName
|
subtitle :: Array HH.ClassName
|
||||||
subtitle = [HH.ClassName "subtitle"]
|
subtitle = [HH.ClassName "subtitle"]
|
||||||
|
table :: Array HH.ClassName
|
||||||
|
table = [HH.ClassName "table"]
|
||||||
tile :: Array HH.ClassName
|
tile :: Array HH.ClassName
|
||||||
tile = [HH.ClassName "tile"]
|
tile = [HH.ClassName "tile"]
|
||||||
title :: Array HH.ClassName
|
title :: Array HH.ClassName
|
||||||
|
|
Loading…
Reference in New Issue