Rework the relay detail page and edit screen

This commit is contained in:
Jon Staab
2026-03-03 10:54:14 -08:00
parent 7e577bf7ff
commit 0482c2710a
10 changed files with 520 additions and 235 deletions
+15 -1
View File
@@ -1,4 +1,5 @@
import { accounts, API_URL } from "./nostr"
import { Relay as NostrRelay, RelayManagement } from "applesauce-relay"
type NostrTag = string[]
@@ -146,7 +147,6 @@ export type UpdateRelayInput = {
subdomain: string
icon: string
description: string
plan: string
config: RelayConfig
}
@@ -245,3 +245,17 @@ export function adminDeactivateRelay(id: string) {
method: "POST",
})
}
export async function getRelayMemberCount(relayUrl: string): Promise<number | undefined> {
const signer = getActiveSigner()
const management = new RelayManagement(new NostrRelay(relayUrl), signer)
try {
const members = await management.listAllowedPubkeys()
return members.length
} catch {
// ignore and fall back to unknown member count
}
return undefined
}