Fix (fe): fixing issue #23 and #26, added close button that when clicked reload the table items

This commit is contained in:
Marco Cavalli 2025-07-22 17:01:55 +02:00
parent ae049b7966
commit 95a50531da
2 changed files with 22 additions and 7 deletions

View file

@ -42,9 +42,8 @@ const uploadFiles = async () => {
);
});
await Promise.all(uploadPromises);
uploadingFilesNow.value = false;
await Promise.all(uploadPromises)
//uploadingFilesNow.value = false;
};
const checkUploadStatus = async (file) => {
@ -55,8 +54,7 @@ const checkUploadStatus = async (file) => {
}).then(response => {
if (response.status === 200) {
if (response.data.import_status === 1) {
//checkUploadStatus(id)
console.log('test')
} else {
file.uploadingNow = false
clearInterval(file.checkAnalyzer);
@ -65,6 +63,13 @@ const checkUploadStatus = async (file) => {
})
}
watch(selectedFilesMetadata, (newValue, oldValue) => {
const notUploading = newValue.every(data => data.uploadingNow)
console.log(newValue)
if (!notUploading) {
uploadingFilesNow.value = false;
}
}, {deep: true})
</script>
<template>
@ -113,12 +118,20 @@ const checkUploadStatus = async (file) => {
<v-btn
color="primary"
size="large"
variant="flat"
type="submit"
variant="elevated"
:disabled="selectedFiles.length === 0 || uploadingFilesNow"
:loading="uploadingFilesNow"
:disabled="selectedFiles.length === 0"
@click="uploadFiles"
>Carica
</v-btn>
<v-btn
color="secondary"
size="large"
variant="flat"
:disabled="uploadingFilesNow"
@click="$emit('confirm',false)"
>Chiudi</v-btn>
</v-card-actions>
</v-card>
</template>