Add link to seed node from registration page

Signed-off-by: Sebastian Martinez <sebastinez@me.com>
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
Sebastian Martinez
2022-02-06 21:32:36 +01:00
committed by Alexis Sellier
parent 4b1e192b1f
commit 75ccac422e
2 changed files with 14 additions and 6 deletions
+13 -6
View File
@@ -10,6 +10,7 @@
editable: boolean;
error?: string;
example?: string;
url?: string;
}
const validationExamples: Record<string, string> = {
@@ -41,12 +42,12 @@
</script>
<script lang="ts">
import { link } from "svelte-routing";
import { createEventDispatcher } from 'svelte';
import { marked } from 'marked';
import { capitalize, isUrl, isAddress, formatSeedId } from '@app/utils';
import Address from '@app/Address.svelte';
import type { Config } from '@app/config';
import Icon from "@app/Icon.svelte";
export let fields: Field[];
export let editable = false;
@@ -113,6 +114,11 @@
margin: 0;
white-space: nowrap;
}
.ellipsis {
width: 28rem;
overflow: hidden;
text-overflow: ellipsis;
}
.description {
padding-left: 1rem;
@@ -178,12 +184,9 @@
<span class="field">
{#if field.value}
{#if isUrl(field.value)}
<span class="desktop">
<span class="ellipsis">
<a class="link" href="{field.value}" target="_blank">{field.value}</a>
</span>
<span class="mobile" title={field.value}>
<Icon name="url" />
</span>
{:else if isAddress(field.value)}
<div class="desktop">
<Address resolve={field.resolve ?? false} address={field.value} {config} />
@@ -191,7 +194,11 @@
<div class="mobile">
<Address compact resolve={field.resolve ?? false} address={field.value} {config} />
</div>
{:else if (field.label === "Seed ID")}
{:else if (field.url)}
<div>
<a class="link" use:link href="{field.url}">{field.value}</a>
</div>
{:else if (field.validate === "id")}
<div class="mobile">
{formatSeedId(field.value)}
</div>
+1
View File
@@ -79,6 +79,7 @@
description: "The GitHub username associated with this name.",
value: r.profile.github, editable: true },
{ name: "seed.host", label: "Seed Host", validate: "domain", placeholder: "seed.acme.org",
url: r.profile.seed && `/seeds/${r.profile.seed.host}`,
description: "The seed host address. " +
"Only domain names with TLS are supported. " +
`HTTP(S) API requests use port ${config.seed.api.port}.`,