mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-16 10:16:12 +01:00
additional setting for improved wp page
This commit is contained in:
@@ -28,16 +28,23 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.updateSetting = function(site, setting) {
|
$scope.updateSetting = function(site, setting) {
|
||||||
|
var settingMap = {
|
||||||
|
'search-indexing': 'searchIndex',
|
||||||
|
'debugging': 'debugging',
|
||||||
|
'password-protection': 'passwordprotection',
|
||||||
|
'maintenance-mode': 'maintenanceMode'
|
||||||
|
};
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
siteId: site.id,
|
siteId: site.id,
|
||||||
setting: setting,
|
setting: setting,
|
||||||
value: site[setting] ? 1 : 0
|
value: site[settingMap[setting]] ? 1 : 0
|
||||||
};
|
};
|
||||||
|
|
||||||
GLobalAjaxCall($http, "{% url 'UpdateWPSettings' %}", data,
|
GLobalAjaxCall($http, "{% url 'UpdateWPSettings' %}", data,
|
||||||
function(response) {
|
function(response) {
|
||||||
if (!response.data.status) {
|
if (!response.data.status) {
|
||||||
site[setting] = !site[setting];
|
site[settingMap[setting]] = !site[settingMap[setting]];
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Operation Failed!',
|
title: 'Operation Failed!',
|
||||||
text: response.data.error_message || 'Unknown error',
|
text: response.data.error_message || 'Unknown error',
|
||||||
@@ -52,7 +59,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
function(response) {
|
function(response) {
|
||||||
site[setting] = !site[setting];
|
site[settingMap[setting]] = !site[settingMap[setting]];
|
||||||
new PNotify({
|
new PNotify({
|
||||||
title: 'Operation Failed!',
|
title: 'Operation Failed!',
|
||||||
text: 'Could not connect to server, please try again.',
|
text: 'Could not connect to server, please try again.',
|
||||||
@@ -103,7 +110,13 @@
|
|||||||
GLobalAjaxCall($http, "{% url 'FetchWPdata' %}", data,
|
GLobalAjaxCall($http, "{% url 'FetchWPdata' %}", data,
|
||||||
function(response) {
|
function(response) {
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
angular.extend(site, response.data.ret_data);
|
var data = response.data.ret_data;
|
||||||
|
site.version = data.version;
|
||||||
|
site.phpVersion = site.phpVersion || 'PHP ' + site.php_version;
|
||||||
|
site.searchIndex = data.searchIndex === 1;
|
||||||
|
site.debugging = data.debugging === 1;
|
||||||
|
site.passwordProtection = data.passwordprotection === 1;
|
||||||
|
site.maintenanceMode = data.maintenanceMode === 1;
|
||||||
// After getting basic site data, fetch plugins and themes
|
// After getting basic site data, fetch plugins and themes
|
||||||
fetchPluginData(site);
|
fetchPluginData(site);
|
||||||
fetchThemeData(site);
|
fetchThemeData(site);
|
||||||
|
|||||||
Reference in New Issue
Block a user