fix file batch deletion

This commit is contained in:
2025-05-28 12:09:56 +02:00
parent 9b98370989
commit 552d1feb2e
6 changed files with 178 additions and 22 deletions

View File

@@ -74,8 +74,7 @@ export class UploadManager {
async startUpload(files) {
this.uploadProgressContainer.style.display = 'block';
this.uploadProgressBar.style.width = '0%';
this.uploadProgressBar.classList.remove('bg-success');
this.uploadProgressBar.classList.add('bg-info');
this.uploadProgressBar.className = 'progress-bar bg-primary-opacity-15 text-primary';
this.uploadProgressText.textContent = '';
this.pendingUploads = files;
@@ -109,8 +108,7 @@ export class UploadManager {
// All files processed
this.uploadProgressBar.style.width = '100%';
this.uploadProgressBar.textContent = '100%';
this.uploadProgressBar.classList.remove('bg-info');
this.uploadProgressBar.classList.add('bg-success');
this.uploadProgressBar.className = 'progress-bar bg-success-opacity-15 text-success';
this.uploadProgressText.textContent = 'Upload complete!';
// Reset state
@@ -123,8 +121,7 @@ export class UploadManager {
setTimeout(() => {
this.uploadProgressContainer.style.display = 'none';
this.uploadProgressText.textContent = '';
this.uploadProgressBar.style.backgroundColor = '#16767b';
this.uploadProgressBar.style.color = '#fff';
this.uploadProgressBar.className = 'progress-bar bg-primary-opacity-15 text-primary';
}, 3000);
// Refresh file list
@@ -175,8 +172,7 @@ export class UploadManager {
} catch (error) {
console.error('Upload error:', error);
this.uploadProgressText.textContent = `Error uploading ${file.name}`;
this.uploadProgressBar.style.backgroundColor = '#ef4444';
this.uploadProgressBar.style.color = '#fff';
this.uploadProgressBar.className = 'progress-bar bg-danger-opacity-15 text-danger';
currentFileIndex++;
updateProgress();
await processNextFile();
@@ -226,8 +222,7 @@ export class UploadManager {
}
uploadError.style.display = 'block';
this.uploadProgressBar.style.backgroundColor = '#ef4444';
this.uploadProgressBar.style.color = '#fff';
this.uploadProgressBar.className = 'progress-bar bg-danger-opacity-15 text-danger';
}
async handleFileExists(file, formData) {