pi-hole / web

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

Update the charts if the number of queries has increased significantly #3058

Closed DL6ER closed 4 weeks ago

DL6ER commented 1 month ago

What does this implement/fix?

This PR addresses the issue mentioned in https://github.com/pi-hole/FTL/pull/1977#issuecomment-2191035021


Related issue or feature (if applicable): https://github.com/pi-hole/FTL/pull/1977

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

yubiuser commented 1 month ago

Good idea - but it's not working for me right now. After the queries are imported the count of 'Total queries' jumps up from 0 to a few thousand but no charts are updated. After a while the top lists are updated/populated but the 'overTime' graphs are not (or I did not wait long enough)

DL6ER commented 1 month ago

The update should work immediately so not having waited long enough isn't an option. I looked again at the logic and you description of

the count of 'Total queries' jumps up from 0 to a few thousand

translates into

if (0 < 1000 && 1000 > 100) {
  // update the charts
}

should definitely have fired. Either this is a caching issue with the JS file or - I'm afraid - I have to ask you to do some debugging on this when time allows.

yubiuser commented 1 month ago

Ok, you have probably be right with the caching issue. I tried with a fresh cache on FF and Chrome and it worked better - but now I get a constant re-drawing. I think we miss an exit of the loop somewhere.

Peek 2024-06-28 21-16