project.jsp
6.42 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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<%@ 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="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>
<res:useJs value="${res.js.local['alarm_js']}" target="head-js" />
<script type="text/javascript">
$(document).ready(function() {
$('#projects_config').addClass('active open');
$('#projects').addClass('active');
if("${payload.action.name}" != 'projects') {
var state = '${model.opState}';
if(state=='Success'){
$('#state').html('操作成功');
}else{
$('#state').html('操作失败');
}
setInterval(function(){
$('#state').html(' ');
},3000);
}
$.widget( "custom.catcomplete", $.ui.autocomplete, {
_renderMenu: function( ul, items ) {
var that = this,
currentCategory = "";
$.each( items, function( index, item ) {
if ( item.category != currentCategory ) {
ul.append( "<li class='ui-autocomplete-category'>" + item.category + "</li>" );
currentCategory = item.category;
}
that._renderItemData( ul, item );
});
}
});
var data = [];
<c:forEach var="project" items="${model.projects}">
var item = {};
item['label'] = '${project.domain}';
item['category'] ='${project.bu} - ${project.cmdbProductline}';
data.push(item);
</c:forEach>
$( "#search" ).catcomplete({
delay: 0,
source: data
});
$("#search_go").bind("click",function(e){
var newUrl = '/cat/s/config?op=projects&domain='+$( "#search" ).val() +'&date=${model.date}';
window.location.href = newUrl;
});
$('#wrap_search').submit(
function(){
var newUrl = '/cat/s/config?op=projects&domain='+$( "#search" ).val() +'&date=${model.date}';
window.location.href = newUrl;
return false;
}
);
});
</script>
<div class="navbar-header pull-left position" style="width:350px;MARGIN-LEFT:10%;MARGIN-TOP:5px;padding:5px;">
<form id="wrap_search" style="margin-bottom:0px;">
<div class="input-group">
<c:if test="${not empty payload.project.domain}">
<c:set var="domain" value="${payload.project.domain}"/>
</c:if>
<c:if test="${not empty payload.domain}">
<c:set var="domain" value="${payload.domain}"/>
</c:if>
<c:if test="${empty domain}">
<c:set var="domain" value="cat"/>
</c:if>
<span class="input-icon" style="width:300px;">
<input type="text" placeholder="input domain for search" value="${domain}" class="search-input search-input form-control ui-autocomplete-input" id="search" autocomplete="off" />
<i class="ace-icon fa fa-search nav-search-icon"></i>
</span>
<span class="input-group-btn" style="width:50px">
<button class="btn btn-sm btn-primary" type="button" id="search_go">
Go
</button>
</span>
</div>
</form>
</div>
<br/>
<br/>
<br/>
<div style="padding:5px;">
<form name="projectUpdate" id="form" method="get" action="${model.pageUri}?op=updateSubmit">
<table class="table table-striped table-condensed ">
<c:if test="${not empty model.project }">
<input type="hidden" name="project.id" value="${model.project.id}" />
</c:if>
<input type="hidden" name="op" value="updateSubmit" />
<tr>
<td style="width:10%;">CAT项目名称</td>
<td>
<c:if test="${not empty model.project }">
<input type="name" class="input-xlarge" name="project.domain" value="${model.project.domain}" readonly/>
</c:if>
<c:if test="${empty model.project }">
<input type="name" class="input-xlarge" name="project.domain" value="${model.project.domain}" />
</c:if>
</td>
<td style="color:red">注意:接入CAT项目会在每个小时15分钟自动插入数据库。当搜索不到项目时候,可以支持手动添加。</td>
</tr>
<tr>
<td style="width:10%;">CMDB项目名称</td>
<td><input type="name" class="input-xlarge" name="project.cmdbDomain" value="${model.project.cmdbDomain}" /></td>
<td>cmdb中项目统一名称</td>
</tr>
<tr>
<td style="width:10%;">CMDB项目级别</td>
<td><input type="name" class="input-xlarge" name="project.level" value="${model.project.level}" /></td>
<td>cmdb中项目统一级别<span style="color:red">【此字段会和CMDB信息同步,只能是数字1\2\3】</span></td>
</tr>
<tr>
<td style="width:10%;">CMDB事业部</td>
<td><input type="name" class="input-xlarge" name="project.bu" value="${model.project.bu}" /></td>
<td>cmdb中项目所属事业部名称<span style="color:red">【此字段会和CMDB信息同步】</span></td>
</tr>
<tr>
<td style="width:10%;">CMDB产品线</td>
<td><input type="name" class="input-xlarge" name="project.cmdbProductline" value="${model.project.cmdbProductline}" /></td>
<td>cmdb中项目所属产品线名称<span style="color:red">【此字段会和CMDB信息同步】</span></td>
</tr>
<tr>
<td style="width:10%;">负责人</td>
<td><input type="name" class="input-xlarge" name="project.owner" value="${model.project.owner}"/></td>
<td>项目负责人<span style="color:red">【此字段会和CMDB信息同步】</span></td>
</tr>
<tr>
<td style="width:10%;">项目组邮件</td>
<td><input type="name" name="project.email" class="input-xxlarge" value="${model.project.email}"/></td>
<td>字段(多个,逗号分割)<span style="color:red">【此字段会和CMDB信息同步】</span></td>
</tr>
<tr>
<td>项目组号码</td>
<td><input type="name" name="project.phone" class="input-xxlarge" value="${model.project.phone}"/></td>
<td>字段(多个,逗号分割)<span style="color:red">【此字段会和CMDB信息同步】</span></td>
</tr>
<tr>
<td colspan="2" align="center"><input class='btn btn-primary btn-sm' type="submit" name="submit" value="提交" />
<a href="?op=projectDelete&projectId=${model.project.id}" class="btn btn-danger btn-sm delete" >
<i class="ace-icon fa fa-trash-o bigger-140"></i></a>
<h4 class="text-center text-danger" id="state"> </h4></td>
</tr>
</table>
</form>
</div>
</a:config>
<style>
.input-icon>.ace-icon {
z-index: 0;
}
</style>