Showing
3 changed files
with
291 additions
and
253 deletions
monitor-ui-web/src/main/webapp/img/redis.png
0 → 100644
![](/ops/monitor-ui/raw/0431daab7c587c24cd3992085c3c03317214e32b/monitor-ui-web/src/main/webapp/img/redis.png)
2.69 KB
@@ -10,8 +10,18 @@ | @@ -10,8 +10,18 @@ | ||
10 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | 10 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
11 | <html> | 11 | <html> |
12 | <head> | 12 | <head> |
13 | + <%--<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">--%> | ||
14 | + <%--<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>--%> | ||
15 | + <%--<link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/>--%> | ||
16 | + <%--<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>--%> | ||
17 | + <%--<link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/>--%> | ||
18 | + <%--<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>--%> | ||
19 | + <%--<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>--%> | ||
20 | + <%--<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>--%> | ||
21 | + <%--<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>--%> | ||
13 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | 22 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
14 | <link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/> | 23 | <link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/> |
24 | + <link rel="stylesheet" href="<%=basePath %>css/bootstrap-datetimepicker.css"/> | ||
15 | <link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/> | 25 | <link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/> |
16 | <link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/> | 26 | <link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/> |
17 | <link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/> | 27 | <link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/> |
@@ -19,6 +29,11 @@ | @@ -19,6 +29,11 @@ | ||
19 | <link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/> | 29 | <link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/> |
20 | <link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/> | 30 | <link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/> |
21 | <link rel="stylesheet" href="<%=basePath %>css/uniform.css"/> | 31 | <link rel="stylesheet" href="<%=basePath %>css/uniform.css"/> |
32 | + <link rel="stylesheet" href="<%=basePath %>css/select2.css"/> | ||
33 | + <link rel="stylesheet" href="<%=basePath %>js/jstree/themes/proton/style.css"/> | ||
34 | + <link rel="stylesheet" href="<%=basePath %>css/select2.css"/> | ||
35 | + <link rel="stylesheet" href="<%=basePath %>css/yoho.css"/> | ||
36 | + <link href="<%=basePath %>css/nginxview.css" rel="stylesheet"> | ||
22 | <script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script> | 37 | <script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script> |
23 | <script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script> | 38 | <script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script> |
24 | <script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script> | 39 | <script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script> |
@@ -47,19 +62,16 @@ | @@ -47,19 +62,16 @@ | ||
47 | </div> | 62 | </div> |
48 | 63 | ||
49 | <div class="container-fluid"> | 64 | <div class="container-fluid"> |
50 | - <div class="row-fluid" | ||
51 | - style="border: solid 1px #CDC9C9; padding: 10px"> | ||
52 | - <div class="span12"> | ||
53 | - <div class="section section-visible"> | ||
54 | - <h3 style="margin-left: 16px;">REDIS(最近两分钟)</h3> | ||
55 | - <div id="redisAppendDiv"> | ||
56 | - | 65 | + <div class="widget-box"> |
66 | + <div class="widget-title"> | ||
67 | + <h5>Redis状态预览 <font color="red">(最近2分钟)</font></h5> | ||
57 | </div> | 68 | </div> |
58 | - | ||
59 | - </div> | ||
60 | - <!-- row --> | ||
61 | </div> | 69 | </div> |
62 | 70 | ||
71 | + <div class="container-fluid"> | ||
72 | + | ||
73 | + <div id="redisAppendDiv"> | ||
74 | + </div> | ||
63 | </div> | 75 | </div> |
64 | </div> | 76 | </div> |
65 | 77 | ||
@@ -72,6 +84,7 @@ | @@ -72,6 +84,7 @@ | ||
72 | aria-hidden="true">×</button> | 84 | aria-hidden="true">×</button> |
73 | <h4 class="modal-title" id="myModalLabel"></h4> | 85 | <h4 class="modal-title" id="myModalLabel"></h4> |
74 | </div> | 86 | </div> |
87 | + | ||
75 | <div class="modal-body" id="redislistDetail"> | 88 | <div class="modal-body" id="redislistDetail"> |
76 | 89 | ||
77 | </div> | 90 | </div> |
@@ -86,247 +99,5 @@ | @@ -86,247 +99,5 @@ | ||
86 | <script> | 99 | <script> |
87 | $("#li_redisInfo").addClass("active"); | 100 | $("#li_redisInfo").addClass("active"); |
88 | </script> | 101 | </script> |
89 | -<script type="text/javascript"> | ||
90 | - var myMasterRedis=null; | ||
91 | - var mySlaveRedis=null; | ||
92 | - $(function () { | ||
93 | - loadRedisMonitorData(); | ||
94 | - timerRedisMonitor(); | ||
95 | - }); | ||
96 | 102 | ||
97 | - function timerRedisMonitor() { | ||
98 | - loadRedisMonitorData(); | ||
99 | - setTimeout("timerRedisMonitor()", 30000); | ||
100 | - } | ||
101 | - | ||
102 | - function loadRedisMonitorData(){ | ||
103 | - $.ajax({ | ||
104 | - url: contextPath + "redisInfo/getRedisInfo", | ||
105 | - type: 'get', | ||
106 | - async: false, | ||
107 | - dataType: "json", | ||
108 | - success: function (data) { | ||
109 | - console.log(data); | ||
110 | - var time = ""; | ||
111 | - var awsHtml = ''; | ||
112 | - if (data.data != null) { | ||
113 | - myMasterRedis = new Array(); | ||
114 | - mySlaveRedis = new Array(); | ||
115 | - $("#redisAppendDiv").html(""); | ||
116 | - $.each(data.data, function (name, value) { | ||
117 | - var contentHtml = ""; | ||
118 | - var topNode = ""; | ||
119 | - var awsAcount = 0; | ||
120 | - var qcloudAcount = 0; | ||
121 | - var awsIp = ''; | ||
122 | - var qcoloudIp = ''; | ||
123 | - $.each(value, function (n, obj) { | ||
124 | - if (obj.level == 0) { | ||
125 | - topNode = obj.nodeFrom; | ||
126 | - return true; | ||
127 | - } | ||
128 | - if (obj.level == 1) { | ||
129 | - if (obj.nodeTo.indexOf("172") == 0) { | ||
130 | - awsAcount = awsAcount + 1; | ||
131 | - if (obj.isFailed == 1) { | ||
132 | - awsIp += '<button onclick="displatyTetail(\'' + obj.nodeTo + '\')" class="btn_java_api btn btn-lg btn-default btn-primary" style="margin-top:2px;margin-left:5px;width: 165px;text-align:left;font-size: 12px;">' + obj.nodeTo; | ||
133 | - var cccc=obj.paramMonitor.split(";"); | ||
134 | - awsIp=awsIp+"<br/>"+cccc[1]+"<br/>"+cccc[2]+'</button>'; | ||
135 | - } else if (obj.isFailed == 0) { | ||
136 | - awsIp += '<button class="btn_java_api btn btn-lg btn-default btn-danger" style="margin-top:5px;margin-left:5px;width: 165px;text-align:left;font-size: 12px;">' + obj.nodeTo; | ||
137 | - awsIp=awsIp+"<br/>"+obj.paramMonitor+ '</button>'; | ||
138 | - } | ||
139 | - } else if (obj.nodeTo.indexOf("10") == 0) { | ||
140 | - qcloudAcount = qcloudAcount + 1; | ||
141 | - if (obj.isFailed == 1) { | ||
142 | - qcoloudIp += '<button onclick="displatyTetail(\'' + obj.nodeTo + '\')" class="btn_java_api btn btn-lg btn-default btn-primary" style="margin-top:2px;margin-left:5px;width: 165px;text-align:left;font-size: 12px;">' + obj.nodeTo; | ||
143 | - var cccc=obj.paramMonitor.split(";"); | ||
144 | - qcoloudIp=qcoloudIp+"<br/>"+cccc[1]+"<br/>"+cccc[2]+'</button>'; | ||
145 | - } else if (obj.isFailed == 0) { | ||
146 | - qcoloudIp += '<button class="btn_java_api btn btn-lg btn-default btn-danger" style="margin-top:5px;margin-left:5px;width: 165px;text-align:left;font-size: 12px;">' + obj.nodeTo; | ||
147 | - qcoloudIp=qcoloudIp+"<br/>"+obj.paramMonitor+ '</button>'; | ||
148 | - } | ||
149 | - } | ||
150 | - return true; | ||
151 | - } | ||
152 | - if (obj.level == 2) { | ||
153 | - if (obj.isSlave == 0) { | ||
154 | - myMasterRedis.push(obj); | ||
155 | - } else if (obj.isSlave == 1) { | ||
156 | - mySlaveRedis.push(obj); | ||
157 | - } | ||
158 | - } | ||
159 | - }); | ||
160 | - contentHtml = '<div class="col-md-4" id="aws" style="height: 360px; width: 800px;">' + | ||
161 | - '<div class="panel panel-success-alt noborder" style="background-color: #5cb85c;">' + | ||
162 | - '<div class="panel-heading noborder">' + | ||
163 | - '<div>' + '<div style="margin-left: 18px;"><img src="<%=basePath%>img/log_redis.png"><span style="font-size:28px;color: white;margin-left: 180px;">' + topNode + '</span></div>' + | ||
164 | - '</div>' + | ||
165 | - '<hr>' + | ||
166 | - '<div class="clearfix mt15">' + | ||
167 | - '<div style="width:360px; height: 180px;float: left; border: 1px solid white;word-break:break-all;">' + | ||
168 | - '<h4 class="modal-title" style="text-align: center;color: white;">AWS</h4>'; | ||
169 | - if (awsIp == "") { | ||
170 | - contentHtml += "无"; | ||
171 | - } else { | ||
172 | - contentHtml += awsIp; | ||
173 | - } | ||
174 | - contentHtml += '</div>' + | ||
175 | - '<div style="width:360px; height: 180px;float: right; border: 1px solid white;word-break:break-all;">' + | ||
176 | - '<h4 class="modal-title" style="text-align: center;color: white;" >QCloud</h4>'; | ||
177 | - if (qcoloudIp == "") { | ||
178 | - contentHtml += "无"; | ||
179 | - } else { | ||
180 | - contentHtml += qcoloudIp; | ||
181 | - } | ||
182 | - contentHtml += '</div>' + | ||
183 | - '</div>' + | ||
184 | - '</div>' + | ||
185 | - '</div>' + | ||
186 | - '</div>'; | ||
187 | - $("#redisAppendDiv").append(contentHtml); | ||
188 | - }); | ||
189 | - } | ||
190 | - } | ||
191 | - }); | ||
192 | - } | ||
193 | - | ||
194 | - | ||
195 | - function displatyTetail(ip){ | ||
196 | - var detailListRedis=new Array(); | ||
197 | - $.each(myMasterRedis, function (i, myMasterObj) { | ||
198 | - myMasterObj.slaveParam=""; | ||
199 | - if(ip==myMasterObj.nodeFrom){ | ||
200 | - $.each(mySlaveRedis, function (j, mySlaveObj) { | ||
201 | - if(myMasterObj.nodeTo==mySlaveObj.nodeFrom){ | ||
202 | - myMasterObj.slaveParam=mySlaveObj.paramMonitor+","+mySlaveObj.nodeTo; | ||
203 | - } | ||
204 | - }); | ||
205 | - detailListRedis.push(myMasterObj); | ||
206 | - } | ||
207 | - }); | ||
208 | - $("#redislistDetail").empty(); | ||
209 | - $("#redislistDetail").table({ | ||
210 | - columnAutoWidth : false, | ||
211 | - data : detailListRedis, | ||
212 | - striped : true, | ||
213 | - columns : [{ | ||
214 | - title : "IP", | ||
215 | - field : "nodeTo", | ||
216 | - formatter : function(value, rowData, rowIndex) { | ||
217 | - var ipport=value.split(":"); | ||
218 | - return ipport[0]; | ||
219 | - }, | ||
220 | - width : "10%" | ||
221 | - },{ | ||
222 | - title : "port", | ||
223 | - field : "nodeTo", | ||
224 | - formatter : function(value, rowData, rowIndex) { | ||
225 | - var ipport=value.split(":"); | ||
226 | - return ipport[1]; | ||
227 | - }, | ||
228 | - width : "8%" | ||
229 | - },{ | ||
230 | - title : "角色", | ||
231 | - field : "paramMonitor", | ||
232 | - formatter : function(value, rowData, rowIndex) { | ||
233 | - var paramMonitor=value.split(","); | ||
234 | - if(paramMonitor[1]==null){ | ||
235 | - return ""; | ||
236 | - }else{ | ||
237 | - return paramMonitor[1]; | ||
238 | - } | ||
239 | - }, | ||
240 | - width : "7%" | ||
241 | - },{ | ||
242 | - title : "最大内存", | ||
243 | - field : "paramMonitor", | ||
244 | - formatter : function(value, rowData, rowIndex) { | ||
245 | - var paramMonitor=value.split(","); | ||
246 | - if(paramMonitor[2]==null){ | ||
247 | - return ""; | ||
248 | - }else{ | ||
249 | - return paramMonitor[2]; | ||
250 | - } | ||
251 | - }, | ||
252 | - width : "8%" | ||
253 | - },{ | ||
254 | - title : "使用内存", | ||
255 | - field : "paramMonitor", | ||
256 | - formatter : function(value, rowData, rowIndex) { | ||
257 | - var paramMonitor=value.split(","); | ||
258 | - if(paramMonitor[4]==null){ | ||
259 | - return ""; | ||
260 | - }else{ | ||
261 | - return paramMonitor[4]; | ||
262 | - } | ||
263 | - }, | ||
264 | - width : "8%" | ||
265 | - },{ | ||
266 | - title : "使用率", | ||
267 | - field : "paramMonitor", | ||
268 | - formatter : function(value, rowData, rowIndex) { | ||
269 | - var paramMonitor=value.split(","); | ||
270 | - if(paramMonitor[3]==null){ | ||
271 | - return ""; | ||
272 | - }else{ | ||
273 | - return paramMonitor[3]; | ||
274 | - } | ||
275 | - }, | ||
276 | - width : "8%" | ||
277 | - },{ | ||
278 | - title : "状态", | ||
279 | - field : "paramMonitor", | ||
280 | - formatter : function(value, rowData, rowIndex) { | ||
281 | - var paramMonitor=value.split(","); | ||
282 | - if(paramMonitor[0]==null){ | ||
283 | - return ""; | ||
284 | - }else{ | ||
285 | - if(paramMonitor[0]=="0"){ | ||
286 | - | ||
287 | - return "ERROR"; | ||
288 | - }else if(paramMonitor[0]=="1"){ | ||
289 | - return "OK" | ||
290 | - } | ||
291 | - } | ||
292 | - }, | ||
293 | - styler : function(value, rowData, rowIndex) { | ||
294 | - var paramMonitor=value.split(","); | ||
295 | - if(paramMonitor[0]==null){ | ||
296 | - return ""; | ||
297 | - }else{ | ||
298 | - if(paramMonitor[0]=="0"){ | ||
299 | - return { | ||
300 | - "background-color" : "red", | ||
301 | - "color":"white" | ||
302 | - }; | ||
303 | - }else if(paramMonitor[0]=="1"){ | ||
304 | - return { | ||
305 | - "background-color" : "green", | ||
306 | - "color":"white" | ||
307 | - }; | ||
308 | - } | ||
309 | - } | ||
310 | - }, | ||
311 | - width : "6%" | ||
312 | - },{ | ||
313 | - title : "主从", | ||
314 | - field : "slaveParam", | ||
315 | - formatter : function(value, rowData, rowIndex) { | ||
316 | - if(value!=""){ | ||
317 | - var slaveParam=value.split(","); | ||
318 | - return "主从"+slaveParam[0]+",主IP:"+slaveParam[1]; | ||
319 | - } | ||
320 | - return "无"; | ||
321 | - | ||
322 | - }, | ||
323 | - width : "25%" | ||
324 | - }] | ||
325 | - }); | ||
326 | - $("#myModalLabel").text("twemproxy详细信息"); | ||
327 | - $("#myRedisProxyDetail").modal('show'); | ||
328 | - } | ||
329 | - | ||
330 | - | ||
331 | - | ||
332 | -</script> | ||
103 | +<script src="<%=basePath %>script/redis/redis_info_list.js"></script> |
1 | +var myMasterRedis=null; | ||
2 | +var mySlaveRedis=null; | ||
3 | +$(function () { | ||
4 | + loadRedisMonitorData(); | ||
5 | + timerRedisMonitor(); | ||
6 | +}); | ||
7 | + | ||
8 | +function timerRedisMonitor() { | ||
9 | + setTimeout("loadRedisMonitorData()", 30000); | ||
10 | +} | ||
11 | + | ||
12 | +function loadRedisMonitorData() { | ||
13 | + $.ajax({ | ||
14 | + url: contextPath + "redisInfo/getRedisInfo", | ||
15 | + type: 'get', | ||
16 | + async: false, | ||
17 | + dataType: "json", | ||
18 | + success: function(data) { | ||
19 | + console.log(data); | ||
20 | + var time = ""; | ||
21 | + var awsHtml = ''; | ||
22 | + if (data.data != null) { | ||
23 | + myMasterRedis = new Array(); | ||
24 | + mySlaveRedis = new Array(); | ||
25 | + | ||
26 | + $("#redisAppendDiv").html(""); | ||
27 | + $.each(data.data, function(name, value) { | ||
28 | + var contentHtml = ""; | ||
29 | + var topNode = ""; | ||
30 | + var awsAcount = 0; | ||
31 | + var qcloudAccount = 0; | ||
32 | + var awsIp = ''; | ||
33 | + var qcloudIp = ''; | ||
34 | + $.each(value, function(n, obj) { | ||
35 | + if (obj.level == 0) { | ||
36 | + topNode = obj.nodeFrom; | ||
37 | + return true; | ||
38 | + } | ||
39 | + if (obj.level == 1) { | ||
40 | + if (obj.nodeTo.indexOf("172") == 0) { | ||
41 | + awsAcount = awsAcount + 1; | ||
42 | + if (obj.isFailed == 1) { | ||
43 | + | ||
44 | + awsIp += "<div class='col-md-4' onclick='displatyTetail(\"" + obj.nodeTo + "\")'>"; | ||
45 | + awsIp += "<div class='panel panel-success-alt noborder'><div class='panel-heading noborder'>"; | ||
46 | + awsIp += "<div class='panel-icon'style='background-image:url(\""+ contextPath + "img/redis.png\");height:60px;'></div>"; | ||
47 | + awsIp += "<div class='media-body'><h5 class='md-title nomargin'><strong>" + topNode + " AWS</strong></h5><h1 class='mt5'>" + obj.nodeTo + "</h1></div><hr>"; | ||
48 | + | ||
49 | + var cccc=obj.paramMonitor.split(";"); | ||
50 | + | ||
51 | + awsIp += "<div class='clearfix mt20'>"; | ||
52 | + awsIp += "<div class='pull-left'><h5 class='md-title nomargin'>总连接数</h5><h4 class='nomargin'>" + cccc[1].split(":")[1] + "</h4></div>"; | ||
53 | + awsIp += "<div class='pull-left' style='margin-left: 135px'><h5 class='md-title nomargin'>当前连接数</h5><h4 class='nomargin' style='margin-left: 20px'>" + cccc[2].split(":")[1] + "</h4></div>"; | ||
54 | + | ||
55 | + awsIp += "</div></div></div></div>"; | ||
56 | + } else if (obj.isFailed == 0) { | ||
57 | + awsIp += "<div class='col-md-4'>"; | ||
58 | + awsIp += "<div class='panel panel panel-fail-alt noborder noborder'><div class='panel-heading noborder'>"; | ||
59 | + awsIp += "<div class='panel-icon'style='background-image:url(\""+ contextPath + "img/redis.png\"); width:60px;height:60px;'></div>"; | ||
60 | + awsIp += "<div class='media-body'><h5 class='md-title nomargin'><strong>" + topNode + " QCloud</strong></h5><h1 class='mt5'>" + obj.nodeTo + "</h1></div><hr>"; | ||
61 | + | ||
62 | + var cccc=obj.paramMonitor.split(":"); | ||
63 | + | ||
64 | + awsIp += "<div class='clearfix mt20'>"; | ||
65 | + awsIp += "<div class='pull-left'><h5 class='md-title nomargin'>失败</h5><h4 class='nomargin'>" + cccc[1] + ":" + cccc[2] + "</h4></div>"; | ||
66 | + awsIp += "</div></div></div></div>"; | ||
67 | + } | ||
68 | + } else if (obj.nodeTo.indexOf("10") == 0) { | ||
69 | + qcloudAccount = qcloudAccount + 1; | ||
70 | + | ||
71 | + if (obj.isFailed == 1) { | ||
72 | + qcloudIp += "<div class='col-md-4' onclick='displatyTetail(\"" + obj.nodeTo + "\")'>"; | ||
73 | + qcloudIp += "<div class='panel panel-success-alt noborder'><div class='panel-heading noborder'>"; | ||
74 | + qcloudIp += "<div class='panel-icon'style='background-image:url(\""+ contextPath + "img/redis.png\"); width:60px;height:60px;'></div>"; | ||
75 | + qcloudIp += "<div class='media-body'><h5 class='md-title nomargin'><strong>" + topNode + " QCloud</strong></h5><h1 class='mt5'>" + obj.nodeTo + "</h1></div><hr>"; | ||
76 | + | ||
77 | + var cccc=obj.paramMonitor.split(";"); | ||
78 | + | ||
79 | + qcloudIp += "<div class='clearfix mt20'>"; | ||
80 | + qcloudIp += "<div class='pull-left'><h5 class='md-title nomargin'>总连接数</h5><h4 class='nomargin'>" + cccc[1].split(":")[1] + "</h4></div>"; | ||
81 | + qcloudIp += "<div class='pull-left' style='margin-left: 135px'><h5 class='md-title nomargin'>当前连接数</h5><h4 class='nomargin' style='margin-left: 20px'>" + cccc[2].split(":")[1] + "</h4></div>"; | ||
82 | + | ||
83 | + qcloudIp += "</div></div></div></div>"; | ||
84 | + } else if (obj.isFailed == 0) { | ||
85 | + | ||
86 | + qcloudIp += "<div class='col-md-4'>"; | ||
87 | + qcloudIp += "<div class='panel panel-fail-alt noborder'><div class='panel-heading noborder'>"; | ||
88 | + qcloudIp += "<div class='panel-icon'style='background-image:url(\""+ contextPath + "img/redis.png\"); width:60px;height:60px;'></div>"; | ||
89 | + qcloudIp += "<div class='media-body'><h5 class='md-title nomargin'><strong>" + topNode + " QCloud</strong></h5><h1 class='mt5'>" + obj.nodeTo + "</h1></div><hr>"; | ||
90 | + | ||
91 | + var cccc=obj.paramMonitor.split(":"); | ||
92 | + | ||
93 | + qcloudIp += "<div class='clearfix mt20'>"; | ||
94 | + qcloudIp += "<div class='pull-left'><h5 class='md-title nomargin'>失败</h5><h4 class='nomargin'>" + cccc[1] + ":" + cccc[2] + "</h4></div>"; | ||
95 | + qcloudIp += "</div></div></div></div>"; | ||
96 | + } | ||
97 | + } | ||
98 | + return true; | ||
99 | + } | ||
100 | + if (obj.level == 2) { | ||
101 | + if (obj.isSlave == 0) { | ||
102 | + myMasterRedis.push(obj); | ||
103 | + } else if (obj.isSlave == 1) { | ||
104 | + mySlaveRedis.push(obj); | ||
105 | + } | ||
106 | + } | ||
107 | + | ||
108 | + }); | ||
109 | + | ||
110 | + contentHtml += "<div class='row-fluid' style='border:solid 1px #CDC9C9; padding: 10px; margin-bottom: 20px'><div class='span12'><h1>" + topNode + "</h1><hr style='border:1px solid grey;opacity:0.1;>"; | ||
111 | + if (awsAcount != 0) { | ||
112 | + contentHtml += "<div class='section section-visible'>"; | ||
113 | + contentHtml += "<h3>AWS</h3>"; | ||
114 | + contentHtml += "<div class='hider updatable' ><div class='row row-stat'>"; | ||
115 | + contentHtml += awsIp + "</div></div></div>"; | ||
116 | + } | ||
117 | + | ||
118 | + if (qcloudAccount != 0) { | ||
119 | + contentHtml += "<div class='section section-visible'>"; | ||
120 | + contentHtml += "<h3>QCloud</h3>"; | ||
121 | + contentHtml += "<div class='hider updatable' ><div class='row row-stat'>"; | ||
122 | + contentHtml += qcloudIp + "</div></div></div>"; | ||
123 | + } | ||
124 | + contentHtml += "</div></div>" | ||
125 | + | ||
126 | + $("#redisAppendDiv").append(contentHtml); | ||
127 | + }); | ||
128 | + | ||
129 | + } | ||
130 | + } | ||
131 | + }); | ||
132 | +} | ||
133 | + | ||
134 | +function displatyTetail(ip){ | ||
135 | + var detailListRedis=new Array(); | ||
136 | + $.each(myMasterRedis, function (i, myMasterObj) { | ||
137 | + myMasterObj.slaveParam=""; | ||
138 | + if(ip==myMasterObj.nodeFrom){ | ||
139 | + $.each(mySlaveRedis, function (j, mySlaveObj) { | ||
140 | + if(myMasterObj.nodeTo==mySlaveObj.nodeFrom){ | ||
141 | + myMasterObj.slaveParam=mySlaveObj.paramMonitor+","+mySlaveObj.nodeTo; | ||
142 | + } | ||
143 | + }); | ||
144 | + detailListRedis.push(myMasterObj); | ||
145 | + } | ||
146 | + }); | ||
147 | + $("#redislistDetail").empty(); | ||
148 | + $("#redislistDetail").table({ | ||
149 | + columnAutoWidth : false, | ||
150 | + data : detailListRedis, | ||
151 | + striped : true, | ||
152 | + columns : [{ | ||
153 | + title : "IP", | ||
154 | + field : "nodeTo", | ||
155 | + formatter : function(value, rowData, rowIndex) { | ||
156 | + var ipport=value.split(":"); | ||
157 | + return ipport[0]; | ||
158 | + }, | ||
159 | + width : "10%" | ||
160 | + },{ | ||
161 | + title : "port", | ||
162 | + field : "nodeTo", | ||
163 | + formatter : function(value, rowData, rowIndex) { | ||
164 | + var ipport=value.split(":"); | ||
165 | + return ipport[1]; | ||
166 | + }, | ||
167 | + width : "8%" | ||
168 | + },{ | ||
169 | + title : "角色", | ||
170 | + field : "paramMonitor", | ||
171 | + formatter : function(value, rowData, rowIndex) { | ||
172 | + var paramMonitor=value.split(","); | ||
173 | + if(paramMonitor[1]==null){ | ||
174 | + return ""; | ||
175 | + }else{ | ||
176 | + return paramMonitor[1]; | ||
177 | + } | ||
178 | + }, | ||
179 | + width : "7%" | ||
180 | + },{ | ||
181 | + title : "最大内存", | ||
182 | + field : "paramMonitor", | ||
183 | + formatter : function(value, rowData, rowIndex) { | ||
184 | + var paramMonitor=value.split(","); | ||
185 | + if(paramMonitor[2]==null){ | ||
186 | + return ""; | ||
187 | + }else{ | ||
188 | + return paramMonitor[2]; | ||
189 | + } | ||
190 | + }, | ||
191 | + width : "8%" | ||
192 | + },{ | ||
193 | + title : "使用内存", | ||
194 | + field : "paramMonitor", | ||
195 | + formatter : function(value, rowData, rowIndex) { | ||
196 | + var paramMonitor=value.split(","); | ||
197 | + if(paramMonitor[4]==null){ | ||
198 | + return ""; | ||
199 | + }else{ | ||
200 | + return paramMonitor[4]; | ||
201 | + } | ||
202 | + }, | ||
203 | + width : "8%" | ||
204 | + },{ | ||
205 | + title : "使用率", | ||
206 | + field : "paramMonitor", | ||
207 | + formatter : function(value, rowData, rowIndex) { | ||
208 | + var paramMonitor=value.split(","); | ||
209 | + if(paramMonitor[3]==null){ | ||
210 | + return ""; | ||
211 | + }else{ | ||
212 | + return paramMonitor[3]; | ||
213 | + } | ||
214 | + }, | ||
215 | + width : "8%" | ||
216 | + },{ | ||
217 | + title : "状态", | ||
218 | + field : "paramMonitor", | ||
219 | + formatter : function(value, rowData, rowIndex) { | ||
220 | + var paramMonitor=value.split(","); | ||
221 | + if(paramMonitor[0]==null){ | ||
222 | + return ""; | ||
223 | + }else{ | ||
224 | + if(paramMonitor[0]=="0"){ | ||
225 | + | ||
226 | + return "ERROR"; | ||
227 | + }else if(paramMonitor[0]=="1"){ | ||
228 | + return "OK" | ||
229 | + } | ||
230 | + } | ||
231 | + }, | ||
232 | + styler : function(value, rowData, rowIndex) { | ||
233 | + var paramMonitor=value.split(","); | ||
234 | + if(paramMonitor[0]==null){ | ||
235 | + return ""; | ||
236 | + }else{ | ||
237 | + if(paramMonitor[0]=="0"){ | ||
238 | + return { | ||
239 | + "background-color" : "red", | ||
240 | + "color":"white" | ||
241 | + }; | ||
242 | + }else if(paramMonitor[0]=="1"){ | ||
243 | + return { | ||
244 | + "background-color" : "green", | ||
245 | + "color":"white" | ||
246 | + }; | ||
247 | + } | ||
248 | + } | ||
249 | + }, | ||
250 | + width : "6%" | ||
251 | + },{ | ||
252 | + title : "主从", | ||
253 | + field : "slaveParam", | ||
254 | + formatter : function(value, rowData, rowIndex) { | ||
255 | + if(value!=""){ | ||
256 | + var slaveParam=value.split(","); | ||
257 | + return "主从"+slaveParam[0]+",主IP:"+slaveParam[1]; | ||
258 | + } | ||
259 | + return "无"; | ||
260 | + | ||
261 | + }, | ||
262 | + width : "25%" | ||
263 | + }] | ||
264 | + }); | ||
265 | + $("#myModalLabel").text("twemproxy详细信息"); | ||
266 | + $("#myRedisProxyDetail").modal('show'); | ||
267 | +} |
-
Please register or login to post a comment