Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pretty #96

Merged
merged 1 commit into from
Apr 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/pi-hole/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,10 @@
const lastRun = data?.data;
let lastRunText = "Latest run is unavailable";
if (lastRun) {
lastRunText = `\nLatest run:\n${lastRun.replace(/["{},]/g, "").replace(/\n\s*\n/g, "\n").replace(/^\n+|\s+$/g, "")}`;
lastRunText = `\nLatest run:\n${lastRun
.replace(/["{},]/g, "")

Check failure on line 612 in scripts/pi-hole/js/settings.js

View workflow job for this annotation

GitHub Actions / Node

Prefer `String#replaceAll()` over `String#replace()`.
.replace(/\n\s*\n/g, "\n")

Check failure on line 613 in scripts/pi-hole/js/settings.js

View workflow job for this annotation

GitHub Actions / Node

Prefer `String#replaceAll()` over `String#replace()`.
.replace(/^\n+|\s+$/g, "")}`;

Check failure on line 614 in scripts/pi-hole/js/settings.js

View workflow job for this annotation

GitHub Actions / Node

Prefer `String#replaceAll()` over `String#replace()`.
}

const statusText = `Using ${speedtestVersion} CLI\nSchedule is ${scheduleStatusText}\nNext run is${triggerText}\n${lastRunText}`;
Expand Down Expand Up @@ -829,7 +832,7 @@
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
Loading