mirror of
https://github.com/ProjectSegfault/website.git
synced 2024-12-29 00:11:13 +05:30
adjust to new api
This commit is contained in:
parent
5a76748208
commit
5ab0e2ecdc
@ -2,5 +2,8 @@ import type { PageServerLoad } from "./$types";
|
|||||||
import { env } from "$env/dynamic/private";
|
import { env } from "$env/dynamic/private";
|
||||||
|
|
||||||
export const load: PageServerLoad = async () => {
|
export const load: PageServerLoad = async () => {
|
||||||
return await fetch(env.VITE_API_URL + "/api/v1/status").then((res) => res.json());
|
return {
|
||||||
|
state: await fetch(env.VITE_API_URL + "/api/v1/state/status").then((res) => res.json()),
|
||||||
|
instances: await fetch(env.VITE_API_URL + "/api/v1/status").then((res) => res.json())
|
||||||
|
}
|
||||||
}
|
}
|
@ -13,10 +13,12 @@
|
|||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<h1>Our instances</h1>
|
<h1>Our instances</h1>
|
||||||
|
|
||||||
|
{#if data.state.enabled}
|
||||||
<div class="flex flex-col gap-4">
|
<div class="flex flex-col gap-4">
|
||||||
<CardOuter>
|
<CardOuter>
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
{#each data.status as group}
|
{#each data.instances.status as group}
|
||||||
<h2>{group.name}</h2>
|
<h2>{group.name}</h2>
|
||||||
<div class="items">
|
<div class="items">
|
||||||
{#each group.data as item}
|
{#each group.data as item}
|
||||||
@ -44,7 +46,7 @@
|
|||||||
</CardOuter>
|
</CardOuter>
|
||||||
|
|
||||||
<span>Last updated: {dayjs
|
<span>Last updated: {dayjs
|
||||||
.unix(data.updated)
|
.unix(data.instances.updated)
|
||||||
.format("DD/MM/YYYY HH:mm:ss")}
|
.format("DD/MM/YYYY HH:mm:ss")}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -62,3 +64,9 @@
|
|||||||
gap: 2rem;
|
gap: 2rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
{:else}
|
||||||
|
<div class="flex items-center gap-1 mt-16">
|
||||||
|
<div class="i-fa6-solid:circle-info" />
|
||||||
|
<span>Instances are currently disabled.</span>
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
Loading…
Reference in New Issue
Block a user