Authored by xuhui

双中心切换添加java服务重启功能

... ... @@ -205,6 +205,7 @@
$("#" + array[i] + "-btn").removeClass("btn-success");
}
switchWait = toWait("正在切换,请耐心等候...");
doExe(array, 0, toCloud);
}else{
alert("短信验证码错误或者失效");
... ... @@ -218,9 +219,6 @@
var switchWait;
//执行切换
function doExe(array, i,commond) {
if(switchWait==null || switchWait== undefined){
switchWait = toWait("正在切换,请耐心等候...");
}
var name = array[i];
$("#"+name+"-btn").addClass("btn-warning");
$.ajax({
... ... @@ -295,40 +293,43 @@
});
}
var statusWait;
function checkStatus(){
var wait = toWait("正在检查状态,请耐心等候...");
statusWait = toWait("正在检查状态,请耐心等候...");
$("#detail-div").empty();
for (var i = 0; i < array.length; i++) {
var name=array[i];
$.ajax({
type: 'post',
url: contextPath + "/centerSwitch/checkStatus",
data: {
'name': name,
'exe': 'status'
},
dataType: 'json',
success: function (data) {
if (!data || data.code != 200) {
var div = "<h4 class=\"alert-heading\">"+data.message+"</h4>";
$("#detail-div").append(div);
return;
}
var div = "<div class=\"alert alert-info alert-block\">";
div = div + "<h4 class=\"alert-heading\">" + name + "</h4>";
div = div + data.data + "</div>";
$("#detail-div").append(div);
statusWait(array,0);
}
wait.modal('hide');
},
error: function () {
var div = "<div>查看状态请求异常</div>";
function status(array, i){
var name = array[i];
$.ajax({
type: 'post',
url: contextPath + "/centerSwitch/checkStatus",
data: {
'name': name,
'exe': 'status'
},
dataType: 'json',
success: function (data) {
if (!data || data.code != 200) {
var div = "<h4 class=\"alert-heading\">"+data.message+"</h4>";
$("#detail-div").append(div);
wait.modal('hide');
return;
}
});
}
i++;
if(i < array.length){
status(array,i);
}else{
statusWait.modal('hide');
}
},
error: function () {
var div = "<div>查看状态请求异常</div>";
$("#detail-div").append(div);
statusWait.modal('hide');
}
});
}
function toWait(content) {
... ...