...
|
...
|
@@ -28,7 +28,6 @@ |
|
|
<script src="<%=basePath %>js/typeahead-bs2.min.js" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/ace-elements.min.js" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/ace.min.js" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>script/nginx_switch.js" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/layer/layer.js" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>/js/unicorn.js" type="text/javascript"></script>
|
|
|
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
|
...
|
...
|
@@ -117,9 +116,10 @@ |
|
|
|
|
|
<script src="<%=basePath %>script/common/genarate_left_panel.js" type="text/javascript"></script>
|
|
|
<script type="text/javascript">
|
|
|
var dialog1, dialog2;
|
|
|
function initSwitch(cloudName) {
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
dialog1 = $("<div>").appendTo($("body"));
|
|
|
dialog1.dialog({
|
|
|
title: "你确定切换吗",
|
|
|
backdrop: "static",
|
|
|
content: "你确定要将脚本切换至" + cloudName + "吗?",
|
...
|
...
|
@@ -127,7 +127,7 @@ |
|
|
text: "否",
|
|
|
className: "btn-danger",
|
|
|
onclick: function () {
|
|
|
$(dialog).dialog("hide");
|
|
|
$(dialog1).dialog("hide");
|
|
|
}
|
|
|
}, {
|
|
|
text: "是",
|
...
|
...
|
@@ -136,37 +136,57 @@ |
|
|
var param = {
|
|
|
cloudName: cloudName
|
|
|
};
|
|
|
$.ajax({
|
|
|
type: 'post',
|
|
|
url: 'switchConf',
|
|
|
data: param,
|
|
|
dataType: 'text',
|
|
|
success: function (resp) {
|
|
|
$(dialog).dialog("hide");
|
|
|
var data = JSON.parse(resp);
|
|
|
|
|
|
var dialog2 = $("<div>").appendTo($("body"));
|
|
|
dialog2.dialog({
|
|
|
title: "切换结果",
|
|
|
backdrop: "static",
|
|
|
content: data.data,
|
|
|
buttons: [{
|
|
|
text: "确定",
|
|
|
className: "btn-danger",
|
|
|
onclick: function () {
|
|
|
window.location.href = contextPath + "/luaswitch/toLuaSwitch";
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
},
|
|
|
error: function () {
|
|
|
layer.msg("异常", {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
sendAjax("post", "viewToChangeLuaConf", param, "text", viewToChangeSuccess, errorFunc);
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function viewToChangeSuccess(resp) {
|
|
|
$(dialog1).dialog("hide");
|
|
|
|
|
|
var data = JSON.parse(resp);
|
|
|
dialog2 = $("<div>").appendTo($("body"));
|
|
|
dialog2.dialog({
|
|
|
title: "切换结果",
|
|
|
backdrop: "static",
|
|
|
content: data.data,
|
|
|
buttons: [{
|
|
|
text: "否",
|
|
|
className: "btn-danger",
|
|
|
onclick: function () {
|
|
|
$(dialog2).dialog("hide");
|
|
|
}
|
|
|
}, {
|
|
|
text: "确定",
|
|
|
className: "btn-success",
|
|
|
onclick: function () {
|
|
|
sendAjax("post", "switchConf", {}, "text", switchSuccess, errorFunc);
|
|
|
}
|
|
|
}]
|
|
|
}).find(".modal-body").css({
|
|
|
height: "550px"
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function switchSuccess() {
|
|
|
window.location.href = contextPath + "/luaswitch/toLuaSwitch";
|
|
|
}
|
|
|
|
|
|
function sendAjax(type, url, data, dataType, success, error) {
|
|
|
$.ajax({
|
|
|
type: type,
|
|
|
url: url,
|
|
|
data: data,
|
|
|
dataType: dataType,
|
|
|
success: success,
|
|
|
error: error
|
|
|
});
|
|
|
}
|
|
|
|
|
|
function errorFunc() {
|
|
|
layer.msg("Token异常", {icon: 2});
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|
|
|
</html> |
...
|
...
|
|