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

Commit 82d87bb

Browse files
committed
fix: change daemon to node and upgrade error messages
1 parent 392dc16 commit 82d87bb

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

examples/exchange-files-in-browser/public/app.css

+8-8
Original file line numberDiff line numberDiff line change
@@ -167,35 +167,35 @@ table tbody tr:hover {
167167
margin-bottom: 1em;
168168
}
169169

170-
/* Daemon
170+
/* Node
171171
=========================================================================== */
172172

173-
.box.daemon > div {
173+
.box.node > div {
174174
display: flex;
175175
margin-bottom: 1em;
176176
}
177177

178-
.box.daemon > div:last-child {
178+
.box.node > div:last-child {
179179
margin-bottom: 0;
180180
}
181181

182-
.box.daemon > div > h3 {
182+
.box.node > div > h3 {
183183
flex: 0 0 15%;
184184
}
185185

186-
.box.daemon > div pre,
187-
.box.daemon > div > ul {
186+
.box.node > div pre,
187+
.box.node > div > ul {
188188
flex: 0 0 85%;
189189
margin: 0;
190190
}
191191

192-
.box.daemon ul {
192+
.box.node ul {
193193
margin: 0;
194194
padding: 0;
195195
list-style: none;
196196
}
197197

198-
.daemon-addresses li {
198+
.node-addresses li {
199199
margin-bottom: 0.5em;
200200
font-size: 0.7em;
201201
word-wrap: break-word;

examples/exchange-files-in-browser/public/app.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
const IPFS = require('ipfs')
44

5-
// Daemon
6-
const $daemonId = document.querySelector('.daemon-id')
7-
const $daemonAddresses = document.querySelector('.daemon-addresses')
5+
// Node
6+
const $nodeId = document.querySelector('.node-id')
7+
const $nodeAddresses = document.querySelector('.node-addresses')
88
const $logs = document.querySelector('#logs')
99
// Peers
1010
const $peers = document.querySelector('#peers')
@@ -50,7 +50,7 @@ function start () {
5050
.then((id) => {
5151
info = id
5252
updateView('ready', node)
53-
onSuccess('Daemon is ready.')
53+
onSuccess('Node is ready.')
5454
setInterval(refreshPeerList, 1000)
5555
})
5656
.catch((error) => onError(err))
@@ -110,7 +110,7 @@ function getFile () {
110110
}
111111
})
112112
})
113-
.catch((error) => onError('The inserted multihash is invalid.'))
113+
.catch((error) => onError('An error occurred when fetching the files.'))
114114
}
115115

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

184184
function refreshPeerList () {
@@ -237,8 +237,8 @@ const states = {
237237
const addressesHtml = info.addresses.map((address) => {
238238
return `<li><pre>${address}</pre></li>`
239239
}).join('')
240-
$daemonId.innerText = info.id
241-
$daemonAddresses.innerHTML = addressesHtml
240+
$nodeId.innerText = info.id
241+
$nodeAddresses.innerHTML = addressesHtml
242242
$allDisabledButtons.forEach(b => { b.disabled = false })
243243
$allDisabledInputs.forEach(b => { b.disabled = false })
244244
$allDisabledElements.forEach(el => { el.classList.remove('disabled') })

examples/exchange-files-in-browser/public/index.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
</header>
1313

1414
<main>
15-
<div class="box daemon">
16-
<h2>Daemon</h2>
15+
<div class="box node">
16+
<h2>Node</h2>
1717

1818
<div>
1919
<h3>ID</h3>
20-
<pre class="daemon-id"></pre>
20+
<pre class="node-id"></pre>
2121
</div>
2222

2323
<div>
2424
<h3>Addresses</h3>
25-
<ul class="daemon-addresses"></ul>
25+
<ul class="node-addresses"></ul>
2626
</div>
2727

2828
<div>
2929
<h3>Logs</h3>
3030
<div>
31-
<pre id="logs" class="success">Initializing daemon...</pre>
31+
<pre id="logs" class="success">Initializing node...</pre>
3232
</div>
3333
</div>
3434
</div>

0 commit comments

Comments
 (0)