Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[development-v6] Top Domains and Top Clients are not hidden when they contain no data #3068

Closed
mwoolweaver opened this issue Jul 8, 2024 · 9 comments · Fixed by #3069
Closed

Comments

@mwoolweaver
Copy link

mwoolweaver commented Jul 8, 2024

was originally opened as pi-hole/pi-hole/issues/5699 in error

Versions

Core
Version is v5.18.2-400-g8b324741 (Latest: null)
Branch is development-v6
Hash is 8b324741 (Latest: 8b324741)

Web
Version is v5.19-818-ge852fbb2 (Latest: null)
Branch is development-v6
Hash is e852fbb (Latest: e852fbb )

FTL
Version is vDev-5c97d29 (Latest: null)
Branch is development-v6
Hash is 5c97d290 (Latest: 5c97d290 )

Platform

  • OS and version: Ubuntu 24.04 LTS
  • Platform: Raspberry Pi 4 Model B Rev 1.1

Expected behavior

when privacy mode is set to anything other than Show Everything the last 4 boxes should be hidden when they contain no data.

Actual behavior / bug

when privacy mode is set to anything other than Show Everything the last 4 boxes show a loading wheel endlessly when they contain no data.

Steps to reproduce

Steps to reproduce the behavior:

  1. set privacy mode to anything other than Show Everything
  2. go to the dashboard
  3. Scroll down to the bottom of the dashboard (http://pi.hole/admin/)
  4. See boxes with loading wheels, how many depends on privacy mode selection ( as seen in screenshots )

Debug Token

Screenshots

This is when Anonymous mode & Hide domains and clients is selected

Screenshot from 2024-07-07 21-09-56

This is when Hide domains is selected

Screenshot from 2024-07-07 21-45-52

Additional context

Worth noting is an old issue that's very similar #932 the fix was #966

@mwoolweaver mwoolweaver changed the title [development-v6] Top Domains and Top Clients show a spinning wheel when privacy mode is set to Anonymous mode [development-v6] Top Domains and Top Clients do not adjust according to privacy mode selection Jul 8, 2024
@mwoolweaver
Copy link
Author

mwoolweaver commented Jul 8, 2024

it seems the graphs shouldn't be shown when empty if I'm looking at this correctly

function updateQueriesOverTime() {
$.getJSON("/api/history", function (data) {
// Remove graph if there are no results (e.g. new
// installation or privacy mode enabled)
if (jQuery.isEmptyObject(data.history)) {
$("#queries-over-time").remove();
return;
}

function updateClientsOverTime() {
$.getJSON("/api/history/clients", function (data) {
// Remove graph if there are no results (e.g. new
// installation or privacy mode enabled)
if (jQuery.isEmptyObject(data.history)) {
$("#clients").remove();
return;
}

@mwoolweaver mwoolweaver changed the title [development-v6] Top Domains and Top Clients do not adjust according to privacy mode selection [development-v6] Top Domains and Top Clients are not hidden when they contain no data Jul 8, 2024
@yubiuser
Copy link
Member

yubiuser commented Jul 8, 2024

You're correct. (This shows how many of us use anything besides "Show everything").

The fix is simple...

@yubiuser
Copy link
Member

yubiuser commented Jul 8, 2024

Please try if pihole checkout web fix/privacy is fixing the issue for you

@mwoolweaver
Copy link
Author

mwoolweaver commented Jul 8, 2024

shows an empty graph still

Screenshot from 2024-07-08 13-35-41

could this be because of

// Add note if there are no results (e.g. privacy mode enabled)
if (jQuery.isEmptyObject(data.clients)) {
clienttable.append('<tr><td colspan="3"><center>- No data -</center></td></tr>');
}

// Add note if there are no results (e.g. privacy mode enabled)
if (jQuery.isEmptyObject(data.domains)) {
domaintable.append('<tr><td colspan="3"><center>- No data -</center></td></tr>');
}

@yubiuser
Copy link
Member

yubiuser commented Jul 8, 2024

Yes. But I think it's fine to show the empty table with "No data".

@mwoolweaver
Copy link
Author

mwoolweaver commented Jul 8, 2024

I'll close this as fixed then since it is working as intended but aesthetically it would look better if hidden when empty.

@rdwebdesign
Copy link
Member

Just remember to return to the v6 branch using pihole checkout web development-v6.

@mwoolweaver
Copy link
Author

mwoolweaver commented Jul 8, 2024

yes i have switched back, thank you for the reminder.

for anyone in the future that comes across this there is a work around via uBlock Origin

add the following to your custom filters

pi.hole##div.col-lg-6:has-text(No data)

without the filter & privacy mode is Hide domains
without_uBlock

with the filter & privacy mode is Hide domains
with_uBlock

@mwoolweaver
Copy link
Author

mwoolweaver commented Jul 8, 2024

Yes. But I think it's fine to show the empty table with "No data".

@yubiuser shouldn't all empty graphs be treated the same?? the clients over time graph gets hidden when it has no data to show (e.g. when privacy mode is Hide domains and clients or Anonymous mode)

cot

see #3072 for more information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants