mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Merge pull request #459 from pi-hole/new/FTLupdatenotification
Show FTL version and update notification (if available) in footer
This commit is contained in:
@@ -144,6 +144,7 @@ $("#pihole-disable-custom").on("click", function(e){
|
||||
|
||||
var piholeVersion = $("#piholeVersion").html();
|
||||
var webVersion = $("#webVersion").html();
|
||||
var FTLVersion = $("#FTLVersion").html();
|
||||
|
||||
// Credit for following function: https://gist.github.com/alexey-bass/1115557
|
||||
// Modified to discard any possible "v" in the string
|
||||
@@ -183,17 +184,24 @@ function versionCompare(left, right) {
|
||||
$.getJSON("https://api.github.com/repos/pi-hole/pi-hole/releases/latest", function(json) {
|
||||
if(versionCompare(piholeVersion, json.tag_name.slice(1)) < 0) {
|
||||
// Alert user
|
||||
$("#piholeVersion").html($("#piholeVersion").text() + "<a class=\"alert-link\" href=\"https://github.com/pi-hole/pi-hole/releases\">(Update available!)</a>");
|
||||
$("#piholeVersion").html($("#piholeVersion").text() + " <a class=\"alert-link lookatme\" href=\"https://github.com/pi-hole/pi-hole/releases\">(Update available!)</a>");
|
||||
$("#alPiholeUpdate").show();
|
||||
}
|
||||
});
|
||||
$.getJSON("https://api.github.com/repos/pi-hole/AdminLTE/releases/latest", function(json) {
|
||||
if(versionCompare(webVersion, json.tag_name.slice(1)) < 0) {
|
||||
// Alert user
|
||||
$("#webVersion").html($("#webVersion").text() + "<a class=\"alert-link\" href=\"https://github.com/pi-hole/adminLTE/releases\">(Update available!)</a>");
|
||||
$("#webVersion").html($("#webVersion").text() + " <a class=\"alert-link lookatme\" href=\"https://github.com/pi-hole/adminLTE/releases\">(Update available!)</a>");
|
||||
$("#alWebUpdate").show();
|
||||
}
|
||||
});
|
||||
$.getJSON("https://api.github.com/repos/pi-hole/FTL/releases/latest", function(json) {
|
||||
if(versionCompare(FTLVersion, json.tag_name.slice(1)) < 0) {
|
||||
// Alert user
|
||||
$("#FTLVersion").html($("#FTLVersion").text() + " <a class=\"alert-link lookatme\" href=\"https://github.com/pi-hole/FTL/releases\">(Update available!)</a>");
|
||||
$("#alFTLUpdate").show();
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
* Make sure that Pi-hole is updated to at least v2.7, since that is needed to use the sudo
|
||||
|
||||
@@ -392,7 +392,14 @@ function updateSummaryData(runOnce) {
|
||||
}, 500);
|
||||
|
||||
}).done(function() {
|
||||
setTimer(1);
|
||||
if(!FTLoffline)
|
||||
{
|
||||
setTimer(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setTimer(10);
|
||||
}
|
||||
}).fail(function() {
|
||||
setTimer(300);
|
||||
});
|
||||
|
||||
@@ -62,10 +62,25 @@
|
||||
else {
|
||||
$webVersion = exec("git describe --tags --abbrev=0");
|
||||
}
|
||||
|
||||
$FTLVersion = exec("pihole-FTL version");
|
||||
?>
|
||||
<style type="text/css">
|
||||
@-webkit-keyframes Pulse{
|
||||
from {color:#630030;-webkit-text-shadow:0 0 9px #333;}
|
||||
50% {color:#e33100;-webkit-text-shadow:0 0 32px #e33100;}
|
||||
to {color:#630030;-webkit-text-shadow:0 0 9px #333;}
|
||||
}
|
||||
a.lookatme {
|
||||
-webkit-animation-name: Pulse;
|
||||
-webkit-animation-duration: 2s;
|
||||
-webkit-animation-iteration-count: infinite;
|
||||
}
|
||||
</style>
|
||||
<div class="pull-right hidden-xs <?php if(isset($piholeCommit) || isset($webCommit)) { ?>hidden-md<?php } ?>">
|
||||
<b>Pi-hole Version </b> <span id="piholeVersion"><?php echo $piholeVersion; ?></span><?php if(isset($piholeCommit)) { echo " (".$piholeBranch.", ".$piholeCommit.")"; } ?>
|
||||
<b>Web Interface Version </b> <span id="webVersion"><?php echo $webVersion; ?></span><?php if(isset($webCommit)) { echo " (".$webBranch.", ".$webCommit.")"; } ?>
|
||||
<b>FTL Version </b> <span id="FTLVersion"><?php echo $FTLVersion; ?></span>
|
||||
</div>
|
||||
<div><a href="https://github.com/pi-hole"><i class="fa fa-github"></i></a> <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3J2L3Z4DHW9UY">Donate</a></strong> if you found this useful.</div>
|
||||
</footer>
|
||||
|
||||
Reference in New Issue
Block a user