Print just one message on the fotter asking to run "pihole updatechecker"

instead of adding "Latest: N/A" per component, when at least one Pi-hole
component is missing the remote version info.

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2026-02-27 00:40:59 -03:00
parent 561f9c1ab7
commit 0bcda1083a

View File

@@ -454,6 +454,7 @@ function updateVersionInfo() {
let updateAvailable = false;
let dockerUpdate = false;
let isDocker = false;
let versionWarning = false;
$("#versions").empty();
$("#update-hint").empty();
@@ -518,7 +519,7 @@ function updateVersionInfo() {
"</a>";
if (v.remote === null) {
// No remote version available, we cannot determine if an update is available
localVersion = v.local + " (Latest: N/A)";
versionWarning = true;
} else if (versionCompare(v.local, v.remote) === -1) {
// Update available
updateComponentAvailable = true;
@@ -538,7 +539,7 @@ function updateVersionInfo() {
if (v.name === "Docker Tag") {
if (v.remote === null) {
// No remote version available, we cannot determine if an update is available
localVersion = v.local + " (Latest: N/A)";
versionWarning = true;
} else if (versionCompare(v.local, v.remote) === -1) {
// Display update information for the docker tag
updateComponentAvailable = true;
@@ -575,6 +576,13 @@ function updateVersionInfo() {
}
}
// Display message asking to run updatechecker, to populate versions file
if (versionWarning) {
$("#versions").append(
"<p><small>The <code>versions</code> file is incomplete. Please execute <code>sudo pihole updatechecker</code> on the command line.</small></p>"
);
}
if (dockerUpdate)
$("#update-hint").html(
'To install updates, <a href="https://github.com/pi-hole/docker-pi-hole#upgrading-persistence-and-customizations" rel="noopener noreferrer" target="_blank">replace this old container with a fresh upgraded image</a>.'