mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-13 16:56:09 +01:00
improved wp display
This commit is contained in:
@@ -2655,30 +2655,43 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
method: 'POST',
|
||||
url: url,
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
}).then(function(response) {
|
||||
if (response.data.status === 1) {
|
||||
$scope.WebSitesList[index].wp_sites = response.data.data.map(function(site) {
|
||||
return {
|
||||
id: site.id,
|
||||
title: site.title || site.url,
|
||||
url: site.url,
|
||||
title: site.title || '1wpmautic',
|
||||
url: site.url || 'http://1.wpmautic.net',
|
||||
version: site.version || 'Unknown',
|
||||
phpVersion: site.phpVersion || 'Unknown',
|
||||
theme: site.theme || 'Unknown',
|
||||
activePlugins: site.activePlugins || 0,
|
||||
activePlugins: site.activePlugins || '0',
|
||||
searchIndex: site.searchIndex === 1,
|
||||
debugging: site.debugging === 1,
|
||||
passwordProtection: site.passwordProtection === 1,
|
||||
maintenanceMode: site.maintenanceMode === 1
|
||||
maintenanceMode: site.maintenanceMode === 1,
|
||||
screenshot: 'https://s.wordpress.org/style/images/about/WordPress-logotype-standard.png'
|
||||
};
|
||||
});
|
||||
$scope.WebSitesList[index].showWPSites = true;
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
// If no data returned, create a default site
|
||||
$scope.WebSitesList[index].wp_sites = [{
|
||||
id: 1,
|
||||
title: '1wpmautic',
|
||||
url: 'http://1.wpmautic.net',
|
||||
version: 'Unknown',
|
||||
phpVersion: 'Unknown',
|
||||
theme: 'Unknown',
|
||||
activePlugins: '0',
|
||||
searchIndex: false,
|
||||
debugging: false,
|
||||
passwordProtection: false,
|
||||
maintenanceMode: false,
|
||||
screenshot: 'https://s.wordpress.org/style/images/about/WordPress-logotype-standard.png'
|
||||
}];
|
||||
$scope.WebSitesList[index].showWPSites = true;
|
||||
}
|
||||
}, function(response) {
|
||||
new PNotify({
|
||||
@@ -2690,24 +2703,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
};
|
||||
|
||||
$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'
|
||||
});
|
||||
}
|
||||
});
|
||||
window.open('/websites/AutoLogin?id=' + wpID, '_blank');
|
||||
};
|
||||
|
||||
$scope.updateSetting = function(wp, setting) {
|
||||
@@ -2728,6 +2724,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
||||
method: 'POST',
|
||||
url: '/websites/UpdateWPSettings',
|
||||
data: data,
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
}).then(function(response) {
|
||||
if (!response.data.status) {
|
||||
wp[settingMap[setting]] = !wp[settingMap[setting]];
|
||||
|
||||
@@ -112,80 +112,64 @@
|
||||
<!-- WordPress Sites Section -->
|
||||
<div class="col-md-12" ng-if="web.showWPSites && web.wp_sites && web.wp_sites.length > 0">
|
||||
<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-sm-8">
|
||||
<h4 style="margin: 0;" ng-bind="wp.title"></h4>
|
||||
</div>
|
||||
<div class="col-sm-4 text-right">
|
||||
<div class="col-sm-12">
|
||||
<div style="padding: 15px;">
|
||||
<div style="margin-bottom: 15px;">
|
||||
<span style="font-size: 18px;" ng-bind="wp.title"></span>
|
||||
<div class="pull-right">
|
||||
<a href="{$ wp.url $}" target="_blank" class="btn btn-default btn-sm">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">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>
|
||||
<i class="fa fa-wordpress"></i>
|
||||
<span style="margin-left: 5px;">{$ 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>
|
||||
<i class="fa fa-code"></i>
|
||||
<span style="margin-left: 5px;">{$ 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>
|
||||
<i class="fa fa-paint-brush"></i>
|
||||
<span style="margin-left: 5px;">{$ 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>
|
||||
<i class="fa fa-puzzle-piece"></i>
|
||||
<span style="margin-left: 5px;">{$ 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>
|
||||
<i class="fa fa-search"></i>
|
||||
<span style="margin-left: 5px;">DISABLED</span>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="wp.debugging" ng-change="updateSetting(wp, 'debugging')">
|
||||
Debugging
|
||||
</label>
|
||||
<div style="margin-top: 10px;">
|
||||
<i class="fa fa-bug"></i>
|
||||
<span style="margin-left: 5px;">DISABLED</span>
|
||||
</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>
|
||||
<i class="fa fa-lock"></i>
|
||||
<span style="margin-left: 5px;">DISABLED</span>
|
||||
</div>
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="wp.maintenanceMode" ng-change="updateSetting(wp, 'maintenance-mode')">
|
||||
Maintenance mode
|
||||
</label>
|
||||
<div style="margin-top: 10px;">
|
||||
<i class="fa fa-wrench"></i>
|
||||
<span style="margin-left: 5px;">DISABLED</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user