mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Have API return floats instead of ints for the values that are percentages computed by FTL
This commit is contained in:
+7
-7
@@ -179,11 +179,11 @@ if (isset($_GET['getForwardDestinations']) && $auth)
|
||||
$tmp = explode(" ",$line);
|
||||
if(count($tmp) == 4)
|
||||
{
|
||||
$forward_dest[$tmp[3]."|".$tmp[2]] = intval($tmp[1]);
|
||||
$forward_dest[$tmp[3]."|".$tmp[2]] = floatval($tmp[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forward_dest[$tmp[2]] = intval($tmp[1]);
|
||||
$forward_dest[$tmp[2]] = floatval($tmp[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ if (isset($_GET['getQueryTypes']) && $auth)
|
||||
foreach($return as $ret)
|
||||
{
|
||||
$tmp = explode(": ",$ret);
|
||||
$querytypes[$tmp[0]] = intval($tmp[1]);
|
||||
$querytypes[$tmp[0]] = floatval($tmp[1]);
|
||||
}
|
||||
|
||||
$result = array('querytypes' => $querytypes);
|
||||
@@ -257,7 +257,7 @@ if (isset($_GET['overTimeDataForwards']) && $auth)
|
||||
{
|
||||
$tmp = explode(" ",$line);
|
||||
for ($i=0; $i < count($tmp)-1; $i++) {
|
||||
$over_time[intval($tmp[0])][$i] = intval($tmp[$i+1]);
|
||||
$over_time[intval($tmp[0])][$i] = floatval($tmp[$i+1]);
|
||||
}
|
||||
}
|
||||
$result = array('over_time' => $over_time);
|
||||
@@ -274,11 +274,11 @@ if (isset($_GET['getForwardDestinationNames']) && $auth)
|
||||
$tmp = explode(" ",$line);
|
||||
if(count($tmp) == 4)
|
||||
{
|
||||
$forward_dest[$tmp[3]."|".$tmp[2]] = intval($tmp[1]);
|
||||
$forward_dest[$tmp[3]."|".$tmp[2]] = floatval($tmp[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$forward_dest[$tmp[2]] = intval($tmp[1]);
|
||||
$forward_dest[$tmp[2]] = floatval($tmp[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +296,7 @@ if (isset($_GET['overTimeDataQueryTypes']) && $auth)
|
||||
{
|
||||
$tmp = explode(" ",$line);
|
||||
for ($i=0; $i < count($tmp)-1; $i++) {
|
||||
$over_time[intval($tmp[0])][$i] = intval($tmp[$i+1]);
|
||||
$over_time[intval($tmp[0])][$i] = floatval($tmp[$i+1]);
|
||||
}
|
||||
}
|
||||
$result = array('over_time' => $over_time);
|
||||
|
||||
Reference in New Issue
Block a user