mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Add web interface with admin functionality (#167)
This commit is contained in:
parent
79dea504b0
commit
a779c3803c
76 changed files with 8252 additions and 87 deletions
39
web/src/routes/__layout.svelte
Normal file
39
web/src/routes/__layout.svelte
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<script lang="ts">
|
||||
import { getRequest } from '$lib/api';
|
||||
import { onDestroy } from 'svelte';
|
||||
import { fade } from 'svelte/transition';
|
||||
import '../app.css';
|
||||
import { serverEndpoint } from '../lib/constants';
|
||||
|
||||
let endpoint = serverEndpoint;
|
||||
let isServerOk = true;
|
||||
|
||||
const pingServerInterval = setInterval(async () => {
|
||||
const response = await getRequest('server-info/ping', '');
|
||||
|
||||
if (response.res === 'pong') isServerOk = true;
|
||||
if (response.statusCode === 404) isServerOk = false;
|
||||
}, 10000);
|
||||
|
||||
onDestroy(() => clearInterval(pingServerInterval));
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<slot />
|
||||
</main>
|
||||
|
||||
<footer
|
||||
class="text-sm fixed bottom-0 h-8 flex place-items-center place-content-center bg-immich-primary/10 w-screen font-mono gap-8 px-4 font-medium"
|
||||
>
|
||||
<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>
|
||||
</footer>
|
||||
Loading…
Add table
Add a link
Reference in a new issue