Adding link to online gateway (#42)
parent
c5c5ab4f99
commit
ab4267acfb
7
app.js
7
app.js
|
@ -3,12 +3,17 @@ const hashString = 'Hello from IPFS Gateway Checker'
|
|||
|
||||
const $results = document.querySelector('#results')
|
||||
|
||||
function returnHtmlLink (gateway) {
|
||||
let gatewayTitle = gateway.split(hashToTest)[0]
|
||||
return '<a title="' + gatewayTitle + '" href="' + gateway + '">' + gateway + '</a>'
|
||||
}
|
||||
|
||||
function addNode (gateway, online, title) {
|
||||
const para = document.createElement('div')
|
||||
let node
|
||||
if (online) {
|
||||
node = document.createElement('strong')
|
||||
node.innerText = '✅ - Online - ' + gateway
|
||||
node.innerHTML = '✅ - Online - ' + returnHtmlLink(gateway)
|
||||
} else {
|
||||
node = document.createElement('div')
|
||||
node.innerText = '❌ - Offline - ' + gateway
|
||||
|
|
Loading…
Reference in New Issue