metric.jsp 4.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="a" uri="/WEB-INF/app.tld"%>
<%@ taglib prefix="w" uri="http://www.unidal.org/web/core"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="res" uri="http://www.unidal.org/webres"%>
<jsp:useBean id="ctx" type="com.dianping.cat.report.page.metric.Context" scope="request"/>
<jsp:useBean id="payload" type="com.dianping.cat.report.page.metric.Payload" scope="request"/>
<jsp:useBean id="model" type="com.dianping.cat.report.page.metric.Model" scope="request"/>

<a:body>
Y
yong.you 已提交
11

12
<res:useCss value='${res.css.local.table_css}' target="head-css" />
Y
yong.you 已提交
13 14
<res:useJs value="${res.js.local['svgchart.latest.min.js']}" target="head-js"/>
<res:useJs value="${res.js.local['baseGraph.js']}" target="head-js"/>
Y
yong.you 已提交
15

16 17
<script type="text/javascript">
	$(document).ready(function() {
S
merge  
sunryuan 已提交
18
		<c:forEach var="item" items="${model.lineCharts}" varStatus="status">
19
			var data = ${item.jsonString};
Y
yong.you 已提交
20
			graphLineChart(document.getElementById('${item.title}'), data);
21 22
		</c:forEach>
		
Y
yong.you 已提交
23 24 25 26 27
		var product = '${payload.product}';
		var test = '${payload.test}';
		
		$('#'+product).addClass('active');
		$('#'+test).addClass('active');
S
merge  
sunryuan 已提交
28
		$('i[tips]').popover();
29 30 31 32 33
	});
</script>
<div class="report">
	<table class="header">
		<tr>
S
merge  
sunryuan 已提交
34
			<td class="title">&nbsp;&nbsp;From ${w:format(model.startTime,'yyyy-MM-dd HH:mm:ss')} to ${w:format(model.endTime,'yyyy-MM-dd HH:mm:ss')}</td>
Y
yong.you 已提交
35
			<td class="nav">
36
				<c:forEach var="nav" items="${model.navs}">
Y
yong.you 已提交
37
					&nbsp;[ <a href="${model.baseUri}?date=${model.date}&domain=${model.domain}&step=${nav.hours}&product=${payload.product}&test=${payload.test}&${navUrlPrefix}">${nav.title}</a> ]&nbsp;
38
				</c:forEach>
S
merge  
sunryuan 已提交
39
				&nbsp;[ <a href="${model.baseUri}?${navUrlPrefix}&product=${payload.product}">now</a> ]&nbsp;
40 41 42
			</td>
		</tr>
	</table>
S
sunryuan 已提交
43
	
44
	</br>
S
sunryuan 已提交
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
	<table>
		<tr style="text-align: left">
			<th>Time range: &nbsp;[&nbsp; 
			<c:choose>
				<c:when test="${payload.timeRange eq 2}">
					<a href="?date=${model.date}&domain=${model.domain}&product=${payload.product}&test=${payload.test}&timeRange=2"
								class="current">Two hours</a>
				</c:when>
				<c:otherwise>
					<a href="?date=${model.date}&domain=${model.domain}&product=${payload.product}&test=${payload.test}&timeRange=2">Two hours</a>
				</c:otherwise>
			</c:choose> &nbsp;]&nbsp; 
   	  		&nbsp;[&nbsp;
   	  		<c:choose>
					<c:when test="${payload.timeRange eq 24}">
						<a href="?date=${model.date}&domain=${model.domain}&product=${payload.product}&test=${payload.test}&timeRange=24"
									class="current">One day</a>
					</c:when>
					<c:otherwise>
						<a href="?date=${model.date}&domain=${model.domain}&product=${payload.product}&test=${payload.test}&timeRange=24">One day</a>
					</c:otherwise>
				</c:choose> &nbsp;]
			</th>
		</tr>
	</table>
	<br/>
71 72 73 74 75
	<div class="container-fluid">
      <div class="row-fluid">
        <div class="span2">
          <div class="well sidebar-nav">
            <ul class="nav nav-list">
S
merge  
sunryuan 已提交
76
            	 <li class='nav-header' id="${item.id}"><a href="?op=dashboard&date=${model.date}&domain=${model.domain}"><strong>业务大盘</strong></a></li>
Y
yong.you 已提交
77 78 79
	            <c:forEach var="item" items="${model.productLines}" varStatus="status">
	              <li class='nav-header' id="${item.id}"><a href="?date=${model.date}&domain=${model.domain}&product=${item.id}"><strong>${item.title}</strong></a></li>
	              <c:if test="${payload.product eq item.id }">
S
merge  
sunryuan 已提交
80
		               <c:forEach var="test" items="${model.abtests}" varStatus="status">
Y
yong.you 已提交
81
		               	   <c:if test="${test.value.id ne -1}">
S
merge  
sunryuan 已提交
82 83
				              <li id="${test.key}"><a href="?date=${model.date}&domain=${model.domain}&product=${payload.product}&test=${test.key}">${test.key}<i tips="" data-trigger="hover" class="icon-question-sign" data-toggle="popover" data-placement="right" data-content="${test.value.name}"></i></a>
				              </li>
Y
yong.you 已提交
84
		               	   </c:if>
Y
yong.you 已提交
85 86 87
		       		  </c:forEach>
	              </c:if>
	            </c:forEach>
88
              <li >&nbsp;</li>
89 90 91 92
            </ul>
          </div><!--/.well -->
        </div><!--/span-->
        <div class="span10">
S
sunryuan 已提交
93 94 95
        	<c:if test="${payload.timeRange eq 24 }">
        		<h3 class='text-red'>说明:图中纵轴数据为10分钟数据之和</h3>
        	</c:if>
S
merge  
sunryuan 已提交
96
        	<c:forEach var="item" items="${model.lineCharts}" varStatus="status">
Y
yong.you 已提交
97 98
       			<div style="float:left;">
       				<h5 class="text-center text-error">${item.title}</h5>
Y
yong.you 已提交
99
       				<div  id="${item.title}" class="metricGraph"></div>
Y
yong.you 已提交
100
       			</div>
Y
yong.you 已提交
101
			</c:forEach>
102 103 104 105 106 107 108
        </div>
	<table  class="footer">
		<tr>
			<td>[ end ]</td>
		</tr>
	</table>
</div>
Y
yong.you 已提交
109 110
</a:body>
<style type="text/css">
S
merge  
sunryuan 已提交
111 112 113 114 115
.row-fluid .span2{
	width:10%;
}
.row-fluid .span10{
	width:87%;
Y
yong.you 已提交
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130
}
.well {
padding: 10px 10px 10px 19p;
}
.nav-list  li  a{
	padding:2px 15px;
}

.nav li  +.nav-header{
	margin-top:2px;
}
.nav-header{
	padding:5px 3px;
}
</style>