- 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>
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>
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>
- 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>
- 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>
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>
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>
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>
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>
- 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>
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>
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>
Swap vendored AdminLTE 2.4.18 + Bootstrap 3.4.1 for AdminLTE 4.1.0 +
Bootstrap 5.3.8 (AdminLTE's dist CSS now bundles Bootstrap, so the
separate Bootstrap stylesheet is dropped; only its JS bundle remains).
Rewrite the page shell (header, header_authenticated, sidebar, footer)
to AdminLTE 4's app-wrapper/app-header/app-sidebar/app-main/app-content
structure and nav-sidebar/nav-treeview markup, and convert the dashboard
(index.lp) box/small-box markup to Bootstrap 5 cards as the first fully
migrated page.
Verified against a live container: fixed a chart.js tooltip lookup that
still targeted the old .box selector, restored the header logo mini/full
swap and sidebar user-panel collapse behavior that AdminLTE 2 used to
provide for free, and resolved a duplicate id="navigation" collision
with AdminLTE 4's own accessibility skip-link script.
Every other page still uses the old box/Bootstrap-3-grid/BS3-plugin
markup and will render incorrectly until the remaining migration phases
land.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
FTL's DoT/DoH client work (pi-hole/FTL#2940) pins tls:// and https://
URIs onto the well-known resolver list, but the picker only rendered
checkboxes for the plain addresses.
- Plain / DoT / DoH tabs, one checkbox per address family per tab
- DoT/DoH tabs omit vendors with no pinned URI for that protocol,
instead of showing empty rows
- keeps the table narrow as more protocols (DoQ, DoH3, ...) get added
- each tab shows a label with how many upstreams are selected there,
positioned top-right with a tooltip, per rdwebdesign's review
comments
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Adam Warner <github@promofaux.dev>
Resolves the `// TODO Fix eslint` left on the TTL validation. `ttlVal` is
always a number (`NaN` or a `Math.trunc` result), so `Number.isFinite` is
equivalent to the global `isFinite` here while satisfying
`unicorn/prefer-number-properties`, letting us drop the accompanying
`eslint-disable-next-line`.
Signed-off-by: DL6ER <dl6er@dl6er.de>
The startup timer setup used `Math.trunc(enaT.text())` while `countDown()`
uses `Math.trunc(Number(enaT.text()))`. Both work (the stored value is a
clean millisecond timestamp), but wrap the value in `Number()` here too so
the two call sites read the `#enableTimer` text identically.
Signed-off-by: DL6ER <dl6er@dl6er.de>
`unicorn/prefer-scoped-selector` (new in xo 3) requires `:scope` in
combined element queries, so the selector was changed to
`:scope > .btn-box-tool > i`. The child combinator `>` after `:scope` is
wrong though: the box markup nests the tool button as
`.box > .box-header > .box-tools > button.btn-box-tool`, so a direct-child
query matched nothing and the collapse/expand chevron never toggled on
`#forgot-pw-box` (login) and `#custom-servers-box` (settings/dns). Use the
descendant combinator `:scope .btn-box-tool > i`, which the rule's own
suggestion inserts and which correctly resolves the icon in the header.
Signed-off-by: DL6ER <dl6er@dl6er.de>
The "Add" button has the same `.saveRevServers` CSS class as the other
normal "Save" buttons. This is fine and simplifies the code, as all rows
(including the last one) use the same validation pattern and functions.
The only difference is the `addRevServer` function, used to save the new
values.
Preceding the selector with `tbody`, makes sure only the normal "Save"
buttons will use the `saveRecord()` function.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
- add a placeholder using CSS
- use a javascript to trim undesired spaces. This command also removes the
"hidden" line break automatically added by browsers when the content of
an editable element is cleared/deleted.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
- remove `<input>` tags and add contenteditable attribute to all
editable cells
- rows are always enabled now (no "edit" button to enable them)
- Simplify javascript code:
- use classNames to simplify column selection, instead of unique ids
- use datatables "columnDefs" and "createdCell" to add attributes
- use CSS class "editing" and CSS rules to handle buttons
- remove unused and unnecessary attributes from elements
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
Previously, the same function was used to initialize the table and update
the table rows, when lines were added, edited or deleted.
Now, one function initializes the table and another function saves the
changes, shows a message and updates the table to reflect the changes.
The values are "saved and applied" immediately using an AJAX call.
The waitMe overlay is also shown, but the page is NOT reloaded.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
- add functions and buttons to add, modify, undo changes and delete lines
- generate the table using data already on the textarea
- add functions to read textarea contents and parse then into an array
- add functions to update the textarea contents from the table
- hide the textarea. Only the table will be visible
- make sure the table is not shown when the option was set by ENV VARS
- move some help paragraphs to the table legend
- remove usused original help text for the textarea
- use fixed size for all action buttons
- don't use "icheck" styling on the checkboxes in the table
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>