WebClient: prevent uploads if no file is selected

Fixes #1980

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2025-05-19 18:21:55 +02:00
parent 6f9729f245
commit e275e8a142
5 changed files with 15 additions and 0 deletions

View File

@@ -284,6 +284,7 @@
"download": "Herunterladen",
"download_ready": "Download abgeschlossen",
"upload_queue_not_ready": "Die Upload-Warteschlange wird noch geladen, bitte versuche es in ein paar Augenblicken erneut!",
"upload_no_files": "Keine Dateien ausgewählt. Bitte wählen oder ziehen Sie Dateien zum Hochladen",
"move_copy": "Verschieben oder kopieren",
"share": "Teilen",
"home": "Startseite",

View File

@@ -284,6 +284,7 @@
"download": "Download",
"download_ready": "Your download is ready",
"upload_queue_not_ready": "The upload queue is still loading, please try again in a few moments",
"upload_no_files": "No files selected. Please choose or drag files to upload",
"move_copy": "Move or copy",
"share": "Share",
"home": "Home",

View File

@@ -284,6 +284,7 @@
"download": "Télécharger",
"download_ready": "Votre téléchargement est prêt",
"upload_queue_not_ready": "La file d'attente de téléchargement est en cours de chargement, veuillez réessayer dans quelques instants",
"upload_no_files": "Aucun fichier sélectionné. Veuillez choisir ou glisser des fichiers à téléverser",
"move_copy": "Déplacer ou copier",
"share": "Partager",
"home": "Accueil",

View File

@@ -284,6 +284,7 @@
"download": "Scarica",
"download_ready": "Il tuo download è pronto",
"upload_queue_not_ready": "La coda di caricamento è in fase di elaborazione, riprova tra qualche istante",
"upload_no_files": "Nessun file selezionato. Scegli o trascina i file da caricare",
"move_copy": "Sposta o copia",
"share": "Condividi",
"home": "Home",

View File

@@ -1981,6 +1981,17 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
var playerKeepAlive;
function uploadFiles(files) {
if (files.length == 0) {
ModalAlert.fire({
text: $.t('fs.upload_no_files'),
icon: "warning",
confirmButtonText: $.t('general.ok'),
customClass: {
confirmButton: "btn btn-primary"
}
});
return;
}
keepAlive();
let keepAliveTimer = setInterval(keepAlive, keepAliveInterval);