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

View File

@@ -61,6 +61,16 @@ else
$data = array_merge($data,$stats);
}
if (isset($_GET["getMaxlogage"]) && $auth) {
sendRequestFTL("maxlogage");
// Convert seconds to hours and rounds to one decimal place.
$ret = round(intval(getResponseFTL()[0]) / 3600, 1);
// Return 24h if value is 0, empty, null or non numeric.
$ret = $ret ?: 24;
$data = array_merge($data, array("maxlogage" => $ret));
}
if (isset($_GET['overTimeData10mins']))
{
sendRequestFTL("overTime");