Major overhaul of update checker - checks only every 30 minutes to reduce number of GitHub API requests

This commit is contained in:
DL6ER
2017-06-03 16:26:26 +02:00
parent 065345d414
commit 2f218ba9eb
4 changed files with 142 additions and 106 deletions

View File

@@ -41,30 +41,6 @@
</div>
<!-- /.content-wrapper -->
<footer class="main-footer">
<?php
// Check if on a dev branch
$piholeBranch = exec("cd /etc/.pihole/ && git rev-parse --abbrev-ref HEAD");
$webBranch = exec("git rev-parse --abbrev-ref HEAD");
// Use vDev if not on master
if($piholeBranch !== "master") {
$piholeVersion = "vDev";
$piholeCommit = exec("cd /etc/.pihole/ && git describe --long --dirty --tags");
}
else {
$piholeVersion = exec("cd /etc/.pihole/ && git describe --tags --abbrev=0");
}
if($webBranch !== "master") {
$webVersion = "vDev";
$webCommit = exec("git describe --long --dirty --tags");
}
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;}
@@ -77,10 +53,18 @@
-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 class="pull-right hidden-xs <?php if(isset($core_commit) || isset($web_commit)) { ?>hidden-md<?php } ?>">
<b>Pi-hole Version </b> <?php
echo $core_current;
if(isset($core_commit)) { echo " (".$core_branch.", ".$core_commit.")"; }
if($core_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/pi-hole/releases">(Update available!)</a><?php } ?>
<b>Web Interface Version </b><?php
echo $web_current;
if(isset($web_commit)) { echo " (".$web_branch.", ".$web_commit.")"; }
if($web_update){ ?> <a class="alert-link lookatme\" href="https://github.com/pi-hole/AdminLTE/releases">(Update available!)</a><?php } ?>
<b>FTL Version </b> <?php
echo $FTL_current;
if($FTL_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/FTL/releases">(Update available!)</a><?php } ?>
</div>
<div><a href="https://github.com/pi-hole" target="_blank"><i class="fa fa-github"></i></a> <strong><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&amp;hosted_button_id=3J2L3Z4DHW9UY" target="_blank">Donate</a></strong> if you found this useful.</div>
</footer>