storageRule.jsp
3.16 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
<%@ 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="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ 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>
<c:if test="${payload.type eq 'SQL'}"><c:set var="name" value="数据库" /></c:if>
<c:if test="${payload.type eq 'Cache'}"><c:set var="name" value="缓存" /></c:if>
<table class="table table-striped table-condensed table-bordered table-hover" id="contents" width="100%">
<thead>
<tr>
<th width="20%" class="center">${name}</th>
<th width="20%" class="center">机器</th>
<th width="20%" class="center">方法</th>
<th width="20%" class="center">监控项</th>
<th width="10%" class="center">与条件</th>
<th width="10%" class="center">操作 <a href="?op=storageRuleUpdate&type=${payload.type}" class="btn btn-primary btn-xs" >
<i class="ace-icon glyphicon glyphicon-plus bigger-120"></i></a></th>
</tr></thead><tbody>
<c:forEach var="item" items="${model.rules}" varStatus="status">
<c:set var="conditions" value="${fn:split(item.id, ';')}" />
<c:set var="name" value="${conditions[0]}" />
<c:set var="machine" value="${conditions[1]}" />
<c:set var="method" value="${conditions[2]}" />
<c:set var="attribute" value="${conditions[3]}" />
<c:set var="andStr" value="${conditions[4]}" />
<tr class="center">
<td>${name}</td>
<td>${machine}</td>
<td>${method}</td>
<td>
<c:if test="${attribute eq 'error'}">错误数</c:if>
<c:if test="${attribute eq 'errorPercent'}">错误率</c:if>
<c:if test="${attribute eq 'avg'}">响应时间</c:if>
</td>
<td>
<c:choose>
<c:when test="${andStr eq 'true'}">
<i class="ace-icon glyphicon glyphicon-ok bigger-120 btn-success"></i>
</c:when>
<c:otherwise>
<i class="ace-icon glyphicon glyphicon-remove bigger-120 btn-danger"></i>
</c:otherwise>
</c:choose>
</td>
<td><a href="?op=storageRuleUpdate&ruleId=${item.id}&type=${payload.type}" class="btn btn-primary btn-xs">
<i class="ace-icon fa fa-pencil-square-o bigger-120"></i></a>
<a href="?op=storageRuleDelete&ruleId=${item.id}&type=${payload.type}" class="btn btn-danger btn-xs delete" >
<i class="ace-icon fa fa-trash-o bigger-120"></i></a></td>
</tr>
</c:forEach></tbody>
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
$('#application_config').addClass('active open');
<c:if test="${payload.type eq 'SQL'}">
$('#storageDatabaseRule').addClass('active');
</c:if>
<c:if test="${payload.type eq 'Cache'}">
$('#storageCacheRule').addClass('active');
</c:if>
});
</script>
</a:config>