backupbutton disable update

This commit is contained in:
unknown
2023-08-08 14:06:27 +05:00
parent 3315d26d49
commit 26d2fbf5bf
3 changed files with 12 additions and 4 deletions

View File

@@ -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;
}
};

View File

@@ -77,7 +77,7 @@
<div class="form-group destinationHide">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button type="button" ng-click="createBackup()" class="btn btn-primary btn-lg btn-block">{% trans "Create Backup" %}</button>
<button type="button" ng-click="createBackup()" id="createBackup" class="btn btn-primary btn-lg btn-block">{% trans "Create Backup" %}</button>
</div>
</div>

View File

@@ -42,7 +42,7 @@
<div ng-hide="restoreButton" class="form-group">
<label class="col-sm-3 control-label"></label>
<div class="col-sm-4">
<button type="button" ng-click="restoreBackup()" class="btn btn-primary btn-lg btn-block">{% trans "Restore" %}</button>
<button type="button" ng-click="restoreBackup()" id="restoreBackup" class="btn btn-primary btn-lg btn-block">{% trans "Restore" %}</button>
</div>
</div>