mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-17 06:47:07 +02:00
improved wp display
This commit is contained in:
@@ -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 = {
|
||||
|
||||
@@ -111,46 +111,84 @@
|
||||
|
||||
<!-- 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">
|
||||
<div ng-repeat="wp in web.wp_sites" class="panel" style="margin: 15px; padding: 20px; background: white; border: 1px solid #ddd; border-radius: 4px;">
|
||||
<div ng-repeat="wp in web.wp_sites" class="wp-site-item" style="border: 1px solid #ddd; margin: 15px 0; border-radius: 4px;">
|
||||
<div class="wp-site-header" style="padding: 15px; border-bottom: 1px solid #ddd; background: #f5f5f5;">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div style="margin-bottom: 20px;">
|
||||
<h3 style="display: inline-block; margin: 0; font-weight: normal;" ng-bind="wp.title"></h3>
|
||||
<a href="{$ wp.url $}" class="btn btn-default btn-sm" style="margin-left: 10px;">Visit Site</a>
|
||||
<a href="#" ng-click="wpLogin(wp.id)" class="btn btn-default btn-sm">WP Login</a>
|
||||
<a href="/websites/WPHome?ID={$ wp.id $}" class="btn btn-primary btn-sm pull-right">MANAGE</a>
|
||||
<div class="col-sm-8">
|
||||
<h4 style="margin: 0;" ng-bind="wp.title"></h4>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right">
|
||||
<a href="/websites/WPHome?ID={$ wp.id $}" class="btn btn-primary btn-sm">MANAGE</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wp-site-content" style="padding: 15px;">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="text-left" style="margin-bottom: 15px;">
|
||||
<a href="{$ wp.url $}" target="_blank" class="btn btn-default btn-sm">
|
||||
<i class="fa fa-external-link-alt"></i> Visit Site
|
||||
</a>
|
||||
<a href="#" ng-click="wpLogin(wp.id)" class="btn btn-default btn-sm">
|
||||
<i class="fa fa-wordpress"></i> WP Login
|
||||
</a>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="info-box">
|
||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">WordPress</label>
|
||||
<span style="font-size: 14px;">{$ wp.version || 'Unknown' $}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="info-box">
|
||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">PHP Version</label>
|
||||
<span style="font-size: 14px;">{$ wp.phpVersion || 'Unknown' $}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="info-box">
|
||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">Theme</label>
|
||||
<span style="font-size: 14px;">{$ wp.theme || 'Unknown' $}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
<div class="info-box">
|
||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">Plugins</label>
|
||||
<span style="font-size: 14px;">{$ wp.activePlugins || '0' $} active</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="margin-top: 15px;">
|
||||
<div class="col-sm-6">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="wp.searchIndex" ng-change="updateSetting(wp, 'search-indexing')">
|
||||
Search engine indexing
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="wp.debugging" ng-change="updateSetting(wp, 'debugging')">
|
||||
Debugging
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="wp.passwordProtection" ng-change="updateSetting(wp, 'password-protection')">
|
||||
Password protection
|
||||
</label>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="wp.maintenanceMode" ng-change="updateSetting(wp, 'maintenance-mode')">
|
||||
Maintenance mode
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<i class="fa fa-wordpress" style="color: #666;"></i>
|
||||
<span style="margin-left: 5px; color: #666;">Unknown</span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<i class="fa fa-code" style="color: #666;"></i>
|
||||
<span style="margin-left: 5px; color: #666;">Unknown</span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<i class="fa fa-paint-brush" style="color: #666;"></i>
|
||||
<span style="margin-left: 5px; color: #666;">UNKNOWN</span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<i class="fa fa-puzzle-piece" style="color: #666;"></i>
|
||||
<span style="margin-left: 5px; color: #666;">0 ACTIVE</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top: 15px;">
|
||||
<div class="col-md-6">
|
||||
<i class="fa fa-search" style="color: #666;"></i>
|
||||
<span style="margin-left: 5px; color: #666;">DISABLED</span>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<i class="fa fa-lock" style="color: #666;"></i>
|
||||
<span style="margin-left: 5px; color: #666;">DISABLED</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user