Ind.ie is now Small Technology Foundation.
Commit 25705775 authored by Aral Balkan's avatar Aral Balkan

Display hypercore details on the page

parent bd6ab1fd
......@@ -30,6 +30,9 @@ function to_hex(input) {
const setupForm = document.getElementById('setupForm')
const changeButton = document.getElementById('change')
const indeterminateProgressIndicator = document.getElementById('indeterminateProgressIndicator')
const generatedTextField = document.getElementById('generated')
const hypercoreContentsTextArea = document.getElementById('hypercoreContents')
const publicSigningKeyTextField = document.getElementById('publicSigningKey')
const privateSigningKeyTextArea = document.getElementById('privateSigningKey')
const publicEncryptionKeyTextField = document.getElementById('publicEncryptionKey')
......@@ -106,15 +109,27 @@ function generateKeys() {
feed.on('ready', () => {
console.log('Feed: [Ready]')
console.log(`Feed writeable? ${feed.writable}`)
generatedTextField.value = 'Yes'
if (!feed.writable) {
generatedTextField.value = 'Yes (warning: but feed is not writable)'
return
}
// Create a read stream
const stream = feed.createReadStream({live:true})
stream.on('data', x => console.log(x))
stream.on('data', (data) => {
// New data is available on the feed. Display it on the page.
for (let [key, value] of Object.entries(data)) {
hypercoreContentsTextArea.value += `${key}: ${value}\n`
}
})
//
// TEST
//
const NUMBER_TO_APPEND = 1
const NUMBER_TO_APPEND = 3
let counter = 0
Date.prototype.getUnixTime = function() { return this.getTime()/1000|0 };
......
......@@ -14,15 +14,18 @@
<fieldset>
<legend>Public details</legend>
<div>
<label for='domain'>Domain name:</label>
<input type='text' id='domain' value='ar.al' readonly>
</div>
<div>
<label for='publicSigningKey'>Hyphalink:</label>
<input type='text' id='publicSigningKey'>
</div>
<div>
</div>
<div>
<label>Passphrase:</label>
<input type='text' id='passphrase' readonly>
<div style='position: relative;'>
......@@ -38,6 +41,16 @@
</div>
</div>
<div>
<label for='generated'>Hypercore created?</label>
<input type='text' id='generated' value='No'>
</div>
<div>
<label for='hypercoreContents'>Hypercore contents</label>
<textarea id='hypercoreContents'></textarea>
</div>
<h3>Notes</h3>
<p>Your domain name and <em>hyphalink</em> are two ways for other people to find your Hypha. The difference is that your hyphalink is decentralised and resilient to censorship. If your domain registrar confiscates or blocks your domain, people will still be able to reach your Hypha as long as there is at least one replica of it on the Internet.</p>
......
......@@ -73,7 +73,11 @@ input, textarea {
}
textarea {
height: 2.5em;
height: 3em;
}
#hypercoreContents {
height: 6em;
}
footer {
......
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