mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-22 20:11:32 +01:00
add loader
This commit is contained in:
@@ -2684,10 +2684,6 @@ app.controller('listWebsites', function ($scope, $http, $window) {
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
$("#listFail").hide();
|
||||
// Fetch details for each WordPress site
|
||||
site.wp_sites.forEach(function(wp) {
|
||||
fetchWPSiteData(wp);
|
||||
});
|
||||
} else {
|
||||
$("#listFail").fadeIn();
|
||||
site.showWPSites = false;
|
||||
@@ -2716,92 +2712,6 @@ app.controller('listWebsites', function ($scope, $http, $window) {
|
||||
});
|
||||
};
|
||||
|
||||
function fetchWPSiteData(wp) {
|
||||
wp.loading = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
// Fetch site data
|
||||
$http.post('/websites/FetchWPdata', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var data = response.data.ret_data;
|
||||
wp.version = data.version;
|
||||
wp.phpVersion = data.phpVersion || 'PHP 7.4';
|
||||
wp.searchIndex = data.searchIndex === 1;
|
||||
wp.debugging = data.debugging === 1;
|
||||
wp.passwordProtection = data.passwordprotection === 1;
|
||||
wp.maintenanceMode = data.maintenanceMode === 1;
|
||||
fetchPluginData(wp);
|
||||
fetchThemeData(wp);
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchPluginData(wp) {
|
||||
wp.loadingPlugins = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentPlugins', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var plugins = JSON.parse(response.data.plugins);
|
||||
wp.activePlugins = plugins.filter(function(p) { return p.status === 'active'; }).length;
|
||||
wp.totalPlugins = plugins.length;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingPlugins = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchThemeData(wp) {
|
||||
wp.loadingTheme = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentTheme', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
wp.theme = response.data.theme;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.visitSite = function(wp) {
|
||||
var url = wp.url || wp.domain;
|
||||
if (!url) return;
|
||||
@@ -5913,10 +5823,6 @@ app.controller('listWebsites', function ($scope, $http, $window) {
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
$("#listFail").hide();
|
||||
// Fetch details for each WordPress site
|
||||
site.wp_sites.forEach(function(wp) {
|
||||
fetchWPSiteData(wp);
|
||||
});
|
||||
} else {
|
||||
$("#listFail").fadeIn();
|
||||
site.showWPSites = false;
|
||||
@@ -5945,92 +5851,6 @@ app.controller('listWebsites', function ($scope, $http, $window) {
|
||||
});
|
||||
};
|
||||
|
||||
function fetchWPSiteData(wp) {
|
||||
wp.loading = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
// Fetch site data
|
||||
$http.post('/websites/FetchWPdata', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var data = response.data.ret_data;
|
||||
wp.version = data.version;
|
||||
wp.phpVersion = data.phpVersion || 'PHP 7.4';
|
||||
wp.searchIndex = data.searchIndex === 1;
|
||||
wp.debugging = data.debugging === 1;
|
||||
wp.passwordProtection = data.passwordprotection === 1;
|
||||
wp.maintenanceMode = data.maintenanceMode === 1;
|
||||
fetchPluginData(wp);
|
||||
fetchThemeData(wp);
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchPluginData(wp) {
|
||||
wp.loadingPlugins = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentPlugins', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var plugins = JSON.parse(response.data.plugins);
|
||||
wp.activePlugins = plugins.filter(function(p) { return p.status === 'active'; }).length;
|
||||
wp.totalPlugins = plugins.length;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingPlugins = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchThemeData(wp) {
|
||||
wp.loadingTheme = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentTheme', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
wp.theme = response.data.theme;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.visitSite = function(wp) {
|
||||
var url = wp.url || wp.domain;
|
||||
if (!url) return;
|
||||
@@ -9716,10 +9536,6 @@ app.controller('listWebsites', function ($scope, $http, $window) {
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
$("#listFail").hide();
|
||||
// Fetch details for each WordPress site
|
||||
site.wp_sites.forEach(function(wp) {
|
||||
fetchWPSiteData(wp);
|
||||
});
|
||||
} else {
|
||||
$("#listFail").fadeIn();
|
||||
site.showWPSites = false;
|
||||
@@ -9748,92 +9564,6 @@ app.controller('listWebsites', function ($scope, $http, $window) {
|
||||
});
|
||||
};
|
||||
|
||||
function fetchWPSiteData(wp) {
|
||||
wp.loading = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
// Fetch site data
|
||||
$http.post('/websites/FetchWPdata', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var data = response.data.ret_data;
|
||||
wp.version = data.version;
|
||||
wp.phpVersion = data.phpVersion || 'PHP 7.4';
|
||||
wp.searchIndex = data.searchIndex === 1;
|
||||
wp.debugging = data.debugging === 1;
|
||||
wp.passwordProtection = data.passwordprotection === 1;
|
||||
wp.maintenanceMode = data.maintenanceMode === 1;
|
||||
fetchPluginData(wp);
|
||||
fetchThemeData(wp);
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchPluginData(wp) {
|
||||
wp.loadingPlugins = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentPlugins', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var plugins = JSON.parse(response.data.plugins);
|
||||
wp.activePlugins = plugins.filter(function(p) { return p.status === 'active'; }).length;
|
||||
wp.totalPlugins = plugins.length;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingPlugins = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchThemeData(wp) {
|
||||
wp.loadingTheme = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentTheme', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
wp.theme = response.data.theme;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.visitSite = function(wp) {
|
||||
var url = wp.url || wp.domain;
|
||||
if (!url) return;
|
||||
@@ -13884,10 +13614,6 @@ app.controller('manageAliasController', function ($scope, $http, $timeout, $wind
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
$("#listFail").hide();
|
||||
// Fetch details for each WordPress site
|
||||
site.wp_sites.forEach(function(wp) {
|
||||
fetchWPSiteData(wp);
|
||||
});
|
||||
} else {
|
||||
$("#listFail").fadeIn();
|
||||
site.showWPSites = false;
|
||||
@@ -13916,92 +13642,6 @@ app.controller('manageAliasController', function ($scope, $http, $timeout, $wind
|
||||
});
|
||||
};
|
||||
|
||||
function fetchWPSiteData(wp) {
|
||||
wp.loading = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
// Fetch site data
|
||||
$http.post('/websites/FetchWPdata', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var data = response.data.ret_data;
|
||||
wp.version = data.version;
|
||||
wp.phpVersion = data.phpVersion || 'PHP 7.4';
|
||||
wp.searchIndex = data.searchIndex === 1;
|
||||
wp.debugging = data.debugging === 1;
|
||||
wp.passwordProtection = data.passwordprotection === 1;
|
||||
wp.maintenanceMode = data.maintenanceMode === 1;
|
||||
fetchPluginData(wp);
|
||||
fetchThemeData(wp);
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loading = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchPluginData(wp) {
|
||||
wp.loadingPlugins = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentPlugins', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
var plugins = JSON.parse(response.data.plugins);
|
||||
wp.activePlugins = plugins.filter(function(p) { return p.status === 'active'; }).length;
|
||||
wp.totalPlugins = plugins.length;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingPlugins = false;
|
||||
});
|
||||
}
|
||||
|
||||
function fetchThemeData(wp) {
|
||||
wp.loadingTheme = true;
|
||||
|
||||
var config = {
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
var data = $.param({
|
||||
WPid: wp.id
|
||||
});
|
||||
|
||||
$http.post('/websites/GetCurrentTheme', data, config)
|
||||
.then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
wp.theme = response.data.theme;
|
||||
}
|
||||
})
|
||||
.finally(function() {
|
||||
wp.loadingTheme = false;
|
||||
});
|
||||
}
|
||||
|
||||
$scope.updateSetting = function(wp, setting) {
|
||||
var settingMap = {
|
||||
'search-indexing': 'searchIndex',
|
||||
|
||||
Reference in New Issue
Block a user