download index
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
ale 2024-09-23 01:48:53 +02:00
parent bfd205d568
commit 14741055e5
2 changed files with 19 additions and 21 deletions

View File

@ -54,9 +54,10 @@
Total scanned <span id="instances">0</span> instances with <span id="peers">0</span> peers - <span Total scanned <span id="instances">0</span> instances with <span id="peers">0</span> peers - <span
id="created">0</span> created - <span id="updated">0</span> id="created">0</span> created - <span id="updated">0</span>
updated<br /> updated<br />
matrix <a id="matrix" href="/?matrix">off</a> - download json <a id="download" download target="_blank">index</a> - matrix <a id="matrix" href="/?matrix">off</a> - download json <a id="download" download
target="_blank">index</a> -
by <a href="https://about.manalejandro.com" target="_blank">ale</a> by <a href="https://about.manalejandro.com" target="_blank">ale</a>
&copy;2024 <s>&copy;</s>2024
</footer> </footer>
<div id="modal"> <div id="modal">
<div class="modal-content"> <div class="modal-content">

View File

@ -17,7 +17,7 @@ document.addEventListener('DOMContentLoaded', function () {
document.getElementById('instance').addEventListener('keyup', function (event) { document.getElementById('instance').addEventListener('keyup', function (event) {
if (event.key && !event.ctrlKey && !event.altKey && !event.shiftKey) { if (event.key && !event.ctrlKey && !event.altKey && !event.shiftKey) {
if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) { if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) {
keypress(event, event.target.value) keypress(event.target.value)
} else { } else {
event.preventDefault() event.preventDefault()
event.stopPropagation() event.stopPropagation()
@ -112,7 +112,6 @@ document.addEventListener('DOMContentLoaded', function () {
document.getElementById('download').addEventListener('click', function (event) { document.getElementById('download').addEventListener('click', function (event) {
loading() loading()
ac = new AbortController() ac = new AbortController()
try {
fetch('/api/donwload_index', { signal: ac.signal }).then(async function (result) { fetch('/api/donwload_index', { signal: ac.signal }).then(async function (result) {
var res = await result.blob(), var res = await result.blob(),
a = document.createElement('a') a = document.createElement('a')
@ -126,12 +125,10 @@ document.addEventListener('DOMContentLoaded', function () {
console.error(err) console.error(err)
document.getElementById('loader-content').style.display = 'none' document.getElementById('loader-content').style.display = 'none'
}) })
} catch (e) { event.preventDefault()
console.error(e) event.stopPropagation()
document.getElementById('loader-content').style.display = 'none'
}
}) })
function keypress(event, content) { function keypress(content) {
loading() loading()
if (timeout) { if (timeout) {
clearTimeout(timeout) clearTimeout(timeout)