Commit Graph
66 Commits
Author SHA1 Message Date
RD WebDesign 220cfc9b19 Remove unnecessary markup from toast title
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-08-08 01:24:03 -03:00
RD WebDesign 7e05004743 Remove margin-top from the toast icon
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-08-08 01:02:48 -03:00
yubiuser d4518cfc65 Re-Implement updating toasts
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-07 22:25:15 +02:00
yubiuser 45614b5fbd Adhere to bootstrap's example and method naming
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-07 13:10:47 +02:00
yubiuser 9573b72d5a Remove code to update existing toasts. It made the code very complex and was used only in two places
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-07 09:05:54 +02:00
yubiuser f832210c2c Remove unnecessary code and make it more human readable
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-07 09:04:21 +02:00
yubiuser 9f978eb36d Replace bootstrap-notify.js by bootstrapv5-toast
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-06 20:13:15 +02: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
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
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
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 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 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 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 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
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
DL6ER d66df6fda8 Fix collapse icon selector in toggleBoxCollapse
`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>
2026-07-12 16:57:44 +02:00
yubiuser 70efb5f327 Fix copilot's suggestions
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 10:54:37 +02:00
yubiuser beab932add Fix utils.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 09:12:19 +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 032311ba7b Fix issues in utils.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-07 16:30:05 +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 d449e01b13 Allow to add an optional port to the reverse server IP
and include validation functions

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-13 22:02:08 -03:00
RD WebDesign f2a23569c0 Fix loadingOverlayTimeoutCallback() to actually remove waitMe overlay
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-13 16:54:27 -03:00
RD WebDesign 5eef250a4d Use regex flag "u" to fix errors after merging development branch
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-05-19 17:57:07 -03:00
RD WebDesignandGitHub 571768a83c Merge branch 'development' into new/simple-dhcp-static-leases2
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-05-19 17:44:36 -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
RD WebDesign e6fe47c2e9 Register event listeners on document scope to call updateLineNumbers()
Also fix 2 issues on validation functions:
- better regex for validateMAC()
- make sure validateIPv6Brackets() correctly trims the value before
  validation

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-05-06 00:09:51 -03:00
RD WebDesign bc01113163 Enforce hostname and IPv6 validation on the static DHCP table
Only accept valid hostnames:
  Previously, invalid hostnames were trigerring the cell highlighting,
  but invalid entries were still accepted when using the green "save"
  button. Now, hostnames are saved only if they pass the validation,
  like other values.

Only allow IPv6 enclosed in square brackets:
  The previous validation function used to validate IPv6 didn't accept
  brackets, resulting in errors when an IPv6 was typed directly on the
  table cell. A new function was created to validate IPv6 enclosed in
  brackets.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-24 15:10:06 -03:00
RD WebDesignandGitHub 3501ad003c Merge branch 'development' into new/simple-dhcp-static-leases
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-29 11:14:59 -03: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
RD WebDesign 356666122b Remove unused filter_dnsmasq_warnings=true option
Also remove the old code used to read hideNonfatalDnsmasqWarnings_chkbox
from localstorage. This value was a leftover from v5 web interface.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-10-27 19:50:17 -03:00
DL6ER 3489ddf284 Validate hwaddr and IP address while typing
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-07-20 20:33:35 +02:00
DL6ER 69b461ae8e Add IPv6 support for static DHCP lease management
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-07-15 20:16:30 +02:00
Adam WarnerandGitHub acc8583f43 utils: modernize hex functions (#3546) 2025-07-11 18:42:41 +01:00
XhmikosR 9c00467a6d utils: remove duplicate function and convert changeTableButtonStates to vanilla JS
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-07-01 16:38:57 +03:00
Adam WarnerandGitHub 387ad34927 settings-dns: expand custom servers box if it has custom servers (#3514) 2025-06-29 12:28:48 +02:00
XhmikosR 4ce43a304f utils: modernize hex functions
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-28 08:48:43 +03:00
XhmikosR 4ac3fd060f Drop htmlPass util since it's only used once
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-27 17:12:48 +03:00
XhmikosR 5efe33bbab Abstract collapsing box to a new util
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-21 08:49:23 +03:00
Adam WarnerandGitHub f683631afd Use proper Object methods (#3441) 2025-05-19 18:26:44 +01:00
Adam WarnerandGitHub d078d1fd09 utils: improve readability for validateIPv* functions (#3423) 2025-05-16 17:22:14 +01:00