Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: change daemon to node and upgrade error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
fsdiogo committed May 14, 2018
1 parent da63633 commit 0f77759
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions examples/exchange-files-in-browser/public/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,35 +167,35 @@ table tbody tr:hover {
margin-bottom: 1em;
}

/* Daemon
/* Node
=========================================================================== */

.box.daemon > div {
.box.node > div {
display: flex;
margin-bottom: 1em;
}

.box.daemon > div:last-child {
.box.node > div:last-child {
margin-bottom: 0;
}

.box.daemon > div > h3 {
.box.node > div > h3 {
flex: 0 0 15%;
}

.box.daemon > div pre,
.box.daemon > div > ul {
.box.node > div pre,
.box.node > div > ul {
flex: 0 0 85%;
margin: 0;
}

.box.daemon ul {
.box.node ul {
margin: 0;
padding: 0;
list-style: none;
}

.daemon-addresses li {
.node-addresses li {
margin-bottom: 0.5em;
font-size: 0.7em;
word-wrap: break-word;
Expand Down
16 changes: 8 additions & 8 deletions examples/exchange-files-in-browser/public/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

const IPFS = require('ipfs')

// Daemon
const $daemonId = document.querySelector('.daemon-id')
const $daemonAddresses = document.querySelector('.daemon-addresses')
// Node
const $nodeId = document.querySelector('.node-id')
const $nodeAddresses = document.querySelector('.node-addresses')
const $logs = document.querySelector('#logs')
// Peers
const $peers = document.querySelector('#peers')
Expand Down Expand Up @@ -50,7 +50,7 @@ function start () {
.then((id) => {
info = id
updateView('ready', node)
onSuccess('Daemon is ready.')
onSuccess('Node is ready.')
setInterval(refreshPeerList, 1000)
})
.catch((error) => onError(err))
Expand Down Expand Up @@ -110,7 +110,7 @@ function getFile () {
}
})
})
.catch((error) => onError('The inserted multihash is invalid.'))
.catch((error) => onError('An error occurred when fetching the files.'))
}

/* Drag & Drop
Expand Down Expand Up @@ -178,7 +178,7 @@ function connectToPeer (event) {
onSuccess(`Successfully connected to peer.`)
$multiaddrInput.value = ''
})
.catch((error) => onError('The inserted multiaddr is invalid.'))
.catch((error) => onError('An error occurred when connecting to the peer.'))
}

function refreshPeerList () {
Expand Down Expand Up @@ -237,8 +237,8 @@ const states = {
const addressesHtml = info.addresses.map((address) => {
return `<li><pre>${address}</pre></li>`
}).join('')
$daemonId.innerText = info.id
$daemonAddresses.innerHTML = addressesHtml
$nodeId.innerText = info.id
$nodeAddresses.innerHTML = addressesHtml
$allDisabledButtons.forEach(b => { b.disabled = false })
$allDisabledInputs.forEach(b => { b.disabled = false })
$allDisabledElements.forEach(el => { el.classList.remove('disabled') })
Expand Down
10 changes: 5 additions & 5 deletions examples/exchange-files-in-browser/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
</header>

<main>
<div class="box daemon">
<h2>Daemon</h2>
<div class="box node">
<h2>Node</h2>

<div>
<h3>ID</h3>
<pre class="daemon-id"></pre>
<pre class="node-id"></pre>
</div>

<div>
<h3>Addresses</h3>
<ul class="daemon-addresses"></ul>
<ul class="node-addresses"></ul>
</div>

<div>
<h3>Logs</h3>
<div>
<pre id="logs" class="success">Initializing daemon...</pre>
<pre id="logs" class="success">Initializing node...</pre>
</div>
</div>
</div>
Expand Down

0 comments on commit 0f77759

Please sign in to comment.