Authored by qinchao

lb切换

... ... @@ -245,7 +245,7 @@
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"></script>
<script src="<%=basePath %>script/switch.js?v=20180529-006"></script>
<script src="<%=basePath %>script/switch.js?v=20180531-001"></script>
<script type="text/javascript">
$("#li_switch").addClass("active open");
... ...
... ... @@ -289,15 +289,40 @@ function nginxInitSwitch(cloudName) {
data: param ,
success: function (data) {
console.log(data);
if(data.code != 200){
if(data==null||data.code != 200){
layer.close(layerMirror);
alert(data.message);
alert("lb switch error"+data.message);
}else{
window.location.href = contextPath + "topoSwitch/toTopoSwitch";
var count = 0;
var intervalIndex = setInterval(function() {
$.ajax({
url: contextPath+'topoSwitch/getNgixnStatus',
type: 'POST',
data:{},
dataType: 'json',
timeout : 0,
success: function (queryData) {
count++;
if (count>5||(queryData && queryData.code == 200)) {
clearInterval(intervalIndex);
window.location.href = contextPath + "topoSwitch/toTopoSwitch";
}
},
error: function (e) {
count++;
if(count>8){
clearInterval(intervalIndex);
window.location.href = contextPath + "topoSwitch/toTopoSwitch";
}
}
});
}, 10000);
}
},
error: function (e) {
alert("系统错误");
console.log(e);
layer.close(layerMirror);
alert("切换lb请求返回异常");
}
});
dialog.dialog("hide");
... ...