Skip to content

Commit

Permalink
make it double
Browse files Browse the repository at this point in the history
  • Loading branch information
ipitio committed Feb 11, 2024
1 parent b0aca36 commit ca480e6
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions scripts/pi-hole/js/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ $(function () {
.fail(function () {
const triggerText = speedtestTest.attr("value") ? " awaiting confirmation" : " unknown";
const lastRunText = "\nLatest run is unavailable";
const statusText = "Failed to get schedule\nNext run is" + triggerText + lastRunText;
const statusText = "Schedule is unavailable\nNext run is" + triggerText + lastRunText;
codeBlock(speedtestStatus, statusText, speedtestStatusBtn, "status");
});
};
Expand Down Expand Up @@ -676,7 +676,17 @@ $(function () {
speedtestLog.find("p").remove();
codeBlock(speedtestLog, log, speedtestLogBtn, "log");
} else {
codeBlock(speedtestLog, "The log is empty", speedtestLogBtn, "log");
codeBlock(
speedtestLog,
"tmux a -t pimod; cat /var/log/pihole/mod.log",
speedtestLogBtn,
"log"
);
if (speedtestLogCtr.find("p").length === 0) {

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

View workflow job for this annotation

GitHub Actions / Node

'speedtestLogCtr' is not defined.
speedtestLogCtr.append(

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

View workflow job for this annotation

GitHub Actions / Node

'speedtestLogCtr' is not defined.
`<p style="margin-top: .5vw;">Use this command to get the log while I look for it</p>`
);
}
}
})
.fail(function () {
Expand All @@ -688,7 +698,7 @@ $(function () {
);
if (speedtestLogCtr.find("p").length === 0) {

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

View workflow job for this annotation

GitHub Actions / Node

'speedtestLogCtr' is not defined.
speedtestLogCtr.append(

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

View workflow job for this annotation

GitHub Actions / Node

'speedtestLogCtr' is not defined.
`<p style="margin-top: .5vw;">Failed to get process output. Use the above command to get it.</p>`
`<p style="margin-top: .5vw;">Use this command to get the log while I look for it</p>`
);
}
});
Expand Down Expand Up @@ -886,6 +896,17 @@ $(function () {
latestLog();
}

// if speedtestLogCtr has a p element, cycle through ellipsis
const info = speedtestLogCtr.find("p");

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

View workflow job for this annotation

GitHub Actions / Node

'speedtestLogCtr' is not defined.
if (info.length > 0) {
const text = info.text();
if (text.includes("...")) {
info.text(text.replace(/\.{3}/, "."));
} else {
info.text(text + ".");
}
}

canRestore();
}, 1000);
});

0 comments on commit ca480e6

Please sign in to comment.