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