diff --git a/debug.php b/debug.php
new file mode 100644
index 00000000..90139a0a
--- /dev/null
+++ b/debug.php
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/scripts/pi-hole/js/debug.js b/scripts/pi-hole/js/debug.js
new file mode 100644
index 00000000..51c7d334
--- /dev/null
+++ b/scripts/pi-hole/js/debug.js
@@ -0,0 +1,64 @@
+// Credit: http://stackoverflow.com/a/10642418/2087442
+function httpGet(ta,quiet,theUrl)
+{
+ var xmlhttp;
+ if (window.XMLHttpRequest)
+ {
+ // code for IE7+
+ xmlhttp = new XMLHttpRequest();
+ }
+ else
+ {
+ // code for IE6, IE5
+ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+ }
+ xmlhttp.onreadystatechange=function()
+ {
+ if (xmlhttp.readyState === 4 && xmlhttp.status === 200)
+ {
+ ta.show();
+ ta.empty();
+ if(!quiet)
+ {
+ ta.append(xmlhttp.responseText);
+ }
+ else
+ {
+ quietfilter(ta,xmlhttp.responseText);
+ }
+ }
+ };
+ xmlhttp.open("GET", theUrl, false);
+ xmlhttp.send();
+}
+
+function eventsource() {
+ var ta = $("#output");
+
+ // IE does not support EventSource - load whole content at once
+ if (typeof EventSource !== "function") {
+ httpGet(ta,quiet,"/admin/scripts/pi-hole/php/debug.php");
+ return;
+ }
+
+ var host = window.location.host;
+ var source = new EventSource("/admin/scripts/pi-hole/php/debug.php");
+
+ // Reset and show field
+ ta.empty();
+ ta.show();
+
+ source.addEventListener("message", function(e) {
+ ta.append(e.data);
+ }, false);
+
+ // Will be called when script has finished
+ source.addEventListener("error", function(e) {
+ source.close();
+ }, false);
+}
+
+$("#debugBtn").on("click", function(){
+ $("#debugBtn").attr("disabled", true);
+ eventsource();
+});
diff --git a/scripts/pi-hole/php/debug.php b/scripts/pi-hole/php/debug.php
new file mode 100644
index 00000000..d57fddae
--- /dev/null
+++ b/scripts/pi-hole/php/debug.php
@@ -0,0 +1,19 @@
+
diff --git a/scripts/pi-hole/php/header.php b/scripts/pi-hole/php/header.php
index 91a56f7d..85c6a276 100644
--- a/scripts/pi-hole/php/header.php
+++ b/scripts/pi-hole/php/header.php
@@ -405,7 +405,7 @@
Enable
- active">
+ active">
Tools
@@ -431,6 +431,12 @@
Tail pihole.log
+
+ class="active">
+
+ Generate debug log
+
+