mirror of
https://github.com/pi-hole/web.git
synced 2025-12-20 10:48:26 +00:00
Fix update logic for custom branches by comparing hashes
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -474,6 +474,7 @@ function updateVersionInfo() {
|
|||||||
remote: version.core.remote.version,
|
remote: version.core.remote.version,
|
||||||
branch: version.core.local.branch,
|
branch: version.core.local.branch,
|
||||||
hash: version.core.local.hash,
|
hash: version.core.local.hash,
|
||||||
|
hash_remote: version.core.remote.hash,
|
||||||
url: "https://github.com/pi-hole/pi-hole/releases",
|
url: "https://github.com/pi-hole/pi-hole/releases",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -482,6 +483,7 @@ function updateVersionInfo() {
|
|||||||
remote: version.ftl.remote.version,
|
remote: version.ftl.remote.version,
|
||||||
branch: version.ftl.local.branch,
|
branch: version.ftl.local.branch,
|
||||||
hash: version.ftl.local.hash,
|
hash: version.ftl.local.hash,
|
||||||
|
hash_remote: version.ftl.remote.hash,
|
||||||
url: "https://github.com/pi-hole/FTL/releases",
|
url: "https://github.com/pi-hole/FTL/releases",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -490,6 +492,7 @@ function updateVersionInfo() {
|
|||||||
remote: version.web.remote.version,
|
remote: version.web.remote.version,
|
||||||
branch: version.web.local.branch,
|
branch: version.web.local.branch,
|
||||||
hash: version.web.local.hash,
|
hash: version.web.local.hash,
|
||||||
|
hash_remote: version.web.remote.hash,
|
||||||
url: "https://github.com/pi-hole/web/releases",
|
url: "https://github.com/pi-hole/web/releases",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -508,23 +511,38 @@ function updateVersionInfo() {
|
|||||||
'" rel="noopener" target="_blank">' +
|
'" rel="noopener" target="_blank">' +
|
||||||
localVersion +
|
localVersion +
|
||||||
"</a>";
|
"</a>";
|
||||||
} else localVersion = "vDev (" + v.branch + ", " + v.hash + ")";
|
if (versionCompare(v.local, v.remote) === -1) {
|
||||||
|
// Update available
|
||||||
if (versionCompare(v.local, v.remote) === -1) {
|
$("#versions").append(
|
||||||
if (v.name === "Docker Tag") dockerUpdate = true;
|
"<li><strong>" +
|
||||||
else updateAvailable = true;
|
v.name +
|
||||||
$("#versions").append(
|
"</strong> " +
|
||||||
"<li><strong>" +
|
localVersion +
|
||||||
v.name +
|
'· <a class="lookatme" lookatme-text="Update available!" href="' +
|
||||||
"</strong> " +
|
v.url +
|
||||||
localVersion +
|
'" rel="noopener" target="_blank">Update available!</a></li>'
|
||||||
'· <a class="lookatme" lookatme-text="Update available!" href="' +
|
);
|
||||||
v.url +
|
} else {
|
||||||
'" rel="noopener" target="_blank">Update available!</a></li>'
|
$("#versions").append("<li><strong>" + v.name + "</strong> " + localVersion + "</li>");
|
||||||
);
|
}
|
||||||
} else {
|
} else {
|
||||||
$("#versions").append("<li><strong>" + v.name + "</strong> " + localVersion + "</li>");
|
// non-master branch
|
||||||
}
|
localVersion = "vDev (" + v.branch + ", " + v.hash + ")";
|
||||||
|
if (v.hash != v.hash_remote) {
|
||||||
|
// hash differ > Update available
|
||||||
|
$("#versions").append(
|
||||||
|
"<li><strong>" +
|
||||||
|
v.name +
|
||||||
|
"</strong> " +
|
||||||
|
localVersion +
|
||||||
|
'· <a class="lookatme" lookatme-text="Update available!" href="' +
|
||||||
|
v.url +
|
||||||
|
'" rel="noopener" target="_blank">Update available!</a></li>'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$("#versions").append("<li><strong>" + v.name + "</strong> " + localVersion + "</li>");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user