2026-09-08 22:47:51 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import Stars from "@assets/icons/stars.svg?dataurl"
|
|
|
|
|
import CheckCircle from "@assets/icons/check-circle.svg?dataurl"
|
|
|
|
|
import Stethoscope from "@assets/icons/stethoscope.svg?dataurl"
|
|
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import Badge from "@lib/components/Badge.svelte"
|
|
|
|
|
import Button from "@lib/components/Button.svelte"
|
2026-09-08 23:30:23 +00:00
|
|
|
import HomeSection from "@app/components/HomeSection.svelte"
|
2026-09-08 22:47:51 +00:00
|
|
|
import HealthCheckItem from "@app/components/HealthCheckItem.svelte"
|
|
|
|
|
import {healthChecks} from "@app/healthChecks"
|
|
|
|
|
|
|
|
|
|
const pending = $healthChecks.pending.$
|
|
|
|
|
|
|
|
|
|
const applyAll = () => {
|
|
|
|
|
for (const healthCheck of $pending) {
|
|
|
|
|
$healthChecks.apply(healthCheck)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-09-08 23:30:23 +00:00
|
|
|
<HomeSection title="Health checks" icon={Stethoscope}>
|
|
|
|
|
{#snippet action()}
|
2026-09-08 22:47:51 +00:00
|
|
|
{#if $pending.length > 0}
|
|
|
|
|
<Badge variant="warning">{$pending.length} open</Badge>
|
|
|
|
|
{/if}
|
2026-09-08 23:30:23 +00:00
|
|
|
{/snippet}
|
2026-09-08 22:47:51 +00:00
|
|
|
{#if $pending.length === 0}
|
2026-09-08 23:30:23 +00:00
|
|
|
<p class="flex items-center gap-2 px-4 pb-4 text-sm opacity-75">
|
2026-09-08 22:47:51 +00:00
|
|
|
<Icon icon={CheckCircle} size={4} />
|
|
|
|
|
Your connection to the network looks healthy.
|
|
|
|
|
</p>
|
|
|
|
|
{:else}
|
2026-09-08 23:30:23 +00:00
|
|
|
<div class="flex flex-col divide-y divide-line border-t border-line">
|
2026-09-22 17:57:47 +00:00
|
|
|
{#each $pending as healthCheck (healthCheck.id)}
|
2026-09-08 23:30:23 +00:00
|
|
|
<HealthCheckItem {healthCheck} />
|
|
|
|
|
{/each}
|
|
|
|
|
{#if $pending.length > 1}
|
|
|
|
|
<div class="flex justify-center p-3">
|
|
|
|
|
<Button class="button button-primary button-sm" onclick={applyAll}>
|
|
|
|
|
<Icon icon={Stars} size={4} />
|
|
|
|
|
Apply all recommendations
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2026-09-08 22:47:51 +00:00
|
|
|
{/if}
|
2026-09-08 23:30:23 +00:00
|
|
|
</HomeSection>
|