From 7bce1d26068672143e03d117292a9764e1b73b2e Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Sat, 18 Jun 2022 17:23:09 +0500 Subject: [PATCH] db manager --- .../templates/userManagment/userProfile.html | 2 - .../websiteFunctions/websiteFunctions.js | 44 +++++++++++++++ .../websiteFunctions/WPsiteHome.html | 45 +++++++++++++-- .../websiteFunctions/WPsitesList.html | 48 +++++++--------- websiteFunctions/urls.py | 1 + websiteFunctions/views.py | 21 +++++++ websiteFunctions/website.py | 56 +++++++++++++++++++ 7 files changed, 181 insertions(+), 36 deletions(-) diff --git a/userManagment/templates/userManagment/userProfile.html b/userManagment/templates/userManagment/userProfile.html index 1647d7550..1fd6a1446 100755 --- a/userManagment/templates/userManagment/userProfile.html +++ b/userManagment/templates/userManagment/userProfile.html @@ -61,8 +61,6 @@ - - diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index baea452ff..8603eee50 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -1237,6 +1237,7 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo }; $scope.fetchstaging = function () { + $('#wordpresshomeloading').show(); $scope.wordpresshomeloading = false; @@ -1285,6 +1286,49 @@ app.controller('WPsiteHome', function ($scope, $http, $timeout, $compile, $windo }; + $scope.fetchDatabase = function () { + + $('#wordpresshomeloading').show(); + $scope.wordpresshomeloading = false; + + var url = "/websites/fetchDatabase"; + + var data = { + WPid: $('#WPid').html(), + } + + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; + + + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); + + + function ListInitialDatas(response) { + wordpresshomeloading = true; + $('#wordpresshomeloading').hide(); + + if (response.data.status === 1) { + $('#DB_Name').html(response.data.DataBaseName); + $('#DB_User').html(response.data.DataBaseUser); + $('#tableprefix').html(response.data.tableprefix); + } else { + alert("Error data.error_message:" + response.data.error_message) + + } + } + + function cantLoadInitialDatas(response) { + $('#wordpresshomeloading').hide(); + alert("Error" + response) + + } + + }; + $scope.SaveUpdateConfig = function () { $('#wordpresshomeloading').show(); var data = { diff --git a/websiteFunctions/templates/websiteFunctions/WPsiteHome.html b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html index 0a6fbec1c..e2962d707 100644 --- a/websiteFunctions/templates/websiteFunctions/WPsiteHome.html +++ b/websiteFunctions/templates/websiteFunctions/WPsiteHome.html @@ -30,7 +30,6 @@

-
@@ -65,7 +63,7 @@ Open
+
+
+

+ {% trans "Database for" %} {{ wpsite.title }} +

+
+
+ + +
+ +
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+

diff --git a/websiteFunctions/templates/websiteFunctions/WPsitesList.html b/websiteFunctions/templates/websiteFunctions/WPsitesList.html index 3c5bc8c39..47d60824b 100644 --- a/websiteFunctions/templates/websiteFunctions/WPsitesList.html +++ b/websiteFunctions/templates/websiteFunctions/WPsitesList.html @@ -99,16 +99,10 @@ - - - - - - + + + + @@ -116,29 +110,27 @@ {% for sub in wpsite %} - -
WordPress Site Title - WP-Login - Domain - Action - WordPress Site TitleLoginDomainAction
+

{{ sub.title }}

-
- WP-admin - - - - + + + +