mirror of
https://github.com/immich-app/immich.git
synced 2025-12-28 09:14:59 +03:00
34 lines
946 B
Svelte
34 lines
946 B
Svelte
<script lang="ts">
|
|
import AdminPageLayout from '$lib/components/layouts/AdminPageLayout.svelte';
|
|
import ServerStatisticsPanel from '$lib/components/server-statistics/ServerStatisticsPanel.svelte';
|
|
import { getServerStatistics } from '@immich/sdk';
|
|
import { onMount } from 'svelte';
|
|
import type { PageData } from './$types';
|
|
|
|
type Props = {
|
|
data: PageData;
|
|
};
|
|
|
|
const { data }: Props = $props();
|
|
|
|
let stats = $state(data.stats);
|
|
|
|
const updateStatistics = async () => {
|
|
stats = await getServerStatistics();
|
|
};
|
|
|
|
onMount(() => {
|
|
const interval = setInterval(() => void updateStatistics(), 5000);
|
|
|
|
return () => clearInterval(interval);
|
|
});
|
|
</script>
|
|
|
|
<AdminPageLayout title={data.meta.title}>
|
|
<section id="setting-content" class="flex place-content-center sm:mx-4">
|
|
<section class="w-full pb-28 sm:w-5/6 md:w-212.5">
|
|
<ServerStatisticsPanel {stats} />
|
|
</section>
|
|
</section>
|
|
</AdminPageLayout>
|