metricConfigs.jsp
6.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<jsp:useBean id="ctx" type="com.dianping.cat.system.page.config.Context" scope="request"/>
<jsp:useBean id="payload" type="com.dianping.cat.system.page.config.Payload" scope="request"/>
<jsp:useBean id="model" type="com.dianping.cat.system.page.config.Model" scope="request"/>
<a:config>
<res:useJs value="${res.js.local['jquery.validate.min.js']}" target="head-js" />
<res:useJs value="${res.js.local['alarm_js']}" target="head-js" />
<res:useJs value="${res.js.local['dependencyConfig_js']}" target="head-js" />
<res:useCss value="${res.css.local['select2.css']}" target="head-css" />
<res:useJs value="${res.js.local['select2.min.js']}" target="head-js" />
<res:useCss value="${res.css.local['multiple-select.css']}" target="head-css" />
<res:useJs value="${res.js.local['jquery.multiple.select.js']}" target="head-js" />
<script type="text/javascript">
$(document).ready(function() {
$('#application_config').addClass('active open');
$('#metricConfigList').addClass('active');
var productLine = '${payload.productLineName}';
$('#tab-'+productLine).addClass('active');
$('#tabContent-'+productLine).addClass('active');
var action = '${payload.action.name}';
if(action=='metricConfigDelete'||action=='metricConfigAddSumbit'||action=='metricRuleAddSubmit'){
var state = '${model.opState}';
if(state=='Success'){
$('#state').html('操作成功');
}else{
$('#state').html('操作失败');
}
setInterval(function(){
$('#state').html(' ');
},3000);
}
});
</script>
<div class="tabbable tabs-left" id="content"> <!-- Only required for left/right tabs -->
<ul class="nav nav-tabs padding-12 ">
<c:forEach var="item" items="${model.productMetricConfigs}" varStatus="status">
<c:set var="product" value="${item.key}"/>
<c:set var="key" value="${product.id}"/>
<li id="tab-${key}" class="text-right"><a href="#tabContent-${key}" data-toggle="tab"> ${product.title}</a></li>
</c:forEach>
</ul>
<div class="tab-content">
<c:forEach var="item" items="${model.productMetricConfigs}" varStatus="status">
<c:set var="product" value="${item.key}"/>
<c:set var="key" value="${product.id}"/>
<c:set var="value" value="${item.value}"/>
<div class="tab-pane" id="tabContent-${key}">
<h4 class="text-center text-danger">${product.title}:产品线内业务监控配置 业务大盘标签会默认进行基线告警</h4>
<table class="table table-striped table-condensed table-bordered table-hover">
<tr class="text-success">
<th width="9%"><h5 class='text-center'>项目</h5></th>
<th width="4%"><h5 class='text-center'>类型</h5></th>
<th width="6%"><h5 class='text-center'>显示顺序</h5></th>
<th width="6%"><h5 class='text-center'>是否告警</h5></th>
<th width="14%"><h5 class='text-center'>MetricKey</h5></th>
<th width="16%"><h5 class='text-center'>标题</h5></th>
<th width="6%"><h5 class='text-center'>次数</h5></th>
<th width="6%"><h5 class='text-center'>平均值</h5></th>
<th width="6%"><h5 class='text-center'>总和</h5></th>
<th width="20%"><h5 class='text-center'>标签</h5></th>
<th width="13%"><h5 class='text-center'>操作
<%-- <a class="btn update btn-primary btn-xs" href="?op=metricConfigAdd&metricKey=${config.metricKey}&domain=${config.domain}&productLineName=${key}">新增</a>
--%></h5></th>
</tr>
<c:forEach var="config" items="${value}">
<tr>
<td>${config.domain}</td>
<td>${config.type}</td>
<td>${config.viewOrder}</td>
<td>
<c:if test="${config.alarm}">
<span class="text-danger">是</span>
</c:if>
<c:if test="${config.alarm == false}">
<span>否</span>
</c:if>
</td>
<td style="word-wrap:break-word;word-break:break-all;">${config.metricKey}</td>
<td style="word-wrap:break-word;word-break:break-all;">${config.title}</td>
<td>
<c:if test="${config.showCount}">
<span class="dashboard"> </span>
</c:if>
</td>
<td>
<c:if test="${config.showAvg}">
<span class="dashboard"> </span>
</c:if>
</td>
<td>
<c:if test="${config.showSum}">
<span class="dashboard"> </span>
</c:if>
</td>
<td>
<c:if test="${config.tags!=null}">
<c:forEach var="tag" items="${config.tags}">
<span class="label label-info">${tag.name}</span>,
</c:forEach>
</c:if>
</td>
<td style="text-align:center;white-space: nowrap">
<a href="?op=metricConfigAdd&metricKey=${config.metricKey}&type=${config.type}&domain=${config.domain}&productLineName=${key}" class="btn btn-primary btn-xs">
<i class="ace-icon fa fa-pencil-square-o bigger-120"></i></a>
<a href="?op=metricConfigDelete&metricKey=${config.metricKey}&type=${config.type}&domain=${config.domain}&productLineName=${key}" class="btn btn-danger btn-xs delete" >
<i class="ace-icon fa fa-trash-o bigger-120"></i></a>
<a href="?op=metricRuleAdd&metricKey=${config.metricKey}&type=${config.type}&domain=${config.domain}&productLineName=${key}" id="alertRule" class="btn btn-primary btn-xs">告警</a>
</td>
</tr>
</c:forEach>
</table>
</div>
</c:forEach>
</div>
</div>
</a:config>