add ipns
parent
a43044f5bf
commit
d6fc309d29
11
index.html
11
index.html
|
@ -17,8 +17,15 @@
|
|||
<!-- IPFS Hash -->
|
||||
<p>
|
||||
IPFS Hash :
|
||||
<input type="text" name="hash" id="input">
|
||||
<button onclick="start();">Submit</button>
|
||||
<input type="text" name="ipfs_hash" id="input_ipfs">
|
||||
<button onclick="start_ipfs();">Submit</button>
|
||||
</p>
|
||||
|
||||
<!-- IPNS Hash -->
|
||||
<p>
|
||||
IPNS Hash :
|
||||
<input type="text" name="ipns_hash" id="input_ipns">
|
||||
<button onclick="start_ipns();">Submit</button>
|
||||
</p>
|
||||
|
||||
<h3 id="stats"></h3>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
var hashToTest = "";
|
||||
var protocol = "";
|
||||
const $results = document.querySelector('#results');
|
||||
|
||||
function returnHtmlLink(gateway) {
|
||||
|
@ -29,6 +30,7 @@ function checkGateways(gateways) {
|
|||
const total = gateways.length;
|
||||
let checked = 0;
|
||||
gateways.forEach((gateway) => {
|
||||
gateway = gateway.replace('/ipfs/', protocol);
|
||||
const gatewayAndHash = gateway.replace(':hash', hashToTest);
|
||||
// opt-out from gateway redirects done by browser extension
|
||||
const testUrl = gatewayAndHash + '#x-ipfs-companion-no-redirect';
|
||||
|
@ -48,13 +50,28 @@ function checkGateways(gateways) {
|
|||
});
|
||||
}
|
||||
|
||||
function start() {
|
||||
function start_ipfs() {
|
||||
|
||||
while ($results.lastChild) {
|
||||
$results.removeChild($results.lastChild);
|
||||
}
|
||||
|
||||
hashToTest = document.querySelector("#input").value;
|
||||
hashToTest = document.querySelector("#input_ipfs").value;
|
||||
protocol = "/ipfs/";
|
||||
|
||||
fetch('./json/gateways.json')
|
||||
.then(res => res.json())
|
||||
.then(gateways => checkGateways(gateways));
|
||||
}
|
||||
|
||||
function start_ipns() {
|
||||
|
||||
while ($results.lastChild) {
|
||||
$results.removeChild($results.lastChild);
|
||||
}
|
||||
|
||||
hashToTest = document.querySelector("#input_ipns").value;
|
||||
protocol = "/ipns/";
|
||||
|
||||
fetch('./json/gateways.json')
|
||||
.then(res => res.json())
|
||||
|
|
|
@ -1 +1 @@
|
|||
QmRvQrZ5Vb3Hpqg7iQBrawmbdnyi6cpgQUVXMu1DHq8yAk
|
||||
QmYSBFMAo7NFcapLoW4UTAnnPnwBGNB944HrENgrXbkg5k
|
||||
|
|
Loading…
Reference in New Issue