Commit Graph
17 Commits
Author SHA1 Message Date
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 6f4186f7f2 Apply Copilit's suggestions III
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 11:49:10 +02:00
yubiuser 8cfb2230c4 Fix settings-api.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 09:17:53 +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
RD WebDesign 053cfb2180 Escape data.x_forwarded_for value before inserting it into the DOM
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-01-09 17:56:12 -03:00
DominikandGitHub cb6da5677f settings-api: fix wrong code (#3463) 2025-05-17 15:09:39 +02:00
XhmikosR c72b7b872f settings-api: fix wrong code
`ids` is an array so `id` is the value when using a for...of loop.

Also, switch to Number.isInteger since we expect the IDs to be numbers

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-16 11:19:37 +03:00
XhmikosR f69df08a08 Fix deprecated ready function
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-15 18:17:31 +03:00
XhmikosRandGitHub 612a110109 settings-api: fix deprecated keyup() function
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-01 19:59:09 +03:00
XhmikosR 756239a6dd xo: enable strict mode
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 20:50:12 +03:00
XhmikosR f598a8e35c Manual xo fixes and suppressions
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 07:53:16 +03:00
XhmikosR f8a0a1d4ec Tighten xo rules
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 07:53:13 +03:00
XhmikosR addad5495a Replace remaining i element cases with em
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-03 07:59:44 +03: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
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
yubiuser 1e922a8b29 Move all files from /scripts/pi-hole/ to /scripts/
Signed-off-by: yubiuser <github@yubiuser.dev>
2024-10-28 20:22:09 +01:00