pi-hole / web

Pi-hole Dashboard for stats and more
https://pi-hole.net
Other
1.98k stars 549 forks source link

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

Closed mwoolweaver closed 2 weeks ago

mwoolweaver commented 2 weeks ago

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 e852fbb2 (Latest: e852fbb2 )

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

Platform

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 commented 2 weeks ago

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

https://github.com/pi-hole/web/blob/e852fbb2f513cfdcf76505584068b5940031e066/scripts/pi-hole/js/index.js#L24-L32

https://github.com/pi-hole/web/blob/e852fbb2f513cfdcf76505584068b5940031e066/scripts/pi-hole/js/index.js#L136-L144

yubiuser commented 2 weeks ago

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

The fix is simple...

yubiuser commented 2 weeks ago

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

mwoolweaver commented 2 weeks ago

shows an empty graph still

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

could this be because of

https://github.com/pi-hole/web/blob/e852fbb2f513cfdcf76505584068b5940031e066/scripts/pi-hole/js/index.js#L295-L298

https://github.com/pi-hole/web/blob/e852fbb2f513cfdcf76505584068b5940031e066/scripts/pi-hole/js/index.js#L352-L355

yubiuser commented 2 weeks ago

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

mwoolweaver commented 2 weeks ago

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

rdwebdesign commented 2 weeks ago

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

mwoolweaver commented 2 weeks ago

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 commented 2 weeks ago

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