dashboard: add adlist filter dropdown to Top Blocked Domains#3791
dashboard: add adlist filter dropdown to Top Blocked Domains#3791sushantbhadauria wants to merge 2 commits into
Conversation
|
Please provide a screenshot for your change. Btw: tests are failing |
Allow users to filter the Top Blocked Domains table by subscription
list (adlist) directly from the dashboard.
- index.lp: add a <select id="ad-frequency-list-filter"> in the
Top Blocked Domains box header
- scripts/js/index.js:
- populateBlockedListFilter(): fetch /api/lists, populate dropdown
with enabled blocklists
- updateTopDomainsTable(): when a specific list is selected, fetch a
larger pool of top domains and filter client-side via
/api/search/<domain> to identify which adlist each domain belongs
to, then render the top 10 matches; falls back to the unfiltered
endpoint when "All lists" is selected
- wire dropdown change event to refresh the table
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Sushant Bhadauria <sushant14bhadauria@gmail.com>
- Replace .forEach() with for...of loops (unicorn/no-array-for-each) - Use Number.parseInt instead of parseInt (unicorn/prefer-number-properties) - Add required blank lines before statements (@stylistic/padding-line-between-statements) Co-authored-by: Cursor <cursoragent@cursor.com> Signed-off-by: Sushant Bhadauria <sushant14bhadauria@gmail.com>
ff9f04e to
5f013fd
Compare
|
Now the test should pass but this should go post pi-hole/FTL#2904 . Here is screenshot. |
|
Ok, I see. What is you end goal here? What benefit does the user have, if we added this selection box? The same domain could be part of multiple list, why should I care about which list it belongs to? Note: the top blocked table also contains domains that would be blocked by a blocked domain entry or a blocking regex. How do you want to handle those? |
|
Thanks for the feedback — The main goal is to help users evaluate and audit their subscription lists. When someone subscribes to 10–15 lists (ads, malware, adult content, regional lists, etc.), it's currently impossible to tell which lists are actively contributing to blocks on their network. A per-list breakdown lets them answer questions like: "Is this list doing anything useful, or can I remove it?" and "Most of my blocked traffic — is it ads or malware?" Domain in multiple lists: a domain can appear in several lists simultaneously. The current behaviour is that filtering by list A shows all domains that are in list A, even if they also appear in other lists. Regex / denylist entries: These are intentionally hidden when a specific list is selected, since they don't belong to any subscription list. They continue to appear normally under "All lists". I can add a note in the UI (e.g., a small tooltip or footnote) clarifying that the filtered view only reflects subscription list matches. |
|
The existing per-domain drill-down works well for looking up a specific domain, but it requires clicking through each entry individually and mentally tracking which list appears most. There is no way to get an aggregated view like "across all my blocked traffic today, how much came from my malware list vs. my ads list?" The dashboard dropdown answers that at a glance — without clicking through 10 domains one by one and keeping a manual tally. It is the difference between a lookup tool and a summary view. For example, a user might want to know: "Is my network seeing more malware attempts or more ad traffic?" Right now there is no way to answer that from the dashboard. You would have to open the query log, click each blocked domain, expand the row, note the list, and count manually. |
Allow users to filter the Top Blocked Domains table by subscription list (adlist) directly from the dashboard.