mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-15 17:56:12 +01:00
additional setting for improved wp page
This commit is contained in:
@@ -62,10 +62,39 @@
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Initialize tooltips
|
// Function to fetch plugin data
|
||||||
angular.element(document).ready(function() {
|
function fetchPluginData(site) {
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
var data = { WPid: site.id };
|
||||||
});
|
GLobalAjaxCall($http, "{% url 'GetCurrentPlugins' %}", data,
|
||||||
|
function(response) {
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
var plugins = JSON.parse(response.data.plugins);
|
||||||
|
site.activePlugins = plugins.filter(function(p) { return p.status === 'active'; }).length;
|
||||||
|
site.totalPlugins = plugins.length;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(response) {
|
||||||
|
site.activePlugins = 'Error';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Function to fetch theme data
|
||||||
|
function fetchThemeData(site) {
|
||||||
|
var data = { WPid: site.id };
|
||||||
|
GLobalAjaxCall($http, "{% url 'GetCurrentThemes' %}", data,
|
||||||
|
function(response) {
|
||||||
|
if (response.data.status === 1) {
|
||||||
|
var themes = JSON.parse(response.data.themes);
|
||||||
|
site.activeTheme = themes.find(function(t) { return t.status === 'active'; }).name;
|
||||||
|
site.totalThemes = themes.length;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function(response) {
|
||||||
|
site.activeTheme = 'Error';
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Fetch site data for each site
|
// Fetch site data for each site
|
||||||
function fetchSiteData(site) {
|
function fetchSiteData(site) {
|
||||||
@@ -75,6 +104,9 @@
|
|||||||
function(response) {
|
function(response) {
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
angular.extend(site, response.data.ret_data);
|
angular.extend(site, response.data.ret_data);
|
||||||
|
// After getting basic site data, fetch plugins and themes
|
||||||
|
fetchPluginData(site);
|
||||||
|
fetchThemeData(site);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
function(response) {
|
function(response) {
|
||||||
@@ -90,6 +122,11 @@
|
|||||||
if ($scope.wpSites) {
|
if ($scope.wpSites) {
|
||||||
$scope.wpSites.forEach(fetchSiteData);
|
$scope.wpSites.forEach(fetchSiteData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Initialize tooltips
|
||||||
|
angular.element(document).ready(function() {
|
||||||
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user