Skip to content

Commit

Permalink
prettier speedtest log (#95)
Browse files Browse the repository at this point in the history
* prettier log

* even prettier

* also remove leading n and trailing s
  • Loading branch information
ipitio authored Apr 14, 2024
1 parent a6373e2 commit ea66757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/pi-hole/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ $(function () {
const lastRun = data?.data;
let lastRunText = "Latest run is unavailable";
if (lastRun) {
lastRunText = `Latest run:\n\n${lastRun}`;
lastRunText = `\nLatest run:\n${lastRun.replace(/["{},]/g, "").replace(/\n\s*\n/g, "\n").replace(/^\n+|\s+$/g, "")}`;
}

const statusText = `Using ${speedtestVersion} CLI\nSchedule is ${scheduleStatusText}\nNext run is${triggerText}\n${lastRunText}`;
Expand Down Expand Up @@ -829,7 +829,7 @@ $(function () {
if (speedtestUninstall.attr("value")) {
newClass =
(didFlush && speedtestDelete.attr("value")) ||
(historyExists && !speedtestDelete.attr("value"))
(historyExists && !speedtestDelete.attr("value"))
? colorClasses[1]
: colorClasses[2];
} else if (speedtestDelete.attr("value")) {
Expand Down

0 comments on commit ea66757

Please sign in to comment.