Setting default values for each property of versions object

- set Docker versions (local/remote) to `null` if they are empty strings, undefined or null;
- set other components versions to `"N/A"` if they are empty strings, undefined or null;
- set branches and hashes to `null` if they are empty strings, undefined or null;

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign
2025-03-02 00:05:01 -03:00
parent 014b2e8338
commit 54e5b29416

View File

@@ -485,37 +485,37 @@ function updateVersionInfo() {
var versions = [
{
name: "Docker Tag",
local: version.docker.local,
remote: version.docker.remote,
local: version.docker.local || null,
remote: version.docker.remote || null,
branch: null,
hash: null,
url: "https://github.com/pi-hole/docker-pi-hole/releases",
},
{
name: "Core",
local: version.core.local.version,
remote: version.core.remote.version,
branch: version.core.local.branch,
hash: version.core.local.hash,
hash_remote: version.core.remote.hash,
local: version.core.local.version || "N/A",
remote: version.core.remote.version || "N/A",
branch: version.core.local.branch || null,
hash: version.core.local.hash || null,
hash_remote: version.core.remote.hash || null,
url: "https://github.com/pi-hole/pi-hole/releases",
},
{
name: "FTL",
local: version.ftl.local.version,
remote: version.ftl.remote.version,
branch: version.ftl.local.branch,
hash: version.ftl.local.hash,
hash_remote: version.ftl.remote.hash,
local: version.ftl.local.version || "N/A",
remote: version.ftl.remote.version || "N/A",
branch: version.ftl.local.branch || null,
hash: version.ftl.local.hash || null,
hash_remote: version.ftl.remote.hash || null,
url: "https://github.com/pi-hole/FTL/releases",
},
{
name: "Web interface",
local: version.web.local.version,
remote: version.web.remote.version,
branch: version.web.local.branch,
hash: version.web.local.hash,
hash_remote: version.web.remote.hash,
local: version.web.local.version || "N/A",
remote: version.web.remote.version || "N/A",
branch: version.web.local.branch || null,
hash: version.web.local.hash || null,
hash_remote: version.web.remote.hash || null,
url: "https://github.com/pi-hole/web/releases",
},
];