Authored by simba

update

... ... @@ -7,47 +7,92 @@
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/>
<link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
<script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>/js/bootstrap.min.js"></script>
<script src="<%=basePath %>/js/unicorn.js"></script>
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script>
var contextPath = '<%=basePath %>';
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">Redis</a>
</script>
<title>YOHO!运维</title>
</head>
<body>
<!-- 头部 -->
<div id="head">
<h5 style="color: #E0EEE0;font-style:oblique;font-weight:900;font-size:200%;margin-left: 45px;margin-top: 40px;">
YOHO</h5>
</div>
<div class="container-fluid">
<div class="row-fluid"
style="border: solid 1px #CDC9C9; padding: 10px">
<div class="span12">
<div class="section section-visible">
<h3 style="margin-left: 16px;">REDIS(最近两分钟)</h3>
<div id="redisAppendDiv">
<!-- 左侧菜单项 -->
<div id="sidebar">
</div>
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Home</a> <a href="#" class="current">Redis</a>
</div>
<div class="container-fluid">
<div class="row-fluid"
style="border: solid 1px #CDC9C9; padding: 10px">
<div class="span12">
<div class="section section-visible">
<h3 style="margin-left: 16px;">REDIS(最近两分钟)</h3>
<div id="redisAppendDiv">
</div>
</div>
<!-- row -->
</div>
<!-- row -->
</div>
</div>
</div>
</div>
<div class="modal fade" data-backdrop="true" style="margin-top: 60px;" id="myRedisProxyDetail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="width:900px;height: 500px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel"></h4>
</div>
<div class="modal-body" id="redislistDetail">
<div class="modal fade" data-backdrop="true" style="margin-top: 60px;" id="myRedisProxyDetail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content" style="width:900px;height: 500px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"
aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel"></h4>
</div>
<div class="modal-body" id="redislistDetail">
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-content -->
<!-- /.modal -->
</div>
<!-- /.modal -->
<div id="testDiv"></div>
</div>
</body>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script>
$("#li_redisInfo").addClass("active");
</script>
<script type="text/javascript">
var myMasterRedis=null;
var mySlaveRedis=null;
... ... @@ -68,76 +113,76 @@
async: false,
dataType: "json",
success: function (data) {
var time="";
var time = "";
var awsHtml = '';
if(data.data != null){
myMasterRedis=new Array();
mySlaveRedis=new Array();
if (data.data != null) {
myMasterRedis = new Array();
mySlaveRedis = new Array();
$("#redisAppendDiv").html("");
$.each(data.data,function(name,value) {
var contentHtml="";
var topNode="";
var awsAcount=0;
var qcloudAcount=0;
var awsIp='';
var qcoloudIp='';
$.each(data.data, function (name, value) {
var contentHtml = "";
var topNode = "";
var awsAcount = 0;
var qcloudAcount = 0;
var awsIp = '';
var qcoloudIp = '';
$.each(value, function (n, obj) {
if(obj.level==0){
topNode=obj.nodeFrom;
if (obj.level == 0) {
topNode = obj.nodeFrom;
return true;
}
if(obj.level==1){
if(obj.nodeTo.indexOf("172")==0){
awsAcount=awsAcount+1;
if(obj.isFailed==1){
awsIp+='<button title="'+obj.paramMonitor+'" onclick="displatyTetail(\''+obj.nodeTo+'\')" class="btn_java_api btn btn-lg btn-default btn-primary" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">'+obj.nodeTo+'</button>';
}else if(obj.isFailed==0){
awsIp+='<button class="btn_java_api btn btn-lg btn-default btn-danger" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">'+obj.nodeTo+'</button>';
if (obj.level == 1) {
if (obj.nodeTo.indexOf("172") == 0) {
awsAcount = awsAcount + 1;
if (obj.isFailed == 1) {
awsIp += '<button title="' + obj.paramMonitor + '" onclick="displatyTetail(\'' + obj.nodeTo + '\')" class="btn_java_api btn btn-lg btn-default btn-primary" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">' + obj.nodeTo + '</button>';
} else if (obj.isFailed == 0) {
awsIp += '<button class="btn_java_api btn btn-lg btn-default btn-danger" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">' + obj.nodeTo + '</button>';
}
}else if(obj.nodeTo.indexOf("10")==0) {
} else if (obj.nodeTo.indexOf("10") == 0) {
qcloudAcount = qcloudAcount + 1;
if(obj.isFailed==1){
qcoloudIp+='<button title="'+obj.paramMonitor+'" onclick="displatyTetail(\''+obj.nodeTo+'\')" class="btn_java_api btn btn-lg btn-default btn-primary" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">'+obj.nodeTo+'</button>';
}else if(obj.isFailed==0){
qcoloudIp+='<button class="btn_java_api btn btn-lg btn-default btn-danger" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">'+obj.nodeTo+'</button>';
if (obj.isFailed == 1) {
qcoloudIp += '<button title="' + obj.paramMonitor + '" onclick="displatyTetail(\'' + obj.nodeTo + '\')" class="btn_java_api btn btn-lg btn-default btn-primary" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">' + obj.nodeTo + '</button>';
} else if (obj.isFailed == 0) {
qcoloudIp += '<button class="btn_java_api btn btn-lg btn-default btn-danger" style="margin-top:5px;margin-left:5px;width: 160px;font-size: 12px;">' + obj.nodeTo + '</button>';
}
}
return true;
}
if(obj.level==2){
if(obj.isSlave==0){
if (obj.level == 2) {
if (obj.isSlave == 0) {
myMasterRedis.push(obj);
}else if(obj.isSlave==1){
} else if (obj.isSlave == 1) {
mySlaveRedis.push(obj);
}
}
});
contentHtml='<div class="col-md-4" id="aws" style="height: 360px; width: 800px;">'+
'<div class="panel panel-success-alt noborder" style="background-color: #5cb85c;">'+
'<div class="panel-heading noborder">'+
'<div>'+ '<div style="margin-left: 18px;"><img src="img/log_redis.png"><span style="font-size:28px;color: white;margin-left: 180px;">'+topNode+'</span></div>'+
'</div>'+
'<hr>'+
'<div class="clearfix mt15">'+
'<div style="width:350px; height: 130px;float: left; border: 1px solid white;word-break:break-all;">'+
contentHtml = '<div class="col-md-4" id="aws" style="height: 360px; width: 800px;">' +
'<div class="panel panel-success-alt noborder" style="background-color: #5cb85c;">' +
'<div class="panel-heading noborder">' +
'<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>' +
'</div>' +
'<hr>' +
'<div class="clearfix mt15">' +
'<div style="width:350px; height: 130px;float: left; border: 1px solid white;word-break:break-all;">' +
'<h4 class="modal-title" style="text-align: center;color: white;">AWS</h4>';
if(awsIp==""){
contentHtml+="无";
}else{
contentHtml+=awsIp;
if (awsIp == "") {
contentHtml += "无";
} else {
contentHtml += awsIp;
}
contentHtml+= '</div>'+
'<div style="width:350px; height: 130px;float: right; border: 1px solid white;word-break:break-all;">'+
contentHtml += '</div>' +
'<div style="width:350px; height: 130px;float: right; border: 1px solid white;word-break:break-all;">' +
'<h4 class="modal-title" style="text-align: center;color: white;" >QCloud</h4>';
if(qcoloudIp==""){
contentHtml+="无";
}else{
contentHtml+=qcoloudIp;
if (qcoloudIp == "") {
contentHtml += "无";
} else {
contentHtml += qcoloudIp;
}
contentHtml+= '</div>'+
'</div>'+
'</div>'+
'</div>'+
contentHtml += '</div>' +
'</div>' +
'</div>' +
'</div>' +
'</div>';
$("#redisAppendDiv").append(contentHtml);
});
... ... @@ -171,7 +216,7 @@
formatter : function(value, rowData, rowIndex) {
var ipport=value.split(":");
return ipport[0];
},
},
width : "10%"
},{
title : "port",
... ...