Initial OpenECOMP policy/engine commit
[policy/engine.git] / ecomp-sdk-app / src / main / webapp / WEB-INF / fusion / jsp / collaborateList.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal SDK
4   ================================================================================
5   Copyright (C) 2017 AT&T Intellectual Property
6   ================================================================================
7   Licensed under the Apache License, Version 2.0 (the "License");
8   you may not use this file except in compliance with the License.
9   You may obtain a copy of the License at
10   
11        http://www.apache.org/licenses/LICENSE-2.0
12   
13   Unless required by applicable law or agreed to in writing, software
14   distributed under the License is distributed on an "AS IS" BASIS,
15   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   See the License for the specific language governing permissions and
17   limitations under the License.
18   ================================================================================
19   --%>
20 <%@ include file="/WEB-INF/fusion/jsp/popup_modal.html" %>
21 <div>
22 <a href="JavaScript:void(0);" style= "color:#00547A" onClick="downloadScreenCaptureExtenstion()" id="install-button">
23                 Please download the extension for ScreenCapture and refresh page</a>
24                 </div>
25 <div ng-controller="collaborateListController" id="collaborate_ctrl">
26         <div>
27                 <h1 class="heading1" style="margin-top:20px;">User List</h1>
28                 <div style="margin-top:30px">
29                         <table att-table table-data="tableData" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
30
31                             <thead  att-table-row type="header">
32                                         <tr>
33                                                 <th att-table-header key="id">User ID</th>
34                                     <th att-table-header key="lastName">Last Name</th>        
35                                     <th att-table-header key="firstName">First Name</th>    
36                                     <th att-table-header key="email">Email</th>
37                                     <th att-table-header key="orgUserId">UserId</th>        
38                                     <th att-table-header key="online" default-sort="d">Online/Offline</th>         
39                                 </tr>
40                             </thead>
41                             <tbody att-table-row type="body" row-repeat="rowData in tableData">
42                                 <tr>
43                                 <td att-table-body ng-bind="rowData['id']"></td>
44                                 <td att-table-body ng-bind="rowData['lastName']"></td>
45                                 <td att-table-body ng-bind="rowData['firstName']"></td>
46                                 <td att-table-body ng-bind="rowData['email']"></td>
47                                 <td att-table-body ng-bind="rowData['orgUserId']"></td>
48                                         <td att-table-body >
49                                            <tag-badges ng-hide="rowData.online" style-type="color" class="lred" ng-click="rowData.isActive=true;openCollaboration(rowData.chatId)">Offline</tag-badges>
50                                                    <tag-badges ng-show="rowData.online" style-type="color" class="lgreen" ng-click="rowData.isActive=false;openCollaboration(rowData.chatId)">Online</tag-badges>                               
51                                    </td>
52                                 </tr>     
53                             </tbody>      
54                         </table>
55                 </div>
56         </div>  
57         <div class="fn-ebz-container">
58                   Rows Per Page:
59                   <input class="fn-ebz-text" type="text" ng-model="viewPerPage" size="5" style="width: 47px;">
60     </div>
61         <div class="fn-ebz-container">
62                   Current Page:
63                   <input class="fn-ebz-text" type="text" ng-model="currentPage" size="5" style="width: 47px;">
64     </div>
65     <div class="fn-ebz-container">
66                   Total Page(s):
67                   <input class="fn-ebz-text" type="text" ng-model="totalPage" size="5" readonly="true" style="width: 47px;">
68     </div>
69         
70
71 </div>
72
73
74 <!-- handling websocket peer broadcast session -->
75   <script type="text/javascript" src="app/fusion/scripts/socket/peerBroadcast.js"></script> 
76   <script type="text/javascript" src="app/fusion/external/utils/js/browserCheck.js"></script>
77   <script>
78  
79         var initialPageVisit = "${sessionScope.initialPageVisit}";
80         var userId     = "${sessionScope.user.orgUserId}";
81         socketSetup(initialPageVisit, userId, null, "socketSend");
82         
83   
84   </script>
85  
86 <script>
87 var popupModalService;
88 app.controller("collaborateListController", function ($scope,$http,modalService, $modal) { 
89         // Table Data
90         $scope.tableData=${model.profileList};
91         $scope.viewPerPage = 20;
92     $scope.scrollViewsPerPage = 2;
93     $scope.currentPage = 1;
94     $scope.totalPage;
95     $scope.searchCategory = "";
96     $scope.searchString = "";
97     popupModalService = modalService;
98     setPopupService(modalService);
99  /*    modalService.showSuccess('','Modal Sample') ; */
100         for(x in $scope.tableData){
101                 if($scope.tableData[x].active_yn=='Y')
102                         $scope.tableData[x].active_yn=true;
103                 else
104                         $scope.tableData[x].active_yn=false;
105         }
106     $scope.openCollaboration = function(chatId){
107         openInNewTab('collaboration?chat_id=' + chatId);
108         
109     }
110    
111     $scope.toggleProfileActive = function(profileId) {
112         if (confirm("You are about to change user's active status. Do you want to continue?")) {
113                  $http.get("profile/toggleProfileActive?profile_id="+profileId).success(function(){});
114         }
115     };
116    
117 });
118
119 function openInNewTab(url) {
120           
121         //popupModalService.popupConfirmWin("Confirm","");
122         var win = window.open(url, '_blank');
123         win.popupService = popupModalService;
124         win.focus();
125 };
126
127 function downloadScreenCaptureExtenstion() {
128           
129           var chromeURL = 'https://chrome.google.com/webstore/detail/icgmlogfeajbfdffajhoebcfbibfhaen';
130           var firefoxURL = 'https://addons.mozilla.org/en-US/firefox/addon/screen-capturing-capability';
131           var url;
132           
133           if(isChrome)
134                 url = chromeURL;
135           else if(isFirefox)
136                 url =   firefoxURL;
137           
138           var win = window.open(url);
139           win.focus();
140 };
141
142 </script>
143
144
145  
146   <div id="peerBroadcastSection"> </div>