new: Show version number

This commit is contained in:
SinTan1729
2024-02-10 19:41:50 -06:00
parent 0227c5f783
commit 95a8263797
3 changed files with 26 additions and 1 deletions

View File

@@ -9,6 +9,12 @@ const getSiteUrl = async () => await fetch("/api/siteurl")
}
});
const getVersion = async () => await fetch("/api/version")
.then(res => res.text())
.then(text => {
return text;
});
const refreshData = async () => {
let reply = await fetch("/api/all").then(res => res.text());
if (reply == "logged_out") {
@@ -32,7 +38,14 @@ const refreshData = async () => {
};
const displayData = async (data) => {
let version = await getVersion();
link = document.getElementById("version-number")
link.innerText = "v" + version;
link.href = "https://github.com/SinTan1729/chhoto-url/releases/tag/" + version;
link.hidden = false;
let site = await getSiteUrl();
table_box = document.querySelector(".pure-table");
loading_text = document.getElementsByName("loading-text")[0];