Better rendition of the zone content (empty line between record groups).

beta
Philippe Pittoli 2024-02-09 02:12:02 +01:00
parent 412a06d10b
commit 42192fb9e9
1 changed files with 12 additions and 1 deletions

View File

@ -723,10 +723,21 @@ render_resources records
then Bulma.table [] [ Bulma.srv_table_header, render_srv_records ] then Bulma.table [] [ Bulma.srv_table_header, render_srv_records ]
else Bulma.p "no srv records" else Bulma.p "no srv records"
render_basic_records = table_content all_basic_rr render_basic_records = table_content_with_separations all_basic_rr
render_mx_records = table_content all_mx_rr render_mx_records = table_content all_mx_rr
render_srv_records = table_content all_srv_rr render_srv_records = table_content all_srv_rr
table_content_with_separations records_ = HH.tbody_ $ split_records
where
split_records = A.concat -- [[hh],[line],[hh],[line],[h]] -> [h h line h h line h]
$ map A.concat -- [[hh],[line],[hh],[line],[h]] -> [h h line h h line h]
$ A.intersperse [emptyline] -- [[hh], [hh], [h]] -> [[hh],[line],[hh],[line],[h]]
$ map (map rows) -- [[xx], [yy], [z]] -> [[hh], [hh], [h]] ('h' means 'html')
$ map NonEmpty.toArray -- [NE[xx], NE[yy], NE[z]] -> [[xx], [yy], [z]]
$ A.groupAllBy (comparing (_.rrtype)) records_ -- [x x y y z] -> [NE[xx], NE[yy], NE[z]]
emptyline = [ HH.tr_ [ Bulma.txt_name "", HH.td_ [], HH.td_ [], HH.td_ [], HH.td_ [], HH.td_ [] ] ]
table_content records_ = HH.tbody_ $ A.concat $ map rows records_ table_content records_ = HH.tbody_ $ A.concat $ map rows records_
rows rr = [ HH.tr_ $ render_row rr ] -- <> error_row rr rows rr = [ HH.tr_ $ render_row rr ] -- <> error_row rr