From 0d5365af865c4c99f6c7547b5f53c3e945272baa Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 21 Nov 2023 20:23:38 -0300 Subject: [PATCH 1/7] Use 2 columns only in large screens Signed-off-by: RD WebDesign --- settings-dnsrecords.lp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/settings-dnsrecords.lp b/settings-dnsrecords.lp index eecee140..02183520 100644 --- a/settings-dnsrecords.lp +++ b/settings-dnsrecords.lp @@ -14,7 +14,7 @@ PageTitle = "Local DNS Settings" mg.include('scripts/pi-hole/lua/settings_header.lp','r') ?>
-
+

Local DNS records

@@ -70,7 +70,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
-
+

Local CNAME records records

From 3dcc2862b598444e489172892a98c2f272519a69 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 21 Nov 2023 20:25:38 -0300 Subject: [PATCH 2/7] Adjust the grid for datatables elements Signed-off-by: RD WebDesign --- scripts/pi-hole/js/settings-dns-records.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/settings-dns-records.js b/scripts/pi-hole/js/settings-dns-records.js index c629566b..ce045c30 100644 --- a/scripts/pi-hole/js/settings-dns-records.js +++ b/scripts/pi-hole/js/settings-dns-records.js @@ -99,7 +99,7 @@ function populateDataTable(endpoint) { $(`td:eq(${endpoint === "hosts" ? 2 : 3})`, row).html(button); }, dom: - "<'row'<'col-sm-6'l><'col-sm-6'f>>" + + "<'row'<'col-sm-5'l><'col-sm-7'f>>" + "<'row'<'col-sm-12'p>>" + "<'row'<'col-sm-12'<'table-responsive'tr>>>" + "<'row'<'col-sm-12'p>>" + From 2aa278d20989dd76da821cd4d42f344efc13a53d Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 21 Nov 2023 21:17:42 -0300 Subject: [PATCH 3/7] Move notes to extenal box-footer Signed-off-by: RD WebDesign --- settings-dnsrecords.lp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/settings-dnsrecords.lp b/settings-dnsrecords.lp index 02183520..7872caf4 100644 --- a/settings-dnsrecords.lp +++ b/settings-dnsrecords.lp @@ -45,9 +45,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
- @@ -68,6 +66,10 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
+
@@ -105,13 +107,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
- @@ -133,6 +129,14 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r') + From 4ceabfb388146ece4e062ae396a51a9cae9d021d Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 22 Nov 2023 00:24:18 -0300 Subject: [PATCH 4/7] Simplify the layout moving "add new item" fields to the table footer - create a table footer and move the input fields there; - CSS to format the input fields - remove the collapsible box Signed-off-by: RD WebDesign --- settings-dnsrecords.lp | 113 +++++++++++++++-------------------------- style/pi-hole.css | 8 ++- 2 files changed, 47 insertions(+), 74 deletions(-) diff --git a/settings-dnsrecords.lp b/settings-dnsrecords.lp index 7872caf4..016a66d0 100644 --- a/settings-dnsrecords.lp +++ b/settings-dnsrecords.lp @@ -21,46 +21,30 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
-
-
- -
-

- Add new DNS record -

-
- -
-
- -
-
-
- - -
-
- - -
-
-
- -
-

List of local DNS records

- - - - - + + + + + + + + + + + +
DomainIP
DomainIP
+ + + + + +
@@ -79,51 +63,34 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
-
-
- -
-

- Add new CNAME record -

-
- -
-
- -
-
-
- - -
-
- - -
-
- - -
-
-
- -
-

List of local CNAME records

- - - - - - + + + + + + + + + + + + + +
DomainTargetTTL
DomainTargetTTL
+ + + + + + + +
diff --git a/style/pi-hole.css b/style/pi-hole.css index 197da27f..1dceed62 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -373,12 +373,18 @@ td.lookatme { font-family: inherit; } -.form-inline .dataTables .form-control { +.form-inline .dataTable .form-control { display: inline-block; width: 100%; vertical-align: middle; } +/* Table footer row used to add new items, using inline input fields */ +tfoot.add-new-item > tr > th { + font-weight: normal; + vertical-align: inherit; +} + .select2-container--default .select2-results > .select2-results__options { max-height: 400px; } From 0a4af1046336166b7fcb0482d6e2bc8bb5d286f8 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 22 Nov 2023 00:58:55 -0300 Subject: [PATCH 5/7] Add missing text "(optional)" to the TTL field Signed-off-by: RD WebDesign --- settings-dnsrecords.lp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings-dnsrecords.lp b/settings-dnsrecords.lp index 016a66d0..bd033854 100644 --- a/settings-dnsrecords.lp +++ b/settings-dnsrecords.lp @@ -71,7 +71,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r') Domain Target - TTL + TTL (optional) From 9fdd77f9b51658b5e222ad413df0b1fe884ad8b4 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 22 Nov 2023 19:14:24 -0300 Subject: [PATCH 6/7] Adjusting the placeholder text and cell widths Signed-off-by: RD WebDesign --- scripts/pi-hole/js/settings-dns-records.js | 5 ++++- settings-dnsrecords.lp | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/pi-hole/js/settings-dns-records.js b/scripts/pi-hole/js/settings-dns-records.js index ce045c30..b4d1ed61 100644 --- a/scripts/pi-hole/js/settings-dns-records.js +++ b/scripts/pi-hole/js/settings-dns-records.js @@ -49,7 +49,7 @@ function populateDataTable(endpoint) { columns = [ { data: null, render: CNAMEdomain }, { data: null, render: CNAMEtarget }, - { data: null, render: CNAMEttl }, + { data: null, width: "40px", render: CNAMEttl }, { data: null, width: "22px", orderable: false }, ]; } @@ -266,4 +266,7 @@ $(document).ready(function () { console.log(exception); // eslint-disable-line no-console }); }); + + // Add a small legend below the CNAME table + $("#cnameRecords-Table").after("* TTL in seconds (optional)"); }); diff --git a/settings-dnsrecords.lp b/settings-dnsrecords.lp index bd033854..7e726a85 100644 --- a/settings-dnsrecords.lp +++ b/settings-dnsrecords.lp @@ -35,10 +35,10 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r') - + - + @@ -71,20 +71,20 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r') Domain Target - TTL (optional) + TTL * - + - + - + From 1c0a3ea8a32dc7d95c507919eeb8872736804880 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Thu, 23 Nov 2023 03:26:49 -0300 Subject: [PATCH 7/7] Fix column width zero adding `autoWidth: false` Signed-off-by: RD WebDesign --- scripts/pi-hole/js/settings-dns-records.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/pi-hole/js/settings-dns-records.js b/scripts/pi-hole/js/settings-dns-records.js index b4d1ed61..94c620aa 100644 --- a/scripts/pi-hole/js/settings-dns-records.js +++ b/scripts/pi-hole/js/settings-dns-records.js @@ -73,6 +73,7 @@ function populateDataTable(endpoint) { type: "GET", dataSrc: `config.dns.${endpoint}`, }, + autoWidth: false, columns: columns, columnDefs: [ {