Commit Graph

2878 Commits

Author SHA1 Message Date
Adam Warner
e2d711f547 Request ANSI colour codes when calling gravity API
Add the 'color=true' query parameter to the gravity API call so that the
FTL backend will include ANSI escape codes for terminal color output.

This works in conjunction with FTL changes that make color codes opt-in
rather than always-on.

Addresses: pi-hole/FTL#2671
2025-11-19 21:28:47 +00:00
Adam Warner
77b3833fa6 Use the start of day for past 7 and 30 days
No need to check for null on endofTime, it will always have a values

Co-authored-by: yubiuser <github@yubiuser.dev>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-11-19 20:06:57 +00:00
Adam Warner
1b509593c9 Treat 0.0 response as NULL. Also get the in-memory timetamp, and then use whichever of the two timestamps is smallest (and non-zero)
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-11-12 23:11:53 +00:00
Adam Warner
0f76df92b9 Refactor date range initialization to fetch earliest timestamp from API and set default values
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-11-10 00:00:08 +00:00
RD WebDesign
5e3000c141 Make sure the table is redrawn after the dnssec API call returns
Without this, the icons won't show up on the initial table draw because the
asynchronous AJAX call usually only completes after that.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-10-29 18:04:49 -03:00
RD WebDesign
356666122b Remove unused filter_dnsmasq_warnings=true option
Also remove the old code used to read hideNonfatalDnsmasqWarnings_chkbox
from localstorage. This value was a leftover from v5 web interface.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-10-27 19:50:17 -03:00
Adam Warner
4159aaade6 Merge commit from fork
HTML escape adlist URL and non-domain entried before printing it in gravity stream
2025-10-25 10:08:44 +01:00
RD WebDesign
8c0f785351 Replace mg.request_info.request_uri with the variable scriptname
The information from `mg.request_info.request_uri` depends on the URL typed
by the user. This information was used without any sanitization, allowing
an attacker to send crafted links containing anything, including javascript
code, which could be loaded and executed in a few pages.

