flotilla/src/routes/home/+page.svelte

55 lines
1.8 KiB
Svelte
Raw Normal View History

2024-08-05 21:45:16 +00:00
<script lang="ts">
import {onMount} from "svelte"
import Home from "@assets/icons/home.svg?dataurl"
2024-10-09 21:19:27 +00:00
import Icon from "@lib/components/Icon.svelte"
import Page from "@lib/components/Page.svelte"
import PageBar from "@lib/components/PageBar.svelte"
import PageContent from "@lib/components/PageContent.svelte"
import HomeInbox from "@app/components/HomeInbox.svelte"
import HomeNetwork from "@app/components/HomeNetwork.svelte"
import HomeHealthChecks from "@app/components/HomeHealthChecks.svelte"
import HomeHosting from "@app/components/HomeHosting.svelte"
2026-06-08 21:14:40 +00:00
import {goToSpace} from "@app/routes"
import {HOSTING_ENABLED} from "@app/hosting"
import {PLATFORM_RELAYS} from "@app/env"
2026-02-18 19:02:39 +00:00
const today = new Date().toLocaleDateString(undefined, {
weekday: "long",
month: "short",
day: "numeric",
})
// A single-space build has no dashboard to show - everything on it is scoped to the one space.
onMount(() => {
2026-02-18 19:02:39 +00:00
if (PLATFORM_RELAYS.length > 0) {
goToSpace(PLATFORM_RELAYS[0], {replaceState: true})
}
})
2024-08-05 21:45:16 +00:00
</script>
<Page>
<PageBar>
<div class="flex items-center justify-between gap-2">
<div class="flex items-center gap-2">
<Icon icon={Home} size={6} />
<strong>Home</strong>
</div>
<span class="hidden text-sm opacity-75 sm:inline">{today}</span>
</div>
</PageBar>
<PageContent noPad class="flex flex-col">
<div class="flex min-w-0 flex-col lg:flex-row lg:items-stretch">
<div class="flex min-w-0 flex-col bg-surface lg:flex-[2] lg:border-r lg:border-line">
<HomeInbox />
<HomeNetwork />
</div>
<div class="flex min-w-0 flex-col border-t border-line lg:w-80 lg:shrink-0 lg:border-t-0">
<HomeHealthChecks />
{#if HOSTING_ENABLED}
<HomeHosting />
{/if}
</div>
</div>
</PageContent>
</Page>