mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 00:36:10 +01:00
improved wp display
This commit is contained in:
@@ -2641,8 +2641,59 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
$scope.recordsToShow = 10;
|
||||
|
||||
$scope.showWPSites = function(index) {
|
||||
// Toggle the showWPSites flag for the clicked website
|
||||
$scope.WebSitesList[index].showWPSites = !$scope.WebSitesList[index].showWPSites;
|
||||
// If details are already loaded, just toggle visibility
|
||||
if ($scope.WebSitesList[index].wp_sites) {
|
||||
$scope.WebSitesList[index].showWPSites = !$scope.WebSitesList[index].showWPSites;
|
||||
return;
|
||||
}
|
||||
|
||||
// Otherwise fetch the details
|
||||
var url = "/websites/fetchWPDetails";
|
||||
var data = {domain: $scope.WebSitesList[index].domain};
|
||||
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: url,
|
||||
data: data,
|
||||
}).then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
$scope.WebSitesList[index].wp_sites = response.data.data;
|
||||
$scope.WebSitesList[index].showWPSites = true;
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}, function(response) {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page.',
|
||||
type: 'error'
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
$scope.wpLogin = function(wpID) {
|
||||
var url = "/websites/wpLogin";
|
||||
var data = {wpID: wpID};
|
||||
|
||||
$http({
|
||||
method: 'POST',
|
||||
url: url,
|
||||
data: data,
|
||||
}).then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
window.open(response.data.loginURL, '_blank');
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.getFurtherWebsitesFromDB = function () {
|
||||
|
||||
@@ -111,22 +111,54 @@
|
||||
|
||||
<!-- WordPress Sites Section -->
|
||||
<div class="col-md-12" ng-if="web.showWPSites && web.wp_sites && web.wp_sites.length > 0">
|
||||
<div class="wp-sites-list" style="padding: 15px; background-color: #f8f9fa; border: 1px solid #eee; margin: 10px; border-radius: 4px;">
|
||||
<h4 style="margin-bottom: 15px;">WordPress Sites</h4>
|
||||
<div ng-repeat="wp in web.wp_sites" style="margin-bottom: 10px; padding: 10px; background: white; border: 1px solid #e9ecef; border-radius: 4px;">
|
||||
<div class="wp-sites-list" style="margin: 15px;">
|
||||
<div ng-repeat="wp in web.wp_sites" class="panel" style="box-shadow: 0px 0px 1px 0px #888888; margin-bottom: 15px;">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<h5 style="margin-top: 0;">{$ wp.title $}</h5>
|
||||
<a href="{$ wp.url $}" target="_blank" style="color: #007bff;">{$ wp.url $}</a>
|
||||
<div class="col-md-12">
|
||||
<div class="col-lg-10 content-box-header" style="text-transform: none;">
|
||||
<h2 style="display: inline; color: #414C59;" ng-bind="wp.title"></h2>
|
||||
<a href="{$ wp.url $}" target="_blank" style="margin-left: 10px;">Visit Site</a>
|
||||
<a href="#" ng-click="wpLogin(wp.id)" style="margin-left: 10px;">WP Login</a>
|
||||
</div>
|
||||
<div class="col-md-2 content-box-header text-right">
|
||||
<a href="/websites/WPHome?ID={$ wp.id $}" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-cog"></i> Manage
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div><strong>Version:</strong> {$ wp.version || 'Unknown' $}</div>
|
||||
<div><strong>PHP:</strong> {$ wp.phpVersion || 'Unknown' $}</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-wordpress btn-icon text-muted" data-toggle="tooltip" data-placement="right" title="WordPress Version"> </i>
|
||||
<span>{$ wp.version || 'Unknown' $}</span>
|
||||
</div>
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-code btn-icon text-muted" data-toggle="tooltip" data-placement="right" title="PHP Version"> </i>
|
||||
<span>{$ wp.phpVersion || 'Unknown' $}</span>
|
||||
</div>
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-paint-brush btn-icon text-muted" data-toggle="tooltip" data-placement="right" title="Theme"> </i>
|
||||
<span>{$ wp.theme || 'Unknown' $}</span>
|
||||
</div>
|
||||
<div class="col-md-3 content-box-header">
|
||||
<i class="p fa fa-puzzle-piece btn-icon text-muted" data-toggle="tooltip" data-placement="right" title="Active Plugins"> </i>
|
||||
<span>{$ wp.activePlugins || '0' $} active</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2 text-right">
|
||||
<a href="/websites/WPHome?ID={$ wp.id $}" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-cog"></i> Manage
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6 content-box-header">
|
||||
<i class="p fa fa-search btn-icon text-muted" data-toggle="tooltip" data-placement="right" title="Search Engine Indexing"> </i>
|
||||
<span>{$ wp.searchEngineIndexing ? 'Enabled' : 'Disabled' $}</span>
|
||||
</div>
|
||||
<div class="col-md-6 content-box-header">
|
||||
<i class="p fa fa-lock btn-icon text-muted" data-toggle="tooltip" data-placement="right" title="Maintenance Mode"> </i>
|
||||
<span>{$ wp.maintenanceMode ? 'Enabled' : 'Disabled' $}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user