diff --git a/footer.php b/footer.php index b52bec47..879b60c9 100644 --- a/footer.php +++ b/footer.php @@ -8,8 +8,8 @@ $piholeVersion = exec("cd /etc/.pihole/ && git describe --tags --abbrev=0"); $webVersion = exec("cd /var/www/html/admin/ && git describe --tags --abbrev=0"); ?> - Pi-hole Version - Web Interface Version + Pi-hole Version
+ Web Interface Version
Donate if you found this useful. diff --git a/js/pihole/footer.js b/js/pihole/footer.js index 1ee06d80..a2ec3f78 100644 --- a/js/pihole/footer.js +++ b/js/pihole/footer.js @@ -8,6 +8,9 @@ $("body").on("click", function(event) { } }); +var piholeVersion = $("#piholeVersion").html(); +var webVersion = $("#webVersion").html(); + // Credit for following function: https://gist.github.com/alexey-bass/1115557 function versionCompare(left, right) { if (typeof left + typeof right != 'stringstring') @@ -30,7 +33,7 @@ function versionCompare(left, right) { // Update check $.getJSON("https://api.github.com/repos/pi-hole/pi-hole/releases/latest", function(json) { - if(versionCompare("", json.tag_name.slice(1)) < 0) { + if(versionCompare(piholeVersion, json.tag_name.slice(1)) < 0) { // Alert user $("#alPiholeUpdate").show(); if(!$("#dropdown-menu").hasClass("open")) { @@ -39,7 +42,7 @@ $.getJSON("https://api.github.com/repos/pi-hole/pi-hole/releases/latest", functi } }); $.getJSON("https://api.github.com/repos/pi-hole/AdminLTE/releases/latest", function(json) { - if(versionCompare("", json.tag_name.slice(1)) < 0) { + if(versionCompare(webVersion, json.tag_name.slice(1)) < 0) { // Alert user $("#alWebUpdate").show(); if(!$("#dropdown-menu").hasClass("open")) {