Initial commit
This commit is contained in:
14
frontend/static/js/main.js
Normal file
14
frontend/static/js/main.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// Exemple pour polling du download si nécessaire
|
||||
function checkDownloadStatus(downloadId) {
|
||||
fetch(`/download_status/${downloadId}`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if(data.status === 'ready') {
|
||||
// Mettre à jour le lien sur la page
|
||||
document.querySelector(`#link-${downloadId}`).innerHTML =
|
||||
`<a href="${data.link}">Télécharger</a>`;
|
||||
} else {
|
||||
setTimeout(() => checkDownloadStatus(downloadId), 5000);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user