From 791860d1eecc37567e280ed3791325148a925bbd Mon Sep 17 00:00:00 2001 From: Hassan Hashmi <75794688+habbi-hb@users.noreply.github.com> Date: Mon, 6 Jun 2022 13:47:09 +0500 Subject: [PATCH 1/2] backupstart --- .../websiteFunctions/websiteFunctions.js | 44 +++++++++++++++++++ .../websiteFunctions/WPsiteHome.html | 5 +++ websiteFunctions/urls.py | 1 + websiteFunctions/views.py | 21 +++++++++ websiteFunctions/website.py | 40 +++++++++++++++++ 5 files changed, 111 insertions(+) diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 314bf7785..849d13a25 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -1376,6 +1376,50 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo }; + + $scope.CreateBackup = function (){ + $('#wordpresshomeloading').show(); + var data = { + WPid: $('#WPid').html(), + } + var url = "/websites/WPCreateBackup"; + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + $('#wordpresshomeloading').hide(); + if (response.data.status === 1) { + new PNotify({ + title: 'Success!', + text: 'Backup Created!.', + type: 'success' + }); + } else { + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message, + type: 'error' + }); + + } + + } + + function cantLoadInitialDatas(response) { + $('#wordpresshomeloading').hide(); + alert(response) + + } + + }; + }); var DeploytoProductionID; diff --git a/websiteFunctions/templates/websiteFunctions/WPsiteHome.html b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html index bd8767a22..b82bf8be2 100644 --- a/websiteFunctions/templates/websiteFunctions/WPsiteHome.html +++ b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html @@ -396,6 +396,11 @@ Autoupdate Configurations +
+ +

@@ -396,11 +445,7 @@ Autoupdate Configurations -
- -
+