Commit Graph
3042 Commits
Author SHA1 Message Date
RD WebDesignandGitHub b04eaf9778 Improve DHCP static leases interface (#3766)
Add an editable table to edit simple static DHCP leases (consisting of MAC Address, IP and hostname). 

All advanced options will still available using the text area.
2026-06-13 14:55:36 -03:00
DL6ER bb86afbec1 Don't discard unsaved table edits on programmatic textarea input
Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-06-13 17:39:06 +02:00
RD WebDesign 3e40fb9660 Use <span> tag instead of <i> for icons on List page
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-13 03:32:11 -03:00
yubiuser 705fbd9144 Update daterangepicker ranges everytime the picker is shown
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-06-03 22:12:20 +02:00
vinayandvinaykulk621 4f8b47ddc1 fix: make changes as suggested and rebase with development branch
Signed-off-by: vinaykulk621 <kulkarnivinay621@gmail.com>
2026-05-23 13:50:23 +05:30
vinayandvinaykulk621 96e3a55f77 bug: multiline comments on doughnut chart
Signed-off-by: vinaykulk621 <kulkarnivinay621@gmail.com>
2026-05-23 13:48:28 +05:30
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 a88b579abf Accept invalid values ​​and let the table highlight the errors
Now we allow invalid values on the table and highlight them.
This will allow users to find errors in data already saved on pihole.toml.

New parsing rules added - The line is also considered as "advanced" if:
  - the line contains an asterisk;
  - more than one IP is found;
  - more than one Mac Address is found;
  - more than one hostname is found.

The table also highlights invalid data onload, before a row is clicked.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-05-07 21:29:10 -03: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 62132c8565 Use a different parse function to check the line
This function tries to use a simplified version of the dnsmasq code used
to parse dhcp-host options.

Also, use the parse function when we cancel edit operation on a line

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-05-05 22:44:10 -03:00
RD WebDesign f981871d2d Use the correct tags for icons
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-29 19:57:52 -03:00
RD WebDesign f06cc5291c Add cancel button, to allow restore edited unsaved table rows
When editing a row, two new buttons will be visible: Confirm and Cancel

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-29 19:05:34 -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 WebDesign 9cdf3830d0 Fix tooltips on dynamically created buttons (Static DHCP lease table)
Dinamically created buttons were not showing bootstrap tooltips because
the event listener was created too early, before the buttons were
created (only previuosly existing buttons would show a tooltip).

Now, tooptip() function is called once, on the body element.

This attaches an event listener to the body. Every dynamically created
button will display the tooltip, without the need to call tooltip()
function. We need to manually call .tooltip("hide"), to remove tooltips
when buttons are clicked.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-24 15:09:58 -03:00
RD WebDesign b985503e6f Use CSS to show confirmation message when editing static DHCP table rows
Remove the javascript code used to add and remove "hints" and replace it
with a single CSS pseudo-element after the table, instead of one message
per line. Also, adjust LCARS message position.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-22 19:33:41 -03:00
RD WebDesign 9ec6c529fc Disable the textarea during table editing to prevent loss of unsaved data
If enabled, the textarea can be edited, which triggers a table rewrite,
resulting in the loss of all unsaved changes made to the table rows.

This commit keeps the textarea disabled until all edited rows are saved.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-22 19:33:41 -03:00
RD WebDesign 81cec5dde5 Use a different approach to update .dhcp-hosts height
- replace DOMContentLoaded listener with a function and call it when needed
- use javascript to update the CSS variable `--num-lines`
- use CSS to calculate the elements height

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-22 18:32:34 -03:00
RD WebDesign 04d76f865d Adjust DHCP "edit-hint" and action buttons
- only show save button when needed
- use fixed size and right aligned text for button column
- highlight cells only on error and remove the highlight when is fixed
- replace a few inline CSS styles with proper HTML tags
- adjust CSS on specific themes

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-22 18:30:44 -03:00
RD WebDesign 82033d0936 Group both "on click" functions for save-static-row button
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-22 16:19:11 -03:00
RD WebDesign 6d50dc552e Fix prettier complaints after merging development
Fix regex adding `v` flag and fix line breaks to respect maximum lenght

Note: these issues were not previously reported because there was a
previous merge conflict. The prettier test was executed only after the
merge conflict was resolved.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-04-22 16:17:44 -03: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 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
RD WebDesign a23462fd2c Add buttons to lines containing "advanced" settings
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-28 22:43:03 -03:00
RD WebDesignandGitHub bd173da6b7 Fix regex for hostname validation in DHCP settings
When using the `v` flag, hyphens need to be escaped inside a character class.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-26 23:02:04 -03:00
yubiuser 74f68fba89 Remove the loggingButton from Settings > System > Actions
Signed-off-by: yubiuser <github@yubiuser.dev>
2026-03-25 08:23:18 +01:00
Dominik 79c4c14a21 Merge development into new/simple-dhcp-static-leases and address review feedback
Resolve merge conflict in style/pi-hole.css (keep both StaticDHCPTable
styles and DNSSEC query log styles).

Address outstanding reviewer feedback:
- Change save button icon from floppy-disk to checkmark to clarify it
  confirms the row edit, not a final save
- Update hint text to mention "Save & Apply" is still needed
- Add hostname validation on the hostname cell (rejects spaces, commas,
  and other characters invalid in DNS names)

Signed-off-by: Dominik <dl6er@dl6er.de>
2026-03-25 07:23:10 +01:00
DominikandGitHub 5d16e2c44a fix: check on responseJSON when wrong password (#3693) 2026-03-25 06:34:14 +01:00
RD WebDesign 973900bfeb Fix sanitize_hostname() function (Lua) to escape invalid hostnames
The new function uses a single str:gsub() call with multiple replacements,
which is a lot faster than muiltiple calls with single string replacement.

Fix: https://github.com/pi-hole/web/security/advisories/GHSA-pg2q-335w-h75w

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-19 19:38:47 -03:00
RD WebDesign 4f5bdd1fae Escape output on Queries page, to avoid Stored HTML Injection
Fix: https://github.com/pi-hole/web/security/advisories/GHSA-jx8x-mj2r-62vq

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-19 19:38:36 -03:00
RD WebDesign b8c35e230f Escape values and keys on Settings All page, to avoid possible stored XSS
Fix: https://github.com/pi-hole/web/security/advisories/GHSA-9rfm-c5g6-538p

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-19 19:38:35 -03: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
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
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 eacf8cdaf4 Escape output on taillog.js to avoid Reflected XSS
Fix: https://github.com/pi-hole/web/security/advisories/GHSA-7xqw-r9pr-qv59

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-03-12 21:41:10 -03: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
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
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
Adam WarnerandGitHub d328f14371 Merge commit from fork
Use `.dataset` to avoid passing untrusted data to HTML button
2026-02-15 17:45:54 +00:00
Adam WarnerandGitHub 1a0c6f4fe6 Merge commit from fork
Escape `data.x_forwarded_for` value before inserting it into the DOM
2026-02-15 17:45:39 +00:00
Dominik fdbba6b965 Use the properties earliest_timestamp and earliest_timestamp_disk provided by FTL (on related branch) to avoid having to call the (very heavy) GET /info/database endpoint just for sourcing the earliest timestamps in the database
Signed-off-by: Dominik <dl6er@dl6er.de>
2026-02-08 10:09:07 +01:00
Guybrush aka Gabriele Labita 0b4cf3c7bb fix: check for server unreachable error.
Signed-off-by: Guybrush aka Gabriele Labita <gabriele.labita@linux.it>
2026-01-15 22:29:07 +01:00