Skip to content

Commit

Permalink
Expose both name and IP of client
Browse files Browse the repository at this point in the history
Signed-off-by: Mcat12 <[email protected]>
  • Loading branch information
AzureMarker committed Jun 6, 2018
1 parent 6f93f89 commit 357da1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion api_FTL.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,11 @@
$client_names = array();
foreach($return as $line)
{
$client_names[] = $line;
$tmp = explode(" ", $line);
$client_names[] = array(
"name" => $tmp[0],
"ip" => $tmp[1]
);
}

$result = array('clients' => $client_names);
Expand Down
2 changes: 1 addition & 1 deletion scripts/pi-hole/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function updateClientsOverTime() {
for (key in data.clients)
{
if (!{}.hasOwnProperty.call(data.clients, key)) continue;
labels.push(data.clients[key]);
labels.push(data.clients[key].name);
}
// Get colors from AdminLTE
var colors = [];
Expand Down

0 comments on commit 357da1d

Please sign in to comment.