crashLog.jsp
3.87 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
<%@ 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.app.Context" scope="request" />
<jsp:useBean id="payload" type="com.dianping.cat.report.page.app.Payload" scope="request" />
<jsp:useBean id="model" type="com.dianping.cat.report.page.app.Model" scope="request" />
<a:body>
<%@include file="crashLogDetail.jsp"%>
</a:body>
<script type="text/javascript">
function query(){
var plat = $("#platformType").val();
var appVersion = queryField('${model.fieldsInfo.appVersions}','appVersion');
var platVersion = queryField('${model.fieldsInfo.platVersions}','platformVersion');
var module = queryField('${model.fieldsInfo.modules}','module');
var level = queryField('${model.fieldsInfo.levels}','level');
var split = ";";
var query = plat + split + appVersion + split + platVersion + split + module + split + level;
window.location.href = "?op=${payload.action.name}&query1=" + query + "&step=${payload.step}";
}
function clickMe(fields, prefix) {
var fs = [];
if(fields != "[]") {
fs = fields.replace(/[\[\]]/g,'').split(', ');
}
var num = 0;
for( var i=0; i<fs.length; i++){
var f = prefix + "_" + fs[i];
if(document.getElementById(f).checked){
num ++;
}else{
document.getElementById(prefix + "All").checked = false;
break;
}
}
if(num > 0 && num == fs.length) {
document.getElementById(prefix + "All").checked = true;
}
}
function clickAll(fields, prefix) {
var fs = [];
if(fields.length > 0){
fs = fields.replace(/[\[\]]/g,'').split(', ');
for( var i=0; i<fs.length; i++){
var f = prefix + "_" + fs[i];
if(document.getElementById(f) != undefined) {
document.getElementById(f).checked = document.getElementById(prefix + "All").checked;
}
}
}
}
function queryField(fields, prefix){
var fs = [];
if(fields.length > 0) {
fs = fields.replace(/[\[\]]/g,'').split(', ');
}
var url = '';
var num = 0;
if(document.getElementById(prefix + "All").checked == false && fs.length > 0) {
for( var i=0; i<fs.length; i++){
var f = prefix + "_" + fs[i];
if(document.getElementById(f) != undefined
&& document.getElementById(f).checked){
url += fs[i] + ":";
}
}
url = url.substring(0, url.length-1);
}else{
url = "";
}
return url;
}
function docReady(field, fields, prefix){
var urls = [];
if(typeof field == "undefined" || field.length == 0){
document.getElementById(prefix + "All").checked = true;
clickAll(fields, prefix);
}else{
urls = field.split(":");
for(var i=0; i<urls.length; i++) {
if(document.getElementById(prefix + "_" + urls[i]) != null) {
document.getElementById(prefix + "_" + urls[i]).checked = true;
}
}
}
}
$("#platformType")
.change(function () {
window.location.href = "?op=${payload.action.name}&query1=" + this.value + ";;;;&date=${model.date}&reportType=${payload.reportType}";
})
$(document).ready(
function() {
$('#crashLog').addClass('active');
var fields = "${payload.query1}".split(";");
if("${payload.query1}".length > 0) {
$("#platformType").val(fields[0]);
}
docReady(fields[1], '${model.fieldsInfo.appVersions}','appVersion');
docReady(fields[2], '${model.fieldsInfo.platVersions}','platformVersion');
docReady(fields[3], '${model.fieldsInfo.modules}','module');
docReady(fields[4], '${model.fieldsInfo.levels}','level');
});
</script>
<style type="text/css">
.row-fluid .span2 {
width:10%;
}
.row-fluid .span10 {
width:87%;
}
.report .btn-group {
position: relative;
display: inline-block;
font-size: 0;
white-space: normal;
vertical-align: middle;
}
</style>