...
|
...
|
@@ -78,6 +78,36 @@ |
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" >
|
|
|
<div class="modal-dialog" style="margin-top: 5%;
|
|
|
margin-left: auto;
|
|
|
height:50.333%;
|
|
|
width: 60%;
|
|
|
overflow:scroll;
|
|
|
overflow-x:auto;
|
|
|
overflow-y:auto ">
|
|
|
<div class="modal-content">
|
|
|
<div class="modal-header">
|
|
|
<button type="button" class="close" data-dismiss="modal"
|
|
|
aria-hidden="true">×</button>
|
|
|
<h4 class="modal-title" id="myModalLabel"></h4>
|
|
|
</div>
|
|
|
<div class="modal-body">
|
|
|
<div id="check_result_div" style="">
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
<div class="modal-footer">
|
|
|
<button type="button" class="btn btn-danger" data-dismiss="modal">关闭</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- /.modal-content -->
|
|
|
</div>
|
|
|
<!-- /.modal -->
|
|
|
</div>
|
|
|
|
|
|
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
$("#li_switch").addClass("active open");
|
...
|
...
|
@@ -99,36 +129,54 @@ |
|
|
columns: [{
|
|
|
title: "切换项",
|
|
|
field: "cName",
|
|
|
width: "20%"
|
|
|
width: "15%"
|
|
|
}, {
|
|
|
title: "切向QQ",
|
|
|
field: "name",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var div = $("<div>");
|
|
|
$("<button onclick=\"doExe(\'" + value + "\',\'qcloud\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
|
|
$("<button onclick=\"doExe(\'" + value + "\',\'beforeCheck\')\">").addClass("btn btn-xs btn-success").html("前检测").appendTo(div);
|
|
|
div.append(" ");
|
|
|
$("<button onclick=\"toDoExe(\'" + value + "\',\'toQcloud\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
|
|
div.append(" ");
|
|
|
$("<button onclick=\"doExe(\'" + value + "\',\'afterCheck\')\">").addClass("btn btn-xs btn-success").html("后检测").appendTo(div);
|
|
|
|
|
|
return div;
|
|
|
},
|
|
|
width: "40%"
|
|
|
width: "35%"
|
|
|
},{
|
|
|
title: "切回AWS",
|
|
|
field: "name",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var div = $("<div>");
|
|
|
$("<button onclick=\"doExe(\'" + value + "\',\'aws\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
|
|
$("<button onclick=\"doExe(\'" + value + "\',\'afterCheck\')\">").addClass("btn btn-xs btn-success").html("前检测").appendTo(div);
|
|
|
div.append(" ");
|
|
|
$("<button onclick=\"toDoExe(\'" + value + "\',\'toAws\')\">").addClass("btn btn-primary").html("切换").appendTo(div);
|
|
|
div.append(" ");
|
|
|
$("<button onclick=\"doExe(\'" + value + "\',\'beforeCheck\')\">").addClass("btn btn-xs btn-success").html("后检测").appendTo(div);
|
|
|
return div;
|
|
|
},
|
|
|
width: "40%"
|
|
|
width: "35%"
|
|
|
},{
|
|
|
title: "状态查看",
|
|
|
field: "name",
|
|
|
formatter: function (value, rowData, rowIndex) {
|
|
|
var div = $("<div>");
|
|
|
$("<button onclick=\"doExe(\'" + value + "\',\'status\')\">").addClass("btn btn-primary").html("当前状态").appendTo(div);
|
|
|
return div;
|
|
|
},
|
|
|
width: "35%"
|
|
|
}]
|
|
|
});
|
|
|
});
|
|
|
|
|
|
//执行切换
|
|
|
function doExe(name, toCloud) {
|
|
|
function toDoExe(name, toCloud) {
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
title: "切换确定",
|
|
|
backdrop: "static",
|
|
|
content: "name:"+name+" 切向:"+toCloud,
|
|
|
content: "name:"+name+" exe:"+toCloud,
|
|
|
buttons: [{
|
|
|
text: "否",
|
|
|
className: "btn-danger",
|
...
|
...
|
@@ -140,11 +188,51 @@ |
|
|
className: "btn-success",
|
|
|
onclick: function () {
|
|
|
$(dialog).dialog("hide");
|
|
|
window.open(contextPath + "centerSwitch/todoExe?name=" + name + "&toCloud=" + toCloud, "_self");
|
|
|
doExe(name,toCloud);
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//执行切换
|
|
|
function doExe(name, exe) {
|
|
|
var jq = $("#switchTable");
|
|
|
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: contextPath + "/centerSwitch/doExe",
|
|
|
data:{
|
|
|
'name':name,
|
|
|
'exe':exe
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
beforeSend:function(){
|
|
|
var div = $("<div>").attr("tableSelector", jq.selector).addClass("modal-backdrop fade in").appendTo($("body")).hide();
|
|
|
var tableOffset = jq.offset();
|
|
|
var tableWidth = jq.outerWidth(true), tableHeight = jq.outerHeight(true);
|
|
|
div.append($("<div>").addClass("table-loading").css({
|
|
|
left : (tableWidth - 124) / 2,
|
|
|
top : (tableHeight - 124) / 2
|
|
|
}));
|
|
|
div.css({
|
|
|
width : tableWidth,
|
|
|
height : tableHeight,
|
|
|
left : tableOffset.left,
|
|
|
top : tableOffset.top
|
|
|
});
|
|
|
div.show();
|
|
|
},
|
|
|
success: function (resp) {
|
|
|
$("body").find("div[tableSelector='"+ jq.selector +"']").remove();
|
|
|
$("#check_result_div").html(resp.data);
|
|
|
$("#myModalLabel").text("name:"+name+" exe:"+exe);
|
|
|
$("#myModal").modal('show');
|
|
|
|
|
|
},
|
|
|
error: function (resp) {
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
</script> |
|
|
|
|
|
\ No newline at end of file |
...
|
...
|
|