Merge pull request #765 from pi-hole/tweak/client-names

Use new `client-names` FTL response format
This commit is contained in:
Mark Drobnak
2018-06-07 21:40:19 -04:00
committed by GitHub
2 changed files with 15 additions and 4 deletions

View File

@@ -336,9 +336,11 @@ else
$client_names = array();
foreach($return as $line)
{
$tmp = explode(" ",$line);
// returned data is in format: "ID count hostname"
$client_names[intval($tmp[0])] = $tmp[2];
$tmp = explode(" ", $line);
$client_names[] = array(
"name" => $tmp[0],
"ip" => $tmp[1]
);
}
$result = array('clients' => $client_names);