...
|
...
|
@@ -77,6 +77,9 @@ |
|
|
<h4 style="display: inline">切换操作</h4>
|
|
|
</div>
|
|
|
<div class="panel-body">
|
|
|
<button class="btn btn-large btn-primary" style="background-color: green" id="status-btn" onclick="checkStatus()">
|
|
|
查看状态(可以随时查看)
|
|
|
</button>
|
|
|
<button class="btn btn-large btn-primary" id="toaws-btn" onclick="toDoExe('toAws')">
|
|
|
所有流量切向aws
|
|
|
</button>
|
...
|
...
|
@@ -156,6 +159,15 @@ |
|
|
</html>
|
|
|
|
|
|
<script>
|
|
|
var array = new Array();
|
|
|
$(document).ready(function () {
|
|
|
array.push("switch_redis");
|
|
|
array.push("switch_internel_dns");
|
|
|
array.push("switch_cobar");
|
|
|
array.push("switch_lua");
|
|
|
array.push("switch_dnspod");
|
|
|
});
|
|
|
|
|
|
//执行切换
|
|
|
function toDoExe(toCloud) {
|
|
|
$("input[name='cloud_name']").val(toCloud);
|
...
|
...
|
@@ -186,12 +198,6 @@ |
|
|
if(resp.code == 200){
|
|
|
$('#confirmSubmitDivId').modal('hide');
|
|
|
$("#detail-div").empty();
|
|
|
var array = new Array();
|
|
|
array.push("switch_redis");
|
|
|
array.push("switch_internel_dns");
|
|
|
array.push("switch_cobar");
|
|
|
array.push("switch_lua");
|
|
|
array.push("switch_dnspod");
|
|
|
for (var i = 0; i < array.length; i++) {
|
|
|
$("#" + array[i] + "-btn").removeClass("btn-success");
|
|
|
}
|
...
|
...
|
@@ -218,6 +224,7 @@ |
|
|
'exe': commond
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
async: false,
|
|
|
success: function (resp) {
|
|
|
$("#"+name+"-btn").removeClass("btn-warning");
|
|
|
$("#"+name+"-btn").addClass("btn-success");
|
...
|
...
|
@@ -234,4 +241,35 @@ |
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function checkStatus(){
|
|
|
$("#detail-div").empty();
|
|
|
for (var i = 0; i < array.length; i++) {
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: contextPath + "/centerSwitch/checkStatus",
|
|
|
data: {
|
|
|
'name': array[i],
|
|
|
'exe': 'status'
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
async: false,
|
|
|
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\">" + array[i] + "</h4>";
|
|
|
div = div + data.data + "</div>";
|
|
|
$("#detail-div").append(div);
|
|
|
},
|
|
|
error: function () {
|
|
|
var div = "<div>查看状态请求异常</div>";
|
|
|
$("#detail-div").append(div);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
</script> |
|
|
\ No newline at end of file |
...
|
...
|
|