diff --git a/scripts/pi-hole/js/footer.js b/scripts/pi-hole/js/footer.js index e59beed3f..ce6401551 100644 --- a/scripts/pi-hole/js/footer.js +++ b/scripts/pi-hole/js/footer.js @@ -40,7 +40,7 @@ function piholeChange(action, duration) case "enable": btnStatus = $("#flip-status-enable"); btnStatus.html(" "); - $.getJSON("api.php?enable&token=" + token, (data) => { + $.getJSON("api.php?enable&token=" + token, function(data) { if(data.status === "enabled") { btnStatus.html(""); piholeChanged("enabled"); @@ -51,7 +51,7 @@ function piholeChange(action, duration) case "disable": btnStatus = $("#flip-status-disable"); btnStatus.html(" "); - $.getJSON("api.php?disable=" + duration + "&token=" + token, (data) => { + $.getJSON("api.php?disable=" + duration + "&token=" + token, function(data) { if(data.status === "disabled") { btnStatus.html(""); piholeChanged("disabled"); diff --git a/scripts/pi-hole/js/index.js b/scripts/pi-hole/js/index.js index 3eec3beae..5030af14b 100644 --- a/scripts/pi-hole/js/index.js +++ b/scripts/pi-hole/js/index.js @@ -291,7 +291,7 @@ $(document).ready(function() { enabled: true, mode: "x-axis", callbacks: { - title(tooltipItem, data) { + title: function(tooltipItem, data) { var label = tooltipItem[0].xLabel; var time = label.match(/(\d?\d):?(\d?\d?)/); var h = parseInt(time[1], 10); @@ -300,7 +300,7 @@ $(document).ready(function() { var to = padNumber(h)+":"+padNumber(m+9)+":59"; return "Queries from "+from+" to "+to; }, - label(tooltipItems, data) { + label: function(tooltipItems, data) { if(tooltipItems.datasetIndex === 1) { var percentage = 0.0; diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php index b5c1b66b7..f5b795286 100644 --- a/scripts/pi-hole/php/header.php +++ b/scripts/pi-hole/php/header.php @@ -249,7 +249,7 @@
- Pi-hole logo + Pi-hole logo

Status

@@ -293,33 +293,33 @@ ?>
$nproc) { - echo '#FF0000'; + echo "#FF0000"; } else { - echo '#7FFF00'; + echo "#7FFF00"; } - echo '""> Load:  ' . $loaddata[0] . '  ' . $loaddata[1] . '  '. $loaddata[2] . ''; + echo "\"> Load:  " . $loaddata[0] . "  " . $loaddata[1] . "  ". $loaddata[2] . ""; ?>
0.75 || $memory_usage < 0.0) { - echo '#FF0000'; + echo "#FF0000"; } else { - echo '#7FFF00'; + echo "#7FFF00"; } if($memory_usage > 0.0) { - echo '""> Memory usage:  ' . sprintf("%.1f",100.0*$memory_usage) . '%'; + echo "\"> Memory usage:  " . sprintf("%.1f",100.0*$memory_usage) . "%"; } else { - echo '""> Memory usage:   N/A'; + echo "\"> Memory usage:   N/A"; } ?>
diff --git a/scripts/pi-hole/php/savesettings.php b/scripts/pi-hole/php/savesettings.php index e65a7a610..050165ecd 100644 --- a/scripts/pi-hole/php/savesettings.php +++ b/scripts/pi-hole/php/savesettings.php @@ -355,10 +355,21 @@ function validDomain($domain_name) $error .= "Lease time ".$leasetime." is invalid!
"; } + if(isset($_POST["useIPv6"])) + { + $ipv6 = "true"; + $type = "(IPv4 + IPv6)"; + } + else + { + $ipv6 = "false"; + $type = "(IPv4)"; + } + if(!strlen($error)) { - exec("sudo pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain); - $success .= "The DHCP server has been activated"; + exec("sudo pihole -a enabledhcp ".$from." ".$to." ".$router." ".$leasetime." ".$domain." ".$ipv6); + $success .= "The DHCP server has been activated ".$type; } } else diff --git a/settings.php b/settings.php index 175af9f16..7983e1072 100644 --- a/settings.php +++ b/settings.php @@ -104,6 +104,17 @@
0 && $piHoleIPv6 != "unknown") + { + if(substr($piHoleIPv6, 0, 4) != "fe80") + { + $usingipv6 = true; + } + } + if(isset($setupVars["DHCP_ACTIVE"])) { if($setupVars["DHCP_ACTIVE"] == 1) @@ -132,6 +143,15 @@ { $DHCPleasetime = 24; } + if(isset($setupVars["DHCP_IPv6"])) + { + $DHCPIPv6 = $setupVars["DHCP_IPv6"]; + } + else + { + $DHCPIPv6 = $usingipv6; + } + } else { @@ -149,6 +169,7 @@ $DHCProuter = ""; } $DHCPleasetime = 24; + $DHCPIPv6 = $usingipv6; } if(isset($setupVars["PIHOLE_DOMAIN"])){ $piHoleDomain = $setupVars["PIHOLE_DOMAIN"]; @@ -205,6 +226,11 @@
+
+
+
+
+