From c8704d707e0c907ca723c9339679bdd5deedd789 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Wed, 20 Mar 2024 16:57:12 -0300 Subject: [PATCH 1/6] Add missing priority `ERROR` to taillog `formatFTL()` function Signed-off-by: RD WebDesign --- scripts/pi-hole/js/taillog.js | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/pi-hole/js/taillog.js b/scripts/pi-hole/js/taillog.js index 44351989..2d8f1c79 100644 --- a/scripts/pi-hole/js/taillog.js +++ b/scripts/pi-hole/js/taillog.js @@ -53,6 +53,7 @@ function formatFTL(line, prio) { } case "ERR": + case "ERROR": case "EMERG": case "ALERT": case "CRIT": { From 1ccd27ff57ba5d30bee2c6c9a66d97f6a274ae33 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 25 Mar 2024 05:31:26 +0100 Subject: [PATCH 2/6] Do not redirect outside of settings pages on basic level and empty pages Signed-off-by: DL6ER --- scripts/pi-hole/js/footer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index b1f71557..65726b0b 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -698,7 +698,12 @@ function applyExpertSettings() { // If we left with an empty page (no visible boxes) after switching from // Expert to Basic settings, redirect to admin/settings/system instead - if ($(".box:visible").length === 0) { + // - class settings-selector is present (this class is present in every + // settings pages, but not in other pages - it is there on the "all" + // settings page as well, even when the button has "only modified" + // functionality there), and + // - there are no visible boxes (the page is empty) + if ($(".settings-selector").length > 0 && $(".box:visible").length === 0) { window.location.href = "/admin/settings/system"; } } From a5fd8b6735df46dab0eb3a40dbee2a31d3f8c578 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 30 Mar 2024 20:36:23 +0100 Subject: [PATCH 3/6] Move local DNS records from expert to basic settings level Signed-off-by: DL6ER --- scripts/pi-hole/lua/sidebar.lp | 2 +- settings-dnsrecords.lp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/pi-hole/lua/sidebar.lp b/scripts/pi-hole/lua/sidebar.lp index 7b20d99a..578e8b94 100644 --- a/scripts/pi-hole/lua/sidebar.lp +++ b/scripts/pi-hole/lua/sidebar.lp @@ -163,7 +163,7 @@ Teleporter -
  • +
  • Local DNS Records diff --git a/settings-dnsrecords.lp b/settings-dnsrecords.lp index 24402d21..685c4f05 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

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

    Local CNAME records records

    From 64ccce4bd55fec0ea83541097d0c4a03bc6c11a3 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 1 Apr 2024 19:52:22 +0100 Subject: [PATCH 4/6] Add field-sizing-content class that makes input and textarea fields it is applied to automatically scale to the size of their content. Signed-off-by: DL6ER --- scripts/pi-hole/js/settings-advanced.js | 2 +- settings-api.lp | 4 ++-- settings-dhcp.lp | 2 +- settings-dns.lp | 2 +- style/pi-hole.css | 4 ++++ 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/pi-hole/js/settings-advanced.js b/scripts/pi-hole/js/settings-advanced.js index 6286617c..9f73bf74 100644 --- a/scripts/pi-hole/js/settings-advanced.js +++ b/scripts/pi-hole/js/settings-advanced.js @@ -209,7 +209,7 @@ function generateRow(topic, key, value) { box += '' + '
    ' + - ' +

    Domains may be described by their domain name (like ^example\.com$)

    Clients to be excluded from Top Client Lists and Query Log

    - +

    Clients may be described either by their IP addresses (IPv4 and IPv6 are supported), or hostnames (like ^laptop\.lan$).

    diff --git a/settings-dhcp.lp b/settings-dhcp.lp index 4be3ca45..a643b1d1 100644 --- a/settings-dhcp.lp +++ b/settings-dhcp.lp @@ -156,7 +156,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')

    Specify per host parameters for the DHCP server. This allows a machine with a particular hardware address to be always allocated the same hostname, IP address and lease time. A hostname specified like this overrides any supplied by the DHCP client on the machine. It is also allowable to omit the hardware address and include the hostname, in which case the IP address and lease times will apply to any machine claiming that name.

    -
      +
     

    Each entry should be on a separate line, and should be of the form:

    [<hwaddr>][,id:<client_id>|*][,set:<tag>][,tag:<tag>][,<ipaddr>][,<hostname>][,<lease_time>][,ignore]

    Only one entry per MAC address is allowed.

    diff --git a/settings-dns.lp b/settings-dns.lp index a67b6e6d..49e4b6f7 100644 --- a/settings-dns.lp +++ b/settings-dns.lp @@ -226,7 +226,7 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')

    Enabling Conditional Forwarding will also forward all hostnames (i.e., non-FQDNs) to the router when "Never forward non-FQDNs" is not enabled.

    The following list contains all reverse servers you want to add. The expected format is one server per line in form of <enabled>,<ip-address>[/<prefix-len>],<server>[#<port>][,<domain>]. A valid config line could look like true,192.168.0.0/24,192.168.0.1,fritz.box

    - +
    diff --git a/style/pi-hole.css b/style/pi-hole.css index 034fb210..79b106f0 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -1471,3 +1471,7 @@ table.dataTable tbody > tr > .selected { text-align: right; } } + +.field-sizing-content { + field-sizing: content; +} From 09e9ae544f2a7d778bc13c847c9c18cfb7bfb677 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 1 Apr 2024 19:57:27 +0200 Subject: [PATCH 5/6] Add some defensive CSS to protect the textarea auto-sizing from getting into an undesirable visual state. Previously, inputs had a fair amount of fixed sizes, but after applying field-sizing: content, the inputs can become much too small or much too large. Signed-off-by: DL6ER --- style/pi-hole.css | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/style/pi-hole.css b/style/pi-hole.css index 79b106f0..c2997864 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -1472,6 +1472,10 @@ table.dataTable tbody > tr > .selected { } } -.field-sizing-content { +textarea.field-sizing-content { + min-block-size: 3.5rlh; + max-block-size: 20rlh; + min-inline-size: 20ch; + max-inline-size: 50ch; field-sizing: content; } From b542a301a5b738f2214355e78ad3fa4a002bfbcd Mon Sep 17 00:00:00 2001 From: Dominik Date: Tue, 2 Apr 2024 20:29:44 +0200 Subject: [PATCH 6/6] Update style/pi-hole.css Signed-off-by: Dominik --- style/pi-hole.css | 1 - 1 file changed, 1 deletion(-) diff --git a/style/pi-hole.css b/style/pi-hole.css index c2997864..f457c342 100644 --- a/style/pi-hole.css +++ b/style/pi-hole.css @@ -1476,6 +1476,5 @@ textarea.field-sizing-content { min-block-size: 3.5rlh; max-block-size: 20rlh; min-inline-size: 20ch; - max-inline-size: 50ch; field-sizing: content; }