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

This commit is contained in:
ale 2024-09-23 02:20:45 +02:00
parent e8a85ce0e5
commit 852a55e6fa

View File

@ -112,11 +112,11 @@ document.addEventListener('DOMContentLoaded', function () {
document.getElementById('download_index').addEventListener('click', function (event) { document.getElementById('download_index').addEventListener('click', function (event) {
loading() loading()
ac = new AbortController() ac = new AbortController()
fetch('/api/donwload_index', { signal: ac.signal }).then(async function (result) { fetch('/api/download_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')
a.download = 'fediblock-index.json.gz' a.download = 'fediblock-index.json.gz'
a.href = URL.createObjectURL(res) a.href = URL.createObjectURL([res])
a.type = 'application/x-gzip' a.type = 'application/x-gzip'
a.target = '_blank' a.target = '_blank'
a.dispatchEvent(new MouseEvent('click')) a.dispatchEvent(new MouseEvent('click'))