Replacing this value with `scriptname` variable fixes the issue, since this
variable contains the name of the file currently being executed. This
information cannot be externally manipulated and it is safe to be used on
the page.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-10-19 18:44:52 -03:00
yubiuser
febc2b870a Escape all lines to also prevent XSS for non-domain entries
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-12 15:44:23 +02:00
RD WebDesign
507fde4edf Add CPU usage percentage to the Load tooltip
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-10-06 22:34:47 -03:00
yubiuser
4f11435291 Update FTL %cpu and %mem everytime total CPU stats are updated
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-06 21:18:46 +02:00
Dominik
5ecfcf3f19 Adjust domain count according to pi-hole/FTL#2177 (#3619) 2025-10-05 09:55:38 +02:00
Adam Warner
4b5697c7be Fix addList function to include type in API request URL
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2025-10-04 22:35:27 +01:00
yubiuser
078e34c96d Adjust domain count according to https://github.com/pi-hole/FTL/pull/2177
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-10-04 22:21:06 +02:00
Adam Warner
dcb07b761b Make DNSSEC icon conditional in Queries Log (redo of https://github.com/pi-hole/web/pull/3399/) (#3535) 2025-10-04 15:33:59 +01:00
yubiuser
94e8e909b7 Improve line graph tooltip (#3601) 2025-10-04 08:58:29 +02:00
RD WebDesign
c6a2e8572e Trigger the offset effect when the mouse is over a legend item
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-09-19 17:11:10 -03:00
RD WebDesign
ec5f8b7037 Add offset effect on hover to the doughnut charts
We need to add a small padding to avoid "clipping" the arc/slice.
This happens because when an arc/slice expands, it grows beyond the canvas
limits and get clipped.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-09-19 17:04:48 -03:00
RD WebDesign
ca57bcfb5c Include the upstream DNS server name to the link, when needed
The link must send the "upstream" parameter in exactly the same format used
by the "suggestions" API.
The format is: "upstream=<IP>#<port> (<servername>)".
This will ensure that when a link is clicked, the correct server name will
be highlighted in the SELECT element on the queries.lp page and no other
OPTION element will be created.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-09-16 16:47:03 -03:00
RD WebDesign
af471bec94 Show the upstream server IP on the title tooltip
Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-09-15 23:03:26 -03:00
RD WebDesign
48666e1ffd Use an array to store upstream server IPs
This will avoid overwritting the IP when more than one upstream DNS server uses the same name

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-09-15 22:34:06 -03:00
RD WebDesign
52441b7b1b Remove unnecessary code
The outer `if` (line 92) already guarantees only 2 possible values.
If `isQueryTypeChart` is false, `isForwardDestinationChart` must be true.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
2025-09-15 22:11:44 -03:00
yubiuser
2c1876879d Fix calculation of tootlip percentage
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-09-10 11:12:04 +02:00
yubiuser
66eb947718 Only display items in queryOverTimeChart tooltips with at least 1 query
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-09-10 11:12:04 +02:00
yubiuser
9dc305c2b5 Show tooltip of bar graphs below x-axis
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-09-10 11:11:52 +02:00
Aaron Blankenship
be3859db7f Prevents getting stuck loading unlimited query log results. Changed in Queries Log table only.
Signed-off-by: Aaron Blankenship <aaron@aaronblankenship.com>
2025-08-24 15:42:59 -05:00
yubiuser
035a2861bf Use /flush/network instead of /flush/arp (#3553) 2025-08-14 21:13:41 +02:00
yubiuser
55e8e4a328 Use \u001B instead of (hidden) ESC character
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-19 21:53:45 +02:00
yubiuser
b4af886192 HTML escape adlist URL before printing it in gravity stream
Co-authored-by: DL6ER <dl6er@dl6er.de>
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-19 21:53:45 +02:00
Dominik
f518450115 Bind address to new element instead of raw HTML construction (#3567) 2025-07-17 07:25:44 +02: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
DL6ER
e137dd0a0f Bind address to new element instead of raw HTML construction
Signed-off-by: DL6ER <dl6er@dl6er.de>
2025-07-16 16:19:46 +02:00
Dominik
6023387c7d Use innerHTML instead of append to fix gravity color output (#3566) 2025-07-16 09:57:58 +02:00
yubiuser
1c753f7cc6 Use innerHTML instead of append to fix gravity color output
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-16 09:03:23 +02:00
yubiuser
1fd924fcff Use label-primary for number of enabled list icon on sidebar
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-13 16:21:18 +02:00
yubiuser
fc01fb030e Fix tests
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-12 10:04:29 +02:00
sharkboots75
eb140af01a Make DNSSEC icon conditional in Queries Log
Avoid emitting the DNSSEC icon in Domain column if DNSSEC is not being used/tracked

Signed-off-by: sharkboots75 <sharkboots75@gmail.com>
2025-07-12 10:04:29 +02:00
yubiuser
41cdc9728c Show pointer only for clickable items
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-12 09:20:05 +02:00
yubiuser
a89fdda77e Only underline clickable legend items in pie charts
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-07-12 09:10:34 +02:00
Adam Warner
353ba2f163 charts.js: refactor to reduce complexity, improve readability and per… (#3542) 2025-07-11 23:09:54 +01:00
Adam Warner
b90361cf41 interfaces: switch to vanilla JS and refactor code to reduce complexi… (#3544) 2025-07-11 18:51:00 +01:00
Adam Warner
014ce38f87 gravity: convert to vanilla JS and refactor code (#3545) 2025-07-11 18:48:19 +01:00
Adam Warner
acc8583f43 utils: modernize hex functions (#3546) 2025-07-11 18:42:41 +01:00
Adam Warner
7207a5c20e utils: remove duplicate function and convert changeTableButtonStates to vanilla JS (#3547) 2025-07-11 18:34:12 +01:00
Adam Warner
0091f74294 taillog: convert to vanilla JS and improve things (#3550) 2025-07-11 18:28:00 +01:00
Adam Warner
e1001d6035 secondsTimeSpanToHMS: use modulo operator and padStart (#3548) 2025-07-11 18:17:58 +01:00
Adam Warner
412c15be4c Update xo to v1.1.1 (#3485) 2025-07-11 17:14:58 +01:00
XhmikosR
9c00467a6d utils: remove duplicate function and convert changeTableButtonStates to vanilla JS
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
2025-07-01 16:38:57 +03:00
yubiuser
16fee67983 Use /flush/network instead of /flush/arp
Signed-off-by: yubiuser <github@yubiuser.dev>
2025-06-30 13:47:11 +02:00