diff --git a/playlet-web/src/lib/Screens/InfoScreen.svelte b/playlet-web/src/lib/Screens/InfoScreen.svelte index 0047a5f1..f39ee4fe 100644 --- a/playlet-web/src/lib/Screens/InfoScreen.svelte +++ b/playlet-web/src/lib/Screens/InfoScreen.svelte @@ -61,28 +61,33 @@ }, ]; - function transformValue(key, value) { + function linkFor(key, value) { switch (key) { case "app_version": case "lib_version": case "lib_version_latest": - return `${value}`; + return `https://github.com/iBicha/playlet/releases/tag/v${encodeURIComponent(value)}`; case "lib_url": - const filename = - value && - value.includes("/") && - (value.endsWith(".zip") || value.endsWith(".pkg")) - ? value.substring(value.lastIndexOf("/") + 1) - : value; - return `${filename}`; + return /^https?:\/\//.test(value) ? value : undefined; case "app_git_commit_hash": case "lib_git_commit_hash": if (value === "unknown") { - return value; + return undefined; } - return `${value}`; + return `https://github.com/iBicha/playlet/commit/${encodeURIComponent(value)}`; default: - break; + return undefined; + } + } + + function displayValue(key, value) { + if ( + key === "lib_url" && + value && + value.includes("/") && + (value.endsWith(".zip") || value.endsWith(".pkg")) + ) { + return value.substring(value.lastIndexOf("/") + 1); } return value; } @@ -268,7 +273,19 @@ ${JSON.stringify(profilesInfo, null, 2)} {#each displayNames as item}