2022-06-03 11:04:30 -05:00
|
|
|
<script context="module" lang="ts">
|
|
|
|
|
import type { Load } from '@sveltejs/kit';
|
|
|
|
|
|
|
|
|
|
export const load: Load = async ({ url }) => ({ props: { url } });
|
|
|
|
|
</script>
|
|
|
|
|
|
2022-05-21 02:23:55 -05:00
|
|
|
<script lang="ts">
|
2022-06-03 11:04:30 -05:00
|
|
|
import '../app.css';
|
|
|
|
|
|
|
|
|
|
import { fly, slide, blur } from 'svelte/transition';
|
|
|
|
|
import { quintOut } from 'svelte/easing';
|
2022-05-22 04:48:38 -05:00
|
|
|
import { getRequest } from '$lib/api';
|
|
|
|
|
import { onDestroy } from 'svelte';
|
2022-06-03 11:04:30 -05:00
|
|
|
import DownloadPanel from '$lib/components/asset-viewer/download-panel.svelte';
|
|
|
|
|
import { serverEndpoint } from '$lib/constants';
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-06-03 11:04:30 -05:00
|
|
|
export let url: string;
|
2022-05-22 04:48:38 -05:00
|
|
|
let endpoint = serverEndpoint;
|
|
|
|
|
let isServerOk = true;
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-05-22 04:48:38 -05:00
|
|
|
const pingServerInterval = setInterval(async () => {
|
|
|
|
|
const response = await getRequest('server-info/ping', '');
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-05-22 04:48:38 -05:00
|
|
|
if (response.res === 'pong') isServerOk = true;
|
2022-05-27 14:02:06 -05:00
|
|
|
else isServerOk = false;
|
2022-05-22 04:48:38 -05:00
|
|
|
}, 10000);
|
2022-05-21 02:23:55 -05:00
|
|
|
|
2022-05-22 04:48:38 -05:00
|
|
|
onDestroy(() => clearInterval(pingServerInterval));
|
2022-05-21 02:23:55 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<main>
|
2022-06-03 11:04:30 -05:00
|
|
|
{#key url}
|
|
|
|
|
<div transition:blur={{ duration: 250 }}>
|
|
|
|
|
<slot />
|
|
|
|
|
<DownloadPanel />
|
|
|
|
|
</div>
|
|
|
|
|
{/key}
|
2022-05-21 02:23:55 -05:00
|
|
|
</main>
|
|
|
|
|
|
2022-05-22 04:48:38 -05:00
|
|
|
<footer
|
2022-05-21 16:50:56 -05:00
|
|
|
class="text-sm fixed bottom-0 h-8 flex place-items-center place-content-center bg-gray-50 w-screen font-mono gap-8 px-4 font-medium"
|
2022-05-21 02:23:55 -05:00
|
|
|
>
|
|
|
|
|
<p class="">
|
|
|
|
|
Server URL <span class="text-immich-primary font-bold">{endpoint}</span>
|
|
|
|
|
</p>
|
|
|
|
|
<p class="">
|
|
|
|
|
Server Status
|
|
|
|
|
{#if isServerOk}
|
|
|
|
|
<span class="text-immich-primary font-bold">OK</span>
|
|
|
|
|
{:else}
|
|
|
|
|
<span class="text-red-500 font-bold">OFFLINE</span>
|
|
|
|
|
{/if}
|
|
|
|
|
</p>
|
2022-05-22 04:48:38 -05:00
|
|
|
</footer>
|