refactor: fetch status page

This commit is contained in:
madkarmaa 2025-05-09 11:33:32 +02:00
parent 87c4bfa88b
commit ff58050f13

View File

@ -2,17 +2,15 @@
import Banner from '$components/organisms/Banner.svelte';
import Button from '$components/atoms/Button.svelte';
import api from '$api';
const statusUrl = 'https://status.revanced.app/'; // TODO: replace with env variable
</script>
{#await api.general.ping() then apiUp}
{#if !apiUp}
<Banner level="caution" permanent>
The API is currently unresponsive and some services may not work correctly.
{#if statusUrl}
Check the <Button type="text" href={statusUrl}>status page</Button> for updates.
{/if}
{#await api.general.getAbout() then data}
Check the <Button type="text" href={data.status}>status page</Button> for updates.
{/await}
</Banner>
{/if}
{/await}