Retreives maxlogage calling api_FTL.php

FTL defines MAXLOGAGE value.
PHP retrieves the value and converts seconds to hours
Javascript calls the API to update the value.

Signed-off-by: rdwebdesign <github@rdwebdesign.com.br>
This commit is contained in:
rdwebdesign
2022-02-01 16:22:24 -03:00
parent 7457f68658
commit 171bf81b11
3 changed files with 25 additions and 12 deletions
+3 -12
View File
@@ -5,19 +5,10 @@
*
* This file is copyright under the latest version of the EUPL.
* Please see LICENSE file for your rights under this license. */
$indexpage = true;
require "scripts/pi-hole/php/header.php";
require_once "scripts/pi-hole/php/gravity.php";
function getinterval()
{
global $piholeFTLConf;
if (isset($piholeFTLConf["MAXLOGAGE"])) {
return min(round(floatval($piholeFTLConf["MAXLOGAGE"]), 1), 24);
} else {
return "24";
}
}
?>
<!-- Sourceing CSS colors from stylesheet to be used in JS code -->
<span class="queries-permitted"></span>
@@ -84,7 +75,7 @@ function getinterval()
<div class="col-md-12">
<div class="box" id="queries-over-time">
<div class="box-header with-border">
<h3 class="box-title">Total queries over last <?php echo getinterval(); ?> hours</h3>
<h3 class="box-title">Total queries over last <span class="maxlogage-interval">24</span> hours</h3>
</div>
<div class="box-body">
<div class="chart">
@@ -109,7 +100,7 @@ function getinterval()
<div class="col-md-12">
<div class="box" id="clients">
<div class="box-header with-border">
<h3 class="box-title">Client activity over last <?php echo getinterval(); ?> hours</h3>
<h3 class="box-title">Client activity over last <span class="maxlogage-interval">24</span> hours</h3>
</div>
<div class="box-body">
<div class="chart">