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

Query Log: Remember last selected "Show X entries" #764

Merged
merged 2 commits into from
Jun 3, 2018

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Jun 3, 2018

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)
  • I have Signed Off all commits. (git commit --signoff)

What does this PR aim to accomplish?:

See title and animation:

ezgif-5-22bd6de52f

How does this PR accomplish the above?:

We use the localStorage API of HTML5 to store the last configuration (number of entries to be shown, etc.) in the local storage of the client's browser. The localStorage object stores the data with no expiration date. The data will not be deleted when the browser is closed, and will be available the next day, week, or year

Different users can use the same Pi-hole with different preferred settings as their settings are stored by the user's browser locally. This information is never transferred to the server (unlike, e.g., cookie).

What documentation changes (if any) are needed to support this PR?:

None

@pi-hole pi-hole deleted a comment Jun 3, 2018
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/load-blacklist-from-network-drive-set-querylog-to-all/10030/9

@AzureMarker AzureMarker merged commit 1278e8e into devel Jun 3, 2018
@AzureMarker AzureMarker deleted the new/remember-table-entries branch June 3, 2018 16:34
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/ftl-always-show-all-in-the-query-log/2580/5

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/recent-queries-remember-number-of-entries-to-show/4220/3

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/web-interface-settings-for-the-query-log-page/6114/6

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/save-settings-in-adminpanel/34364/2

@r2ixuz
Copy link

r2ixuz commented Oct 26, 2021

This does not work with Chrome Browser. You can set the Query Log to show 100 entries, but after a couple hours of not visiting the Pi-hole web interface it is reset to its default value 10. I checked the localStorage in Chrome and it seems to be set correctly. I don't know why it gets lost...

An option in the Pi-hole web interface to set this value (or better for all possible locations where you can alter the amount of visible lines) would be really nice. Or at least set the default to 100. Only 10 entries is today really not useful if you have more than 2 DNS clients on your network.

@yubiuser
Copy link
Member

yubiuser commented Oct 27, 2021

@r2ixuz

Thanks for your report. I could verify the behavior. I guess the reason is that we don't set stateDuration which then defaults to 7200 sec (2h). I'll write a fix for that.

https://datatables.net/reference/option/stateDuration

@yubiuser
Copy link
Member

@r2ixuz

Could you try if

pihole checkout web stateDuration

fixes the issue for you? You can go back to master anytime by pihole checkout web master

@r2ixuz
Copy link

r2ixuz commented Oct 27, 2021

Thanks! I'll try it.

@r2ixuz
Copy link

r2ixuz commented Oct 27, 2021

Hmm, I am using the Docker image. This unfortunately not work there:

root@pihole:/# pihole checkout web stateDuration
Function not supported in Docker images

@yubiuser
Copy link
Member

Yes, this does not work on docker.

@r2ixuz
Copy link

r2ixuz commented Oct 28, 2021

Docker Tag fix_cached_cname_upstream_dest
Pi-hole vDev (development, v5.4-50-g8713135)
FTL vDev (fix/cached_cname_upstream_dest, vDev-9102ea9)
Web Interface vDev (devel, v5.6-75-g98ec9ee)

Seems to be working now with this version. Finally! :-)

@PromoFaux
Copy link
Member

That tag is for a specific fix in FTL, and will be deleted - so keep that in mind!

It works because that tag also pulls in the devel branch of the web interface, into which this fix has been merged.

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

Successfully merging this pull request may close these issues.

6 participants