diff --git a/static/baseTemplate/custom-js/system-status.js b/static/baseTemplate/custom-js/system-status.js index 2cfd5d1e6..41680df3f 100644 --- a/static/baseTemplate/custom-js/system-status.js +++ b/static/baseTemplate/custom-js/system-status.js @@ -36,15 +36,52 @@ function randomPassword(length) { var app = angular.module('CyberCP', []); -app.config(['$interpolateProvider', function($interpolateProvider) { - $interpolateProvider.startSymbol('{$'); - $interpolateProvider.endSymbol('$}'); - }]); +var globalScope; -app.filter('getwebsitename', function() { - return function(domain, uppercase) { +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' + }); + } +} - if(domain !== undefined) { +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) { + + 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,224 +128,225 @@ 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"; + url = "/base/getAdminStatus"; - $http.get(url).then(ListInitialData, cantLoadInitialData); + $http.get(url).then(ListInitialData, cantLoadInitialData); - function ListInitialData(response) { + function ListInitialData(response) { - $scope.currentAdmin = response.data.adminName; - $scope.admin_type = response.data.admin_type; + $scope.currentAdmin = response.data.adminName; + $scope.admin_type = response.data.admin_type; - $("#serverIPAddress").text(response.data.serverIPAddress); + $("#serverIPAddress").text(response.data.serverIPAddress); - if (response.data.admin === 0) { - $('.serverACL').hide(); + if (response.data.admin === 0) { + $('.serverACL').hide(); - if(!Boolean(response.data.versionManagement)){ - $('.versionManagement').hide(); - } - // User Management - if(!Boolean(response.data.createNewUser)){ - $('.createNewUser').hide(); - } - if(!Boolean(response.data.listUsers)){ - $('.listUsers').hide(); - } - if(!Boolean(response.data.resellerCenter)){ - $('.resellerCenter').hide(); - } - if(!Boolean(response.data.deleteUser)){ - $('.deleteUser').hide(); - } - if(!Boolean(response.data.changeUserACL)){ - $('.changeUserACL').hide(); - } - // Website Management - if(!Boolean(response.data.createWebsite)){ - $('.createWebsite').hide(); - } + if (!Boolean(response.data.versionManagement)) { + $('.versionManagement').hide(); + } + // User Management + if (!Boolean(response.data.createNewUser)) { + $('.createNewUser').hide(); + } + if (!Boolean(response.data.listUsers)) { + $('.listUsers').hide(); + } + if (!Boolean(response.data.resellerCenter)) { + $('.resellerCenter').hide(); + } + if (!Boolean(response.data.deleteUser)) { + $('.deleteUser').hide(); + } + if (!Boolean(response.data.changeUserACL)) { + $('.changeUserACL').hide(); + } + // Website Management + if (!Boolean(response.data.createWebsite)) { + $('.createWebsite').hide(); + } - if(!Boolean(response.data.modifyWebsite)){ - $('.modifyWebsite').hide(); - } + if (!Boolean(response.data.modifyWebsite)) { + $('.modifyWebsite').hide(); + } - if(!Boolean(response.data.suspendWebsite)){ - $('.suspendWebsite').hide(); - } + if (!Boolean(response.data.suspendWebsite)) { + $('.suspendWebsite').hide(); + } - if(!Boolean(response.data.deleteWebsite)){ - $('.deleteWebsite').hide(); - } + if (!Boolean(response.data.deleteWebsite)) { + $('.deleteWebsite').hide(); + } - // Package Management + // Package Management - if(!Boolean(response.data.createPackage)){ - $('.createPackage').hide(); - } + if (!Boolean(response.data.createPackage)) { + $('.createPackage').hide(); + } - if(!Boolean(response.data.listPackages)){ - $('.listPackages').hide(); - } + if (!Boolean(response.data.listPackages)) { + $('.listPackages').hide(); + } - if(!Boolean(response.data.deletePackage)){ - $('.deletePackage').hide(); - } + if (!Boolean(response.data.deletePackage)) { + $('.deletePackage').hide(); + } - if(!Boolean(response.data.modifyPackage)){ - $('.modifyPackage').hide(); - } + if (!Boolean(response.data.modifyPackage)) { + $('.modifyPackage').hide(); + } - // Database Management + // Database Management - if(!Boolean(response.data.createDatabase)){ - $('.createDatabase').hide(); - } + if (!Boolean(response.data.createDatabase)) { + $('.createDatabase').hide(); + } - if(!Boolean(response.data.deleteDatabase)){ - $('.deleteDatabase').hide(); - } + if (!Boolean(response.data.deleteDatabase)) { + $('.deleteDatabase').hide(); + } - if(!Boolean(response.data.listDatabases)){ - $('.listDatabases').hide(); - } + if (!Boolean(response.data.listDatabases)) { + $('.listDatabases').hide(); + } - // DNS Management + // DNS Management - if(!Boolean(response.data.dnsAsWhole)){ - $('.dnsAsWhole').hide(); - } + if (!Boolean(response.data.dnsAsWhole)) { + $('.dnsAsWhole').hide(); + } - if(!Boolean(response.data.createNameServer)){ - $('.createNameServer').hide(); - } + if (!Boolean(response.data.createNameServer)) { + $('.createNameServer').hide(); + } - if(!Boolean(response.data.createDNSZone)){ - $('.createDNSZone').hide(); - } + if (!Boolean(response.data.createDNSZone)) { + $('.createDNSZone').hide(); + } - if(!Boolean(response.data.deleteZone)){ - $('.addDeleteRecords').hide(); - } + if (!Boolean(response.data.deleteZone)) { + $('.addDeleteRecords').hide(); + } - if(!Boolean(response.data.addDeleteRecords)){ - $('.deleteDatabase').hide(); - } + if (!Boolean(response.data.addDeleteRecords)) { + $('.deleteDatabase').hide(); + } - // Email Management + // Email Management - if(!Boolean(response.data.emailAsWhole)){ - $('.emailAsWhole').hide(); - } + if (!Boolean(response.data.emailAsWhole)) { + $('.emailAsWhole').hide(); + } - if(!Boolean(response.data.listEmails)){ - $('.listEmails').hide(); - } + if (!Boolean(response.data.listEmails)) { + $('.listEmails').hide(); + } - if(!Boolean(response.data.createEmail)){ - $('.createEmail').hide(); - } + if (!Boolean(response.data.createEmail)) { + $('.createEmail').hide(); + } - if(!Boolean(response.data.deleteEmail)){ - $('.deleteEmail').hide(); - } + if (!Boolean(response.data.deleteEmail)) { + $('.deleteEmail').hide(); + } - if(!Boolean(response.data.emailForwarding)){ - $('.emailForwarding').hide(); - } + if (!Boolean(response.data.emailForwarding)) { + $('.emailForwarding').hide(); + } - if(!Boolean(response.data.changeEmailPassword)){ - $('.changeEmailPassword').hide(); - } + if (!Boolean(response.data.changeEmailPassword)) { + $('.changeEmailPassword').hide(); + } - if(!Boolean(response.data.dkimManager)){ - $('.dkimManager').hide(); - } + if (!Boolean(response.data.dkimManager)) { + $('.dkimManager').hide(); + } - // FTP Management + // FTP Management - if(!Boolean(response.data.ftpAsWhole)){ - $('.ftpAsWhole').hide(); - } + if (!Boolean(response.data.ftpAsWhole)) { + $('.ftpAsWhole').hide(); + } - if(!Boolean(response.data.createFTPAccount)){ - $('.createFTPAccount').hide(); - } + if (!Boolean(response.data.createFTPAccount)) { + $('.createFTPAccount').hide(); + } - if(!Boolean(response.data.deleteFTPAccount)){ - $('.deleteFTPAccount').hide(); - } + if (!Boolean(response.data.deleteFTPAccount)) { + $('.deleteFTPAccount').hide(); + } - if(!Boolean(response.data.listFTPAccounts)){ - $('.listFTPAccounts').hide(); - } + if (!Boolean(response.data.listFTPAccounts)) { + $('.listFTPAccounts').hide(); + } - // Backup Management + // Backup Management - if(!Boolean(response.data.createBackup)){ - $('.createBackup').hide(); - } + if (!Boolean(response.data.createBackup)) { + $('.createBackup').hide(); + } - if(!Boolean(response.data.restoreBackup)){ - $('.restoreBackup').hide(); - } + if (!Boolean(response.data.restoreBackup)) { + $('.restoreBackup').hide(); + } - if(!Boolean(response.data.addDeleteDestinations)){ - $('.addDeleteDestinations').hide(); - } + if (!Boolean(response.data.addDeleteDestinations)) { + $('.addDeleteDestinations').hide(); + } - if(!Boolean(response.data.scheDuleBackups)){ - $('.scheDuleBackups').hide(); - } + if (!Boolean(response.data.scheDuleBackups)) { + $('.scheDuleBackups').hide(); + } - if(!Boolean(response.data.remoteBackups)){ - $('.remoteBackups').hide(); - } + if (!Boolean(response.data.remoteBackups)) { + $('.remoteBackups').hide(); + } - // SSL Management + // SSL Management - if(!Boolean(response.data.manageSSL)){ - $('.manageSSL').hide(); - } + if (!Boolean(response.data.manageSSL)) { + $('.manageSSL').hide(); + } - if(!Boolean(response.data.hostnameSSL)){ - $('.hostnameSSL').hide(); - } + if (!Boolean(response.data.hostnameSSL)) { + $('.hostnameSSL').hide(); + } - if(!Boolean(response.data.mailServerSSL)){ - $('.mailServerSSL').hide(); - } + if (!Boolean(response.data.mailServerSSL)) { + $('.mailServerSSL').hide(); + } - }else{ + } else { - if(!Boolean(response.data.emailAsWhole)){ - $('.emailAsWhole').hide(); - } + if (!Boolean(response.data.emailAsWhole)) { + $('.emailAsWhole').hide(); + } - if(!Boolean(response.data.ftpAsWhole)){ - $('.ftpAsWhole').hide(); - } + if (!Boolean(response.data.ftpAsWhole)) { + $('.ftpAsWhole').hide(); + } - if(!Boolean(response.data.dnsAsWhole)){ - $('.dnsAsWhole').hide(); - } - } + 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)) { - 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)' - }); - } - 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)' - }); - } + /* 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)) { + 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)' + }); + } 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)' + }); + } } }); - - - - - - - } function cantLoadInitialData(response) { @@ -456,11 +487,11 @@ app.controller('homePageStatus', function($scope,$http,$timeout) { //////////// -function increment(){ - $('.box').hide(); - setTimeout(function(){ - $('.box').show(); - },100); +function increment() { + $('.box').hide(); + setTimeout(function () { + $('.box').show(); + }, 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,21 +527,20 @@ app.controller('versionManagment', function($scope,$http,$timeout) { function ListInitialData(response) { - if(response.data.upgrade == 1){ - $scope.upgradeLoading = true; - $scope.updateError = true; - $scope.updateStarted = false; - $scope.updateFinish = true; - $scope.couldNotConnect = true; - getUpgradeStatus(); - } - else{ - $scope.updateError = false; - $scope.updateStarted = true; - $scope.updateFinish = true; - $scope.couldNotConnect = true; - $scope.errorMessage = response.data.error_message; - } + if (response.data.upgrade == 1) { + $scope.upgradeLoading = true; + $scope.updateError = true; + $scope.updateStarted = false; + $scope.updateFinish = true; + $scope.couldNotConnect = true; + getUpgradeStatus(); + } else { + $scope.updateError = false; + $scope.updateStarted = true; + $scope.updateFinish = true; + $scope.couldNotConnect = true; + $scope.errorMessage = response.data.error_message; + } } function cantLoadInitialData(response) { @@ -528,60 +556,58 @@ app.controller('versionManagment', function($scope,$http,$timeout) { } - function getUpgradeStatus(){ + function getUpgradeStatus() { - $scope.upgradeLoading = false; + $scope.upgradeLoading = false; - url = "/base/UpgradeStatus"; + url = "/base/UpgradeStatus"; - var data = { - }; + var data = {}; - var config = { - headers : { - 'X-CSRFToken': getCookie('csrftoken') - } - }; + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; - - $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas); + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - function ListInitialDatas(response) { + function ListInitialDatas(response) { - if(response.data.upgradeStatus === 1){ - - if(response.data.finished===1){ - $timeout.cancel(); - $scope.upgradelogBox = false; - $scope.upgradeLog = response.data.upgradeLog; - $scope.upgradeLoading = true; - $scope.updateError = true; - $scope.updateStarted = true; - $scope.updateFinish = false; - $scope.couldNotConnect = true; - - } - else{ - $scope.upgradelogBox = false; - $scope.upgradeLog = response.data.upgradeLog; - $timeout(getUpgradeStatus,2000); - } - } - - } - function cantLoadInitialDatas(response) { + if (response.data.upgradeStatus === 1) { + if (response.data.finished === 1) { + $timeout.cancel(); + $scope.upgradelogBox = false; + $scope.upgradeLog = response.data.upgradeLog; + $scope.upgradeLoading = true; $scope.updateError = true; $scope.updateStarted = true; - $scope.updateFinish = true; - $scope.couldNotConnect = false; + $scope.updateFinish = false; + $scope.couldNotConnect = true; + } else { + $scope.upgradelogBox = false; + $scope.upgradeLog = response.data.upgradeLog; + $timeout(getUpgradeStatus, 2000); } + } + + } + + function cantLoadInitialDatas(response) { + + $scope.updateError = true; + $scope.updateStarted = true; + $scope.updateFinish = true; + $scope.couldNotConnect = false; + + } - }; + }; }); \ No newline at end of file diff --git a/static/managePHP/managePHP.js b/static/managePHP/managePHP.js old mode 100755 new mode 100644 index 114357995..429050521 --- a/static/managePHP/managePHP.js +++ b/static/managePHP/managePHP.js @@ -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); + + }; + }); diff --git a/static/manageSSL/manageSSL.js b/static/manageSSL/manageSSL.js old mode 100755 new mode 100644 index 783e5081e..423fd7e2a --- a/static/manageSSL/manageSSL.js +++ b/static/manageSSL/manageSSL.js @@ -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; @@ -14,72 +14,66 @@ app.controller('sslIssueCtrl', function($scope,$http) { $scope.couldNotConnect = true; $scope.showbtn = function () { - $scope.issueSSLBtn = false; + $scope.issueSSLBtn = false; }; - $scope.issueSSL = function(){ - $scope.manageSSLLoading = false; + $scope.issueSSL = function () { + $scope.manageSSLLoading = false; - var url = "/manageSSL/issueSSL"; + var url = "/manageSSL/issueSSL"; - var data = { - virtualHost:$scope.virtualHost, - }; + var data = { + virtualHost: $scope.virtualHost, + }; - var config = { - headers : { - 'X-CSRFToken': getCookie('csrftoken') - } - }; + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; - $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas); + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - function ListInitialDatas(response) { + function ListInitialDatas(response) { - if(response.data.SSL == 1){ + if (response.data.SSL == 1) { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = true; - $scope.sslIssued = false; - $scope.couldNotConnect = true; + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = true; + $scope.sslIssued = false; + $scope.couldNotConnect = true; - $scope.sslDomain = $scope.virtualHost; + $scope.sslDomain = $scope.virtualHost; - } + } else { + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = false; + $scope.sslIssued = true; + $scope.couldNotConnect = true; + $scope.errorMessage = response.data.error_message; - else - { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = false; - $scope.sslIssued = true; - $scope.couldNotConnect = true; - $scope.errorMessage = response.data.error_message; - - } + } + } - } - function cantLoadInitialDatas(response) { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = true; - $scope.sslIssued = true; - $scope.couldNotConnect = false; - - } - - + function cantLoadInitialDatas(response) { + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = true; + $scope.sslIssued = true; + $scope.couldNotConnect = false; + } }; @@ -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; @@ -99,74 +93,67 @@ app.controller('sslIssueForHostNameCtrl', function($scope,$http) { $scope.couldNotConnect = true; $scope.showbtn = function () { - $scope.issueSSLBtn = false; + $scope.issueSSLBtn = false; }; + $scope.issueSSL = function () { + $scope.manageSSLLoading = false; - $scope.issueSSL = function(){ - $scope.manageSSLLoading = false; - - var url = "/manageSSL/obtainHostNameSSL"; + var url = "/manageSSL/obtainHostNameSSL"; - var data = { - virtualHost:$scope.virtualHost, - }; + var data = { + virtualHost: $scope.virtualHost, + }; - var config = { - headers : { - 'X-CSRFToken': getCookie('csrftoken') - } - }; + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; - $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas); + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - function ListInitialDatas(response) { + function ListInitialDatas(response) { - if(response.data.SSL == 1){ + if (response.data.SSL == 1) { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = true; - $scope.sslIssued = false; - $scope.couldNotConnect = true; + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = true; + $scope.sslIssued = false; + $scope.couldNotConnect = true; - $scope.sslDomain = $scope.virtualHost; + $scope.sslDomain = $scope.virtualHost; - } + } else { + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = false; + $scope.sslIssued = true; + $scope.couldNotConnect = true; + $scope.errorMessage = response.data.error_message; - else - { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = false; - $scope.sslIssued = true; - $scope.couldNotConnect = true; - $scope.errorMessage = response.data.error_message; - - } + } + } - } - function cantLoadInitialDatas(response) { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = true; - $scope.sslIssued = true; - $scope.couldNotConnect = false; - - } - - + function cantLoadInitialDatas(response) { + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = true; + $scope.sslIssued = true; + $scope.couldNotConnect = false; + } }; @@ -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; @@ -186,74 +173,68 @@ app.controller('sslIssueForMailServer', function($scope,$http) { $scope.couldNotConnect = true; $scope.showbtn = function () { - $scope.issueSSLBtn = false; + $scope.issueSSLBtn = false; }; - $scope.issueSSL = function(){ + $scope.issueSSL = function () { - $scope.manageSSLLoading = false; + $scope.manageSSLLoading = false; - var url = "/manageSSL/obtainMailServerSSL"; + var url = "/manageSSL/obtainMailServerSSL"; - var data = { - virtualHost:$scope.virtualHost, - }; + var data = { + virtualHost: $scope.virtualHost, + }; - var config = { - headers : { - 'X-CSRFToken': getCookie('csrftoken') - } - }; + var config = { + headers: { + 'X-CSRFToken': getCookie('csrftoken') + } + }; - $http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas); + $http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas); - function ListInitialDatas(response) { + function ListInitialDatas(response) { - if(response.data.SSL === 1){ + if (response.data.SSL === 1) { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = true; - $scope.sslIssued = false; - $scope.couldNotConnect = true; + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = true; + $scope.sslIssued = false; + $scope.couldNotConnect = true; - $scope.sslDomain = $scope.virtualHost; + $scope.sslDomain = $scope.virtualHost; - } + } else { + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = false; + $scope.sslIssued = true; + $scope.couldNotConnect = true; + $scope.errorMessage = response.data.error_message; - else - { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = false; - $scope.sslIssued = true; - $scope.couldNotConnect = true; - $scope.errorMessage = response.data.error_message; - - } + } + } - } - function cantLoadInitialDatas(response) { - $scope.sslIssueCtrl = true; - $scope.manageSSLLoading = true; - $scope.issueSSLBtn = false; - $scope.canNotIssue = true; - $scope.sslIssued = true; - $scope.couldNotConnect = false; - - } - - + function cantLoadInitialDatas(response) { + $scope.sslIssueCtrl = true; + $scope.manageSSLLoading = true; + $scope.issueSSLBtn = false; + $scope.canNotIssue = true; + $scope.sslIssued = true; + $scope.couldNotConnect = false; + } };