- use AdminLTE v4 classes to style toasts.
- simplify the javascript code a little, reducing the number of added
CSS classes.
- remove redundant classes: align-items-center, shadow and rounded
(styles already applied by the `.toast` class)
- use `toast-danger` when the toast type is "error"
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
- remove from the table footer some elements created by datatables.
These elements are automatically created to allow table sorting, but the
footer here is used as an interface to add new reverser servers. We
don't need them. Also, the elements will interfere with the placeholder
text (added using CSS, but only to completely empty cells).
- adjust CSS `.actions` class to force right aligned text on the footer.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
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>
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>
- 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>
This branch's code predates development's xo 2 -> 3 upgrade and hadn't been checked against its stricter ruleset. Fix the new violations: drop unnecessary globalThis prefixes on location/matchMedia, prefer location.assign() over href assignment, use early returns instead of wrapping onDropdownClose bodies in an if, fix a parameter shadow in getGroups, and use {capture: true} instead of a bare boolean for addEventListener.
Signed-off-by: Adam Warner <github@promofaux.dev>
- simplify function to avoid code duplication;
- remove unnecessary CSS classes from the buttons;
- set button colors using CSS variables;
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
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>
- use "btn-primary" buttons (TODO: set primary color as the theme color);
- adjust font-sizes, colors, margins and paddings;
- clean up old/unnecessary CSS rules
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
- add `.list-inline-item` class to the versions;
- remove unused/invalid classes;
- use bootstrap 5 classes to adjust the layout;
- only add class `w-100` when there is content.
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
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>
- The multi-line comments added in the previous UI-fix commits aligned their
continuation lines with an odd number of leading spaces, which the
editorconfig check rejects (it wants multiples of two). Re-indent them.
- Equalise the two single-icon columns (list status and list type) on the
subscribed-lists table so the type column is no longer noticeably wider than
the status one, and centre their icons.
Signed-off-by: DL6ER <dl6er@dl6er.de>
Widen the select column from 15px to 2rem so the checkbox is no longer cramped
against the column edges, centre it horizontally and vertically, and draw a
slightly larger, rounded box (dimmed until the row is selected) so the control
reads as a proper checkbox.
Signed-off-by: DL6ER <dl6er@dl6er.de>
The subscribed-lists table rendered each status icon without the coloured
`list-status-N` class the legend uses, so they showed in the default text
colour instead of green/orange/red. Add the matching class so the table icons
convey the same status colours as the legend.
Signed-off-by: DL6ER <dl6er@dl6er.de>