...
|
...
|
@@ -116,6 +116,8 @@ function drawData(resp) { |
|
|
//创建lua切换按钮
|
|
|
createLuaSwitchButton(data.luaType);
|
|
|
|
|
|
//创建入口切换按钮
|
|
|
createDnsSwitchButton(data.luaType);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -165,6 +167,7 @@ function luaInitSwitch(cloudName) { |
|
|
};
|
|
|
sendAjax("post", getUrlBasePath() + "/luaswitch/viewToChangeLuaConf", param, "text", luaViewToChangeSuccess, errorFunc);
|
|
|
dialog.dialog("hide");
|
|
|
toWait();
|
|
|
}
|
|
|
}]
|
|
|
});
|
...
|
...
|
@@ -204,6 +207,84 @@ function luaViewToChangeSuccess(resp) { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 创建Dns切换按钮
|
|
|
* @param luaType
|
|
|
*/
|
|
|
function createDnsSwitchButton(luaType){
|
|
|
if(luaType == ""){
|
|
|
return;
|
|
|
}
|
|
|
var awsButton = "<button class=\"btn btn-sm btn-success\" onclick=\"dnsSwitch(\'toAws\')\"> <em class=\"icon-cogs bigger-110\"></em>切向aws</button>";
|
|
|
var qqButton = "<button class=\"btn btn-sm btn-success\" onclick=\"dnsSwitch(\'toQcloud\')\"> <em class=\"icon-cogs bigger-110\"></em>切向qcloud</button>";
|
|
|
var mixButton = "<button class=\"btn btn-sm btn-success\" onclick=\"dnsSwitch(\'mix\')\"> <em class=\"icon-cogs bigger-110\"></em>切向双云</button>";
|
|
|
|
|
|
if(luaType == 'aws'){
|
|
|
$("#dns-div").html(qqButton + mixButton);
|
|
|
}else if (luaType == 'qq'){
|
|
|
$("#dns-div").html(awsButton + mixButton);
|
|
|
}else{
|
|
|
$("#dns-div").html(awsButton + qqButton);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 直接切换,由于调用的是api
|
|
|
* @param cloud
|
|
|
*/
|
|
|
function dnsSwitch(cloud){
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
title: "你确定切换吗",
|
|
|
backdrop: "static",
|
|
|
content: "由于切换dns是调用的dnspod提供的api,因此当点击确定就直接切换!!!!!!",
|
|
|
buttons: [{
|
|
|
text: "否",
|
|
|
className: "btn-danger",
|
|
|
onclick: function () {
|
|
|
dialog.dialog("hide");
|
|
|
}
|
|
|
}, {
|
|
|
text: "是",
|
|
|
className: "btn-success",
|
|
|
onclick: function () {
|
|
|
sendAjax("post", getUrlBasePath() + "/luaswitch/dnsSwitchConf?cloudName="+cloud, {}, "text", switchSuccess, errorFunc);
|
|
|
dialog.dialog("hide");
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查看当前入口配置
|
|
|
*/
|
|
|
function dnsViewConf(){
|
|
|
sendAjax("post", getUrlBasePath() + "/luaswitch/dnsViewCurrentConf", {}, "text", dnsViewCurrentConf, errorFunc);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 打开对话框,查看当前dns配置
|
|
|
* @param resp 当前响应数据
|
|
|
*/
|
|
|
function dnsViewCurrentConf(resp) {
|
|
|
var data = JSON.parse(resp);
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
title: "当前配置",
|
|
|
backdrop: "static",
|
|
|
content: "<pre>" + data.data + "</pre>",
|
|
|
buttons: [{
|
|
|
text: "确定",
|
|
|
className: "btn-danger",
|
|
|
onclick: function () {
|
|
|
dialog.dialog("hide");
|
|
|
}
|
|
|
}]
|
|
|
}).find(".modal-body").css({
|
|
|
height: "650px"
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查看当前lua配置
|
|
|
*/
|
|
|
function luaViewConf(){
|
...
|
...
|
@@ -401,33 +482,6 @@ function toWait() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 节点
|
|
|
function newNode(scene,x, y, w, h, text) {
|
|
|
var node = new JTopo.Node(text);
|
...
|
...
|
|