Commit 41794af0 authored by Aral Balkan's avatar Aral Balkan
Browse files

Update About page to display info on instance and person

parent b04bf2ea
import Section from './Section.svelte'
import { signedIn, privateMessages } from '../state'
const baseUrl = `https://${window.location.hostname}`
const link = fragment => `${baseUrl}${fragment}`
const fetchJson = async fragment => {
const response = await fetch(link(fragment))
const json = await response.json()
return json
async function getKeys() {
return await fetchJson('/keys')
async function getHostname() {
return (await fetchJson('/hostname')).hostname
h3 {
background-color: lightsteelblue;
padding: 0.25em;
<Section path='/about' title='About'>
<p>This is the About section.</p>
<p>This is a Small Web instance running the Henry reference client. It is currently meant for use by developers.</p>
<h3>Instance details</h3>
{#await getHostname()}
<li><strong>Your hostname is:</strong> loading…</li>
{:then hostname}
<li><strong>Your hostname is:</strong> {hostname}</li>
<h3>Your details</h3>
<p>You are <strong>{$signedIn ? 'signed in' : 'not signed in'}.</strong></p>
<h4>Your public keys</h4>
{#await getKeys()}
<p>Loading keys…</p>
{:then keys}
<li><strong>Signing:</strong> {keys.signing}</li>
<li><strong>Encryption:</strong> {keys.encryption}</li>
<p>These keys are available in JSON format from the <a href={link('/keys')}>/keys</a> route.</p>
<li><a href=''>Client (Henry) source</a></li>
<li><a href=''>Server (Place) source</a></li>
<h4>Private messages:</h4>
{#each $privateMessages as message}
<li>None yet.</li>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment