Commit Graph
22 Commits
Author SHA1 Message Date
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
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
yubiuser 1c5b6b047c Fix network.js
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 09:16:03 +02: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
Adam WarnerandGitHub 8330a7b3bb Merge commit from fork
Alternative advisory fix, including the fix for the Lua function
2026-04-03 16:52:14 +01:00
RD WebDesign e82df84638 Escape hostnames and IP addresses to avoid Stored XSS on network page and
charts tooltips (dashboard page)

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-19 19:38:26 -03:00
yubiuser c02e66fe04 Fix xo errors
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-03-16 08:55:20 +01:00
RD WebDesignandGitHub b8d04230cf Fix DataTables warning message
Use `null` instead of an empty string to define columns initially empty

Fix #3471

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-19 19:46:05 -03:00
Adam WarnerandGitHub f683631afd Use proper Object methods (#3441) 2025-05-19 18:26:44 +01:00
XhmikosRandGitHub 7b6408df6e network: use textContent when we don't need HTML
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-16 21:56:48 +03:00
XhmikosR 44226e1bec Use for...of in more places
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-12 18:46:36 +03:00
XhmikosR 756239a6dd xo: enable strict mode
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 20:50:12 +03:00
XhmikosR f8a0a1d4ec Tighten xo rules
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 07:53:13 +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
XhmikosR ac24b73312 Use pretty URLs when possible
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-29 09:54:05 +02:00
DL6ER 6a6a3911f0 Merge branch 'development' into new/web_prefix
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-18 06:58:10 +01:00
XhmikosR c003548906 Remove trailing slash from void elements
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-10 22:15:01 +02:00
DL6ER 5f3bcdac3c Merge branch 'development' into new/web_prefix
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-09 20:15:59 +01:00
DL6ER 592104b839 Sort IPv4 before IPv6 addresses on the network overview
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-03-06 21:40:32 +01: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
RD WebDesign efa9d146bc Add a hidden column to allow searching by hostnames
Note: using "hide" CSS class to hide the column even if datatables decides to show it

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-02-27 22:04:18 -03: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