immich/web/src/routes/admin/server-status/+page.svelte

36 lines
977 B
Svelte
Raw Normal View History

<script lang="ts">
2025-05-14 11:23:57 -04:00
import AdminPageLayout from '$lib/components/layouts/AdminPageLayout.svelte';
2025-09-16 16:58:47 -04:00
import ServerStatisticsPanel from '$lib/components/server-statistics/ServerStatisticsPanel.svelte';
2025-05-14 11:23:57 -04:00
import { asyncTimeout } from '$lib/utils';
import { getServerStatistics } from '@immich/sdk';
2023-10-13 11:02:28 -04:00
import { onDestroy, onMount } from 'svelte';
import type { PageData } from './$types';
interface Props {
data: PageData;
}
let { data = $bindable() }: Props = $props();
2023-10-13 11:02:28 -04:00
let running = true;
onMount(async () => {
while (running) {
data.stats = await getServerStatistics();
await asyncTimeout(5000);
}
});
onDestroy(() => {
running = false;
});
</script>
2025-05-14 11:23:57 -04:00
<AdminPageLayout title={data.meta.title}>
2023-10-13 11:02:28 -04:00
<section id="setting-content" class="flex place-content-center sm:mx-4">
<section class="w-full pb-28 sm:w-5/6 md:w-[850px]">
2025-09-16 16:58:47 -04:00
<ServerStatisticsPanel stats={data.stats} />
2023-10-13 11:02:28 -04:00
</section>
</section>
2025-05-14 11:23:57 -04:00
</AdminPageLayout>