Authored by xuhui

双中心切换前台优化

@@ -68,7 +68,6 @@ @@ -68,7 +68,6 @@
68 <a href="#" title="Go to Home" class="tip-bottom"><i 68 <a href="#" title="Go to Home" class="tip-bottom"><i
69 class="icon-home"></i> Home</a> <a href="#" class="current">双中心切换</a> 69 class="icon-home"></i> Home</a> <a href="#" class="current">双中心切换</a>
70 </div> 70 </div>
71 -  
72 <div class="container-fluid"> 71 <div class="container-fluid">
73 <div class="widget-box"> 72 <div class="widget-box">
74 <div class="widget-content nopadding"> 73 <div class="widget-content nopadding">
@@ -91,13 +90,11 @@ @@ -91,13 +90,11 @@
91 <h4 style="display: inline">切换流程</h4> 90 <h4 style="display: inline">切换流程</h4>
92 </div> 91 </div>
93 <div class="panel-body"> 92 <div class="panel-body">
94 - <button class="btn btn-large" id="switch_mysql-btn">mysql</button> 93 + <button class="btn btn-large" id="switch_mysql-btn" style="background-color: green">mysql</button>
95 ===》 94 ===》
96 <button class="btn btn-large" id="switch_redis-btn">redis</button> 95 <button class="btn btn-large" id="switch_redis-btn">redis</button>
97 ===》 96 ===》
98 - <button class="btn btn-large" id="switch_internel_dns_aws-btn">aws内部DNS</button>  
99 - ===》  
100 - <button class="btn btn-large" id="switch_internel_dns_qcloud-btn">qq内部DNS</button> 97 + <button class="btn btn-large" id="switch_internel_dns-btn">内部DNS</button>
101 ===》 98 ===》
102 <button class="btn btn-large" id="switch_cobar-btn">cobar</button> 99 <button class="btn btn-large" id="switch_cobar-btn">cobar</button>
103 ===》 100 ===》
@@ -116,7 +113,6 @@ @@ -116,7 +113,6 @@
116 </div> 113 </div>
117 </div> 114 </div>
118 </div> 115 </div>
119 -  
120 </div> 116 </div>
121 </div> 117 </div>
122 118
@@ -141,7 +137,6 @@ @@ -141,7 +137,6 @@
141 <input type="text" name="sms_name" class="form-control"> 137 <input type="text" name="sms_name" class="form-control">
142 </div> 138 </div>
143 <br> 139 <br>
144 -  
145 <div class="modal-footer"> 140 <div class="modal-footer">
146 <button class="btn btn-primary" onclick="submit()">确认</button> 141 <button class="btn btn-primary" onclick="submit()">确认</button>
147 <button type="button" class="btn btn-default" data-dismiss="modal">取消</button> 142 <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
@@ -161,58 +156,16 @@ @@ -161,58 +156,16 @@
161 </html> 156 </html>
162 157
163 <script> 158 <script>
164 -  
165 -  
166 //执行切换 159 //执行切换
167 function toDoExe(toCloud) { 160 function toDoExe(toCloud) {
168 -  
169 $("input[name='cloud_name']").val(toCloud); 161 $("input[name='cloud_name']").val(toCloud);
170 $("input[name='sms_name']").val(''); 162 $("input[name='sms_name']").val('');
171 -  
172 $.ajax({ 163 $.ajax({
173 type: 'post', 164 type: 'post',
174 url: contextPath + "/centerSwitch/doExeAndCheckBefore", 165 url: contextPath + "/centerSwitch/doExeAndCheckBefore",
175 dataType: 'json', 166 dataType: 'json',
176 }); 167 });
177 -  
178 $('#confirmSubmitDivId').modal('show'); 168 $('#confirmSubmitDivId').modal('show');
179 -  
180 -  
181 -  
182 -  
183 -// var dialog = $("<div>").appendTo($("body"));  
184 -// dialog.dialog({  
185 -// title: "切换确定",  
186 -// backdrop: "static",  
187 -// content: "确定将所有流量切向:" + toCloud,  
188 -// buttons: [{  
189 -// text: "否",  
190 -// className: "btn-danger",  
191 -// onclick: function () {  
192 -// $(dialog).dialog("hide");  
193 -// }  
194 -// }, {  
195 -// text: "是",  
196 -// className: "btn-success",  
197 -// onclick: function () {  
198 -// $(dialog).dialog("hide");  
199 -// $("#detail-div").empty();  
200 -// var array = new Array();  
201 -// array.push("switch_mysql");  
202 -// array.push("switch_redis");  
203 -// array.push("switch_internel_dns_aws");  
204 -// array.push("switch_internel_dns_qcloud");  
205 -// array.push("switch_cobar");  
206 -// array.push("switch_lua");  
207 -// array.push("switch_dnspod");  
208 -// for(var i = 0; i <array.length; i++){  
209 -// $("#"+array[i]+"-btn").removeClass("btn-success");  
210 -// }  
211 -// doExe(array,0,toCloud);  
212 -// }  
213 -// }]  
214 -// });  
215 -  
216 } 169 }
217 170
218 function submit(){ 171 function submit(){
@@ -221,9 +174,7 @@ @@ -221,9 +174,7 @@
221 alert("请填写短信验证码"); 174 alert("请填写短信验证码");
222 return; 175 return;
223 } 176 }
224 -  
225 var toCloud = $("input[name='cloud_name']").val(); 177 var toCloud = $("input[name='cloud_name']").val();
226 -  
227 $.ajax({ 178 $.ajax({
228 type: 'post', 179 type: 'post',
229 url: contextPath + "/centerSwitch/checkSmsCode", 180 url: contextPath + "/centerSwitch/checkSmsCode",
@@ -236,10 +187,8 @@ @@ -236,10 +187,8 @@
236 $('#confirmSubmitDivId').modal('hide'); 187 $('#confirmSubmitDivId').modal('hide');
237 $("#detail-div").empty(); 188 $("#detail-div").empty();
238 var array = new Array(); 189 var array = new Array();
239 - array.push("switch_mysql");  
240 array.push("switch_redis"); 190 array.push("switch_redis");
241 - array.push("switch_internel_dns_aws");  
242 - array.push("switch_internel_dns_qcloud"); 191 + array.push("switch_internel_dns");
243 array.push("switch_cobar"); 192 array.push("switch_cobar");
244 array.push("switch_lua"); 193 array.push("switch_lua");
245 array.push("switch_dnspod"); 194 array.push("switch_dnspod");
@@ -257,10 +206,8 @@ @@ -257,10 +206,8 @@
257 206
258 } 207 }
259 208
260 -  
261 //执行切换 209 //执行切换
262 function doExe(array, i,commond) { 210 function doExe(array, i,commond) {
263 -  
264 var name = array[i]; 211 var name = array[i];
265 $("#"+name+"-btn").addClass("btn-warning"); 212 $("#"+name+"-btn").addClass("btn-warning");
266 $.ajax({ 213 $.ajax({
@@ -272,15 +219,12 @@ @@ -272,15 +219,12 @@
272 }, 219 },
273 dataType: 'json', 220 dataType: 'json',
274 success: function (resp) { 221 success: function (resp) {
275 -  
276 $("#"+name+"-btn").removeClass("btn-warning"); 222 $("#"+name+"-btn").removeClass("btn-warning");
277 $("#"+name+"-btn").addClass("btn-success"); 223 $("#"+name+"-btn").addClass("btn-success");
278 -  
279 var div = "<div class=\"alert alert-info alert-block\">"; 224 var div = "<div class=\"alert alert-info alert-block\">";
280 div = div + "<h4 class=\"alert-heading\">" + name + "</h4>"; 225 div = div + "<h4 class=\"alert-heading\">" + name + "</h4>";
281 div = div + resp.data + "</div>"; 226 div = div + resp.data + "</div>";
282 $("#detail-div").append(div); 227 $("#detail-div").append(div);
283 -  
284 i++; 228 i++;
285 if(i < array.length){ 229 if(i < array.length){
286 doExe(array,i,commond); 230 doExe(array,i,commond);
@@ -289,8 +233,5 @@ @@ -289,8 +233,5 @@
289 error: function () { 233 error: function () {
290 } 234 }
291 }); 235 });
292 -  
293 } 236 }
294 -  
295 -</script>  
296 -  
  237 +</script>