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"] class_title_size = [HH.ClassName "is-3"]
render_soa :: forall (w :: Type). Maybe (SOARR ()) -> HH.HTML w Action render_soa :: forall (w :: Type). Maybe (SOARR ()) -> HH.HTML w Action
render_soa Nothing = HH.div_ [ HH.text "SOA not loaded, yet" ] render_soa Nothing = Bulma.box [ HH.text "SOA not loaded, yet" ]
render_soa (Just soa) = Bulma.columns [] [ left_block, right_block ] render_soa (Just soa) = Bulma.box [ Bulma.zone_rr_title "Start Of Authority (SOA)"
where left_block = Bulma.column class_title_size , table_rr
[ Bulma.zone_rr_title "Start Of Authority (SOA)" ] ]
right_block = Bulma.column_ [ table_rr where table_rr = Bulma.table [] [ simple_SOA_table_header, table_content ]
]
table_rr = Bulma.table [] [ simple_SOA_table_header, table_content ]
simple_SOA_table_header simple_SOA_table_header
= HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "name"] = HH.thead_ [ HH.tr_ [ HH.th_ [ HH.text "name"]
, HH.th_ [ HH.text "ttl"] , HH.th_ [ HH.text "ttl"]
@ -657,17 +655,15 @@ 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 :: forall (w :: Type). Hash.HashMap RRId Validation.Errors -> Array (SimpleRR ()) -> HH.HTML w Action
render_records _ [] render_records _ []
= Bulma.columns [] [ left_block, right_block ] = Bulma.box [ Bulma.zone_rr_title "NS, A, AAAA, CNAME"
where left_block = Bulma.column class_title_size , Bulma.subtitle "and TXT records"
[ Bulma.zone_rr_title "NS, A, AAAA, CNAME" , Bulma.subtitle "No records for now"
, Bulma.subtitle "and TXT records" ]
]
right_block = Bulma.column_ [ Bulma.subtitle "No records for now" ]
render_records errors records render_records errors records
= Bulma.columns [] [ Bulma.column class_title_size [Bulma.zone_rr_title title_txt, Bulma.subtitle subtitle_txt ] = Bulma.box [ Bulma.zone_rr_title title_txt
, Bulma.column_ [ Bulma.tile [ table_rr ] ] , Bulma.subtitle subtitle_txt
] , table_rr
]
where where
title_txt = "NS, A, AAAA, CNAME" title_txt = "NS, A, AAAA, CNAME"
subtitle_txt = "and TXT records" subtitle_txt = "and TXT records"
@ -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) render_mx_records :: forall (w :: Type) (l :: Row Type)
. Hash.HashMap RRId Validation.Errors -> Array (MXRR l) -> HH.HTML w Action . Hash.HashMap RRId Validation.Errors -> Array (MXRR l) -> HH.HTML w Action
render_mx_records _ [] render_mx_records _ []
= Bulma.columns [] [ left_block, right_block ] = Bulma.box [ Bulma.zone_rr_title "MX records"
where left_block = Bulma.column class_title_size [ Bulma.zone_rr_title "MX records" ] , Bulma.subtitle "No records for now"
right_block = Bulma.column_ [ Bulma.subtitle "No records for now" ] ]
render_mx_records errors records render_mx_records errors records
= Bulma.columns [] [ Bulma.column class_title_size [ Bulma.zone_rr_title title_txt ] = Bulma.box [ Bulma.zone_rr_title "MX records"
, Bulma.column_ [ Bulma.tile [ table_rr ] ] , table_rr
] ]
where where
title_txt = "MX records"
table_rr = Bulma.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
@ -747,14 +742,14 @@ render_mx_records errors records
render_srv_records :: forall (w :: Type) (l :: Row Type) render_srv_records :: forall (w :: Type) (l :: Row Type)
. Hash.HashMap RRId Validation.Errors -> Array (SRVRR l) -> HH.HTML w Action . Hash.HashMap RRId Validation.Errors -> Array (SRVRR l) -> HH.HTML w Action
render_srv_records _ [] render_srv_records _ []
= Bulma.columns [] [ left_block, right_block ] = Bulma.box [ Bulma.zone_rr_title "SRV records"
where left_block = Bulma.column class_title_size [ Bulma.zone_rr_title "SRV records" ] , Bulma.subtitle "No records for now"
right_block = Bulma.column_ [ Bulma.subtitle "No records for now" ] ]
render_srv_records errors records render_srv_records errors records
= Bulma.columns [] [ Bulma.column class_title_size [ Bulma.zone_rr_title title_txt] = Bulma.box [ Bulma.zone_rr_title "SRV records"
, Bulma.column_ [ Bulma.tile [ table_rr ] ] ] , table_rr
]
where where
title_txt = "SRV records"
table_rr = Bulma.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