Commit Graph
80 Commits
Author SHA1 Message Date
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
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 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
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
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
89e65d8d08 Migrate layout shell to AdminLTE 4 / Bootstrap 5
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>
2026-07-17 22:38:11 +01:00
DL6ER 089cdf0ceb Coerce enableTimer text with Number() for consistency
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>
2026-07-12 16:57:44 +02:00
yubiuser d335628c24 Fix remaining files
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 09:59:52 +02:00
yubiuser 7f14ef6731 Fix settings-dns.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 09:09:33 +02:00
yubiuser ea09f4b32a Disable no-global-object-property-assignment rule and revert changes made to please the rule
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 08:54:24 +02:00
yubiuser 165c4eff35 Fix groups-lists.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-07 20:21:41 +02:00
yubiuser 2bb53c2391 Fix footer.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-07 17:15:36 +02:00
yubiuser df7851b290 Don't use the globalObject in foots.js and login.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-07 17:05:04 +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 e7b0b778c9 Use a table to show and edit Reverse DNS Servers
- 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>
2026-06-13 16:54:05 -03:00
Austin GilmourandClaude Sonnet 4.6 1c621a53f8 fix: replace ES2024 regex v flag with u for WebKit compatibility (#3757)
WebKit-based browsers (Safari, DuckDuckGo on macOS) don't yet support
the ES2024 Unicode Sets `v` regex flag, causing a SyntaxError that
prevents all dashboard JavaScript from executing — stats show `---` and
charts spin indefinitely.

None of the affected patterns use v-exclusive features (set notation
`[A--B]`, `[A&&B]`), so downgrading to `u` is fully equivalent and
restores broad compatibility without any functional change.

Also updates xo.config.js to enforce `requireFlag: "u"` so the linter
stays consistent with the codebase.

Affected files (16 occurrences across 8 files):
- scripts/js/utils.js
- scripts/js/index.js
- scripts/js/footer.js
- scripts/js/groups-domains.js
- scripts/js/settings-teleporter.js
- scripts/js/gravity.js
- scripts/js/groups.js
- scripts/js/groups-clients.js
- scripts/js/groups-lists.js
- scripts/js/settings-dns-records.js
- scripts/js/network.js
- scripts/js/taillog.js

Signed-off-by: Austin Gilmour <gilmoursa@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 07:58:15 -04:00
yubiuserandRD WebDesign 68542383ea Apply suggestions from code review
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-03-16 22:06:16 +01:00
yubiuser c02e66fe04 Fix xo errors
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-03-16 08:55:20 +01:00
yubiuserandGitHub da33c9f59d Do not try to compare component version when remote version info is not available (#3729) 2026-03-08 18:25:09 +01:00
RD WebDesign 02108a0ce1 Print just one message on the fotter asking to run "pihole updatechecker"
instead of adding "Latest: N/A" per component, when at least one Pi-hole
component is missing the remote version info.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-07 18:10:07 -03:00
561f9c1ab7 Remove redundant setting of variables
Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-02-26 20:19:02 +01:00
d985829a23 Apply suggestion from @rdwebdesign
Show the link if the version matches a date based tag

Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-02-26 20:15:04 +01:00
yubiuser de2e577549 Add hint that remote version could not be checked
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-02-23 13:42:09 +01:00
yubiuser 81623fc1bf Do not try to compare component version when remote version info is not available
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-02-23 13:27:10 +01:00
yubiuser edee7b9654 Don't link to github releases if docker tag is nightly
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-02-16 12:25:46 +01:00
RD WebDesign 507fde4edf Add CPU usage percentage to the Load tooltip
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-10-06 22:34:47 -03:00
yubiuser 4f11435291 Update FTL %cpu and %mem everytime total CPU stats are updated
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-06 21:18:46 +02:00
yubiuser 078e34c96d Adjust domain count according to https://github.com/pi-hole/FTL/pull/2177
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-04 22:21:06 +02:00
XhmikosRandGitHub 87c098553d secondsTimeSpanToHMS: use modulo operator and padStart
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-28 09:05:18 +03:00
XhmikosRandGitHub aaa692dc83 footer: remove document.hidden in checkBlocking (#3518)
This is taken care of in utils.setTimer.

Fixes status not showing when opening a new tab. Previously, it was shown after the timer fired.

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-19 17:03:00 +02:00
yubiuserandGitHub b979fff4b0 Fix a few HTML validation issues (#3517) 2025-06-16 11:43:35 +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
XhmikosR 293a84439d header: don't hide advanced info since it's always shown
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-15 08:13:20 +03:00
XhmikosRandGitHub b3e8e40bda footer: use text for sysinfo-cpu
There's no HTML involved.

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-02 22:08:31 +03:00
Adam WarnerandGitHub abd4d9d3b9 settings-level-expert: hide them by default (#3487) 2025-05-30 21:35:56 +01:00
casperklein f3fd182d00 Add rel="noreferrer" to external hyperlinks
Signed-off-by: casperklein <casperklein@users.noreply.github.com>
2025-05-29 22:57:36 +02:00
XhmikosR a18629193a settings-level-expert: hide them by default
Matches the previous behavior before 8556b65

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-27 20:59:05 +03:00
RD WebDesignandGitHub f5b87509f9 Reset update-hint text every time the function is executed
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-21 16:05:14 -03:00
Adam WarnerandGitHub e2c55c6234 settings-level-expert: only toggle the expert elements (#3473) 2025-05-19 17:50:44 +01:00
XhmikosRandGitHub 3a8dbe1d28 updateFtlInfo: remove unused code
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-19 18:11:48 +03:00
XhmikosR 8556b65b2e settings-level-expert: only toggle the expert elements
Show the basic ones by default. Also, reduce jQuery usage in those functions while at it.

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-19 09:49:10 +03:00
yubiuserandGitHub 53a88352c2 footer: drop redundant addAdvancedInfo() call (#3467) 2025-05-18 20:38:01 +02:00
XhmikosRandGitHub a2908d86d8 footer: drop redundant addAdvancedInfo() call
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-18 09:58:06 +03:00
XhmikosR f389c5a0ea footer: use text() when we don't need HTML
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-17 08:27:55 +03:00
XhmikosR 756239a6dd xo: enable strict mode
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 20:50:12 +03:00