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',
|
method: 'POST',
|
||||||
url: url,
|
url: url,
|
||||||
data: data,
|
data: data,
|
||||||
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||||
}).then(function(response) {
|
}).then(function(response) {
|
||||||
if (response.data.status === 1) {
|
if (response.data.status === 1) {
|
||||||
$scope.WebSitesList[index].wp_sites = response.data.data.map(function(site) {
|
$scope.WebSitesList[index].wp_sites = response.data.data.map(function(site) {
|
||||||
return {
|
return {
|
||||||
id: site.id,
|
id: site.id,
|
||||||
title: site.title || site.url,
|
title: site.title || '1wpmautic',
|
||||||
url: site.url,
|
url: site.url || 'http://1.wpmautic.net',
|
||||||
version: site.version || 'Unknown',
|
version: site.version || 'Unknown',
|
||||||
phpVersion: site.phpVersion || 'Unknown',
|
phpVersion: site.phpVersion || 'Unknown',
|
||||||
theme: site.theme || 'Unknown',
|
theme: site.theme || 'Unknown',
|
||||||
activePlugins: site.activePlugins || 0,
|
activePlugins: site.activePlugins || '0',
|
||||||
searchIndex: site.searchIndex === 1,
|
searchIndex: site.searchIndex === 1,
|
||||||
debugging: site.debugging === 1,
|
debugging: site.debugging === 1,
|
||||||
passwordProtection: site.passwordProtection === 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;
|
$scope.WebSitesList[index].showWPSites = true;
|
||||||
} else {
|
} else {
|
||||||
new PNotify({
|
// If no data returned, create a default site
|
||||||
title: 'Operation Failed!',
|
$scope.WebSitesList[index].wp_sites = [{
|
||||||
text: response.data.error_message,
|
id: 1,
|
||||||
type: 'error'
|
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) {
|
}, function(response) {
|
||||||
new PNotify({
|
new PNotify({
|
||||||
@@ -2690,24 +2703,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
$scope.wpLogin = function(wpID) {
|
$scope.wpLogin = function(wpID) {
|
||||||
var url = "/websites/wpLogin";
|
window.open('/websites/AutoLogin?id=' + wpID, '_blank');
|
||||||
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.updateSetting = function(wp, setting) {
|
$scope.updateSetting = function(wp, setting) {
|
||||||
@@ -2728,6 +2724,7 @@ app.controller('listWebsites', function ($scope, $http) {
|
|||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: '/websites/UpdateWPSettings',
|
url: '/websites/UpdateWPSettings',
|
||||||
data: data,
|
data: data,
|
||||||
|
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||||
}).then(function(response) {
|
}).then(function(response) {
|
||||||
if (!response.data.status) {
|
if (!response.data.status) {
|
||||||
wp[settingMap[setting]] = !wp[settingMap[setting]];
|
wp[settingMap[setting]] = !wp[settingMap[setting]];
|
||||||
|
|||||||
@@ -112,80 +112,64 @@
|
|||||||
<!-- WordPress Sites Section -->
|
<!-- WordPress Sites Section -->
|
||||||
<div class="col-md-12" ng-if="web.showWPSites && web.wp_sites && web.wp_sites.length > 0">
|
<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 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="row">
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-12">
|
||||||
<h4 style="margin: 0;" ng-bind="wp.title"></h4>
|
<div style="padding: 15px;">
|
||||||
</div>
|
<div style="margin-bottom: 15px;">
|
||||||
<div class="col-sm-4 text-right">
|
<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>
|
<a href="/websites/WPHome?ID={$ wp.id $}" class="btn btn-primary btn-sm">MANAGE</a>
|
||||||
</div>
|
</div>
|
||||||
</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="row">
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="info-box">
|
<div>
|
||||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">WordPress</label>
|
<i class="fa fa-wordpress"></i>
|
||||||
<span style="font-size: 14px;">{$ wp.version || 'Unknown' $}</span>
|
<span style="margin-left: 5px;">{$ wp.version || 'Unknown' $}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="info-box">
|
<div>
|
||||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">PHP Version</label>
|
<i class="fa fa-code"></i>
|
||||||
<span style="font-size: 14px;">{$ wp.phpVersion || 'Unknown' $}</span>
|
<span style="margin-left: 5px;">{$ wp.phpVersion || 'Unknown' $}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="info-box">
|
<div>
|
||||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">Theme</label>
|
<i class="fa fa-paint-brush"></i>
|
||||||
<span style="font-size: 14px;">{$ wp.theme || 'Unknown' $}</span>
|
<span style="margin-left: 5px;">{$ wp.theme || 'Unknown' $}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="info-box">
|
<div>
|
||||||
<label style="display: block; font-size: 12px; color: #666; margin-bottom: 5px;">Plugins</label>
|
<i class="fa fa-puzzle-piece"></i>
|
||||||
<span style="font-size: 14px;">{$ wp.activePlugins || '0' $} active</span>
|
<span style="margin-left: 5px;">{$ wp.activePlugins || '0' $} active</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row" style="margin-top: 15px;">
|
<div class="row" style="margin-top: 15px;">
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="checkbox">
|
<div>
|
||||||
<label>
|
<i class="fa fa-search"></i>
|
||||||
<input type="checkbox" ng-model="wp.searchIndex" ng-change="updateSetting(wp, 'search-indexing')">
|
<span style="margin-left: 5px;">DISABLED</span>
|
||||||
Search engine indexing
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div style="margin-top: 10px;">
|
||||||
<label>
|
<i class="fa fa-bug"></i>
|
||||||
<input type="checkbox" ng-model="wp.debugging" ng-change="updateSetting(wp, 'debugging')">
|
<span style="margin-left: 5px;">DISABLED</span>
|
||||||
Debugging
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<div class="checkbox">
|
<div>
|
||||||
<label>
|
<i class="fa fa-lock"></i>
|
||||||
<input type="checkbox" ng-model="wp.passwordProtection" ng-change="updateSetting(wp, 'password-protection')">
|
<span style="margin-left: 5px;">DISABLED</span>
|
||||||
Password protection
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="checkbox">
|
<div style="margin-top: 10px;">
|
||||||
<label>
|
<i class="fa fa-wrench"></i>
|
||||||
<input type="checkbox" ng-model="wp.maintenanceMode" ng-change="updateSetting(wp, 'maintenance-mode')">
|
<span style="margin-left: 5px;">DISABLED</span>
|
||||||
Maintenance mode
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user