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

Update About page to display info on instance and person

parent b04bf2ea
<script>
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
}
</script>
<style>
h3 {
background-color: lightsteelblue;
padding: 0.25em;
}
</style>
<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>
<ul>
{#await getHostname()}
<li><strong>Your hostname is:</strong> loading…</li>
{:then hostname}
<li><strong>Your hostname is:</strong> {hostname}</li>
{/await}
</ul>
<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}
<ul>
<li><strong>Signing:</strong> {keys.signing}</li>
<li><strong>Encryption:</strong> {keys.encryption}</li>
</ul>
{/await}
<p>These keys are available in JSON format from the <a href={link('/keys')}>/keys</a> route.</p>
<h3>Source</h3>
<ul>
<li><a href='https://source.small-tech.org/small-web/henry'>Client (Henry) source</a></li>
<li><a href='https://github.com/small-tech/place'>Server (Place) source</a></li>
</ul>
<h3>Logs</h3>
<h4>Private messages:</h4>
<ul>
{#each $privateMessages as message}
<li>{message.data}</li>
{:else}
<li>None yet.</li>
{/each}
</ul>
</Section>
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