2022-12-09 15:51:42 -05:00
|
|
|
<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';
|
2024-02-13 17:07:37 -05:00
|
|
|
import { getServerStatistics } from '@immich/sdk';
|
2023-10-13 11:02:28 -04:00
|
|
|
import { onDestroy, onMount } from 'svelte';
|
2023-07-01 00:50:47 -04:00
|
|
|
import type { PageData } from './$types';
|
2023-02-26 20:57:34 +01:00
|
|
|
|
2024-11-14 08:43:25 -06:00
|
|
|
interface Props {
|
|
|
|
|
data: PageData;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let { data = $bindable() }: Props = $props();
|
2023-10-13 11:02:28 -04:00
|
|
|
|
2024-02-27 08:37:37 -08:00
|
|
|
let running = true;
|
2023-02-26 20:57:34 +01:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
onMount(async () => {
|
2024-02-27 08:37:37 -08:00
|
|
|
while (running) {
|
2024-02-13 17:07:37 -05:00
|
|
|
data.stats = await getServerStatistics();
|
2024-02-27 08:37:37 -08:00
|
|
|
await asyncTimeout(5000);
|
|
|
|
|
}
|
2023-07-01 00:50:47 -04:00
|
|
|
});
|
2023-02-26 20:57:34 +01:00
|
|
|
|
2023-07-01 00:50:47 -04:00
|
|
|
onDestroy(() => {
|
2024-02-27 08:37:37 -08:00
|
|
|
running = false;
|
2023-07-01 00:50:47 -04:00
|
|
|
});
|
2022-12-09 15:51:42 -05:00
|
|
|
</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>
|