Commit Graph
381 Commits
Author SHA1 Message Date
DL6ER 0c3435d6df Rename validateHostnameStrict() -> validateHostname()
The name only made sense next to a non-strict counterpart, and that one is
gone. Its comment claimed to reject characters invalid in DNS names, which
underscores are not - say what the regex actually does instead.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-08-22 07:48:32 +02:00
DL6ER e92e6b837b Fix and rename validateHostname() -> validateClientPattern()
The regex was unanchored: `/[^<>;"]/` matched on the first character that was
not one of those four, so `evil<script>` passed. Output is escaped on render
anyway.

Its only caller is the client field in group management, which takes a host
name or an interface like `:eth0`. FTL matches both verbatim and only records
names of `[A-Za-z0-9._-]`, so we check exactly that.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-08-22 06:42:14 +02:00
DL6ER 5ab5b26807 Encode six hex digits per code point in hexEncode()
`hexEncode()` padded every code point to four hex digits and `hexDecode()`
chopped the string back into four-character groups. That works up to
`U+FFFF`, but code points go up to `U+10FFFF`: an emoji such as `U+1F4D2`
is encoded as the five-digit group `1f4d2`, after which the decoder is out
of step and returns garbage for the remainder of the string.

The tables carry the address/domain/client/name of each row in a
`data-address` (resp. `data-id`) attribute in this encoding, so a list
subscribed with an emoji in its address could neither be deleted nor
edited - we asked FTL to remove something that is not in the database and
it correctly answered `404`.

Widen both functions to six digits, which covers the whole Unicode range.
The encoding never leaves the page, so there is nothing to migrate.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-08-08 21:17:18 +02:00
RD WebDesign e21c6203a9 Fix revServers table after migrating to datatables v2
- remove from the table footer some elements created by datatables.
  These elements are automatically created to allow table sorting, but the
  footer here is used as an interface to add new reverser servers. We
  don't need them. Also, the elements will interfere with the placeholder
  text (added using CSS, but only to completely empty cells).
