Update index.html
This commit is contained in:
parent
720ed0557b
commit
824d78fc95
46
index.html
46
index.html
@ -65,7 +65,6 @@
|
|||||||
</sm-popup>
|
</sm-popup>
|
||||||
<script src="scripts/components.min.js"></script>
|
<script src="scripts/components.min.js"></script>
|
||||||
<script src="https://unpkg.com/uhtml@3.0.1/es.js"></script>
|
<script src="https://unpkg.com/uhtml@3.0.1/es.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const { html, svg, render: renderElem } = uhtml;
|
const { html, svg, render: renderElem } = uhtml;
|
||||||
const uiGlobals = {}
|
const uiGlobals = {}
|
||||||
@ -388,7 +387,7 @@
|
|||||||
"borrow"
|
"borrow"
|
||||||
],
|
],
|
||||||
"category": "finance",
|
"category": "finance",
|
||||||
"hash": "197f0c491e8cabf866603d03c437f9b96ad5b58ce55de2f6bc0d39a633fdf5e2"
|
"hash": "197f0c491e8cabf866603d03c437f9b96ad5b58ce55de2f6bc0d39a633fdf5e1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "BTC Wallet",
|
"name": "BTC Wallet",
|
||||||
@ -919,6 +918,49 @@
|
|||||||
const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
|
const hashHex = hashArray.map(byte => byte.toString(16).padStart(2, '0')).join('');
|
||||||
return hashHex;
|
return hashHex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param { string | []} a single link or array of links
|
||||||
|
*/
|
||||||
|
async function getLinkContentHash(link) {
|
||||||
|
try {
|
||||||
|
const data = JSON.stringify({ url: link })
|
||||||
|
console.log(data)
|
||||||
|
return await (await fetch('https://integrity-api.ranchimall.net/hash', {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
mode: 'no-cors',
|
||||||
|
body: data
|
||||||
|
})).json()
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function downloadReposZipped(repoUrls) {
|
||||||
|
try {
|
||||||
|
const data = JSON.stringify({ urls: repoUrls })
|
||||||
|
const blob = await (await fetch('https://integrity-api.ranchimall.net/download-repos', {
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
},
|
||||||
|
method: "POST",
|
||||||
|
body: data
|
||||||
|
})).blob()
|
||||||
|
// download as zip
|
||||||
|
const a = document.createElement('a')
|
||||||
|
a.href = URL.createObjectURL(blob)
|
||||||
|
a.download = 'dapps.zip'
|
||||||
|
a.click()
|
||||||
|
URL.revokeObjectURL(a.href)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user