diff --git a/api_speedtest.php b/api_speedtest.php index eec772c06..71fab7a07 100644 --- a/api_speedtest.php +++ b/api_speedtest.php @@ -18,7 +18,7 @@ $setupVars = parse_ini_file('/etc/pihole/setupVars.conf'); $cmdLog = '[[ -f /tmp/pimod.log ]] && cat /tmp/pimod.log || { [[ -f /var/log/pihole/mod.log ]] && cat /var/log/pihole/mod.log || echo ""; }'; -$cmdServers = 'speedtest -h | grep -q official && sudo speedtest -L || speedtest --list'; +$cmdServers = 'speedtest -h | grep -q official && sudo speedtest -L || speedtest --secure --list'; $cmdRun = '[[ -f /tmp/speedtest.log ]] && cat /tmp/speedtest.log || { [[ -f /etc/pihole/speedtest.log ]] && cat /etc/pihole/speedtest.log || echo ""; }'; $cmdServersCurl = "curl 'https://c.speedtest.net/speedtest-servers-static.php' --compressed -H 'Upgrade-Insecure-Requests: 1' -H 'DNT: 1' -H 'Sec-GPC: 1'"; $cmdServersJSON = "curl 'https://www.speedtest.net/api/js/servers' --compressed -H 'Upgrade-Insecure-Requests: 1' -H 'DNT: 1' -H 'Sec-GPC: 1'"; diff --git a/scripts/pi-hole/js/speedtest.js b/scripts/pi-hole/js/speedtest.js index e79b520b0..5e65b8a17 100644 --- a/scripts/pi-hole/js/speedtest.js +++ b/scripts/pi-hole/js/speedtest.js @@ -135,8 +135,7 @@ function formatDate(itemdate, results) { } const first = moment(results.at(0).start_time, "YYYY-MM-DD HH:mm:ssZ"); - const last = moment(results.at(-1).start_time, "YYYY-MM-DD HH:mm:ssZ"); - if (last.diff(first, "hours") > 24) { + if (moment.utc().diff(first, "hours") > 24) { output = "Do HH:mm"; }