- adjust CSS `.actions` class to force right aligned text on the footer.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-08-05 22:36:07 -03:00
yubiuser ddae3ef2bf Fix xo errors after AdminLTE4 rebase
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-05 22:25:12 +02:00
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
yubiuser 8124a01a8d Fix prettier complaints
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-05 21:56:52 +02:00
RD WebDesignandGitHub 01e8530944 Fix merge conflict
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-08-02 18:27:06 -03:00
RD WebDesignandGitHub d156625334 Merge branch 'development' into new/adminLTE4
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-08-02 17:51:10 -03:00
yubiuserandGitHub af2bb6d7f5 Improve DNS upstream table (#3827) 2026-08-01 06:54:49 +02:00
yubiuser db57bf1e06 Filter table-selected upstreams from the custom upstream server input field
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-31 21:17:10 +02:00
3fb6e7ad88 Also remove empty lines
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-31 17:29:11 +02:00
RD WebDesignandGitHub 326eb0bcf4 Fix the functions used to validate CF server IPs (#3830) 2026-07-30 04:27:06 -03: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 eadba811e2 Fix the functions used to validate CF server IPs
The functions should only accept IPs with an optional port:
- IPs are valid: "a.b.c.d"
- IPs with port ("a.b.c.d#p") are allowed if the port is valid
- network ranges (CIDR) should be rejected
- empty ports ("a.b.c.d#") should be rejected
- all other strings should be rejected

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-29 18:24:34 -03:00
RD WebDesignandGitHub 6bf0fb3571 Merge branch 'development' into new/adminLTE4
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-29 16:15:24 -03:00
RD WebDesignandGitHub e127974356 Show the API error message when adding from the query log fails (#3824) 2026-07-29 16:10:21 -03:00
RD WebDesign af53bf7108 Fix typo in the validation regex (static DHCP lease table)
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-29 00:14:48 -03:00
4378690c1d Include the domain in the error message title
Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-28 23:24:59 -03:00
yubiuser 4914bf747e Simplify selector
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-28 22:14:48 +02:00
yubiuser 2691919645 Fix DNS upstream table
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-28 15:26:40 +02:00
RD WebDesignandGitHub 5027793d61 Merge branch 'development' into fix/query-log-cname-allow
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-28 00:45:15 -03:00
RD WebDesign 951acc599e Remove the old Alert Modal with and use showAlert() function
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-28 00:44:39 -03:00
DL6ER c3b3db257e Show the API error message when adding from the query log fails
Adding a domain from the query log opens a modal that, on any HTTP
error, showed a fixed "Timeout or Network Connection Error!" text. The
most common case - the domain is already on the list - is returned by
FTL as HTTP 400 with `{"error":{"hint":"The item is already present"}}`,
so it surfaced as a misleading network error.

We now read the JSON error body and show its hint (or message), falling
back to the network-error text only when there genuinely is no response
body.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-07-27 12:12:22 +02:00
RD WebDesign d81cc80f48 Fix dropdown-menu text color, when the theme is set to "default-auto"
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-18 20:09:43 -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 WebDesign bcf825e0d7 Adjust bstreeview indentation to align icons
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-18 00:39:33 -03:00
Adam Warner 72d682c284 Fix xo lint errors surfaced after rebasing onto development
This branch's code predates development's xo 2 -> 3 upgrade and hadn't been checked against its stricter ruleset. Fix the new violations: drop unnecessary globalThis prefixes on location/matchMedia, prefer location.assign() over href assignment, use early returns instead of wrapping onDropdownClose bodies in an if, fix a parameter shadow in getGroups, and use {capture: true} instead of a bare boolean for addEventListener.

Signed-off-by: Adam Warner <github@promofaux.dev>
2026-07-17 22:48:48 +01: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
RD WebDesignandAdam Warner 48d17c7eb0 Replace the old .btn-button class with Bootstrap 5 class.
This class job was basically make the element 100% wide.
We can replace it with the Bootstrap class: `w-100`, or (if the element
already has its own class) we add `width: 100%`.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:40:01 +01:00
RD WebDesignandAdam Warner 306c3feeca Tom Select adjustments and dark theme colors
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:40:01 +01:00
RD WebDesignandAdam Warner eac51c5fb9 Adjust Update Gravity page
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:40:00 +01:00
RD WebDesignandAdam Warner 3c68d2c2ea Fix the Serach Lists page
- fix the hidden output element;
- use Bootstrap 5 classes to style the output;

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:40:00 +01:00
RD WebDesignandAdam Warner f08a23b8b8 Adjusting Settings All page
- use "btn-primary" buttons (TODO: set primary color as the theme color);
- adjust font-sizes, colors, margins and paddings;
- clean up old/unnecessary CSS rules

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:40:00 +01:00
RD WebDesignandAdam Warner 1b36ff898d Fix footer layout
- add `.list-inline-item` class to the versions;
- remove unused/invalid classes;
- use bootstrap 5 classes to adjust the layout;
- only add class `w-100` when there is content.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:40:00 +01:00
RD WebDesignandAdam Warner 83dd675b12 Fix notifications created using showAlert() function
The new theme (AdminLTE 4 + Bootstrap 5) uses different z-index for some
elements. The `nav#navigation` element uses z-index=1034, which is higher
than the default inital z-index (1030) used by bootstrap-notify, resulting
in notifications partially hidden under the navigation bar.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-07-17 22:40:00 +01:00
DL6ERandAdam Warner 07c6b01d8a Fix comment indentation for editorconfig and equalise list icon columns
- The multi-line comments added in the previous UI-fix commits aligned their
  continuation lines with an odd number of leading spaces, which the
  editorconfig check rejects (it wants multiples of two). Re-indent them.
- Equalise the two single-icon columns (list status and list type) on the
  subscribed-lists table so the type column is no longer noticeably wider than
  the status one, and centre their icons.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-07-17 22:40:00 +01:00
DL6ERandAdam Warner e175737cfc Improve the group tables' bulk-select checkbox appearance
Widen the select column from 15px to 2rem so the checkbox is no longer cramped
against the column edges, centre it horizontally and vertically, and draw a
slightly larger, rounded box (dimmed until the row is selected) so the control
reads as a proper checkbox.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-07-17 22:39:59 +01:00
DL6ERandAdam Warner 4de8c48ad9 Colour the list status icons in the table to match the legend
The subscribed-lists table rendered each status icon without the coloured
`list-status-N` class the legend uses, so they showed in the default text
colour instead of green/orange/red. Add the matching class so the table icons
convey the same status colours as the legend.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-07-17 22:39:59 +01:00
DL6ERandAdam Warner 63d576b036 Fix interface tree, network row colours, chart tooltips and wide-table scrollbar
- The vendored bstreeview still emitted Bootstrap 3 collapse attributes
  (`data-toggle`/`data-target`), which Bootstrap 5 ignores, so expanding an
  interface only rotated the caret without revealing its details. Emit the
  `data-bs-*` attributes instead.
- The network overview colours each row by device activity, but Bootstrap 5
  paints the cell background over the row's `background-color`. Drop the
  now-conflicting `table-striped` and colour the row through the
  `--bs-table-bg` variable so the status colours (and the legend) apply again.
- Chart tooltips are positioned relative to their card's parent, but that
  element was not the tooltip's offset parent in the boxed layout, so tooltips
  were shifted far to the side. Make the ancestor `position: relative`.
- Keep the horizontal scrollbar visible on wide `.table-responsive` tables so
  it is clear the content scrolls rather than being cut off.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-07-17 22:39:59 +01:00
DL6ERandAdam Warner 15b11525a4 Restore form spacing and tone down more dark-theme accents
- Bootstrap 5 also removed `.form-group` (row bottom margin) and `.help-block`
  (muted helper text); both are used across the settings and query-log forms,
  so restore them. This recovers the vertical spacing that was missing between
  form rows throughout the interface.
- Dark theme: mute the active pagination link and the filled `.card-info` /
  `.card-primary` card headers (e.g. the query-log "Advanced filtering" box),
  which used Bootstrap's over-bright `#0d6efd`/`#0dcaf0` on the dark background.
  The headers are recoloured via AdminLTE 4's `--lte-card-variant-*` variables.
- Widen the reverse-DNS servers table's "Enabled" column so its header no
  longer overflows into the next column.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-07-17 22:39:59 +01:00
DL6ERandAdam Warner 61b354fd66 Restore Bootstrap 3->5 utility and spacing gaps in the AdminLTE 4 UI
The Bootstrap 3 -> 5 jump silently dropped several utilities and defaults the
templates still relied on, leaving elements mis-rendered:

- `.hidden` no longer exists in Bootstrap 5, so every element toggled via it
  (the 2FA login field, the diagnosis `warning-count` badge, the "reset
  sorting" and "enable 2FA" buttons) was permanently visible. Restore it.
- `.btn-block` was removed; restore it so the settings "Actions" and gravity
  buttons fill their grid column again instead of collapsing left-aligned.
- AdminLTE 4 resets `.card` bottom margin to 0, removing the vertical rhythm
  between stacked cards. Restore a consistent `margin-bottom`.
- `.btn-toolbar` no longer spaces its button groups; add a small gap.
- The header logo/wordmark is no longer swapped when the sidebar collapses, so
  "Pi-hole" wrapped in the narrow header. Show the compact "Ph" mark instead.
- The domain-management tab links were missing the `nav-item`/`nav-link`
  classes Bootstrap 5 requires, so they rendered as bare text.

Also tone down the over-bright `h4` heading colour (`#44def1`) in the dark
theme to the theme's own accent blue, and hide the Tom Select "none selected"
placeholder once a group is selected.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-07-17 22:39:58 +01:00
e5c71a26f0 Fix CI: editorconfig indentation and a codespell false-hit
editorconfig-checker requires comment continuation lines to be
indented in multiples of the file's indent size (4 for .lp, 2 for
.css) - several block comments added during the AdminLTE4 migration
used visual alignment under the opening delimiter instead, tripping
the check. Reflowed them to a flat, spec-compliant indent.

Also fix a spell-check false-negative turned real hit: codespell flags
"pre-selected" as a common misspelling of "preselected".

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-07-17 22:39:58 +01:00
646a3ef6ab Fix theme/layout regressions and CSP-blocked icons found in manual testing
Reviewed and built on top of a round of fixes already applied to the
working tree (boxed layout, badge alignment, sidebar treeview links,
bootstrap5-toggle's on/off->onlabel/offlabel rename, and forcing
data-bs-theme explicitly instead of leaving Bootstrap 5 to fall back to
the OS's prefers-color-scheme, plus the new scripts/js/theme.js that
locks the resolved theme so AdminLTE's own color-mode logic can't
silently override Pi-hole's own theme selection). On top of that:

- Fixed the "day theme still shows dark" gap: the anti-FOUC inline
  background style in header.lp only covered the case where the theme
  is unconditionally dark, never the "auto" theme (whose Lua-side flag
  is literally the string "auto", not "dark") - added a
  prefers-color-scheme media query fallback so the auto theme also
  avoids a white flash without needing to wait for theme.js/CSS to load.
- Fixed a strict Content-Security-Policy (img-src 'self', set by FTL's
  webserver) blocking every checkbox/radio checkmark, the modal close
  button, and the select2 dropdown arrow/clear icon: Bootstrap 5 and its
  plugins ship these as inline data: URI SVGs, which the CSP rejects
  outright. Re-hosted the exact same icons as local files under
  style/icons/ and pointed the same CSS custom properties at them.
  Learned the hard way that a url() stored in a custom property
  resolves relative to the stylesheet that *consumes* it via var(), not
  the one that declares it - the consumer here is always
  vendor/adminLTE/adminlte.min.css, so the override paths needed to
  account for that rather than being relative to pi-hole.css itself.
- Found and fixed three more leftover .box-* selectors in pi-hole.css
  that never got updated to .card-* during the earlier card-conversion
  phase: the query-types/forward-destinations pie chart flex layout,
  the domains-list filter row header, and the dynamically-generated
  settings cards' sizing/hidden-state selectors - all on pages that
  render in normal use, unlike the handful of genuinely-unreachable
  .box-solid/.box-comment selectors left alone in the theme files
  (those modifier classes are never applied by any current markup).

Verified against a live container: boxed layout now visibly constrains
and centers the page, day theme renders light content with checkmarks/
close icons/dropdown arrows all visible with zero console errors,
clicking Settings/Tools now expands the submenu instead of navigating
to the dashboard, and sidebar badges are aligned to a consistent right
edge.

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
4959620022 Fix Bootstrap 5 tab-switching: active state must live on the link itself
Found via manual verification of every page: two places set up tabs
using the Bootstrap 3 pattern of putting the "active" state on the <li>
wrapper (and, for the domains page, only in aria-expanded) rather than
on the <a>/tab-link element itself. Bootstrap 5's Tab component tracks
the active tab exclusively via the "active" class on the link, so with
neither page marking any link "active" at load, Tab.js could never find
a previous tab to deactivate - clicking a different tab just added a
second active pane on top of the first instead of replacing it.

- groups-domains.lp: the Domain/RegEx filter tabs. Added class="active"
  to the initially-selected tab's <a>, and swapped the stale Bootstrap
  3/4 "in" class for "show" on its pane (harmless leftover, but dead
  code once "active" is what actually matters). Also fixed
  groups-domains.js's addDomain(), which was reading
  aria-expanded="true" to figure out which tab is active - Bootstrap 5
  never touches that attribute for plain tabs (only aria-selected/the
  active class), so that lookup would have always resolved to the
  Domain tab even when the RegEx tab was showing, silently misfiling
  regex entries as exact-domain ones. Switched it to read the .active
  class instead.
- settings-advanced.js: the All Settings page's topic pills
  (DNS/DHCP/NTP/etc.). Same fix - add "active" to the first pill's <a>
  in both the initial-load and "only changed settings" code paths.

Verified against a live container: groups/domains now correctly shows
only one tab's content at a time and addDomain() resolves to the right
tab; settings/all now correctly switches between topic panes instead of
stacking them, confirmed via the pane class list before/after a real
click. Zero console errors.

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
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
3d5193154a Replace icheck-bootstrap checkboxes/radios with native Bootstrap 5 form-check
Convert all 35 static checkbox/radio inputs across 9 templates (queries,
search, settings-api, settings-dhcp, groups-domains, settings-dns,
settings-privacy, settings-teleporter) plus the dynamically-generated
ones (settings-advanced.js's per-setting boolean/enum controls,
settings-dns.js's DNS-upstream picker) from icheck-bootstrap's
JS-post-processed styling to Bootstrap 5's native .form-check/
.form-check-input/.form-check-label markup, which needs no JS at all.

Remove footer.js's applyCheckboxRadioStyle() (and its call sites in
settings-advanced.js/settings-dns.js) entirely - it used to strip and
re-add classes on every checkbox/radio's parent after page load, which
would have destroyed the new static .form-check classes at runtime.
Drop the icheck-bootstrap dependency, its vendor CSS and the <link> in
header.lp, and replace its now-dead pseudo-element checkbox styling in
pi-hole.css with a couple of plain .form-check-input/.form-check-label
rules for the one spot that needs a smaller checkbox size (the domain
list's filter-by-type row).

Two "no-icheck"-excluded checkboxes (a table-header select-all in both
settings-dns.lp and settings-dns.js) are left as bare native checkboxes,
matching their original deliberate exclusion.

Also confirmed pi-hole's own text-red/text-green/bg-*/etc. color utility
classes are unaffected by the AdminLTE core removal - each theme file
already defines them fully rather than only overriding an AdminLTE base,
so no fix was needed there.

Verified against a live container: settings/dns (checkbox/radio styling,
custom-servers card-collapse toggle) and settings/privacy (privacy-level
radios) render correctly with zero console errors.

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