From 26d2fbf5bfa4d59523d49583119d6ab08e4bdaf0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Aug 2023 14:06:27 +0500 Subject: [PATCH] backupbutton disable update --- backup/static/backup/backup.js | 12 ++++++++++-- backup/templates/backup/backup.html | 2 +- backup/templates/backup/restore.html | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/backup/static/backup/backup.js b/backup/static/backup/backup.js index 5a6afe076..17e62f6ad 100755 --- a/backup/static/backup/backup.js +++ b/backup/static/backup/backup.js @@ -166,6 +166,8 @@ app.controller('backupWebsiteControl', function ($scope, $http, $timeout) { $scope.createBackup = function () { + var createBackupButton = document.getElementById("createBackup"); + createBackupButton.disabled = true; var websiteToBeBacked = $scope.websiteToBeBacked; $scope.backupLoading = false; @@ -182,7 +184,7 @@ app.controller('backupWebsiteControl', function ($scope, $http, $timeout) { } }; - + // console.log("-------------------") $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); @@ -191,11 +193,13 @@ app.controller('backupWebsiteControl', function ($scope, $http, $timeout) { if (response.data.metaStatus === 1) { getBackupStatus(); + createBackupButton.disabled = false; } } function cantLoadInitialDatas(response) { + createBackupButton.disabled = false; } }; @@ -328,6 +332,8 @@ app.controller('restoreWebsiteControl', function ($scope, $http, $timeout) { $scope.restoreBackup = function () { + var restoreBackupButton = document.getElementById("restoreBackup"); + restoreBackupButton.disabled = true; var backupFile = $scope.backupFile; $scope.running = "Lets start.." @@ -357,17 +363,19 @@ app.controller('restoreWebsiteControl', function ($scope, $http, $timeout) { $scope.status = "Just Started.."; getRestoreStatus(); + restoreBackupButton.disabled = false; } else { $scope.backupError = false; $scope.errorMessage = response.data.error_message; + restoreBackupButton.disabled = false; } } function cantLoadInitialDatas(response) { $scope.couldNotConnect = false; - + restoreBackupButton.disabled = false; } }; diff --git a/backup/templates/backup/backup.html b/backup/templates/backup/backup.html index d80bd2d58..e90e97ab0 100755 --- a/backup/templates/backup/backup.html +++ b/backup/templates/backup/backup.html @@ -77,7 +77,7 @@
- +
diff --git a/backup/templates/backup/restore.html b/backup/templates/backup/restore.html index 5486817c8..b213b683f 100755 --- a/backup/templates/backup/restore.html +++ b/backup/templates/backup/restore.html @@ -42,7 +42,7 @@
- +