|
|
1
|
+<%@page language="java" contentType="text/html;charset=utf-8" %>
|
|
|
2
|
+<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
|
|
3
|
+<%
|
|
|
4
|
+ String path = request.getContextPath();
|
|
|
5
|
+ String basePath = request.getScheme() + "://"
|
|
|
6
|
+ + request.getServerName() + ":" + request.getServerPort()
|
|
|
7
|
+ + path + "/";
|
|
|
8
|
+%>
|
|
|
9
|
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
|
10
|
+<html>
|
|
|
11
|
+<head>
|
|
|
12
|
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
|
13
|
+ <link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
|
|
|
14
|
+ <link rel="stylesheet" href="<%=basePath %>css/bootstrap-datetimepicker.css"/>
|
|
|
15
|
+ <link href="<%=basePath %>js/bootstrap-plugin/css/bootstrap.table.css" rel="stylesheet" media="screen"/>
|
|
|
16
|
+ <link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
|
|
|
17
|
+ <link rel="stylesheet" href="<%=basePath %>css/fullcalendar.css"/>
|
|
|
18
|
+ <link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
|
|
|
19
|
+ <link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
|
|
|
20
|
+ <link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
|
|
|
21
|
+ <link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
|
|
|
22
|
+ <link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
|
|
|
23
|
+ <link rel="stylesheet" href="<%=basePath %>js/jstree/themes/proton/style.css"/>
|
|
|
24
|
+ <link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
|
|
|
25
|
+ <link rel="stylesheet" href="<%=basePath %>css/yoho.css"/>
|
|
|
26
|
+ <script src="<%=basePath %>js/excanvas.min.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
27
|
+ <script src="<%=basePath %>js/jquery-1.12.0.min.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
28
|
+ <script src="<%=basePath %>js/jquery-ui.custom.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
29
|
+ <script src="<%=basePath %>/js/bootstrap.min.js"></script>
|
|
|
30
|
+ <script src="<%=basePath %>/js/unicorn.js"></script>
|
|
|
31
|
+ <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
|
|
|
32
|
+ type="text/javascript"></script>
|
|
|
33
|
+ <script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
|
|
|
34
|
+ type="text/javascript"></script>
|
|
|
35
|
+ <script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
36
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
|
|
|
37
|
+ type="text/javascript"></script>
|
|
|
38
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
39
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
40
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
41
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
42
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
43
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
|
|
|
44
|
+ type="text/javascript"></script>
|
|
|
45
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
|
|
|
46
|
+ type="text/javascript"></script>
|
|
|
47
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
|
|
|
48
|
+ type="text/javascript"></script>
|
|
|
49
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
50
|
+ <script src="<%=basePath %>js/layer/layer.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
51
|
+ <script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
|
|
|
52
|
+ <script src="<%=basePath %>js/jstree/jstree.js"></script>
|
|
|
53
|
+ <script src="<%=basePath %>js/jquery.toaster.js"></script>
|
|
|
54
|
+ <link href="<%=basePath %>css/jquery.tagsinput.css" rel="stylesheet"/>
|
|
|
55
|
+ <script src="<%=basePath %>js/jquery.tagsinput.min.js" type="text/javascript"></script>
|
|
|
56
|
+ <script>
|
|
|
57
|
+ var contextPath = '<%=basePath %>';
|
|
|
58
|
+
|
|
|
59
|
+ </script>
|
|
|
60
|
+ <title>YOHO!运维</title>
|
|
|
61
|
+</head>
|
|
|
62
|
+<body>
|
|
|
63
|
+
|
|
|
64
|
+<!-- 头部 -->
|
|
|
65
|
+<div id="head">
|
|
|
66
|
+
|
|
|
67
|
+</div>
|
|
|
68
|
+<!-- 右侧具体内容 -->
|
|
|
69
|
+<div id="content">
|
|
|
70
|
+
|
|
|
71
|
+<div id="breadcrumb">
|
|
|
72
|
+ <a href="#" title="Go to Home" class="tip-bottom"><i
|
|
|
73
|
+ class="icon-home"></i> Home</a> <a href="#" class="current">降级服务配置</a>
|
|
|
74
|
+</div>
|
|
|
75
|
+
|
|
|
76
|
+<div class="container-fluid">
|
|
|
77
|
+ <div class="widget-box">
|
|
|
78
|
+ <div class="widget-title">
|
|
|
79
|
+
|
|
|
80
|
+ <h5>ZK配置</h5>
|
|
|
81
|
+
|
|
|
82
|
+ </div>
|
|
|
83
|
+ <div class="widget-content nopadding">
|
|
|
84
|
+ <div class="widget-title" style="height: 53px;">
|
|
|
85
|
+ <div>
|
|
|
86
|
+ <div class="form-inline" role="form" id="inBoxQueryDiv"
|
|
|
87
|
+ style=" margin-top: 12px;margin-left: 25px;float: left;">
|
|
|
88
|
+ <div class="input-group" style="float: left;">
|
|
|
89
|
+ <span class="input-group-addon">服务器:</span>
|
|
|
90
|
+ <select id="cloudType" name="cloudType" class="form-control">
|
|
|
91
|
+ <option value="zookeeper_aws">aws</option>
|
|
|
92
|
+ <option value="zookeeper_qq">qCloud</option>
|
|
|
93
|
+ </select>
|
|
|
94
|
+ </div>
|
|
|
95
|
+ <div class="input-group" style="float: left;">
|
|
|
96
|
+ <span class="input-group-addon">配置名称:</span>
|
|
|
97
|
+ <input type="text" id="configName" name="configName" class="form-control" placeholder=""/>
|
|
|
98
|
+ </div>
|
|
|
99
|
+ <div class="input-group" style="float: left;">
|
|
|
100
|
+ <span class="input-group-addon">级别:</span>
|
|
|
101
|
+ <select id="level" name="level" class="form-control">
|
|
|
102
|
+ <option value="">全部</option>
|
|
|
103
|
+ <option value="1">一级</option>
|
|
|
104
|
+ <option value="2">二级</option>
|
|
|
105
|
+ </select>
|
|
|
106
|
+ </div>
|
|
|
107
|
+ <div class="input-group" style="float: left;">
|
|
|
108
|
+ <span class="input-group-addon">开关:</span>
|
|
|
109
|
+ <select id="switch" name="switch" class="form-control">
|
|
|
110
|
+ <option value="">全部</option>
|
|
|
111
|
+ <option value="Y">开</option>
|
|
|
112
|
+ <option value="N">关</option>
|
|
|
113
|
+ </select>
|
|
|
114
|
+ </div>
|
|
|
115
|
+ <button id="searchDegradeInfoBtn" class="btn btn-primary" style="margin-left: 18px;">搜索</button>
|
|
|
116
|
+ </div>
|
|
|
117
|
+ </div>
|
|
|
118
|
+ </div>
|
|
|
119
|
+ <div id="degradeInfoTable">
|
|
|
120
|
+
|
|
|
121
|
+ </div>
|
|
|
122
|
+ </div>
|
|
|
123
|
+ </div>
|
|
|
124
|
+</div>
|
|
|
125
|
+</div>
|
|
|
126
|
+</body>
|
|
|
127
|
+<script>
|
|
|
128
|
+ $(function () {
|
|
|
129
|
+ $("#degradeInfoTable").table({
|
|
|
130
|
+ url: contextPath + "degrade/getList?",
|
|
|
131
|
+ striped : true,
|
|
|
132
|
+ pagination : true,
|
|
|
133
|
+ pageSize : 10,
|
|
|
134
|
+ loadFilter: function (data) {
|
|
|
135
|
+ return defaultLoadFilter(data);
|
|
|
136
|
+ },
|
|
|
137
|
+ columns: [{
|
|
|
138
|
+ title: "配置名称",
|
|
|
139
|
+ width:"25%",
|
|
|
140
|
+ align:"left",
|
|
|
141
|
+ field: "configName"
|
|
|
142
|
+ }, {
|
|
|
143
|
+ title: "配置描述",
|
|
|
144
|
+ width:"35%",
|
|
|
145
|
+ field: "configDesc"
|
|
|
146
|
+ }, {
|
|
|
147
|
+ title: "级别",
|
|
|
148
|
+ width:"10%",
|
|
|
149
|
+ field: "level",
|
|
|
150
|
+ formatter : function(value, rowData, rowIndex) {
|
|
|
151
|
+ if(value == 1){
|
|
|
152
|
+ return '一级';
|
|
|
153
|
+ }else if(value == 2){
|
|
|
154
|
+ return '二级';
|
|
|
155
|
+ }
|
|
|
156
|
+ },
|
|
|
157
|
+ }, {
|
|
|
158
|
+ title: "图片",
|
|
|
159
|
+ width:"10%",
|
|
|
160
|
+ field: "img"
|
|
|
161
|
+ }, {
|
|
|
162
|
+ title: "开关",
|
|
|
163
|
+ width:"10%",
|
|
|
164
|
+ field: "switchOn",
|
|
|
165
|
+ formatter : function(value, rowData, rowIndex) {
|
|
|
166
|
+ if(value == "Y"){
|
|
|
167
|
+ return '开';
|
|
|
168
|
+ }else{
|
|
|
169
|
+ return '关';
|
|
|
170
|
+ }
|
|
|
171
|
+ },
|
|
|
172
|
+ }, {
|
|
|
173
|
+ title: "操作",
|
|
|
174
|
+ width:"10%",
|
|
|
175
|
+ formatter: function (value, rowData, rowIndex) {
|
|
|
176
|
+ var div = $("<div>");
|
|
|
177
|
+ //修改
|
|
|
178
|
+ var editBtn = $("<button data-target='#updateModal' data-toggle='modal'>").addClass("btn btn-xs btn-success").html("修改").appendTo(div);
|
|
|
179
|
+ editBtn.click(function () {
|
|
|
180
|
+ updateDegradeInfo(rowData);
|
|
|
181
|
+ });
|
|
|
182
|
+ return div;
|
|
|
183
|
+ }
|
|
|
184
|
+ }],
|
|
|
185
|
+ });
|
|
|
186
|
+
|
|
|
187
|
+ });
|
|
|
188
|
+
|
|
|
189
|
+function updateDegradeInfo(rowData){
|
|
|
190
|
+ paramObj.id = rowData.id;
|
|
|
191
|
+ paramObj.configName = rowData.configName;
|
|
|
192
|
+ paramObj.configDesc = rowData.configDesc;
|
|
|
193
|
+ paramObj.level = rowData.level;
|
|
|
194
|
+ paramObj.switchOn = rowData.switchOn;
|
|
|
195
|
+ var dialog0 = $("<div>").appendTo($("body"));
|
|
|
196
|
+ dialog0.dialog({
|
|
|
197
|
+ size : "modal-lg",
|
|
|
198
|
+ title : "修改路径",
|
|
|
199
|
+ backdrop : "static",
|
|
|
200
|
+ href : contextPath +"/jsp/degrade/degradeEdit.jsp",
|
|
|
201
|
+ buttons : [{
|
|
|
202
|
+ text : "关闭",
|
|
|
203
|
+ className : "btn-danger",
|
|
|
204
|
+ onclick : function() {
|
|
|
205
|
+ $(dialog0).dialog("hide");
|
|
|
206
|
+ }
|
|
|
207
|
+ }, {
|
|
|
208
|
+ text : "提交",
|
|
|
209
|
+ className : "btn-success",
|
|
|
210
|
+ onclick : function() {
|
|
|
211
|
+
|
|
|
212
|
+ var btn = $(this);
|
|
|
213
|
+ $(dialog0).dialog("hide");
|
|
|
214
|
+ $("#degradeInfoForm").form("submit", {
|
|
|
215
|
+ submitUrl : contextPath + "/degrade/edit.do",
|
|
|
216
|
+ submitData : {
|
|
|
217
|
+ id : rowData.id
|
|
|
218
|
+ },
|
|
|
219
|
+ onBeforeSubmit : function() {
|
|
|
220
|
+
|
|
|
221
|
+ if (!$(this).form("validate")) {
|
|
|
222
|
+ btn.removeAttr("disabled");
|
|
|
223
|
+ return false;
|
|
|
224
|
+ }
|
|
|
225
|
+ },
|
|
|
226
|
+ success : function(data) {
|
|
|
227
|
+ var mes="";
|
|
|
228
|
+ if(data.data==1){
|
|
|
229
|
+ mes="修改成功";
|
|
|
230
|
+ }else{
|
|
|
231
|
+ mes="修改失败";
|
|
|
232
|
+ }
|
|
|
233
|
+ if(data.data==1){
|
|
|
234
|
+
|
|
|
235
|
+ var dialog = $("<div>").appendTo($("body"));
|
|
|
236
|
+ dialog.dialog({
|
|
|
237
|
+ title :mes,
|
|
|
238
|
+ backdrop : "static",
|
|
|
239
|
+ content : mes,
|
|
|
240
|
+ buttons : [{
|
|
|
241
|
+ text : "确定",
|
|
|
242
|
+ className : "btn-success",
|
|
|
243
|
+ onclick : function() {
|
|
|
244
|
+ $(dialog).dialog("hide");
|
|
|
245
|
+ $("#degradeInfoTable").table("load");
|
|
|
246
|
+ }
|
|
|
247
|
+ }]
|
|
|
248
|
+ });
|
|
|
249
|
+ }
|
|
|
250
|
+ $(dialog0).dialog("hide");
|
|
|
251
|
+ }
|
|
|
252
|
+ });
|
|
|
253
|
+ }
|
|
|
254
|
+ }]
|
|
|
255
|
+ });
|
|
|
256
|
+}
|
|
|
257
|
+
|
|
|
258
|
+ //点击查询按钮
|
|
|
259
|
+ $("#searchDegradeInfoBtn").click(function () {
|
|
|
260
|
+ var level = $("#level").val();//=="0"?null:$("#level").val();
|
|
|
261
|
+ var cloudType = $("#cloudType").val();
|
|
|
262
|
+ var configName=$("#configName").val();
|
|
|
263
|
+ var switchOn= $("#switch").val();//=="0"?null:$("#switch").val();
|
|
|
264
|
+
|
|
|
265
|
+ $("#degradeInfoTable").table("load", {
|
|
|
266
|
+ 'cloudType': cloudType,
|
|
|
267
|
+ 'level': level ,
|
|
|
268
|
+ 'configName': configName ,
|
|
|
269
|
+ 'switchOn' : switchOn
|
|
|
270
|
+ });
|
|
|
271
|
+ });
|
|
|
272
|
+
|
|
|
273
|
+</script>
|
|
|
274
|
+<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
|
|
|
275
|
+</html> |