2020-03-31 11:50:13 +02:00
|
|
|
<script>
|
2020-04-23 15:37:08 +02:00
|
|
|
import { store } from "builderStore";
|
2020-04-02 15:16:46 +02:00
|
|
|
import AppList from "components/start/AppList.svelte"
|
2020-03-31 11:50:13 +02:00
|
|
|
import { onMount } from "svelte"
|
2020-04-02 15:16:46 +02:00
|
|
|
import IconButton from "components/common/IconButton.svelte"
|
|
|
|
import Spinner from "components/common/Spinner.svelte"
|
2020-03-31 11:50:13 +02:00
|
|
|
|
|
|
|
let promise = getApps()
|
|
|
|
|
|
|
|
async function getApps() {
|
2020-04-23 15:37:08 +02:00
|
|
|
const res = await fetch(`/api/${$store.clientId}/applications`)
|
2020-03-31 11:50:13 +02:00
|
|
|
const json = await res.json()
|
|
|
|
|
|
|
|
if (res.ok) {
|
|
|
|
return json
|
|
|
|
} else {
|
|
|
|
throw new Error(json)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<main>
|
|
|
|
{#await promise}
|
|
|
|
<div class="spinner-container">
|
|
|
|
<Spinner />
|
|
|
|
</div>
|
|
|
|
{:then result}
|
|
|
|
<AppList apps={result} />
|
|
|
|
{:catch err}
|
|
|
|
<h1 style="color:red">{err}</h1>
|
|
|
|
{/await}
|
|
|
|
</main>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
main {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
font-family: "Roboto", Helvetica, Arial, sans-serif;
|
|
|
|
}
|
|
|
|
|
|
|
|
.spinner-container {
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
</style>
|