🔨 Disable "Backup Now" button if a task is already running

This commit is contained in:
Sebastien Clement 2020-01-05 21:02:30 +01:00
parent c74a069ba1
commit a2c93646a6

View File

@ -396,18 +396,23 @@
switch (data.status) { switch (data.status) {
case "error": case "error":
printStatus('Error', data.message); printStatus('Error', data.message);
$('#btn-backup-now').removeClass("disabled");
break; break;
case "idle": case "idle":
printStatus('Idle', "Waiting for next backup."); printStatus('Idle', "Waiting for next backup.");
$('#btn-backup-now').removeClass("disabled");
break; break;
case "download": case "download":
printStatusWithBar('Downloading Snapshot', data.progress); printStatusWithBar('Downloading Snapshot', data.progress);
$('#btn-backup-now').addClass("disabled");
break; break;
case "upload": case "upload":
printStatusWithBar('Uploading Snapshot', data.progress); printStatusWithBar('Uploading Snapshot', data.progress);
$('#btn-backup-now').addClass("disabled");
break; break;
case "creating": case "creating":
printStatusWithBar('Creating Snapshot', data.progress); printStatusWithBar('Creating Snapshot', data.progress);
$('#btn-backup-now').addClass("disabled");
break; break;
} }
if (data.last_backup != null) { if (data.last_backup != null) {