Commit Graph
59 Commits
Author SHA1 Message Date
yubiuser d3eaf1c0f9 Revert "Fix unicorn/name-replacements errors"
This reverts commit a16a6d67e2.
2026-08-05 22:14:49 +02:00
yubiuser 2b27d3752e Fix unicorn/name-replacements errors
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-05 22:09:04 +02:00
yubiuser d330f86540 Fix xo errors
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-05 21:57:30 +02:00
RD WebDesign 6a205a2c17 Replace class d-lg-none with d-xl-none on the query log table
The previous theme used the `hidden-lg` class to hide this element on
screens larger than 1200px.

Now, we need to use `d-xl-none` to do the same.
2026-07-30 01:47:01 -03:00
RD WebDesign 9f631da088 Fix classes used to hide elements
- Replace the old `.hidden-*` classes and use the new `.d-*-none`. This
  classes apply `display: none` to the elements matching the size or above
- remove unused/unnecessary classes from pi-hole.css

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-18 01:42:12 -03:00
RD WebDesignandAdam Warner b3dc96b65e Adjust colors for Query Log buttons
- simplify function to avoid code duplication;
- remove unnecessary CSS classes from the buttons;
- set button colors using CSS variables;

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:43:26 +01:00
0153772cf5 Swap remaining jQuery plugins for Bootstrap 5-compatible versions
- DataTables: replace the combined BS3 download-builder bundles with
  the official core + Bootstrap 5 styling-adapter package pairs
  (datatables.net(-buttons/-select) + datatables.net-bs5/-buttons-bs5/
  -select-bs5), loaded core-then-adapter.
- bootstrap-select -> Tom Select: bootstrap-select has no Bootstrap 5
  build. Add utils.createGroupSelect(), a small wrapper around Tom
  Select that recreates bootstrap-select's actionsBox (Select all/
  Select none) via a couple of buttons injected into the dropdown, and
  use it for all four "assign to group(s)" multi-selects (groups,
  groups/clients, groups/domains, groups/lists). Two behavioral fixes
  were needed to match the old widget: `hideSelected: false` (Tom
  Select refuses to open its dropdown once every option is already
  selected, which made the actions box unreachable) and
  `dropdownParent: "body"` (otherwise the dropdown is clipped by the
  surrounding .table-responsive/.card ancestors' overflow, same reason
  bootstrap-select was configured with container: "body").
- bootstrap-toggle -> bootstrap5-toggle: drop-in replacement, same
  $.fn.bootstrapToggle() API and onstyle/offstyle option names (all
  call sites already used Bootstrap 5-valid color names).
- select2: bump to 4.1.0 and add the select2-bootstrap-5-theme package
  for correct Bootstrap 5 styling; wire theme: "bootstrap-5" into both
  call sites.
- Remove now-dead bootstrap-select cleanup code (the
  "$('body > .bootstrap-select.dropdown').remove()" DataTables
  drawCallback lines across 8 files) and dead icheck/bootstrap-select
  CSS in pi-hole.css.

Also fixed a Phase 1 regression surfaced by this pass: utils.js's
loadingOverlay() still targeted the old ".wrapper" class instead of
".app-wrapper", throwing whenever a settings page triggered the
Save & Apply overlay.

Verified against a live container: groups/clients' per-row Tom Select
multiselect (open dropdown, Select all/none, Apply, restore-on-cancel),
bootstrap5-toggle switches on groups, select2 filters on the query log,
and DataTables' select/export button row on groups/lists all work with
zero console errors. Settings pages' Save & Apply overlay confirmed
fixed and no longer throwing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-07-17 22:39:57 +01:00
3149820eb4 Convert box/panel markup to Bootstrap 5 cards across all pages
Convert the remaining 20 .lp templates from AdminLTE 2's .box/.panel
component family to Bootstrap 5 .card markup, matching the pattern
established in index.lp/queries.lp during the layout migration:
box/box-header/box-title/box-body/box-footer -> card equivalents,
box-info/-danger/-warning etc. -> card-info/-danger/-warning +
card-outline for the non-solid variant, collapsed-box + data-widget
-> collapsed-card + data-lte-toggle="card-collapse" with the dual
expand/collapse icon AdminLTE 4 expects. Also renames the accompanying
Bootstrap-3-isms throughout (col-xs-*, pull-left/right, input-group-addon,
data-toggle/-dismiss/-backdrop/-keyboard, label -> badge, btn-default,
BS3 modal close-button markup).

