From 42192fb9e978178d72d9e3caac6f95ef297a1198 Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Fri, 9 Feb 2024 02:12:02 +0100 Subject: [PATCH] Better rendition of the zone content (empty line between record groups). --- src/App/ZoneInterface.purs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/App/ZoneInterface.purs b/src/App/ZoneInterface.purs index 7c63da8..747d88b 100644 --- a/src/App/ZoneInterface.purs +++ b/src/App/ZoneInterface.purs @@ -723,10 +723,21 @@ render_resources records then Bulma.table [] [ Bulma.srv_table_header, render_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_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_ rows rr = [ HH.tr_ $ render_row rr ] -- <> error_row rr