Part implement versions page

This commit is contained in:
Fred Boniface 2023-06-26 22:38:28 +01:00
parent fe31a8a8d1
commit 91a7d6ead3

View File

@ -3,12 +3,23 @@
import Island from '$lib/islands/island.svelte'; import Island from '$lib/islands/island.svelte';
import Loading from '$lib/navigation/loading.svelte'; import Loading from '$lib/navigation/loading.svelte';
import Nav from '$lib/navigation/nav.svelte' import Nav from '$lib/navigation/nav.svelte'
import LargeLogo from '$lib/images/large-logo.svelte'; import LargeLogo from '$lib/images/large-logo.svelte';
import { onMount } from 'svelte';
const title = "Versions" const title = "Versions"
const variable = {title:""}; const variable = {title:""};
let web_ver = "Unknown", srv_ver = "Unknown", dbm_ver = "Unknown", let data, isLoading = true;
isLoading = true;
async function getData() {
const url = 'https://owlboard.info/misc/server/versions'
const res = await fetch(url)
data = await res.json();
isLoading = false;
}
onMount(() => {
getData();
});
</script> </script>
@ -20,9 +31,9 @@
<Loading/> <Loading/>
{:else} {:else}
<Island> <Island>
<p>Web-app Version<br>{web_ver}</p> <p>Web-app Version<br>{"Not Implemented"}</p>
<p>API Server Version<br>{srv_ver}</p> <p>API Server Version<br>{data.backend}</p>
<p>DBManager Version<br>{dbm_ver}</p> <p>DBManager Version<br>{data['db-manager']}</p>
</Island> </Island>
{/if} {/if}
<Nav /> <Nav />