Add links to the app info in web app

This commit is contained in:
Brahim Hadriche committed 2023-07-01 13:17:08 -04:00
1 parent b1d8caf5c7
commit 55fd1ba43c
2 files changed
+36 -4

No files matched your search

+4
View File
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Added
- links to the app info in web app
### Fixed
- Video duration formatting in cast dialog
+32 -4
View File
@@ -14,6 +14,26 @@
id: "App ID",
};
function transformValue(key, value) {
switch (key) {
case "version":
case "lib_version":
case "lib_version_latest":
return `<a class="link" href="https://github.com/iBicha/playlet/releases/tag/v${value}" target="_blank" rel="noopener noreferrer">${value}</a>`;
case "lib_url":
return `<a class="link" href="${value}" target="_blank" rel="noopener noreferrer">${value}</a>`;
case "git_commit_hash":
case "lib_git_commit_hash":
if (value === "unknown") {
return value;
}
return `<a class="link" href="https://github.com/iBicha/playlet/commit/${value}" target="_blank" rel="noopener noreferrer">${value}</a>`;
default:
break;
}
return value;
}
let appInfo = {};
let deviceInfo = {};
let invidiousInfo = {};
@@ -52,13 +72,21 @@ ${JSON.stringify(invidiousInfo, null, 2)}
\`\`\`
${JSON.stringify(preferencesInfo, null, 2)}
\`\`\``;
return `https://github.com/iBicha/playlet/issues/new?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`;
title = encodeURIComponent(title);
body = encodeURIComponent(body);
return `https://github.com/iBicha/playlet/issues/new?title=${title}&body=${body}`;
}
</script>
<div class={visibility ? "" : "hidden"}>
<div class="text-base text-center m-8">
Thank you for using Playlet.<br/> You have feedback? Let us know by <a class="link" href={githubUrlIssue} target="_blank" rel="noopener noreferrer">creating an issue on Github</a>.
Thank you for using Playlet.<br /> You have feedback? Let us know by
<a
class="link"
href={githubUrlIssue}
target="_blank"
rel="noopener noreferrer">creating an issue on Github</a
>.
</div>
<div class="overflow-x-auto">
<table class="table">
@@ -72,10 +100,10 @@ ${JSON.stringify(preferencesInfo, null, 2)}
{#each Object.entries(displayNames) as [key, value]}
<tr>
<td>{value}</td>
<td>{appInfo[key]}</td>
<td>{@html transformValue(key, appInfo[key])}</td>
</tr>
{/each}
</tbody>
</table>
</div>
</div>
</div>