Usman Nasir
2021-03-11 13:41:47 +05:00
parent c6e5de1b36
commit 1d18a1c2fb
6 changed files with 169 additions and 12 deletions

View File

@@ -20,6 +20,7 @@ function getCookie(name) {
return cookieValue;
}
/* Java script code to create account */
app.controller('createWebsite', function ($scope, $http, $timeout, $window) {
@@ -388,7 +389,6 @@ app.controller('listWebsites', function ($scope, $http) {
app.controller('listChildDomainsMain', function ($scope, $http, $timeout) {
$scope.currentPage = 1;
$scope.recordsToShow = 10;
@@ -700,7 +700,59 @@ app.controller('listChildDomainsMain', function ($scope, $http, $timeout) {
}
var DeleteDomain;
$scope.deleteDomainInit = function (childDomainForDeletion){
DeleteDomain = childDomainForDeletion;
};
$scope.deleteChildDomain = function () {
$scope.cyberPanelLoading = false;
url = "/websites/submitDomainDeletion";
var data = {
websiteName: DeleteDomain,
DeleteDocRoot: $scope.DeleteDocRoot
};
var config = {
headers: {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data, config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberPanelLoading = true;
if (response.data.websiteDeleteStatus === 1) {
new PNotify({
title: 'Success!',
text: 'Child Domain successfully deleted.',
type: 'success'
});
$scope.getFurtherWebsitesFromDB();
} else {
new PNotify({
title: 'Operation Failed!',
text: response.data.error_message,
type: 'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberPanelLoading = true;
new PNotify({
title: 'Operation Failed!',
text: 'Could not connect to server, please refresh this page',
type: 'error'
});
}
};
});