ab229714eb074ed5be0d6d72301088b24d139b00
[portal/sdk.git] /
1 appDS2.controller('usageListControllerDS2', function ($scope,$interval,$http,$modal, AdminService){
2         AdminService.getUsageList().then(function(data){
3                 
4                 var j = data;
5                 $scope.data = JSON.parse(j.data);
6                 $scope.users =$scope.data;
7                 //$scope.resetMenu();                   
8                 
9         },function(error){
10                 console.log("failed");
11                 reloadPageOnce();
12         });
13         
14         $scope.successPopUp = function () {
15                 var modalInstance = $modal.open({
16                 templateUrl: 'app/fusion/scripts/DS2-modal/success_modal.html',
17                 controller: ModalInstanceCtrl,
18                 sizeClass: 'modal-small',
19                 resolve: {
20                 items: function () {
21                 return '';
22                 }
23                 }
24                 });
25                 };
26                 
27         $scope.removeSession = function(sessionId) {
28
29                 $http.get("usage_list/removeSession?deleteSessionId="+sessionId).success(function(response){
30                         $scope.users=response;
31                         $scope.successPopUp();
32         });
33 /*              modalService.popupConfirmWin("Confirm","You are about to expel this user from the application. All of their unsaved data will be lost. Do you want to continue?",
34                         function(){
35                                   $http.get("usage_list/removeSession?deleteSessionId="+sessionId).success(function(response){$scope.users=response;});
36         })*/
37                 
38         }
39 });