Change TOP Clients from default 10 to 20

Sorry for the n00b question,
But I presume this is only possible if you recompile it your self ?
It isn't possible to edit this on a already installed pi-hole on a raspberry ?

PHP is not compiled, you can edit it.

Thnx,
Stupid me i wasn't looking in the right location to edit it.

Hello,

With the recent upgrade to the web version 4.0, I had to revert the changes that I had made to /var/html/admin/scripts/js/index.js in order to perform the upgrade. No problem with the upgrade; however when trying to add the top clients as well as the total of permitted/blocked domains, I seem to not get the results that I has expected.

For Top Clients: I do not see more than 10 top clients
function updateTopClientsChart() {
$.getJSON("api.php?summaryRaw&getQuerySources&topClientsBlocked=25", function(data)

For Top Items: I do see the Top 20 blocked and permitted.
function updateTopLists() {
$.getJSON("api.php?summaryRaw&topItems=20", function(data)

I am curious if anyone else was able to increase their top clients visible in the GUI?

Thank you and best regards,

Why not make this an option in the next release ?!

Please ? Pretty please ? :smiley:

I was not. My top clients (blocked only) increased, but the top clients (total) and top permitted and top blocked domains stayed at 10.

Do http://pi.hole/admin/api.php?topClients=25 and http://pi.hole/admin/api.php?topItems=25 give you more than 10 results?

1 Like

It does not. On Safari and Brave (both on Mac), I see this:

You need to be logged into Pi-hole's dashboard in the same browser to have the permissions to request these data.

I get more than 10 in both

When your system knows only 4 clients, there is no chance that the table can show more than 10 :wink:

Oops, wrong Pi-Hole. :frowning:The other one with 20 clients shows a similar list, with all 20.

That's a yes to both.

You should use

api.php?summaryRaw&getQuerySources=25&topClientsBlocked=25
2 Likes

Hello,

Thank you for the hint, this was the trick and I now can see the additional clients.

For those that are interested, the same for the top domains can be done with:
function updateTopLists() {
$.getJSON("api.php?summaryRaw&topItems=15", function(data) {

Best regards,

Hi Team,
ive edited: /var/www/html/admin/scripts/pi-hole/js/index.js with this line

api.php?summaryRaw&getQuerySources=25&topClientsBlocked=25

reboot,
but it shows always only 10 clients
Any Ideas?

Pi-hole Version v4.1.1 Web Interface Version v4.1.1 FTL Version v4.1.2

EDIT: ive to wait about 2min, after this time all my 25 clients are shown :wink:

Sorry for newbie question but how do you actually change it? i tried to edit the file on file manager but it wont save the edited file. thx

Hello,

I typically use nano to edit. Being that the permissions are different for the file use sudo.

sudo nano /var/www/html/admin/scripts/pi-hole/js/index.js

You can do ctrl-w to find and enter - topclients, and that should take you to the line. add =25 or what ever number after Sources and Blocked.
example api.php?summaryRaw&getQuerySources=25&topClientsBlocked=25

then ctrl-o to write, then confirm name and press enter to save, then ctrl x to exit

It will take a bit, but should start to show you the larger list of clients.

JC

1 Like

Thank you.

I did this on 5.2.2 and it still works:

on scripts/pi-hole/js/index.js we must add the amount on the parameters getQuerySources, topItems, topClients and topClientsBlocked.

Example, replace getQuerySources&topClientsBlocked for getQuerySources=50&topClientsBlocked=50

We really should have this as a WebUI setting! If no value is received as parameter - as it is on repo index.js -, api.php could query the value from settings instead of using default 10.