mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
ref https://github.com/usmannasir/cyberpanel/issues/397: add restart on edit php config adv
This commit is contained in:
@@ -36,15 +36,52 @@ function randomPassword(length) {
|
||||
|
||||
var app = angular.module('CyberCP', []);
|
||||
|
||||
app.config(['$interpolateProvider', function($interpolateProvider) {
|
||||
var globalScope;
|
||||
|
||||
function GlobalRespSuccess(response) {
|
||||
globalScope.cyberPanelLoading = true;
|
||||
if (response.data.status === 1) {
|
||||
new PNotify({
|
||||
title: 'Success',
|
||||
text: 'Successfully executed.',
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: response.data.error_message,
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function GlobalRespFailed(response) {
|
||||
globalScope.cyberPanelLoading = true;
|
||||
new PNotify({
|
||||
title: 'Operation Failed!',
|
||||
text: 'Could not connect to server, please refresh this page',
|
||||
type: 'error'
|
||||
});
|
||||
}
|
||||
|
||||
function GLobalAjaxCall(http, url, data, successCallBack, failureCallBack) {
|
||||
var config = {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
http.post(url, data, config).then(successCallBack, failureCallBack);
|
||||
}
|
||||
|
||||
app.config(['$interpolateProvider', function ($interpolateProvider) {
|
||||
$interpolateProvider.startSymbol('{$');
|
||||
$interpolateProvider.endSymbol('$}');
|
||||
}]);
|
||||
}]);
|
||||
|
||||
app.filter('getwebsitename', function() {
|
||||
return function(domain, uppercase) {
|
||||
app.filter('getwebsitename', function () {
|
||||
return function (domain, uppercase) {
|
||||
|
||||
if(domain !== undefined) {
|
||||
if (domain !== undefined) {
|
||||
|
||||
domain = domain.replace(/-/g, '');
|
||||
|
||||
@@ -59,9 +96,9 @@ app.filter('getwebsitename', function() {
|
||||
return finalDomainName;
|
||||
}
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
app.controller('systemStatusInfo', function($scope,$http,$timeout) {
|
||||
app.controller('systemStatusInfo', function ($scope, $http, $timeout) {
|
||||
|
||||
//getStuff();
|
||||
|
||||
@@ -81,7 +118,8 @@ app.controller('systemStatusInfo', function($scope,$http,$timeout) {
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {}
|
||||
function cantLoadInitialData(response) {
|
||||
}
|
||||
|
||||
//$timeout(getStuff, 2000);
|
||||
|
||||
@@ -90,7 +128,7 @@ app.controller('systemStatusInfo', function($scope,$http,$timeout) {
|
||||
|
||||
/* Admin status */
|
||||
|
||||
app.controller('adminController', function($scope,$http,$timeout) {
|
||||
app.controller('adminController', function ($scope, $http, $timeout) {
|
||||
|
||||
url = "/base/getAdminStatus";
|
||||
|
||||
@@ -109,205 +147,206 @@ app.controller('adminController', function($scope,$http,$timeout) {
|
||||
$('.serverACL').hide();
|
||||
|
||||
|
||||
if(!Boolean(response.data.versionManagement)){
|
||||
if (!Boolean(response.data.versionManagement)) {
|
||||
$('.versionManagement').hide();
|
||||
}
|
||||
// User Management
|
||||
if(!Boolean(response.data.createNewUser)){
|
||||
if (!Boolean(response.data.createNewUser)) {
|
||||
$('.createNewUser').hide();
|
||||
}
|
||||
if(!Boolean(response.data.listUsers)){
|
||||
if (!Boolean(response.data.listUsers)) {
|
||||
$('.listUsers').hide();
|
||||
}
|
||||
if(!Boolean(response.data.resellerCenter)){
|
||||
if (!Boolean(response.data.resellerCenter)) {
|
||||
$('.resellerCenter').hide();
|
||||
}
|
||||
if(!Boolean(response.data.deleteUser)){
|
||||
if (!Boolean(response.data.deleteUser)) {
|
||||
$('.deleteUser').hide();
|
||||
}
|
||||
if(!Boolean(response.data.changeUserACL)){
|
||||
if (!Boolean(response.data.changeUserACL)) {
|
||||
$('.changeUserACL').hide();
|
||||
}
|
||||
// Website Management
|
||||
if(!Boolean(response.data.createWebsite)){
|
||||
if (!Boolean(response.data.createWebsite)) {
|
||||
$('.createWebsite').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.modifyWebsite)){
|
||||
if (!Boolean(response.data.modifyWebsite)) {
|
||||
$('.modifyWebsite').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.suspendWebsite)){
|
||||
if (!Boolean(response.data.suspendWebsite)) {
|
||||
$('.suspendWebsite').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.deleteWebsite)){
|
||||
if (!Boolean(response.data.deleteWebsite)) {
|
||||
$('.deleteWebsite').hide();
|
||||
}
|
||||
|
||||
// Package Management
|
||||
|
||||
if(!Boolean(response.data.createPackage)){
|
||||
if (!Boolean(response.data.createPackage)) {
|
||||
$('.createPackage').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.listPackages)){
|
||||
if (!Boolean(response.data.listPackages)) {
|
||||
$('.listPackages').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.deletePackage)){
|
||||
if (!Boolean(response.data.deletePackage)) {
|
||||
$('.deletePackage').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.modifyPackage)){
|
||||
if (!Boolean(response.data.modifyPackage)) {
|
||||
$('.modifyPackage').hide();
|
||||
}
|
||||
|
||||
// Database Management
|
||||
|
||||
if(!Boolean(response.data.createDatabase)){
|
||||
if (!Boolean(response.data.createDatabase)) {
|
||||
$('.createDatabase').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.deleteDatabase)){
|
||||
if (!Boolean(response.data.deleteDatabase)) {
|
||||
$('.deleteDatabase').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.listDatabases)){
|
||||
if (!Boolean(response.data.listDatabases)) {
|
||||
$('.listDatabases').hide();
|
||||
}
|
||||
|
||||
// DNS Management
|
||||
|
||||
if(!Boolean(response.data.dnsAsWhole)){
|
||||
if (!Boolean(response.data.dnsAsWhole)) {
|
||||
$('.dnsAsWhole').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.createNameServer)){
|
||||
if (!Boolean(response.data.createNameServer)) {
|
||||
$('.createNameServer').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.createDNSZone)){
|
||||
if (!Boolean(response.data.createDNSZone)) {
|
||||
$('.createDNSZone').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.deleteZone)){
|
||||
if (!Boolean(response.data.deleteZone)) {
|
||||
$('.addDeleteRecords').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.addDeleteRecords)){
|
||||
if (!Boolean(response.data.addDeleteRecords)) {
|
||||
$('.deleteDatabase').hide();
|
||||
}
|
||||
|
||||
// Email Management
|
||||
|
||||
if(!Boolean(response.data.emailAsWhole)){
|
||||
if (!Boolean(response.data.emailAsWhole)) {
|
||||
$('.emailAsWhole').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.listEmails)){
|
||||
if (!Boolean(response.data.listEmails)) {
|
||||
$('.listEmails').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.createEmail)){
|
||||
if (!Boolean(response.data.createEmail)) {
|
||||
$('.createEmail').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.deleteEmail)){
|
||||
if (!Boolean(response.data.deleteEmail)) {
|
||||
$('.deleteEmail').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.emailForwarding)){
|
||||
if (!Boolean(response.data.emailForwarding)) {
|
||||
$('.emailForwarding').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.changeEmailPassword)){
|
||||
if (!Boolean(response.data.changeEmailPassword)) {
|
||||
$('.changeEmailPassword').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.dkimManager)){
|
||||
if (!Boolean(response.data.dkimManager)) {
|
||||
$('.dkimManager').hide();
|
||||
}
|
||||
|
||||
|
||||
// FTP Management
|
||||
|
||||
if(!Boolean(response.data.ftpAsWhole)){
|
||||
if (!Boolean(response.data.ftpAsWhole)) {
|
||||
$('.ftpAsWhole').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.createFTPAccount)){
|
||||
if (!Boolean(response.data.createFTPAccount)) {
|
||||
$('.createFTPAccount').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.deleteFTPAccount)){
|
||||
if (!Boolean(response.data.deleteFTPAccount)) {
|
||||
$('.deleteFTPAccount').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.listFTPAccounts)){
|
||||
if (!Boolean(response.data.listFTPAccounts)) {
|
||||
$('.listFTPAccounts').hide();
|
||||
}
|
||||
|
||||
// Backup Management
|
||||
|
||||
if(!Boolean(response.data.createBackup)){
|
||||
if (!Boolean(response.data.createBackup)) {
|
||||
$('.createBackup').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.restoreBackup)){
|
||||
if (!Boolean(response.data.restoreBackup)) {
|
||||
$('.restoreBackup').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.addDeleteDestinations)){
|
||||
if (!Boolean(response.data.addDeleteDestinations)) {
|
||||
$('.addDeleteDestinations').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.scheDuleBackups)){
|
||||
if (!Boolean(response.data.scheDuleBackups)) {
|
||||
$('.scheDuleBackups').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.remoteBackups)){
|
||||
if (!Boolean(response.data.remoteBackups)) {
|
||||
$('.remoteBackups').hide();
|
||||
}
|
||||
|
||||
|
||||
// SSL Management
|
||||
|
||||
if(!Boolean(response.data.manageSSL)){
|
||||
if (!Boolean(response.data.manageSSL)) {
|
||||
$('.manageSSL').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.hostnameSSL)){
|
||||
if (!Boolean(response.data.hostnameSSL)) {
|
||||
$('.hostnameSSL').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.mailServerSSL)){
|
||||
if (!Boolean(response.data.mailServerSSL)) {
|
||||
$('.mailServerSSL').hide();
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
} else {
|
||||
|
||||
if(!Boolean(response.data.emailAsWhole)){
|
||||
if (!Boolean(response.data.emailAsWhole)) {
|
||||
$('.emailAsWhole').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.ftpAsWhole)){
|
||||
if (!Boolean(response.data.ftpAsWhole)) {
|
||||
$('.ftpAsWhole').hide();
|
||||
}
|
||||
|
||||
if(!Boolean(response.data.dnsAsWhole)){
|
||||
if (!Boolean(response.data.dnsAsWhole)) {
|
||||
$('.dnsAsWhole').hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {}
|
||||
function cantLoadInitialData(response) {
|
||||
}
|
||||
});
|
||||
|
||||
/* Load average */
|
||||
|
||||
app.controller('loadAvg', function($scope,$http,$timeout) {
|
||||
app.controller('loadAvg', function ($scope, $http, $timeout) {
|
||||
|
||||
//getStuff();
|
||||
|
||||
@@ -339,7 +378,7 @@ app.controller('loadAvg', function($scope,$http,$timeout) {
|
||||
|
||||
/// home page system status
|
||||
|
||||
app.controller('homePageStatus', function($scope,$http,$timeout) {
|
||||
app.controller('homePageStatus', function ($scope, $http, $timeout) {
|
||||
|
||||
getStuff();
|
||||
|
||||
@@ -373,76 +412,68 @@ app.controller('homePageStatus', function($scope,$http,$timeout) {
|
||||
$scope.AvailSSL = response.data.AvailSSL;
|
||||
|
||||
|
||||
|
||||
$("#redcircle").addClass("c100");
|
||||
$("#redcircle").addClass("p"+$scope.cpuUsage);
|
||||
$("#redcircle").addClass("p" + $scope.cpuUsage);
|
||||
$("#redcircle").addClass("red");
|
||||
|
||||
$("#greencircle").addClass("c100");
|
||||
$("#greencircle").addClass("p"+$scope.ramUsage);
|
||||
$("#greencircle").addClass("p" + $scope.ramUsage);
|
||||
$("#greencircle").addClass("green");
|
||||
|
||||
|
||||
$("#pinkcircle").addClass("c100");
|
||||
$("#pinkcircle").addClass("p"+$scope.diskUsage);
|
||||
$("#pinkcircle").addClass("p" + $scope.diskUsage);
|
||||
$("#pinkcircle").addClass("red");
|
||||
|
||||
|
||||
// home page cpu,ram and disk update.
|
||||
var rotationMultiplier = 3.6;
|
||||
// For each div that its id ends with "circle", do the following.
|
||||
$( "div[id$='circle']" ).each(function() {
|
||||
$("div[id$='circle']").each(function () {
|
||||
// Save all of its classes in an array.
|
||||
var classList = $( this ).attr('class').split(/\s+/);
|
||||
var classList = $(this).attr('class').split(/\s+/);
|
||||
// Iterate over the array
|
||||
for (var i = 0; i < classList.length; i++) {
|
||||
/* If there's about a percentage class, take the actual percentage and apply the
|
||||
css transformations in all occurences of the specified percentage class,
|
||||
even for the divs without an id ending with "circle" */
|
||||
if (classList[i].match("^p"+$scope.cpuUsage)) {
|
||||
if (classList[i].match("^p" + $scope.cpuUsage)) {
|
||||
var rotationPercentage = $scope.cpuUsage;
|
||||
var rotationDegrees = rotationMultiplier*rotationPercentage;
|
||||
$('.c100.p'+rotationPercentage+ ' .bar').css({
|
||||
'-webkit-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-moz-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-ms-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-o-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'transform' : 'rotate(' + rotationDegrees + 'deg)'
|
||||
var rotationDegrees = rotationMultiplier * rotationPercentage;
|
||||
$('.c100.p' + rotationPercentage + ' .bar').css({
|
||||
'-webkit-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-moz-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-ms-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-o-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'transform': 'rotate(' + rotationDegrees + 'deg)'
|
||||
});
|
||||
}
|
||||
else if(classList[i].match("^p"+$scope.ramUsage)){
|
||||
var rotationPercentage = response.data.ramUsage;;
|
||||
var rotationDegrees = rotationMultiplier*rotationPercentage;
|
||||
$('.c100.p'+rotationPercentage+ ' .bar').css({
|
||||
'-webkit-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-moz-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-ms-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-o-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'transform' : 'rotate(' + rotationDegrees + 'deg)'
|
||||
} else if (classList[i].match("^p" + $scope.ramUsage)) {
|
||||
var rotationPercentage = response.data.ramUsage;
|
||||
;
|
||||
var rotationDegrees = rotationMultiplier * rotationPercentage;
|
||||
$('.c100.p' + rotationPercentage + ' .bar').css({
|
||||
'-webkit-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-moz-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-ms-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-o-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'transform': 'rotate(' + rotationDegrees + 'deg)'
|
||||
});
|
||||
}
|
||||
else if(classList[i].match("^p"+$scope.diskUsage)){
|
||||
var rotationPercentage = response.data.diskUsage;;
|
||||
var rotationDegrees = rotationMultiplier*rotationPercentage;
|
||||
$('.c100.p'+rotationPercentage+ ' .bar').css({
|
||||
'-webkit-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-moz-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-ms-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-o-transform' : 'rotate(' + rotationDegrees + 'deg)',
|
||||
'transform' : 'rotate(' + rotationDegrees + 'deg)'
|
||||
} else if (classList[i].match("^p" + $scope.diskUsage)) {
|
||||
var rotationPercentage = response.data.diskUsage;
|
||||
;
|
||||
var rotationDegrees = rotationMultiplier * rotationPercentage;
|
||||
$('.c100.p' + rotationPercentage + ' .bar').css({
|
||||
'-webkit-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-moz-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-ms-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'-o-transform': 'rotate(' + rotationDegrees + 'deg)',
|
||||
'transform': 'rotate(' + rotationDegrees + 'deg)'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialData(response) {
|
||||
@@ -456,11 +487,11 @@ app.controller('homePageStatus', function($scope,$http,$timeout) {
|
||||
|
||||
////////////
|
||||
|
||||
function increment(){
|
||||
function increment() {
|
||||
$('.box').hide();
|
||||
setTimeout(function(){
|
||||
setTimeout(function () {
|
||||
$('.box').show();
|
||||
},100);
|
||||
}, 100);
|
||||
|
||||
|
||||
}
|
||||
@@ -469,7 +500,7 @@ increment();
|
||||
|
||||
////////////
|
||||
|
||||
app.controller('versionManagment', function($scope,$http,$timeout) {
|
||||
app.controller('versionManagment', function ($scope, $http, $timeout) {
|
||||
|
||||
$scope.upgradeLoading = true;
|
||||
$scope.upgradelogBox = true;
|
||||
@@ -480,9 +511,7 @@ app.controller('versionManagment', function($scope,$http,$timeout) {
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
|
||||
|
||||
|
||||
$scope.upgrade = function() {
|
||||
$scope.upgrade = function () {
|
||||
|
||||
$scope.upgradeLoading = false;
|
||||
$scope.updateError = true;
|
||||
@@ -498,15 +527,14 @@ app.controller('versionManagment', function($scope,$http,$timeout) {
|
||||
|
||||
function ListInitialData(response) {
|
||||
|
||||
if(response.data.upgrade == 1){
|
||||
if (response.data.upgrade == 1) {
|
||||
$scope.upgradeLoading = true;
|
||||
$scope.updateError = true;
|
||||
$scope.updateStarted = false;
|
||||
$scope.updateFinish = true;
|
||||
$scope.couldNotConnect = true;
|
||||
getUpgradeStatus();
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.updateError = false;
|
||||
$scope.updateStarted = true;
|
||||
$scope.updateFinish = true;
|
||||
@@ -528,32 +556,30 @@ app.controller('versionManagment', function($scope,$http,$timeout) {
|
||||
}
|
||||
|
||||
|
||||
function getUpgradeStatus(){
|
||||
function getUpgradeStatus() {
|
||||
|
||||
$scope.upgradeLoading = false;
|
||||
|
||||
url = "/base/UpgradeStatus";
|
||||
|
||||
var data = {
|
||||
};
|
||||
var data = {};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if(response.data.upgradeStatus === 1){
|
||||
if (response.data.upgradeStatus === 1) {
|
||||
|
||||
if(response.data.finished===1){
|
||||
if (response.data.finished === 1) {
|
||||
$timeout.cancel();
|
||||
$scope.upgradelogBox = false;
|
||||
$scope.upgradeLog = response.data.upgradeLog;
|
||||
@@ -563,15 +589,15 @@ app.controller('versionManagment', function($scope,$http,$timeout) {
|
||||
$scope.updateFinish = false;
|
||||
$scope.couldNotConnect = true;
|
||||
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$scope.upgradelogBox = false;
|
||||
$scope.upgradeLog = response.data.upgradeLog;
|
||||
$timeout(getUpgradeStatus,2000);
|
||||
$timeout(getUpgradeStatus, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
|
||||
$scope.updateError = true;
|
||||
|
||||
14
static/managePHP/managePHP.js
Executable file → Normal file
14
static/managePHP/managePHP.js
Executable file → Normal file
@@ -261,6 +261,7 @@ app.controller('installExtensions', function ($scope, $http, $timeout) {
|
||||
app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
|
||||
$scope.loadingPHP = true;
|
||||
$scope.cyberPanelLoading = true;
|
||||
$scope.canNotFetch = true;
|
||||
$scope.phpDetailsBox = true;
|
||||
$scope.couldNotConnect = true;
|
||||
@@ -377,7 +378,6 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
$scope.saveChanges = function () {
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
@@ -439,7 +439,6 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
$scope.fetchAdvancePHPDetails = function () {
|
||||
$scope.loadingPHP = false;
|
||||
$scope.savebtnAdvance = true;
|
||||
@@ -501,7 +500,6 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
$scope.saveChangesAdvance = function () {
|
||||
|
||||
$scope.loadingPHP = false;
|
||||
@@ -555,6 +553,16 @@ app.controller('editPHPConfig', function ($scope, $http, $timeout) {
|
||||
|
||||
};
|
||||
|
||||
$scope.restartPHP = function () {
|
||||
|
||||
globalScope = $scope;
|
||||
$scope.cyberPanelLoading = false;
|
||||
url = "/managephp/restartPHP";
|
||||
var data = {};
|
||||
GLobalAjaxCall($http, url, data, GlobalRespSuccess, GlobalRespFailed);
|
||||
|
||||
};
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
67
static/manageSSL/manageSSL.js
Executable file → Normal file
67
static/manageSSL/manageSSL.js
Executable file → Normal file
@@ -4,7 +4,7 @@
|
||||
|
||||
|
||||
/* Java script code to issue SSL */
|
||||
app.controller('sslIssueCtrl', function($scope,$http) {
|
||||
app.controller('sslIssueCtrl', function ($scope, $http) {
|
||||
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -17,29 +17,29 @@ app.controller('sslIssueCtrl', function($scope,$http) {
|
||||
$scope.issueSSLBtn = false;
|
||||
};
|
||||
|
||||
$scope.issueSSL = function(){
|
||||
$scope.issueSSL = function () {
|
||||
$scope.manageSSLLoading = false;
|
||||
|
||||
var url = "/manageSSL/issueSSL";
|
||||
|
||||
|
||||
var data = {
|
||||
virtualHost:$scope.virtualHost,
|
||||
virtualHost: $scope.virtualHost,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if(response.data.SSL == 1){
|
||||
if (response.data.SSL == 1) {
|
||||
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -51,10 +51,7 @@ app.controller('sslIssueCtrl', function($scope,$http) {
|
||||
$scope.sslDomain = $scope.virtualHost;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
$scope.issueSSLBtn = false;
|
||||
@@ -66,8 +63,8 @@ app.controller('sslIssueCtrl', function($scope,$http) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -79,9 +76,6 @@ app.controller('sslIssueCtrl', function($scope,$http) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
@@ -89,7 +83,7 @@ app.controller('sslIssueCtrl', function($scope,$http) {
|
||||
|
||||
|
||||
/* Java script code to issue SSL for hostname */
|
||||
app.controller('sslIssueForHostNameCtrl', function($scope,$http) {
|
||||
app.controller('sslIssueForHostNameCtrl', function ($scope, $http) {
|
||||
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -103,30 +97,29 @@ app.controller('sslIssueForHostNameCtrl', function($scope,$http) {
|
||||
};
|
||||
|
||||
|
||||
|
||||
$scope.issueSSL = function(){
|
||||
$scope.issueSSL = function () {
|
||||
$scope.manageSSLLoading = false;
|
||||
|
||||
var url = "/manageSSL/obtainHostNameSSL";
|
||||
|
||||
|
||||
var data = {
|
||||
virtualHost:$scope.virtualHost,
|
||||
virtualHost: $scope.virtualHost,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if(response.data.SSL == 1){
|
||||
if (response.data.SSL == 1) {
|
||||
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -138,10 +131,7 @@ app.controller('sslIssueForHostNameCtrl', function($scope,$http) {
|
||||
$scope.sslDomain = $scope.virtualHost;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
$scope.issueSSLBtn = false;
|
||||
@@ -153,8 +143,8 @@ app.controller('sslIssueForHostNameCtrl', function($scope,$http) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -166,9 +156,6 @@ app.controller('sslIssueForHostNameCtrl', function($scope,$http) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
@@ -176,7 +163,7 @@ app.controller('sslIssueForHostNameCtrl', function($scope,$http) {
|
||||
|
||||
|
||||
/* Java script code to issue SSL for MailServer */
|
||||
app.controller('sslIssueForMailServer', function($scope,$http) {
|
||||
app.controller('sslIssueForMailServer', function ($scope, $http) {
|
||||
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -190,7 +177,7 @@ app.controller('sslIssueForMailServer', function($scope,$http) {
|
||||
};
|
||||
|
||||
|
||||
$scope.issueSSL = function(){
|
||||
$scope.issueSSL = function () {
|
||||
|
||||
$scope.manageSSLLoading = false;
|
||||
|
||||
@@ -198,22 +185,22 @@ app.controller('sslIssueForMailServer', function($scope,$http) {
|
||||
|
||||
|
||||
var data = {
|
||||
virtualHost:$scope.virtualHost,
|
||||
virtualHost: $scope.virtualHost,
|
||||
};
|
||||
|
||||
var config = {
|
||||
headers : {
|
||||
headers: {
|
||||
'X-CSRFToken': getCookie('csrftoken')
|
||||
}
|
||||
};
|
||||
|
||||
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
|
||||
|
||||
|
||||
function ListInitialDatas(response) {
|
||||
|
||||
|
||||
if(response.data.SSL === 1){
|
||||
if (response.data.SSL === 1) {
|
||||
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -225,10 +212,7 @@ app.controller('sslIssueForMailServer', function($scope,$http) {
|
||||
$scope.sslDomain = $scope.virtualHost;
|
||||
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
} else {
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
$scope.issueSSLBtn = false;
|
||||
@@ -240,8 +224,8 @@ app.controller('sslIssueForMailServer', function($scope,$http) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function cantLoadInitialDatas(response) {
|
||||
$scope.sslIssueCtrl = true;
|
||||
$scope.manageSSLLoading = true;
|
||||
@@ -253,9 +237,6 @@ app.controller('sslIssueForMailServer', function($scope,$http) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user