Commit Graph

20 Commits

Author SHA1 Message Date
Mordy Ovits f1c7122b1f Fix typo in emptyTable message for DNS settings
Signed-off-by: Mordy Ovits <mordyovits@users.noreply.github.com>
2026-07-06 18:27:06 -04:00
RD WebDesign cec359a63f Do not show the table and edit buttons when the option is set via ENV VAR
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-30 00:00:30 -03:00
RD WebDesign 6b5e9dfa50 Make sure the "Add" button won't trigger the saveRecord() function
The "Add" button has the same `.saveRevServers` CSS class as the other
normal "Save" buttons. This is fine and simplifies the code, as all rows
(including the last one) use the same validation pattern and functions.

The only difference is the `addRevServer` function, used to save the new
values.

Preceding the selector with `tbody`, makes sure only the normal "Save"
buttons will use the `saveRecord()` function.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-29 20:23:32 -03:00
RD WebDesign 3dc97c6ccf Add a placeholder text to the footer cells, to show they are editable
- add a placeholder using CSS
- use a javascript to trim undesired spaces. This command also removes the
  "hidden" line break automatically added by browsers when the content of
  an editable element is cleared/deleted.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-29 20:23:15 -03: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 770a7ca8b5 Add validation to editabled table cells and simplify the table
- remove `<input>` tags and add contenteditable attribute to all
  editable cells
- rows are always enabled now (no "edit" button to enable them)
- Simplify javascript code:
  - use classNames to simplify column selection, instead of unique ids
  - use datatables "columnDefs" and "createdCell" to add attributes
  - use CSS class "editing" and CSS rules to handle buttons
- remove unused and unnecessary attributes from elements

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-13 21:50:14 -03:00
RD WebDesign 2467c748b0 Refactor the code to actually save the Conditional Forwarding data
Previously, the same function was used to initialize the table and update
the table rows, when lines were added, edited or deleted.

Now, one function initializes the table and another function saves the
changes, shows a message and updates the table to reflect the changes.

The values are "saved and applied" immediately using an AJAX call.
The waitMe overlay is also shown, but the page is NOT reloaded.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2026-06-13 17:36:06 -03: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
XhmikosR 5efe33bbab Abstract collapsing box to a new util
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-21 08:49:23 +03:00
XhmikosR 65e2917b74 settings-dns: expand custom servers box if it has custom servers
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-06-21 08:45:53 +03:00
RD WebDesign cb575a5dfb Use the same interface name used by FTL
If `dns.interface` is empty in pihole.toml we use the first interface, just like FTL.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-21 21:27:44 -03:00
XhmikosR f69df08a08 Fix deprecated ready function
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-05-15 18:17:31 +03:00
RD WebDesign 263d01a866 Use the same default interface used by FTL if none is set in pihole.toml
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-05-04 15:47:19 -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
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 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 6cad52b8d1 Set the interface name in Settings > DNS page
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-02-27 23:29:23 -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