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

pi-hole web-ui when adding domain to blocklist via the query page it is still being displayed and the button to block the domain is still present #1202

Open
mhussaincov opened this issue Mar 31, 2020 · 5 comments
Labels

Comments

@mhussaincov
Copy link

In raising this issue, I confirm the following: {please fill the checkboxes, e.g: [X]}

How familiar are you with the the source code relevant to this issue?:

{Replace this with a number from 1 to 10. 1 being not familiar, and 10 being very familiar}
1

Expected behaviour:

after a domain is added to the blocklist the domain should not be listed any more
{A detailed description of what you expect to see}
I expect the domain to have a button that says blacklist converted to whitelist to signifie that the domain has been blacklisted or whitelisted.

Actual behaviour:
the button that states blacklist is still present below the domain
so i blacklist github.com via this url:
http://pi.hole/admin/queries.php?client=192.168.122.1
I wate a few seconds,
and refresh the page using control plus f5
the button that says blacklist is still there
it has not turned in to a button that says whitelist.
I hope this makes sence,

{A detailed description and/or screenshots of what you do see}

Steps to reproduce:

  1. log in to your pi-hole webui

go to one of your named clients where it says
top clients total
and click on one of the names of your connected clients.
3.
try to block a domain
4.
refresh the page after a few seconds.
5
you will see that the blacklist button is still present
below the domain you just tryed blacklisting,
note, the domain does get blacklisted.
it is not displayed on the web-ui.

{Detailed steps of how we can reproduce this}

Debug token provided by uploading pihole -d log:

{Alphanumeric token}

Troubleshooting undertaken, and/or other relevant information:
i'm running pi-hole on the dev-trane,
and understand that breakages are a feature of this.
updated to the very latest dev version
{Steps of what you have done to fix this}

@dschaper dschaper transferred this issue from pi-hole/pi-hole Apr 3, 2020
@github-actions
Copy link
Contributor

This issue is stale because it has been open 30 days with no activity. Please comment or update this issue or it will be closed in 5 days.

@yubiuser
Copy link
Member

I just tried it, it is still reproducible. I think the issue here is that we don't check the black/whitelist when we reload data from memory.

@rdwebdesign
Copy link
Member

I'm not sure this problem is related to records on memory holding the previous states.

I think the buttons (and background colors) are selected according to what happened when the query was made.
This table shows the historical blocking status (recorded when the query was made), not the current blocking status.

The button will never change, because the code never checks the current blocking status of each domain (it uses what is on the database).

@yubiuser
Copy link
Member

You're right. With the current implementation it will never change the button. I decides alone based on the status of the domain when it was made.

https://github.com/pi-hole/AdminLTE/blob/c2afe4221ac275a1c082e1d8e14ccbb6113b0e7b/scripts/pi-hole/js/queries.js#L123-L130

We would need to de-couple the button from the query status

@rdwebdesign
Copy link
Member

To achieve this, we would need to verify the status of every domain during the HTML table creation.

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

No branches or pull requests

3 participants