2024-01-01 18:40:02 +01:00
|
|
|
<svelte:options runes={true} />
|
|
|
|
|
2024-01-01 07:07:55 +01:00
|
|
|
<script lang="ts">
|
2024-01-02 02:10:18 +01:00
|
|
|
import ServiceCard from '$lib/components/ServiceCard.svelte';
|
2024-01-01 20:10:19 +01:00
|
|
|
import type { Service } from '$lib/types/data-types';
|
2024-01-01 07:07:55 +01:00
|
|
|
|
2024-01-02 02:10:18 +01:00
|
|
|
let services: readonly Service[] = $state.frozen([]);
|
|
|
|
|
|
|
|
let icons: readonly string[] = $state.frozen([]);
|
|
|
|
|
|
|
|
async function get(url: string): Promise<any> {
|
|
|
|
let res = await fetch(url)
|
|
|
|
if (res.ok) {
|
|
|
|
let data = await res.json()
|
|
|
|
return data
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
return Promise.reject()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
get("/data/services").then((data: Service[]) => {
|
|
|
|
services = data
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
$effect(() => {
|
|
|
|
get("/assets/icons").then((data: string[]) => {
|
|
|
|
icons = data
|
|
|
|
})
|
|
|
|
})
|
2024-01-01 07:07:55 +01:00
|
|
|
</script>
|
|
|
|
|
2024-01-01 19:36:42 +01:00
|
|
|
<svelte:head>
|
2024-01-01 20:00:35 +01:00
|
|
|
<title>Services</title>
|
|
|
|
<meta name="description" content="Overview of Services running on neshweb.net" />
|
2024-01-01 19:36:42 +01:00
|
|
|
</svelte:head>
|
|
|
|
|
2024-01-01 20:00:35 +01:00
|
|
|
<div class="flex h-full flex-row flex-wrap justify-center gap-10 overflow-auto p-8">
|
|
|
|
{#each services as service}
|
2024-01-02 02:11:23 +01:00
|
|
|
<ServiceCard {service} {icons} />
|
2024-01-01 20:00:35 +01:00
|
|
|
{/each}
|
|
|
|
</div>
|