From fe0140f39776dbcc42fc1811a9b318833da37b8e Mon Sep 17 00:00:00 2001 From: Hassan Hashmi <75794688+habbi-hb@users.noreply.github.com> Date: Wed, 29 Jun 2022 13:35:53 +0500 Subject: [PATCH] restoreremotebackupupdate --- plogical/IncScheduler.py | 1 + .../websiteFunctions/websiteFunctions.js | 63 ++++++++++++++- .../websiteFunctions/BackupfileConfig.html | 77 ++++++++++++++++++- websiteFunctions/urls.py | 1 + websiteFunctions/views.py | 21 +++++ websiteFunctions/website.py | 31 +++++++- 6 files changed, 190 insertions(+), 4 deletions(-) diff --git a/plogical/IncScheduler.py b/plogical/IncScheduler.py index 479a0840f..40e0ca245 100644 --- a/plogical/IncScheduler.py +++ b/plogical/IncScheduler.py @@ -1090,6 +1090,7 @@ Automatic backup failed for %s on %s. obj.lastrun = time.time() obj.save() except BaseException as msg: + print("Error in Sites:%s"%str(msg)) continue except BaseException as msg: print("Error: [RemoteBackup]: %s"%str(msg)) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index c743a525d..7b10360e8 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -2049,7 +2049,7 @@ app.controller('RemoteBackupConfig', function ($scope, $http, $timeout, $window) }); - +var UpdatescheduleID; app.controller('BackupSchedule', function ($scope, $http, $timeout, $window) { $scope.BackupScheduleLoading = true; $scope.SaveBackupSchedule = function () { @@ -2108,8 +2108,67 @@ app.controller('BackupSchedule', function ($scope, $http, $timeout, $window) { } + }; + + + + + $scope.getupdateid = function (ID) { + UpdatescheduleID = ID; } + $scope.UpdateRemoteschedules = function () { + $scope.RemoteBackupLoading = false; + var Frequency = $scope.RemoteFrequency; + var fretention = $scope.RemoteFileretention; + + var data = { + ScheduleID:UpdatescheduleID, + Frequency: Frequency, + FileRetention: fretention + } + var url = "/websites/UpdateRemoteschedules"; + + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $scope.RemoteBackupLoading = true; + if (response.data.status === 1) { + new PNotify({ + title: 'Success!', + text: 'Successfully Updated!.', + type: 'success' + }); + location.reload(); + + + } else { + new PNotify({ + title: 'Error!', + text: response.data.error_message, + type: 'error' + }); + } + } + + function cantLoadInitialDatas(response) { + $scope.RemoteBackupLoading = true; + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + + } + }; $scope.AddWPsiteforRemoteBackup = function () { $scope.RemoteBackupLoading = false; @@ -2163,7 +2222,7 @@ app.controller('BackupSchedule', function ($scope, $http, $timeout, $window) { } - } + }; }); /* Java script code to create account */ app.controller('createWebsite', function ($scope, $http, $timeout, $window) { diff --git a/websiteFunctions/templates/websiteFunctions/BackupfileConfig.html b/websiteFunctions/templates/websiteFunctions/BackupfileConfig.html index c57fb4064..8824c3035 100644 --- a/websiteFunctions/templates/websiteFunctions/BackupfileConfig.html +++ b/websiteFunctions/templates/websiteFunctions/BackupfileConfig.html @@ -27,6 +27,7 @@ + @@ -86,6 +87,10 @@