No more useless columns.

beta
Philippe Pittoli 2023-07-14 21:22:17 +02:00
parent 2d31751b09
commit 4767bd186c
1 changed files with 25 additions and 30 deletions

View File

@ -618,13 +618,11 @@ class_title_size :: Array (HH.ClassName)
class_title_size = [HH.ClassName "is-3"]
render_soa :: forall (w :: Type). Maybe (SOARR ()) -> HH.HTML w Action
render_soa Nothing = HH.div_ [ HH.text "SOA not loaded, yet" ]
render_soa (Just soa) = Bulma.columns [] [ left_block, right_block ]
where left_block = Bulma.column class_title_size
[ Bulma.zone_rr_title "Start Of Authority (SOA)" ]
right_block = Bulma.column_ [ table_rr
render_soa Nothing = Bulma.box [ HH.text "SOA not loaded, yet" ]
render_soa (Just soa) = Bulma.box [ Bulma.zone_rr_title "Start Of Authority (SOA)"
, table_rr
]
table_rr = Bulma.table [] [ simple_SOA_table_header, table_content ]
where table_rr = Bulma.table [] [ simple_SOA_table_header, table_content ]
simple_SOA_table_header
= HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "name"]
, HH.th_ [ HH.text "ttl"]
@ -657,16 +655,14 @@ render_soa (Just soa) = Bulma.columns [] [ left_block, right_block ]
render_records :: forall (w :: Type). Hash.HashMap RRId Validation.Errors -> Array (SimpleRR ()) -> HH.HTML w Action
render_records _ []
= Bulma.columns [] [ left_block, right_block ]
where left_block = Bulma.column class_title_size
[ Bulma.zone_rr_title "NS, A, AAAA, CNAME"
= Bulma.box [ Bulma.zone_rr_title "NS, A, AAAA, CNAME"
, Bulma.subtitle "and TXT records"
, Bulma.subtitle "No records for now"
]
right_block = Bulma.column_ [ Bulma.subtitle "No records for now" ]
render_records errors records
= Bulma.columns [] [ Bulma.column class_title_size [Bulma.zone_rr_title title_txt, Bulma.subtitle subtitle_txt ]
, Bulma.column_ [ Bulma.tile [ table_rr ] ]
= Bulma.box [ Bulma.zone_rr_title title_txt
, Bulma.subtitle subtitle_txt
, table_rr
]
where
title_txt = "NS, A, AAAA, CNAME"
@ -710,15 +706,14 @@ from_error_array_to_td errors attribute = case A.uncons errors of
render_mx_records :: forall (w :: Type) (l :: Row Type)
. Hash.HashMap RRId Validation.Errors -> Array (MXRR l) -> HH.HTML w Action
render_mx_records _ []
= Bulma.columns [] [ left_block, right_block ]
where left_block = Bulma.column class_title_size [ Bulma.zone_rr_title "MX records" ]
right_block = Bulma.column_ [ Bulma.subtitle "No records for now" ]
= Bulma.box [ Bulma.zone_rr_title "MX records"
, Bulma.subtitle "No records for now"
]
render_mx_records errors records
= Bulma.columns [] [ Bulma.column class_title_size [ Bulma.zone_rr_title title_txt ]
, Bulma.column_ [ Bulma.tile [ table_rr ] ]
= Bulma.box [ Bulma.zone_rr_title "MX records"
, table_rr
]
where
title_txt = "MX records"
table_rr = Bulma.table [] [ Bulma.mx_table_header, table_content ]
table_content = HH.tbody_ $ A.concat $ map rows records
@ -747,14 +742,14 @@ render_mx_records errors records
render_srv_records :: forall (w :: Type) (l :: Row Type)
. Hash.HashMap RRId Validation.Errors -> Array (SRVRR l) -> HH.HTML w Action
render_srv_records _ []
= Bulma.columns [] [ left_block, right_block ]
where left_block = Bulma.column class_title_size [ Bulma.zone_rr_title "SRV records" ]
right_block = Bulma.column_ [ Bulma.subtitle "No records for now" ]
= Bulma.box [ Bulma.zone_rr_title "SRV records"
, Bulma.subtitle "No records for now"
]
render_srv_records errors records
= Bulma.columns [] [ Bulma.column class_title_size [ Bulma.zone_rr_title title_txt]
, Bulma.column_ [ Bulma.tile [ table_rr ] ] ]
= Bulma.box [ Bulma.zone_rr_title "SRV records"
, table_rr
]
where
title_txt = "SRV records"
table_rr = Bulma.table [] [ Bulma.srv_table_header, table_content ]
table_content = HH.tbody_ $ A.concat $ map rows records