mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Merge pull request #624 from pi-hole/tweak/updatecheckerFTL
Adding branch/version display for FTL
This commit is contained in:
@@ -48,7 +48,7 @@
|
||||
<!-- /.content-wrapper -->
|
||||
<footer class="main-footer">
|
||||
<!-- Version Infos -->
|
||||
<div class="pull-right hidden-xs hidden-sm<?php if(isset($core_commit) || isset($web_commit)) { ?> hidden-md<?php } ?>">
|
||||
<div class="pull-right hidden-xs hidden-sm<?php if(isset($core_commit) || isset($web_commit) || isset($FTL_commit)) { ?> hidden-md<?php } ?>">
|
||||
<b>Pi-hole Version </b> <?php
|
||||
echo $core_current;
|
||||
if(isset($core_commit)) { echo " (".$core_branch.", ".$core_commit.")"; }
|
||||
@@ -59,6 +59,7 @@
|
||||
if($web_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/AdminLTE/releases" target="_blank">(Update available!)</a><?php } ?>
|
||||
<b>FTL Version </b> <?php
|
||||
echo $FTL_current;
|
||||
if(isset($FTL_commit)) { echo " (".$FTL_branch.", ".$FTL_commit.")"; }
|
||||
if($FTL_update){ ?> <a class="alert-link lookatme" href="https://github.com/pi-hole/FTL/releases" target="_blank">(Update available!)</a><?php } ?>
|
||||
</div>
|
||||
<div style="display: inline-block"><strong><a href="https://pi-hole.net/donate" target="_blank"><i class="fa fa-heart"></i> Donate</a></strong> if you found this useful.</div>
|
||||
|
||||
@@ -42,8 +42,15 @@ else
|
||||
$web_current = explode("-",$versions[1])[0];
|
||||
}
|
||||
|
||||
/********** Get Pi-hole FTL version (not a git repository) **********/
|
||||
$FTL_current = $versions[2];
|
||||
/********** Get Pi-hole FTL (not a git repository) **********/
|
||||
$FTL_branch = $branches[2];
|
||||
if($FTL_branch !== "master") {
|
||||
$FTL_current = "vDev";
|
||||
$FTL_commit = $versions[2];
|
||||
}
|
||||
else {
|
||||
$FTL_current = explode("-",$versions[2])[0];
|
||||
}
|
||||
|
||||
// Get data from GitHub
|
||||
$core_latest = $GitHubversions[0];
|
||||
@@ -77,7 +84,15 @@ else
|
||||
// FTL version comparison
|
||||
// This logic allows the local core version to be newer than the upstream version
|
||||
// The update indicator is only shown if the upstream version is NEWER
|
||||
$FTL_update = (version_compare($FTL_current, $FTL_latest) < 0);
|
||||
if($FTL_current !== "vDev")
|
||||
{
|
||||
$FTL_update = (version_compare($FTL_current, $FTL_latest) < 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
$FTL_update = false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user