Commit Graph
29 Commits
Author SHA1 Message Date
yubiuser d4518cfc65 Re-Implement updating toasts
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-08-07 22:25:15 +02: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
DL6ER 177e1f3143 Use Number.isFinite for the CNAME TTL check
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>
2026-07-12 17:00:33 +02:00
yubiuser 70efb5f327 Fix copilot's suggestions
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 10:54:37 +02:00
yubiuser d335628c24 Fix remaining files
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-07-08 09:59:52 +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
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
yubiuserandGitHub 4c1d8f9a37 Show loading overlay when adding/removing CNAME records as it requires a FTL restart (#3742) 2026-03-19 00:08:02 +01:00
yubiuser c02e66fe04 Fix xo errors
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-03-16 08:55:20 +01:00
yubiuser 0f8279f924 Show loading overlay when adding/removing CNAME records as it requires a FTL restart
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-03-08 21:07:03 +01:00
Adam WarnerandRD WebDesign 192d96ff11 Accidentally a ;
Also fix Unnecessary use of boolean literals in conditional expression.

Co-authored-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2026-02-15 17:55:55 +00:00
RD WebDesign 2378ebad6b Use a different approach to create the delete button
- use `createElement()` to create the button
- add data-* attributes using `.dateset`

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-01-09 17:18:46 -03:00
yubiuser ac7b9845b6 Also trim CNAME input fields
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-16 22:03:25 +02:00
yubiuser d2dc2535bb Trim whitespaces before adding custom DNS record
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-16 22:00:03 +02:00
XhmikosRandGitHub 4750d61339 settings-dns-records: merge DOMContentLoaded listeners
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-27 17:02:56 +03:00
Adam WarnerandGitHub 46728f90c7 Fix deprecated ready function (#3461) 2025-05-15 18:05:44 +01:00
yubiuserandGitHub 29f4bff5ea settings-dns-records: fix typo (#3459) 2025-05-15 19:04:22 +02:00
XhmikosR f69df08a08 Fix deprecated ready function
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-15 18:17:31 +03:00
XhmikosRandGitHub b3ac3afd17 settings-dns-records: fix typo
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-15 10:38:37 +03:00
Jakob Lorenz ae8775898b scripts/js/settings-dns-records.js: fix api url base
Signed-off-by: Jakob Lorenz <onlyJak0b@mailbox.org>
2025-05-14 17:11:33 +02:00
XhmikosR 756239a6dd xo: enable strict mode
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 20:50:12 +03:00
XhmikosR f598a8e35c Manual xo fixes and suppressions
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-04-23 07:53:16 +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
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 bca58f6683 Use em instead of i and strong instead of b
They are semantically more correct

Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-03-13 13:04:43 +02: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
DL6ER 1f6ebdbea3 Accept tabs inside dns.hosts and strip possible trailing comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-02-22 11:27:07 +01: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