Authored by fanzelei

Merge branch 'master' of http://git.yoho.cn/ops/monitor-ui

... ... @@ -23,4 +23,8 @@ a.api_info{
margin-left: 2px;
margin-right: 2px;
cursor: pointer;
}
div.api_info_container{
padding-left: 5px;
}
\ No newline at end of file
... ...
... ... @@ -8,6 +8,11 @@
+ path + "/";
String page_type = request.getParameter("page_type");
String page_url = request.getParameter("page_url");
if(page_type==null)
page_type="";
if(page_url==null)
page_url="";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
... ... @@ -72,7 +77,7 @@
</li>
<li class="" id="hostInfoList"><a href="?page_type=hostInfoList"><i class="icon icon-th"></i> <span>主机管理</span></a>
</li>
<li class="" id="javaApiList"><a href="?page_type=javaApiList"><i class="icon icon-th"></i><span>JAVA服务信息</span></a>
<li class="" id="javaApi"><a href="?page_type=javaApi"><i class="icon icon-th"></i><span>JAVA服务信息</span></a>
</li>
<li class="" id="zkInfo"><a href="?page_type=zkInfo"><i class="icon icon-th"></i><span>ZK监控</span></a>
</li>
... ... @@ -90,19 +95,33 @@
"mobjectInfo": 'jsp/mobject/mobjectInfo.jsp',
"hostGroupList": 'jsp/host/hostGroupList.jsp',
"hostInfoList": 'jsp/host/hostInfoList.jsp',
"javaApiList": 'jsp/javaapi/javaApiList.jsp',
"javaApi": 'jsp/javaapi/javaApi.jsp',
"zkInfo": '/jsp/zkInfo/zkInfoList.jsp',
"redisInfo": '/jsp/redisInfo/redisInfoList.jsp'
}
var page_type = "<%=page_type %>";
var page_url = "<%=page_url %>";
$(function () {
loadPage();
});
var loadPage = function () {
//直接根据url跳转
if (page_url != undefined&&page_url != "") {
$("#content").load(contextPath + page_url);
if (page_type != undefined&&page_type != "") {
console.log("load page : ", page_type);
$("#" + page_type).addClass("active").siblings().removeClass("active");
}
return;
}
//根据菜单跳转
var path = pages[page_type];
if (path == undefined)
if (path == undefined) {
return;
}
console.log("load page : ", page_type);
$("#" + page_type).addClass("active").siblings().removeClass("active");
$("#content").load(contextPath + pages[page_type]);
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i
class="icon-home"></i> Java服务</a> <a href="#" class="current">服务信息</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div class="widget-title">
<h5>Java服务 DashBoard<a href="?page_url=jsp/javaapi/javaApiList.jsp&page_type=javaApi">详细</a></h5>
</div>
<div class="widget-content">
<div class="row api_info_container">
<%--<div class="api_info_item col-xs-3 ">--%>
<%--<div class="panel panel-default">--%>
<%--<div class="panel-heading">gateway</div>--%>
<%--<div class="panel-body">--%>
<%--<h3><span class="label label-default">AWS状态</span>--%>
<%--<span class="label label-default">Gcloud状态</span>--%>
<%--</h3>--%>
<%--<span>更新时间</span>--%>
<%--</div>--%>
<%--</div>--%>
<%--</div>--%>
</div>
</div>
</div>
</div>
<script type="text/javascript">
var javaApiDatas = {
"gateway": {},
"order": {},
"promotion": {},
"product": {},
"message": {},
"sns": {},
"user": {},
"resources": {},
"activity": {},
"union": {},
"browser": {},
"wechat": {}
};
var getJavaAppType = function () {
$.ajax({
url: contextPath + "/type/queryJavaApiType",
type: 'get',
success: function (data) {
if (!data || data.code != 200) {
$.toaster('获取java服务类型失败', '警告', 'warning');
return;
}
console.info(data.data);
initDashBoard(data.data);
},
error: function (data) {
$.toaster('获取java服务类型失败', '警告', 'warning');
}
});
};
var initDashBoard = function (data) {
var div_dash = $(".api_info_container");
$.each(data, function (idx, val) {
var api_info_item = $('<div class="api_info_item col-xs-3 ">');
var api_info_item_panel = $(' <div class="panel panel-default">');
var api_info_item_panel_title = $('<div class="panel-heading">' + val.typeName + '</div>');
var api_info_item_panel_body = $('<div class="panel-body">');
api_info_item_panel_body.append('<h3><span class="label label-default">AWS</span> <span class="label label-default">QCloud</span> </h3>')
api_info_item_panel.append(api_info_item_panel_title)
.append(api_info_item_panel_body);
api_info_item.append(api_info_item_panel);
div_dash.append(api_info_item);
});
};
var refreshDashBoard=function(){
$.ajax({
url: contextPath + "/javaapi",
type: 'get',
success: function (data) {
if (!data || data.code != 200) {
$.toaster('获取java服务类型失败', '警告', 'warning');
return;
}
console.info(data.data);
initDashBoard(data.data);
},
error: function (data) {
$.toaster('获取java服务类型失败', '警告', 'warning');
}
});
};
function timer() {
refreshDashBoard();
setTimeout("timer()", 30000);
}
timer();
$(function () {
getJavaAppType();
});
</script>
\ No newline at end of file
... ...