alter_query.jsp
2.94 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
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page contentType="text/html; charset=utf-8"%>
<div class="text-left"></div>
<div style="float:left;">
开始
<input type="text" id="startTime" style="width:150px;"/>
结束
<input type="text" id="endTime" style="width:150px;"/></div>
应用名
<input type="text" name="domain" id="domain" value="${payload.domain}" style="height:auto" class="input-small">
机器名
<input type="text" name="hostname" id="hostname" value="${payload.hostname}" style="height:auto" class="input-small">
每分钟显示个数
<input type="text" name="count" id="count" value="${payload.count}" style="height:auto" class="input-small">
<input class="btn btn-primary btn-sm" style="margin-bottom:4px;" value="查询" onclick="queryNew()" type="submit">
<br/>
<div id="label-group">
<label class="btn btn-info btn-sm">
<input type="checkbox" style="margin-bottom:0px;" id="select-all-type" />All
</label><label class="btn btn-info btn-sm">
<input type="checkbox" style="margin-bottom:0px;" class="altType" data-type="puppet"/>puppet
</label><label class="btn btn-info btn-sm">
<input type="checkbox" style="margin-bottom:0px;" class="altType" data-type="workflow"/>workflow
</label><label class="btn btn-info btn-sm">
<input type="checkbox" style="margin-bottom:0px;" class="altType" data-type="lazyman"/>lazyman
</label>
</div>
<br>
</div>
<script>
function getAltTypeStr(){
var result = "&altType=";
$(".altType").filter(function(){
return $(this).prop("checked");
}).each(function(){
var data = $(this).data("type");
result += data + ",";
});
return result;
}
function queryNew(){
var startTime=$("#startTime").val();
var endTime=$("#endTime").val();
var domain=$("#domain").val();
var hostname=$("#hostname").val();
var count=$("#count").val();
window.location.href="?op=view&domain="+domain+"&startTime="+startTime+"&endTime="+endTime+"&hostname="+hostname+"&count="+count+getAltTypeStr();
}
$(document).ready(function(){
var types = '${payload.altType}';
if(types == null || types == ""){
$(".altType").each(function(){
$(this).prop("checked", true);
});
}else{
var strs = types.split(",");
for(var count in strs){
var str = strs[count];
if(str !=null && str !=""){
$("[data-type='"+str+"']").prop("checked", true);
}
}
}
checkAllType();
$("#select-all-type").click(dealAllType);
$("#label-group").click(checkAllType);
})
function dealAllType(){
var isAllButtonChecked = $("#select-all-type").prop("checked");
$(".altType").each(function(){
$(this).prop("checked", isAllButtonChecked);
})
}
function checkAllType(){
var isAllChecked = true;
$(".altType").each(function(){
if(!$(this).prop("checked")){
isAllChecked = false;
}
});
$("#select-all-type").prop("checked", isAllChecked);
}
</script>