cdn.jsp
4.81 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<%@ 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.cdn.Context" scope="request"/>
<jsp:useBean id="payload" type="com.dianping.cat.report.page.cdn.Payload" scope="request"/>
<jsp:useBean id="model" type="com.dianping.cat.report.page.cdn.Model" scope="request"/>
<a:body>
<link rel="stylesheet" type="text/css" href="${model.webapp}/js/jquery.datetimepicker.css"/>
<script src="${model.webapp}/js/jquery.datetimepicker.js"></script>
<res:useJs value="${res.js.local['baseGraph.js']}" target="head-js" />
<script type="text/javascript">
function query(){
var province = $("#province").val();
var city = $("#city").val();
var cdn = $("#cdn").val();
var start = $("#startTime").val();
var end = $("#endTime").val();
window.location.href="?province="+province+"&city="+city+"&cdn="+cdn+"&startDate="+start+"&endDate="+end;
}
function proceed(id) {
var start = "${w:format(model.start,'yyyy-MM-dd HH:mm')}";
var end = "${w:format(model.end,'yyyy-MM-dd HH:mm')}";
if ('${payload.cdn}' == 'ALL') {
window.location.href="?province=${payload.province}&city=${payload.city}&cdn="+id+"&startDate="+start+"&endDate="+end;
} else if ('${payload.province}' == 'ALL') {
window.location.href="?province="+id+"&city=${payload.city}&cdn=${payload.cdn}&startDate="+start+"&endDate="+end;
} else if ('${payload.city}' == 'ALL') {
window.location.href="?province=${payload.province}&city="+id+"&cdn=${payload.cdn}&startDate="+start+"&endDate="+end;
}
}
var cityData = ${model.cityInfo};
function provinceChange(){
var key = $("#province").val();
if(key == 'ALL'){
key = '';
}
var value = cityData[key];
select = document.getElementById("city");
select.length=0;
for (var prop in value) {
var opt = $('<option />');
var city = value[prop].city;
if(city == ''){
opt.val('ALL').html('ALL');
}else{
opt.val(city).html(city);
}
opt.appendTo(select);
}
}
function init(){
for ( var prop in cityData) {
if (prop == '') {
$('#province').append("<option value='ALL'>ALL</option>");
}else{
$('#province').append("<option value='"+prop+"'>"+prop+"</option>");
}
}
}
$(document).ready(function() {
$('#startTime').datetimepicker({
format:'Y-m-d H:i',
step:30,
maxDate:0
});
$('#endTime').datetimepicker({
format:'Y-m-d H:i',
step:30,
maxDate:0
});
$('#startTime').val("${w:format(model.start,'yyyy-MM-dd HH:mm')}");
$('#endTime').val("${w:format(model.end,'yyyy-MM-dd HH:mm')}");
init();
$('#System_report').addClass('active open');
$('#system_cdn').addClass('active');
$('#province').on('change',provinceChange);
var province = '${payload.province}';
var city = '${payload.city}';
var cdn = '${payload.cdn}';
if(cdn == '') {
cdn = 'ALL';
}
if(province == '') {
province = 'ALL';
}
if(city == '') {
city = 'ALL';
}
$('#cdn').val(cdn);
$('#province').val(province);
provinceChange();
if(city != ''){
$("#city").val(city);
}
<c:forEach var="item" items="${model.lineCharts}" varStatus="status">
var data = ${item.jsonString};
graphMetricChart(document.getElementById('${item.id}'), data);
</c:forEach>
});
</script>
<div class="report">
<table>
<tr>
<th class="left">
<div style="float:left;">
开始
<input type="text" id="startTime" style="width:150px;"/>
结束
<input type="text" id="endTime" style="width:150px;"/></div>
cdn服务商 <select style="width: 120px;" name="cdn" id="cdn">
<option value="ALL">ALL</option>
<option value="WangSu">网宿</option>
<option value="DiLian">帝联</option>
<option value="TengXun">腾讯</option>
</select>
省份 <select style="width: 100px;" name="province" id="province">
</select> 城市 <select style="width: 100px;" name="city" id="city">
</select>
</th>
<th class="right">
<input class="btn btn-primary btn-sm"
value=" 查询 "
onclick="query()" type="submit">
</div>
</th>
</tr>
</table>
<div>
<c:forEach var="item" items="${model.lineCharts}" varStatus="status">
<div style="float: left; text-align: center;">
<div style="margin: 20px 0 0 0; cursor: pointer;"><a onclick="proceed('${item.id}');">${item.id}</a></div>
<div id="${item.id}" style="width:450px; height:380px;"></div>
</div>
</c:forEach></div>
</div>
</a:body>