nexus site path corrected
[portal.git] / ecomp-portal-BE / war / WEB-INF / fusion / jsp / jcs_admin.jsp
1 <%--
2   ================================================================================
3   eCOMP Portal
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/include.jsp"%> --%>
21 <%@ taglib prefix="c"      uri="http://java.sun.com/jsp/jstl/core" %>
22 <%@ taglib prefix="fmt"    uri="http://java.sun.com/jsp/jstl/fmt" %>
23 <%@ taglib prefix="fn"     uri="http://java.sun.com/jsp/jstl/functions" %>
24
25 <link rel="stylesheet" type="text/css" href="static/ebz/sandbox.css"  >
26 <link rel="stylesheet" type="text/css" href="static/fusion/css/jquery-ui.css">
27
28 <script src= "static/ebz/angular_js/angular.js"></script> 
29 <script src= "static/ebz/angular_js/angular-sanitize.js"></script>
30 <script src= "static/ebz/angular_js/att_abs_tpls.js"></script>
31 <script src= "static/ebz/angular_js/app.js"></script>
32 <script src= "static/ebz/angular_js/gestures.js"></script>
33
34 <script src="static/js/jquery-1.10.2.js"></script>
35 <script src="static/js/modalService.js"></script>
36 <script src="static/js/jquery.mask.min.js" type="text/javascript"></script>
37 <script src="static/js/jquery-ui.js" type="text/javascript"></script>
38 <jsp:include page="/WEB-INF/fusion/jsp/popup_modal.html" ></jsp:include>
39
40 <div align="left" ng-controller="cacheAdminController">
41         <div class="pageTitle"><h3>Cache Regions</h3></div>
42         These are the regions which are currently defined in the cache. 'Items' and 'Bytes' refer to the elements currently in memory (not spooled).
43         You can clear all items for a region by clicking on the Clear icon next to the desired region below. You can also <a href="#" ng-click="clearAll();">clear all regions</a> which
44         empties the entire cache. <br /><br />
45
46         <div style="width: 97%; border-top: 1px solid #c4c4c4; margin-top: 0px; background-color: #fff; padding: 10px 0; color: #646464s">
47                 <div style="margin: 0 20px 10px 0px; font-size: 80%; float: left; width: 97%;">
48                         <div class="col-md-4"><b>Cache Name</b></div>
49                         <div class="col-md-2"><b># of Items</b></div>
50                         <div class="col-md-2"><b>Bytes</b></div>
51                         <div class="col-md-2"><b>Status</b></div>
52                         <div class="col-md-3"><b>Memory Hits</b></div>
53                         <div class="col-md-3"><b>Aux Hits</b></div>
54                         <div class="col-md-3"><b>Not Found Misses</b></div>
55                         <div class="col-md-3"><b>Expired Misses</b></div>
56                         <div class="col-md-1"><b>Clear?</b></div>
57                         <div class="col-md-1"><b>Items</b></div>
58                 </div>
59                 <div ng-repeat="region in regions">
60                         <div style="margin: 0 20px 10px 0px; font-size: 80%; float: left; width: 97%;">
61                                 <div class="col-md-4"><a href="#" tooltip="Click to Show Region Details" ng-click="showRegionDetails(region.cacheName);">{{region.cacheName}}</a></div>
62                                 <div class="col-md-2">{{region.size}}</div>
63                                 <div class="col-md-2">{{region.byteCount}}</div>
64                                 <div class="col-md-2">{{region.status}}</div>
65                                 <div class="col-md-3">{{region.hitCountRam}}</div>
66                                 <div class="col-md-3">{{region.hitCountAux}}</div>
67                                 <div class="col-md-3">{{region.missCountNotFound}}</div>
68                                 <div class="col-md-3">{{region.missCountExpired}}</div>
69                                 <div class="col-md-1">
70                                         <div ng-click="clearRegion(region.cacheName);" style="font-size:20px;"><a href="javascript:void(0)" class="icon-trash"></a></div>
71                                 </div>
72                                 <div class="col-md-1"><span class="att--tree__plus col-md-1" ng-class="{minus: bling$index}" ng-click="bling$index = !bling$index" style="display: block;"></span></div>
73                         </div>
74                         <div style="margin: 0px 20px 0px 30px; font-size: 80%; float: left; width: 95%; border-top: 1px solid #e4e4e4; padding-top: 10px"
75                                 ng-show="bling$index">
76                                 <span class="att--tree__arrow" style="height: 20px; width: 20px; display: inline-block; float: left"></span>
77                                 <div class="col-md-12"><b>Key</b></div>
78                                 <div class="col-md-2"><b>Eternal?</b></div>
79                                 <div class="col-md-4"><b>Created</b></div>
80                                 <div class="col-md-2"><b>Max Life</b></div>
81                                 <div class="col-md-2"><b>Expires</b></div>
82                                 <div class="col-md-1"><b>Clear?</b></div>
83                         </div>
84                         <div ng-repeat="item in region.items">
85                                 <div style="margin: 0px 20px 0px 30px; font-size: 80%; float: left; width: 95%;" ng-show="bling$index">
86                                         <span class="att--tree__arrow" style="height: 20px; width: 20px; display: inline-block; float: left"></span>
87                                         <div class="col-md-12"><a href="#" tooltip="Click to Show Item Details" ng-click="showItemDetails(region.cacheName,item.key);">{{item.key}}</a></div>
88                                         <div class="col-md-2">{{item.eternal}}</div>
89                                         <div class="col-md-4">{{item.createTime}}</div>
90                                         <div class="col-md-2">{{item.maxLifeSeconds}}</div>
91                                         <div class="col-md-2">{{item.expiresInSeconds}}</div>
92                                         <div class="col-md-1"><a ng-click="clearItem(region.cacheName,item.key);"><img  src="static/fusion/images/deleteicon.gif"></a></div>
93                                 </div>
94                         </div>
95                         <div style="clear: both"></div>
96                 </div>
97         </div>
98 </div>
99
100 <script>
101 app.controller('cacheAdminController', function ($scope,$interval,$http,$modal,modalService){
102         $scope.regions=${model};
103          
104         $scope.clearAll = function() {
105                 if(confirm('You are about to clear all of the items for all cache regions. Do you want to continue?')){
106                         $http.get("jcs_admin/clearAll").success(function(response){$scope.regions=response;});
107                 }
108         };
109         
110         $scope.clearRegion = function(cacheName) {
111                 if(confirm('You are about to clear all of the items in the cache region "' + cacheName + '". Do you want to continue?')){
112                         $http.get("jcs_admin/clearRegion?cacheName="+cacheName).success(function(response){$scope.regions=response;});
113                 }
114         };
115         
116         $scope.clearItem = function(cacheName,key) {
117                 if(confirm('You are about to clear this item from the cache region "' + cacheName + '". Do you want to continue?')){
118                         $http.get("jcs_admin/clearItem?keyName="+key+"&cacheName="+cacheName).success(function(response){$scope.regions=response;});
119                 }
120         };
121         
122         $scope.showRegionDetails = function(cacheName) {
123                 $http.get("jcs_admin/showRegionDetails?cacheName="+cacheName).success(function(response){modalService.showSuccess('',response);});
124         };
125
126         $scope.showItemDetails = function(cacheName,key) {
127                         $http.get("jcs_admin/showItemDetails?keyName="+key+"&cacheName="+cacheName).success(function(response){ 
128                                 var message = "CacheName: "+ response.cacheName 
129                                         +"\nkey: "+response.key
130                                         +"\nIS_SPOOL: "+response.attr.IS_SPOOL
131                                         +"\nIS_LATERAL: "+response.attr.IS_LATERAL
132                                         +"\nIS_REMOTE: "+response.attr.IS_REMOTE
133                                         +"\nIS_ETERNAL: "+response.attr.IS_ETERNAL
134                                         +"\nversion: "+response.attr.version
135                                         +"\nmaxLifeSeconds: "+response.attr.maxLifeSeconds
136                                         +"\nmaxIdleTimeSeconds: "+response.attr.maxIdleTimeSeconds
137                                         +"\nsize: "+response.attr.size
138                                         +"\ncreateTime: "+response.attr.createTime
139                                         +"\nlastAccessTime: "+response.attr.lastAccessTime
140                                         +"\nidleTime: "+response.attr.idleTime
141                                         +"\ntimeToLiveSeconds: "+response.attr.timeToLiveSeconds
142                                         +"\nisSpool: "+response.attr.isSpool
143                                         +"\nisLateral: "+response.attr.isLateral
144                                         +"\nisRemote: "+response.attr.isRemote
145                                         +"\nisEternal: "+response.attr.isEternal;
146                                 modalService.showSuccess('',message);});
147         };
148 });
149 </script>