Fix the JS-side selectors that referenced the old markup and would have
silently broken once the classes changed: charts.js's tooltip anchor
lookup, footer.js's "no visible cards" redirect check, login.js's
2FA/forgot-password card color swap (plus made both boxes consistently
non-solid so the swap doesn't need to touch card-outline), and
settings-advanced.js's dynamically generated settings cards and its
manual Bootstrap 3 "in"/"active" tab-pane class toggling (Bootstrap 5
renamed .in to .show). Rewrite settings-dhcp.js's jQuery-plugin tooltip
delegation (`$("body").tooltip(...)`, `.tooltip("hide")`) as a small
lazily-instantiating delegated listener plus direct bootstrap.Tooltip
calls, since Bootstrap 5 dropped jQuery integration entirely and the
DHCP lease action buttons are added to the DOM dynamically. Restore
Bootstrap 3's .has-error/.has-warning/.has-success form-validation
color feedback in pi-hole.css, since Bootstrap 5 dropped those classes
in favor of .is-invalid/.is-valid and a couple of pages still toggle
the old class names for simple color-coded feedback.

Refresh package-lock.json for the admin-lte/bootstrap version bump from
the previous commit.

Verified against a live container: dashboard, query log (incl. the
collapsible advanced-filter card and populated DataTable), groups/lists,
groups/domains, and settings/dns all render correctly with zero console
errors; card-collapse toggling confirmed working on the query log's
filter card. Plugin-styled elements (select2/bootstrap-select dropdowns,
DataTables chrome, icheck checkboxes, bootstrap-toggle switches, nav-tabs)
still look wrong until the JS-plugin-swap phase lands, as expected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-07-17 22:38:11 +01:00
yubiuser 406e7f0992 Apply Copilot's suggestions II
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 11:16:06 +02:00
yubiuser 70efb5f327 Fix copilot's suggestions
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 10:54:37 +02:00
yubiuser e41139148e Disable 'prefer-ternary'
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-07 21:07:11 +02:00
yubiuser 5af313ae0c Fix queries.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-07 20:54:54 +02:00
yubiuser 39504966a6 Use xo --fix to fix huge load of fixable issues, revert fixes to regex for manual inspection
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-07 16:30:05 +02:00
yubiuser 705fbd9144 Update daterangepicker ranges everytime the picker is shown
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-06-03 22:12:20 +02:00
RD WebDesign 4f5bdd1fae Escape output on Queries page, to avoid Stored HTML Injection
Fix: https://github.com/pi-hole/web/security/advisories/GHSA-jx8x-mj2r-62vq

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-19 19:38:36 -03:00
Dominik fdbba6b965 Use the properties earliest_timestamp and earliest_timestamp_disk provided by FTL (on related branch) to avoid having to call the (very heavy) GET /info/database endpoint just for sourcing the earliest timestamps in the database
Signed-off-by: Dominik <dl6er@dl6er.de>
2026-02-08 10:09:07 +01:00
Rob Gill a83229096d Set the end date for live query update to end of epoch
Signed-off-by: Rob Gill <rrobgill@protonmail.com>
2025-12-04 17:31:15 +10:00
Adam Warnerandyubiuser 77b3833fa6 Use the start of day for past 7 and 30 days
No need to check for null on endofTime, it will always have a values

Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-11-19 20:06:57 +00:00
Adam Warner 1b509593c9 Treat 0.0 response as NULL. Also get the in-memory timetamp, and then use whichever of the two timestamps is smallest (and non-zero)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-11-12 23:11:53 +00:00
Adam Warner 0f76df92b9 Refactor date range initialization to fetch earliest timestamp from API and set default values
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-11-10 00:00:08 +00:00
RD WebDesign 5e3000c141 Make sure the table is redrawn after the dnssec API call returns
Without this, the icons won't show up on the initial table draw because the
asynchronous AJAX call usually only completes after that.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-10-29 18:04:49 -03:00
Adam WarnerandGitHub dcb07b761b Make DNSSEC icon conditional in Queries Log (redo of https://github.com/pi-hole/web/pull/3399/) (#3535) 2025-10-04 15:33:59 +01:00
Aaron Blankenship be3859db7f Prevents getting stuck loading unlimited query log results. Changed in Queries Log table only.
Signed-off-by: Aaron Blankenship <aaron@aaronblankenship.com>
2025-08-24 15:42:59 -05:00
yubiuser fc01fb030e Fix tests
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-12 10:04:29 +02:00
sharkboots75andyubiuser eb140af01a Make DNSSEC icon conditional in Queries Log
Avoid emitting the DNSSEC icon in Domain column if DNSSEC is not being used/tracked

Signed-off-by: sharkboots75 <sharkboots75@gmail.com>
2025-07-12 10:04:29 +02:00
XhmikosR 8529cb067c Fix a few HTML validation issues
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-16 09:32:51 +03:00
XhmikosRandGitHub 181fd7122e queries: drop non-existent elements code
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-21 10:13:04 +03:00
Adam WarnerandGitHub f683631afd Use proper Object methods (#3441) 2025-05-19 18:26:44 +01:00
Adam WarnerandGitHub ecb512a0ea queries: improve link to search page (#3422) 2025-05-15 18:00:31 +01:00
XhmikosR 408334380e Use Object methods when possible
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-12 18:46:36 +03:00
XhmikosRandGitHub f9f6969dc5 queries.js: link to CNAME if available
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-11 18:00:16 +03:00
XhmikosRandGitHub 7de8aea119 queries: replace the deprecated jQuery.parseJSON with JSON.parse
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-04 20:14:31 +03:00
XhmikosRandGitHub 7ad15ec82f queries: don't add a link to search if the domain is hidden
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-01 19:20:31 +03:00
XhmikosR 756239a6dd xo: enable strict mode
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 20:50:12 +03:00
XhmikosR f8a0a1d4ec Tighten xo rules
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 07:53:13 +03:00
yubiuser 7487abd385 Allow free input in upstream filter
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-04-21 14:40:30 +02:00
DL6ER b524a2f4b6 Always use document.body.dataset.apiurl instead of the intermediate const apiUrl
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-31 22:00:16 +02:00
Adam WarnerandGitHub a73e95e17d Query Log: Add QUERY_EXTERNAL_BLOCKED_EDE15 rules (#3347) 2025-03-29 10:52:29 +00:00
Adam WarnerandGitHub 51fc14a4db Set an upper limit on the number of rows returned for the query log (#3346) 2025-03-29 10:34:08 +00:00
XhmikosRandGitHub 85ac52adfe Queries: escape querystatus.fieldtext
Even though right now the API doesn't include any HTML code, it's a better practice to be defensive here.

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-27 16:41:22 +02:00
XhmikosRandGitHub e8e60880ba Queries: use fieldText directly
It no longer includes raw HTML, so it should be fine to use it directly

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-27 15:32:44 +02:00
DL6ER d43fcd7658 Query Log is missing a rule for colorization of QUERY_EXTERNAL_BLOCKED_EDE15
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-27 11:58:19 +01:00
Adam Warner 572dcbf110 Remove "All" option from query log, max to 1000 (add in an additional step between 100 and 1000)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-03-26 21:35:52 +00:00
XhmikosR bd693fad80 Queries: fix potential DOM text reinterpreted as HTML issue
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-23 18:32:09 +02:00
DL6ER 5f3bcdac3c Merge branch 'development' into new/web_prefix
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-09 20:15:59 +01:00
DL6ER a7f1ca7800 Allow path prefix multiplexing the dashboard and API. See https://github.com/pi-hole/FTL/pull/2319 for further details
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-02 20:20:10 +01:00
RD WebDesign f6168a4d03 Use margin-right instead of spaces after dnssec icon in Query Log
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-03-01 01:19:01 -03:00
yubiuser 002c39ef78 Save the state of the query log table infinitely
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-02-23 14:28:38 +01:00
DL6ER 64c191fd32 Modify status text if a reply was received for clarify
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-30 17:50:50 +01:00
DL6ER c56578b578 Use new dnssec.color instead of the removed dnssecClass variable
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-01-21 19:36:53 +01:00