centralized execution ph3

This commit is contained in:
usmannasir
2019-03-30 14:21:52 +05:00
parent 34410360c7
commit 40b6093d3e
27 changed files with 766 additions and 457 deletions

View File

@@ -1419,4 +1419,79 @@ app.controller('resellerCenterCTRL', function($scope,$http) {
};
});
/* Java script code for reseller center acl */
/* Java script code for reseller center acl */
/* Java script code for api access */
app.controller('apiAccessCTRL', function($scope,$http) {
$scope.apiAccessDropDown = true;
$scope.cyberpanelLoading = true;
$scope.showApiAccessDropDown = function () {
$scope.apiAccessDropDown = false;
};
$scope.saveChanges = function(){
$scope.cyberpanelLoading = false;
var url = "/users/saveChangesAPIAccess";
var data = {
accountUsername:$scope.accountUsername,
access:$scope.access,
};
var config = {
headers : {
'X-CSRFToken': getCookie('csrftoken')
}
};
$http.post(url, data,config).then(ListInitialDatas, cantLoadInitialDatas);
function ListInitialDatas(response) {
$scope.cyberpanelLoading = true;
if (response.data.status === 1)
{
$scope.apiAccessDropDown = true;
new PNotify({
title: 'Success!',
text: 'Changes successfully applied!',
type:'success'
});
}
else{
new PNotify({
title: 'Error!',
text: response.data.error_message,
type:'error'
});
}
}
function cantLoadInitialDatas(response) {
$scope.cyberpanelLoading = true;
new PNotify({
title: 'Error!',
text: 'Could not connect to server, please refresh this page.',
type:'error'
});
}
};
});
/* Java script code for api access */