diff --git a/websiteFunctions/static/websiteFunctions/websiteFunctions.js b/websiteFunctions/static/websiteFunctions/websiteFunctions.js index 082cd5f03..e45179bc5 100755 --- a/websiteFunctions/static/websiteFunctions/websiteFunctions.js +++ b/websiteFunctions/static/websiteFunctions/websiteFunctions.js @@ -2657,7 +2657,21 @@ app.controller('listWebsites', function ($scope, $http) { data: data, }).then(function(response) { if (response.data.status === 1) { - $scope.WebSitesList[index].wp_sites = response.data.data; + $scope.WebSitesList[index].wp_sites = response.data.data.map(function(site) { + return { + id: site.id, + title: site.title || site.url, + url: site.url, + version: site.version || 'Unknown', + phpVersion: site.phpVersion || 'Unknown', + theme: site.theme || 'Unknown', + activePlugins: site.activePlugins || 0, + searchIndex: site.searchIndex === 1, + debugging: site.debugging === 1, + passwordProtection: site.passwordProtection === 1, + maintenanceMode: site.maintenanceMode === 1 + }; + }); $scope.WebSitesList[index].showWPSites = true; } else { new PNotify({ @@ -2696,6 +2710,49 @@ app.controller('listWebsites', function ($scope, $http) { }); }; + $scope.updateSetting = function(wp, setting) { + var settingMap = { + 'search-indexing': 'searchIndex', + 'debugging': 'debugging', + 'password-protection': 'passwordProtection', + 'maintenance-mode': 'maintenanceMode' + }; + + var data = { + siteId: wp.id, + setting: setting, + value: wp[settingMap[setting]] ? 1 : 0 + }; + + $http({ + method: 'POST', + url: '/websites/UpdateWPSettings', + data: data, + }).then(function(response) { + if (!response.data.status) { + wp[settingMap[setting]] = !wp[settingMap[setting]]; + new PNotify({ + title: 'Operation Failed!', + text: response.data.error_message || 'Unknown error', + type: 'error' + }); + } else { + new PNotify({ + title: 'Success!', + text: 'Setting updated successfully.', + type: 'success' + }); + } + }, function(response) { + wp[settingMap[setting]] = !wp[settingMap[setting]]; + new PNotify({ + title: 'Operation Failed!', + text: 'Could not connect to server, please try again.', + type: 'error' + }); + }); + }; + $scope.getFurtherWebsitesFromDB = function () { var config = { diff --git a/websiteFunctions/templates/websiteFunctions/listWebsites.html b/websiteFunctions/templates/websiteFunctions/listWebsites.html index ccb2b410e..7b0376e17 100755 --- a/websiteFunctions/templates/websiteFunctions/listWebsites.html +++ b/websiteFunctions/templates/websiteFunctions/listWebsites.html @@ -111,46 +111,84 @@
-
-
+
+
-
-
-

- Visit Site - WP Login - MANAGE +
+

+
+
+ MANAGE +
+
+
+
+
+
+ +
+
+
+ + {$ wp.version || 'Unknown' $} +
+
+
+
+ + {$ wp.phpVersion || 'Unknown' $} +
+
+
+
+ + {$ wp.theme || 'Unknown' $} +
+
+
+
+ + {$ wp.activePlugins || '0' $} active +
+
+
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
-
-
- -
-
- - Unknown -
-
- - Unknown -
-
- - UNKNOWN -
-
- - 0 ACTIVE -
-
- -
-
- - DISABLED -
-
- - DISABLED