2025-07-29 17:53:48 +00:00
|
|
|
<script lang="ts">
|
2026-09-26 06:08:41 +00:00
|
|
|
import {spec} from "@welshman/lib"
|
2025-09-10 22:26:39 +00:00
|
|
|
import CloseCircle from "@assets/icons/close-circle.svg?dataurl"
|
|
|
|
|
import Danger from "@assets/icons/danger-triangle.svg?dataurl"
|
|
|
|
|
import ClockCircle from "@assets/icons/clock-circle.svg?dataurl"
|
|
|
|
|
import CheckCircle from "@assets/icons/check-circle.svg?dataurl"
|
2025-07-29 17:53:48 +00:00
|
|
|
import Icon from "@lib/components/Icon.svelte"
|
|
|
|
|
import Button from "@lib/components/Button.svelte"
|
|
|
|
|
import LogOut from "@app/components/LogOut.svelte"
|
2026-06-08 21:14:40 +00:00
|
|
|
import {pushModal} from "@app/modal"
|
2026-07-28 16:16:26 +00:00
|
|
|
import {session} from "@app/core"
|
2026-09-26 06:08:41 +00:00
|
|
|
import {signerHealth, signerRequests} from "@app/signer"
|
2026-01-09 19:02:32 +00:00
|
|
|
import PomadeSessions from "@app/components/PomadeSessions.svelte"
|
2025-07-29 17:53:48 +00:00
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
const finished = $derived($signerRequests.filter(request => request.finishedAt))
|
|
|
|
|
const pending = $derived($signerRequests.filter(request => !request.finishedAt))
|
2026-01-06 23:30:54 +00:00
|
|
|
const success = $derived(finished.filter(spec({ok: true})))
|
2026-07-28 16:16:26 +00:00
|
|
|
const failure = $derived(finished.filter(spec({ok: false})))
|
2025-07-29 17:53:48 +00:00
|
|
|
|
|
|
|
|
const logout = () => pushModal(LogOut)
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-07-28 16:16:26 +00:00
|
|
|
{#if $session}
|
2026-06-24 20:56:53 +00:00
|
|
|
<div class="card flex flex-col gap-4">
|
2025-09-22 22:09:41 +00:00
|
|
|
<div class="flex flex-col gap-2">
|
|
|
|
|
<div class="flex items-center justify-between">
|
|
|
|
|
<span class="text-xl font-bold">Signer Status</span>
|
|
|
|
|
<span class="flex items-center gap-2">
|
2026-09-26 06:08:41 +00:00
|
|
|
{#if $signerHealth.disconnected}
|
2025-09-22 22:09:41 +00:00
|
|
|
<Icon icon={CloseCircle} class="text-error" size={4} /> Disconnected
|
2026-09-26 06:08:41 +00:00
|
|
|
{:else if $signerHealth.failing}
|
2025-09-22 22:09:41 +00:00
|
|
|
<Icon icon={Danger} class="text-warning" size={4} /> Partial Failure
|
2026-09-26 06:08:41 +00:00
|
|
|
{:else if $signerHealth.slow}
|
2025-09-22 22:09:41 +00:00
|
|
|
<Icon icon={ClockCircle} class="text-warning" size={4} /> Slow connection
|
2026-01-06 23:30:54 +00:00
|
|
|
{:else}
|
2025-09-22 22:09:41 +00:00
|
|
|
<Icon icon={CheckCircle} class="text-success" size={4} /> Ok
|
|
|
|
|
{/if}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
2026-01-22 22:23:46 +00:00
|
|
|
<div class="flex flex-col justify-between text-sm opacity-75 sm:flex-row">
|
2025-09-22 22:09:41 +00:00
|
|
|
<p>
|
|
|
|
|
Logged in with
|
2026-07-28 16:16:26 +00:00
|
|
|
{#if $session.method === "nip01"}
|
2025-09-22 22:09:41 +00:00
|
|
|
private key
|
2026-07-28 16:16:26 +00:00
|
|
|
{:else if $session.method === "nip07"}
|
2025-09-22 22:09:41 +00:00
|
|
|
browser extension
|
2026-07-28 16:16:26 +00:00
|
|
|
{:else if $session.method === "nip46"}
|
2025-09-22 22:09:41 +00:00
|
|
|
remote signer
|
2026-07-28 16:16:26 +00:00
|
|
|
{:else if $session.method === "nip55"}
|
|
|
|
|
an external signer
|
|
|
|
|
{:else if $session.method === "pomade"}
|
2026-01-12 23:21:58 +00:00
|
|
|
email and password
|
2025-09-22 22:09:41 +00:00
|
|
|
{/if}
|
|
|
|
|
</p>
|
|
|
|
|
<p>
|
2026-01-06 23:30:54 +00:00
|
|
|
{success.length} requests succeeded, {failure.length} failed, {pending.length} pending
|
2025-09-22 22:09:41 +00:00
|
|
|
</p>
|
|
|
|
|
</div>
|
2025-07-29 17:53:48 +00:00
|
|
|
</div>
|
2026-09-26 06:08:41 +00:00
|
|
|
{#if $signerHealth.disconnected}
|
2026-06-24 20:56:53 +00:00
|
|
|
<Button class="button button-error" onclick={logout}>Logout to Reconnect</Button>
|
2026-01-12 23:21:58 +00:00
|
|
|
{:else}
|
2026-01-09 19:02:32 +00:00
|
|
|
<PomadeSessions />
|
2025-09-22 22:09:41 +00:00
|
|
|
{/if}
|
2025-07-29 17:53:48 +00:00
|
|
|
</div>
|
2025-09-22 22:09:41 +00:00
|
|
|
{/if}
|