mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Support for radicle.local seeds
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
@@ -8,6 +8,10 @@
|
||||
export let session: Session | null;
|
||||
</script>
|
||||
|
||||
<Route path="/seeds/radicle.local" let:params>
|
||||
<View {config} {session} host={"0.0.0.0"}/>
|
||||
</Route>
|
||||
|
||||
<Route path="/seeds/:seed" let:params>
|
||||
<View {config} {session} host={params.seed}/>
|
||||
</Route>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Request, type Host } from '@app/api';
|
||||
import type { Config } from '@app/config';
|
||||
import * as proj from "@app/project";
|
||||
import { isDomain } from '@app/utils';
|
||||
import { isDomain, isLocal } from '@app/utils';
|
||||
import { assert } from '@app/error';
|
||||
|
||||
export class InvalidSeed {
|
||||
@@ -66,6 +66,8 @@ export class Seed {
|
||||
const meta = cfg.seeds.pinned[seed.host];
|
||||
if (meta) {
|
||||
this.emoji = meta.emoji;
|
||||
} else if (isLocal(seed.host)) {
|
||||
this.emoji = "🏠";
|
||||
} else {
|
||||
this.emoji = "🌱";
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import type { Config } from "@app/config";
|
||||
import { formatSeedId } from "@app/utils";
|
||||
import { formatSeedId, formatSeedHost } from "@app/utils";
|
||||
import { Seed } from "@app/base/seeds/Seed";
|
||||
import Loading from "@app/Loading.svelte";
|
||||
import SeedAddress from "@app/SeedAddress.svelte";
|
||||
@@ -16,6 +16,7 @@
|
||||
export let session: Session | null;
|
||||
export let host: string;
|
||||
|
||||
const hostName = formatSeedHost(host);
|
||||
let siweSession: SeedSession | null = null;
|
||||
|
||||
$: if (session?.siwe) {
|
||||
@@ -92,7 +93,7 @@
|
||||
</style>
|
||||
|
||||
<svelte:head>
|
||||
<title>{host}</title>
|
||||
<title>{hostName}</title>
|
||||
</svelte:head>
|
||||
|
||||
{#await Seed.lookup(host, config)}
|
||||
@@ -104,7 +105,7 @@
|
||||
<header>
|
||||
<span class="title">
|
||||
<span class="bold">
|
||||
{host} <span class="desktop inline">{seed.emoji}</span>
|
||||
{hostName} <span class="desktop inline">{seed.emoji}</span>
|
||||
</span>
|
||||
</span>
|
||||
<!-- User Session -->
|
||||
|
||||
Reference in New Issue
Block a user