|
@@ -78,6 +78,36 @@ |
|
@@ -78,6 +78,36 @@ |
78
|
</div>
|
78
|
</div>
|
79
|
|
79
|
|
80
|
</div>
|
80
|
</div>
|
|
|
81
|
+
|
|
|
82
|
+<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
|
|
|
83
|
+ <div class="modal-dialog" style="margin-top: 5%;
|
|
|
84
|
+ margin-left: auto;
|
|
|
85
|
+ height:50.333%;
|
|
|
86
|
+ width: 60%;
|
|
|
87
|
+ overflow:scroll;
|
|
|
88
|
+ overflow-x:auto;
|
|
|
89
|
+ overflow-y:auto ">
|
|
|
90
|
+ <div class="modal-content">
|
|
|
91
|
+ <div class="modal-header">
|
|
|
92
|
+ <button type="button" class="close" data-dismiss="modal"
|
|
|
93
|
+ aria-hidden="true">×</button>
|
|
|
94
|
+ <h4 class="modal-title" id="myModalLabel"></h4>
|
|
|
95
|
+ </div>
|
|
|
96
|
+ <div class="modal-body">
|
|
|
97
|
+ <div id="check_result_div" style="">
|
|
|
98
|
+
|
|
|
99
|
+ </div>
|
|
|
100
|
+
|
|
|
101
|
+ </div>
|
|
|
102
|
+ <div class="modal-footer">
|
|
|
103
|
+ <button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
|
|
|
104
|
+ </div>
|
|
|
105
|
+ </div>
|
|
|
106
|
+ <!-- /.modal-content -->
|
|
|
107
|
+ </div>
|
|
|
108
|
+ <!-- /.modal -->
|
|
|
109
|
+</div>
|
|
|
110
|
+
|
81
|
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
|
111
|
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
|
82
|
<script type="text/javascript">
|
112
|
<script type="text/javascript">
|
83
|
$("#li_switch").addClass("active open");
|
113
|
$("#li_switch").addClass("active open");
|
|
@@ -99,36 +129,54 @@ |
|
@@ -99,36 +129,54 @@ |
99
|
columns: [{
|
129
|
columns: [{
|
100
|
title: "切换项",
|
130
|
title: "切换项",
|
101
|
field: "cName",
|
131
|
field: "cName",
|
102
|
- width: "20%"
|
132
|
+ width: "15%"
|
103
|
}, {
|
133
|
}, {
|
104
|
title: "切向QQ",
|
134
|
title: "切向QQ",
|
105
|
field: "name",
|
135
|
field: "name",
|
106
|
formatter: function (value, rowData, rowIndex) {
|
136
|
formatter: function (value, rowData, rowIndex) {
|
107
|
var div = $("<div>");
|
137
|
var div = $("<div>");
|
108
|
- $("<button onclick=\"doExe(\'" + value + "\',\'qcloud\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
138
|
+ $("<button onclick=\"doExe(\'" + value + "\',\'beforeCheck\')\">").addClass("btn btn-xs btn-success").html("前检测").appendTo(div);
|
|
|
139
|
+ div.append(" ");
|
|
|
140
|
+ $("<button onclick=\"toDoExe(\'" + value + "\',\'toQcloud\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
|
|
141
|
+ div.append(" ");
|
|
|
142
|
+ $("<button onclick=\"doExe(\'" + value + "\',\'afterCheck\')\">").addClass("btn btn-xs btn-success").html("后检测").appendTo(div);
|
|
|
143
|
+
|
109
|
return div;
|
144
|
return div;
|
110
|
},
|
145
|
},
|
111
|
- width: "40%"
|
146
|
+ width: "35%"
|
112
|
},{
|
147
|
},{
|
113
|
title: "切回AWS",
|
148
|
title: "切回AWS",
|
114
|
field: "name",
|
149
|
field: "name",
|
115
|
formatter: function (value, rowData, rowIndex) {
|
150
|
formatter: function (value, rowData, rowIndex) {
|
116
|
var div = $("<div>");
|
151
|
var div = $("<div>");
|
117
|
- $("<button onclick=\"doExe(\'" + value + "\',\'aws\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
152
|
+ $("<button onclick=\"doExe(\'" + value + "\',\'afterCheck\')\">").addClass("btn btn-xs btn-success").html("前检测").appendTo(div);
|
|
|
153
|
+ div.append(" ");
|
|
|
154
|
+ $("<button onclick=\"toDoExe(\'" + value + "\',\'toAws\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
|
|
155
|
+ div.append(" ");
|
|
|
156
|
+ $("<button onclick=\"doExe(\'" + value + "\',\'beforeCheck\')\">").addClass("btn btn-xs btn-success").html("后检测").appendTo(div);
|
|
|
157
|
+ return div;
|
|
|
158
|
+ },
|
|
|
159
|
+ width: "35%"
|
|
|
160
|
+ },{
|
|
|
161
|
+ title: "状态查看",
|
|
|
162
|
+ field: "name",
|
|
|
163
|
+ formatter: function (value, rowData, rowIndex) {
|
|
|
164
|
+ var div = $("<div>");
|
|
|
165
|
+ $("<button onclick=\"doExe(\'" + value + "\',\'status\')\">").addClass("btn btn-primary").html("当前状态").appendTo(div);
|
118
|
return div;
|
166
|
return div;
|
119
|
},
|
167
|
},
|
120
|
- width: "40%"
|
168
|
+ width: "35%"
|
121
|
}]
|
169
|
}]
|
122
|
});
|
170
|
});
|
123
|
});
|
171
|
});
|
124
|
|
172
|
|
125
|
//执行切换
|
173
|
//执行切换
|
126
|
- function doExe(name, toCloud) {
|
174
|
+ function toDoExe(name, toCloud) {
|
127
|
var dialog = $("<div>").appendTo($("body"));
|
175
|
var dialog = $("<div>").appendTo($("body"));
|
128
|
dialog.dialog({
|
176
|
dialog.dialog({
|
129
|
title: "切换确定",
|
177
|
title: "切换确定",
|
130
|
backdrop: "static",
|
178
|
backdrop: "static",
|
131
|
- content: "name:"+name+" 切向:"+toCloud,
|
179
|
+ content: "name:"+name+" exe:"+toCloud,
|
132
|
buttons: [{
|
180
|
buttons: [{
|
133
|
text: "否",
|
181
|
text: "否",
|
134
|
className: "btn-danger",
|
182
|
className: "btn-danger",
|
|
@@ -140,11 +188,51 @@ |
|
@@ -140,11 +188,51 @@ |
140
|
className: "btn-success",
|
188
|
className: "btn-success",
|
141
|
onclick: function () {
|
189
|
onclick: function () {
|
142
|
$(dialog).dialog("hide");
|
190
|
$(dialog).dialog("hide");
|
143
|
- window.open(contextPath + "centerSwitch/todoExe?name=" + name + "&toCloud=" + toCloud, "_self");
|
191
|
+ doExe(name,toCloud);
|
144
|
}
|
192
|
}
|
145
|
}]
|
193
|
}]
|
146
|
});
|
194
|
});
|
147
|
}
|
195
|
}
|
148
|
|
196
|
|
|
|
197
|
+ //执行切换
|
|
|
198
|
+ function doExe(name, exe) {
|
|
|
199
|
+ var jq = $("#switchTable");
|
|
|
200
|
+
|
|
|
201
|
+ $.ajax({
|
|
|
202
|
+ type: 'post',
|
|
|
203
|
+ url: contextPath + "/centerSwitch/doExe",
|
|
|
204
|
+ data:{
|
|
|
205
|
+ 'name':name,
|
|
|
206
|
+ 'exe':exe
|
|
|
207
|
+ },
|
|
|
208
|
+ dataType: 'json',
|
|
|
209
|
+ beforeSend:function(){
|
|
|
210
|
+ var div = $("<div>").attr("tableSelector", jq.selector).addClass("modal-backdrop fade in").appendTo($("body")).hide();
|
|
|
211
|
+ var tableOffset = jq.offset();
|
|
|
212
|
+ var tableWidth = jq.outerWidth(true), tableHeight = jq.outerHeight(true);
|
|
|
213
|
+ div.append($("<div>").addClass("table-loading").css({
|
|
|
214
|
+ left : (tableWidth - 124) / 2,
|
|
|
215
|
+ top : (tableHeight - 124) / 2
|
|
|
216
|
+ }));
|
|
|
217
|
+ div.css({
|
|
|
218
|
+ width : tableWidth,
|
|
|
219
|
+ height : tableHeight,
|
|
|
220
|
+ left : tableOffset.left,
|
|
|
221
|
+ top : tableOffset.top
|
|
|
222
|
+ });
|
|
|
223
|
+ div.show();
|
|
|
224
|
+ },
|
|
|
225
|
+ success: function (resp) {
|
|
|
226
|
+ $("body").find("div[tableSelector='"+ jq.selector +"']").remove();
|
|
|
227
|
+ $("#check_result_div").html(resp.data);
|
|
|
228
|
+ $("#myModalLabel").text("name:"+name+" exe:"+exe);
|
|
|
229
|
+ $("#myModal").modal('show');
|
|
|
230
|
+
|
|
|
231
|
+ },
|
|
|
232
|
+ error: function (resp) {
|
|
|
233
|
+ }
|
|
|
234
|
+ });
|
|
|
235
|
+ }
|
|
|
236
|
+
|
149
|
</script> |
237
|
</script> |
150
|
|
238
|
|