Merge branch 'master' of http://git.yoho.cn/ops/monitor-ui
Showing
3 changed files
with
148 additions
and
3 deletions
@@ -8,6 +8,11 @@ | @@ -8,6 +8,11 @@ | ||
8 | + path + "/"; | 8 | + path + "/"; |
9 | 9 | ||
10 | String page_type = request.getParameter("page_type"); | 10 | String page_type = request.getParameter("page_type"); |
11 | + String page_url = request.getParameter("page_url"); | ||
12 | + if(page_type==null) | ||
13 | + page_type=""; | ||
14 | + if(page_url==null) | ||
15 | + page_url=""; | ||
11 | %> | 16 | %> |
12 | 17 | ||
13 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | 18 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
@@ -72,7 +77,7 @@ | @@ -72,7 +77,7 @@ | ||
72 | </li> | 77 | </li> |
73 | <li class="" id="hostInfoList"><a href="?page_type=hostInfoList"><i class="icon icon-th"></i> <span>主机管理</span></a> | 78 | <li class="" id="hostInfoList"><a href="?page_type=hostInfoList"><i class="icon icon-th"></i> <span>主机管理</span></a> |
74 | </li> | 79 | </li> |
75 | - <li class="" id="javaApiList"><a href="?page_type=javaApiList"><i class="icon icon-th"></i><span>JAVA服务信息</span></a> | 80 | + <li class="" id="javaApi"><a href="?page_type=javaApi"><i class="icon icon-th"></i><span>JAVA服务信息</span></a> |
76 | </li> | 81 | </li> |
77 | <li class="" id="zkInfo"><a href="?page_type=zkInfo"><i class="icon icon-th"></i><span>ZK监控</span></a> | 82 | <li class="" id="zkInfo"><a href="?page_type=zkInfo"><i class="icon icon-th"></i><span>ZK监控</span></a> |
78 | </li> | 83 | </li> |
@@ -90,19 +95,33 @@ | @@ -90,19 +95,33 @@ | ||
90 | "mobjectInfo": 'jsp/mobject/mobjectInfo.jsp', | 95 | "mobjectInfo": 'jsp/mobject/mobjectInfo.jsp', |
91 | "hostGroupList": 'jsp/host/hostGroupList.jsp', | 96 | "hostGroupList": 'jsp/host/hostGroupList.jsp', |
92 | "hostInfoList": 'jsp/host/hostInfoList.jsp', | 97 | "hostInfoList": 'jsp/host/hostInfoList.jsp', |
93 | - "javaApiList": 'jsp/javaapi/javaApiList.jsp', | 98 | + "javaApi": 'jsp/javaapi/javaApi.jsp', |
94 | "zkInfo": '/jsp/zkInfo/zkInfoList.jsp', | 99 | "zkInfo": '/jsp/zkInfo/zkInfoList.jsp', |
95 | "redisInfo": '/jsp/redisInfo/redisInfoList.jsp' | 100 | "redisInfo": '/jsp/redisInfo/redisInfoList.jsp' |
96 | } | 101 | } |
97 | var page_type = "<%=page_type %>"; | 102 | var page_type = "<%=page_type %>"; |
103 | + var page_url = "<%=page_url %>"; | ||
98 | $(function () { | 104 | $(function () { |
99 | loadPage(); | 105 | loadPage(); |
100 | }); | 106 | }); |
101 | 107 | ||
102 | var loadPage = function () { | 108 | var loadPage = function () { |
109 | + | ||
110 | + //直接根据url跳转 | ||
111 | + if (page_url != undefined&&page_url != "") { | ||
112 | + $("#content").load(contextPath + page_url); | ||
113 | + if (page_type != undefined&&page_type != "") { | ||
114 | + console.log("load page : ", page_type); | ||
115 | + $("#" + page_type).addClass("active").siblings().removeClass("active"); | ||
116 | + } | ||
117 | + return; | ||
118 | + } | ||
119 | + | ||
120 | + //根据菜单跳转 | ||
103 | var path = pages[page_type]; | 121 | var path = pages[page_type]; |
104 | - if (path == undefined) | 122 | + if (path == undefined) { |
105 | return; | 123 | return; |
124 | + } | ||
106 | console.log("load page : ", page_type); | 125 | console.log("load page : ", page_type); |
107 | $("#" + page_type).addClass("active").siblings().removeClass("active"); | 126 | $("#" + page_type).addClass("active").siblings().removeClass("active"); |
108 | $("#content").load(contextPath + pages[page_type]); | 127 | $("#content").load(contextPath + pages[page_type]); |
1 | +<%@page language="java" contentType="text/html;charset=utf-8" %> | ||
2 | +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | ||
3 | +<div id="breadcrumb"> | ||
4 | + <a href="#" title="Go to Home" class="tip-bottom"><i | ||
5 | + class="icon-home"></i> Java服务</a> <a href="#" class="current">服务信息</a> | ||
6 | +</div> | ||
7 | + | ||
8 | +<div class="container-fluid"> | ||
9 | + | ||
10 | + | ||
11 | + <div class="widget-box"> | ||
12 | + <div class="widget-title"> | ||
13 | + <h5>Java服务 DashBoard<a href="?page_url=jsp/javaapi/javaApiList.jsp&page_type=javaApi">详细</a></h5> | ||
14 | + </div> | ||
15 | + <div class="widget-content"> | ||
16 | + <div class="row api_info_container"> | ||
17 | + <%--<div class="api_info_item col-xs-3 ">--%> | ||
18 | + <%--<div class="panel panel-default">--%> | ||
19 | + <%--<div class="panel-heading">gateway</div>--%> | ||
20 | + <%--<div class="panel-body">--%> | ||
21 | + <%--<h3><span class="label label-default">AWS状态</span>--%> | ||
22 | + <%--<span class="label label-default">Gcloud状态</span>--%> | ||
23 | + <%--</h3>--%> | ||
24 | + <%--<span>更新时间</span>--%> | ||
25 | + <%--</div>--%> | ||
26 | + <%--</div>--%> | ||
27 | + | ||
28 | + <%--</div>--%> | ||
29 | + | ||
30 | + </div> | ||
31 | + </div> | ||
32 | + </div> | ||
33 | +</div> | ||
34 | + | ||
35 | + | ||
36 | +<script type="text/javascript"> | ||
37 | + var javaApiDatas = { | ||
38 | + "gateway": {}, | ||
39 | + "order": {}, | ||
40 | + "promotion": {}, | ||
41 | + "product": {}, | ||
42 | + "message": {}, | ||
43 | + "sns": {}, | ||
44 | + "user": {}, | ||
45 | + "resources": {}, | ||
46 | + "activity": {}, | ||
47 | + "union": {}, | ||
48 | + "browser": {}, | ||
49 | + "wechat": {} | ||
50 | + }; | ||
51 | + | ||
52 | + var getJavaAppType = function () { | ||
53 | + $.ajax({ | ||
54 | + url: contextPath + "/type/queryJavaApiType", | ||
55 | + type: 'get', | ||
56 | + success: function (data) { | ||
57 | + if (!data || data.code != 200) { | ||
58 | + $.toaster('获取java服务类型失败', '警告', 'warning'); | ||
59 | + return; | ||
60 | + } | ||
61 | + console.info(data.data); | ||
62 | + initDashBoard(data.data); | ||
63 | + }, | ||
64 | + error: function (data) { | ||
65 | + $.toaster('获取java服务类型失败', '警告', 'warning'); | ||
66 | + | ||
67 | + } | ||
68 | + }); | ||
69 | + }; | ||
70 | + | ||
71 | + var initDashBoard = function (data) { | ||
72 | + var div_dash = $(".api_info_container"); | ||
73 | + $.each(data, function (idx, val) { | ||
74 | + var api_info_item = $('<div class="api_info_item col-xs-3 ">'); | ||
75 | + var api_info_item_panel = $(' <div class="panel panel-default">'); | ||
76 | + var api_info_item_panel_title = $('<div class="panel-heading">' + val.typeName + '</div>'); | ||
77 | + var api_info_item_panel_body = $('<div class="panel-body">'); | ||
78 | + api_info_item_panel_body.append('<h3><span class="label label-default">AWS</span> <span class="label label-default">QCloud</span> </h3>') | ||
79 | + api_info_item_panel.append(api_info_item_panel_title) | ||
80 | + .append(api_info_item_panel_body); | ||
81 | + api_info_item.append(api_info_item_panel); | ||
82 | + div_dash.append(api_info_item); | ||
83 | + }); | ||
84 | + | ||
85 | + }; | ||
86 | + | ||
87 | + var refreshDashBoard=function(){ | ||
88 | + $.ajax({ | ||
89 | + url: contextPath + "/javaapi", | ||
90 | + type: 'get', | ||
91 | + success: function (data) { | ||
92 | + if (!data || data.code != 200) { | ||
93 | + $.toaster('获取java服务类型失败', '警告', 'warning'); | ||
94 | + return; | ||
95 | + } | ||
96 | + console.info(data.data); | ||
97 | + initDashBoard(data.data); | ||
98 | + }, | ||
99 | + error: function (data) { | ||
100 | + $.toaster('获取java服务类型失败', '警告', 'warning'); | ||
101 | + | ||
102 | + } | ||
103 | + | ||
104 | + }); | ||
105 | + | ||
106 | + }; | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + function timer() { | ||
111 | + refreshDashBoard(); | ||
112 | + setTimeout("timer()", 30000); | ||
113 | + } | ||
114 | + timer(); | ||
115 | + | ||
116 | + $(function () { | ||
117 | + getJavaAppType(); | ||
118 | + | ||
119 | + }); | ||
120 | + | ||
121 | + | ||
122 | +</script> |
-
Please register or login to post a comment