fix 'settings page crashing' if FTL is offline

Display Message instead of table in 'FTL Information'-Box and fix settings page crash
This commit is contained in:
TheME
2017-11-07 16:59:13 +01:00
committed by GitHub
parent 95cd2db9cd
commit 603871737a
+13 -11
View File
@@ -1082,17 +1082,6 @@ if (in_array($_GET['tab'], array("sysadmin", "blocklists", "dns", "piholedhcp",
</div>
</div>
</div>
<?php
if ($FTL) {
function get_FTL_data($arg)
{
global $FTLpid;
return trim(exec("ps -p " . $FTLpid . " -o " . $arg));
}
$FTLversion = exec("/usr/bin/pihole-FTL version");
}
?>
<div class="col-md-6">
<div class="box">
<div class="box-header with-border">
@@ -1101,6 +1090,16 @@ if (in_array($_GET['tab'], array("sysadmin", "blocklists", "dns", "piholedhcp",
<div class="box-body">
<div class="row">
<div class="col-lg-12">
<?php
if ($FTL) {
function get_FTL_data($arg)
{
global $FTLpid;
return trim(exec("ps -p " . $FTLpid . " -o " . $arg));
}
$FTLversion = exec("/usr/bin/pihole-FTL version");
?>
<table class="table table-striped table-bordered dt-responsive nowrap">
<tbody>
<tr>
@@ -1135,6 +1134,9 @@ if (in_array($_GET['tab'], array("sysadmin", "blocklists", "dns", "piholedhcp",
</tr>
</tbody>
</table>
<?php } else { ?>
<div>The FTL service is offline!</div>
<?php } ?>
</div>
</div>
</div>