|
@@ -116,6 +116,8 @@ function drawData(resp) { |
|
@@ -116,6 +116,8 @@ function drawData(resp) { |
116
|
//创建lua切换按钮
|
116
|
//创建lua切换按钮
|
117
|
createLuaSwitchButton(data.luaType);
|
117
|
createLuaSwitchButton(data.luaType);
|
118
|
|
118
|
|
|
|
119
|
+ //创建入口切换按钮
|
|
|
120
|
+ createDnsSwitchButton(data.luaType);
|
119
|
}
|
121
|
}
|
120
|
|
122
|
|
121
|
/**
|
123
|
/**
|
|
@@ -165,6 +167,7 @@ function luaInitSwitch(cloudName) { |
|
@@ -165,6 +167,7 @@ function luaInitSwitch(cloudName) { |
165
|
};
|
167
|
};
|
166
|
sendAjax("post", getUrlBasePath() + "/luaswitch/viewToChangeLuaConf", param, "text", luaViewToChangeSuccess, errorFunc);
|
168
|
sendAjax("post", getUrlBasePath() + "/luaswitch/viewToChangeLuaConf", param, "text", luaViewToChangeSuccess, errorFunc);
|
167
|
dialog.dialog("hide");
|
169
|
dialog.dialog("hide");
|
|
|
170
|
+ toWait();
|
168
|
}
|
171
|
}
|
169
|
}]
|
172
|
}]
|
170
|
});
|
173
|
});
|
|
@@ -204,6 +207,84 @@ function luaViewToChangeSuccess(resp) { |
|
@@ -204,6 +207,84 @@ function luaViewToChangeSuccess(resp) { |
204
|
}
|
207
|
}
|
205
|
|
208
|
|
206
|
/**
|
209
|
/**
|
|
|
210
|
+ * 创建Dns切换按钮
|
|
|
211
|
+ * @param luaType
|
|
|
212
|
+ */
|
|
|
213
|
+function createDnsSwitchButton(luaType){
|
|
|
214
|
+ if(luaType == ""){
|
|
|
215
|
+ return;
|
|
|
216
|
+ }
|
|
|
217
|
+ var awsButton = "<button class=\"btn btn-sm btn-success\" onclick=\"dnsSwitch(\'toAws\')\"> <em class=\"icon-cogs bigger-110\"></em>切向aws</button>";
|
|
|
218
|
+ var qqButton = "<button class=\"btn btn-sm btn-success\" onclick=\"dnsSwitch(\'toQcloud\')\"> <em class=\"icon-cogs bigger-110\"></em>切向qcloud</button>";
|
|
|
219
|
+ var mixButton = "<button class=\"btn btn-sm btn-success\" onclick=\"dnsSwitch(\'mix\')\"> <em class=\"icon-cogs bigger-110\"></em>切向双云</button>";
|
|
|
220
|
+
|
|
|
221
|
+ if(luaType == 'aws'){
|
|
|
222
|
+ $("#dns-div").html(qqButton + mixButton);
|
|
|
223
|
+ }else if (luaType == 'qq'){
|
|
|
224
|
+ $("#dns-div").html(awsButton + mixButton);
|
|
|
225
|
+ }else{
|
|
|
226
|
+ $("#dns-div").html(awsButton + qqButton);
|
|
|
227
|
+ }
|
|
|
228
|
+}
|
|
|
229
|
+
|
|
|
230
|
+/**
|
|
|
231
|
+ * 直接切换,由于调用的是api
|
|
|
232
|
+ * @param cloud
|
|
|
233
|
+ */
|
|
|
234
|
+function dnsSwitch(cloud){
|
|
|
235
|
+ var dialog = $("<div>").appendTo($("body"));
|
|
|
236
|
+ dialog.dialog({
|
|
|
237
|
+ title: "你确定切换吗",
|
|
|
238
|
+ backdrop: "static",
|
|
|
239
|
+ content: "由于切换dns是调用的dnspod提供的api,因此当点击确定就直接切换!!!!!!",
|
|
|
240
|
+ buttons: [{
|
|
|
241
|
+ text: "否",
|
|
|
242
|
+ className: "btn-danger",
|
|
|
243
|
+ onclick: function () {
|
|
|
244
|
+ dialog.dialog("hide");
|
|
|
245
|
+ }
|
|
|
246
|
+ }, {
|
|
|
247
|
+ text: "是",
|
|
|
248
|
+ className: "btn-success",
|
|
|
249
|
+ onclick: function () {
|
|
|
250
|
+ sendAjax("post", getUrlBasePath() + "/luaswitch/dnsSwitchConf?cloudName="+cloud, {}, "text", switchSuccess, errorFunc);
|
|
|
251
|
+ dialog.dialog("hide");
|
|
|
252
|
+ }
|
|
|
253
|
+ }]
|
|
|
254
|
+ });
|
|
|
255
|
+}
|
|
|
256
|
+
|
|
|
257
|
+/**
|
|
|
258
|
+ * 查看当前入口配置
|
|
|
259
|
+ */
|
|
|
260
|
+function dnsViewConf(){
|
|
|
261
|
+ sendAjax("post", getUrlBasePath() + "/luaswitch/dnsViewCurrentConf", {}, "text", dnsViewCurrentConf, errorFunc);
|
|
|
262
|
+}
|
|
|
263
|
+
|
|
|
264
|
+/**
|
|
|
265
|
+* 打开对话框,查看当前dns配置
|
|
|
266
|
+* @param resp 当前响应数据
|
|
|
267
|
+*/
|
|
|
268
|
+function dnsViewCurrentConf(resp) {
|
|
|
269
|
+ var data = JSON.parse(resp);
|
|
|
270
|
+ var dialog = $("<div>").appendTo($("body"));
|
|
|
271
|
+ dialog.dialog({
|
|
|
272
|
+ title: "当前配置",
|
|
|
273
|
+ backdrop: "static",
|
|
|
274
|
+ content: "<pre>" + data.data + "</pre>",
|
|
|
275
|
+ buttons: [{
|
|
|
276
|
+ text: "确定",
|
|
|
277
|
+ className: "btn-danger",
|
|
|
278
|
+ onclick: function () {
|
|
|
279
|
+ dialog.dialog("hide");
|
|
|
280
|
+ }
|
|
|
281
|
+ }]
|
|
|
282
|
+ }).find(".modal-body").css({
|
|
|
283
|
+ height: "650px"
|
|
|
284
|
+ });
|
|
|
285
|
+}
|
|
|
286
|
+
|
|
|
287
|
+/**
|
207
|
* 查看当前lua配置
|
288
|
* 查看当前lua配置
|
208
|
*/
|
289
|
*/
|
209
|
function luaViewConf(){
|
290
|
function luaViewConf(){
|
|
@@ -401,33 +482,6 @@ function toWait() { |
|
@@ -401,33 +482,6 @@ function toWait() { |
401
|
});
|
482
|
});
|
402
|
}
|
483
|
}
|
403
|
|
484
|
|
404
|
-
|
|
|
405
|
-
|
|
|
406
|
-
|
|
|
407
|
-
|
|
|
408
|
-
|
|
|
409
|
-
|
|
|
410
|
-
|
|
|
411
|
-
|
|
|
412
|
-
|
|
|
413
|
-
|
|
|
414
|
-
|
|
|
415
|
-
|
|
|
416
|
-
|
|
|
417
|
-
|
|
|
418
|
-
|
|
|
419
|
-
|
|
|
420
|
-
|
|
|
421
|
-
|
|
|
422
|
-
|
|
|
423
|
-
|
|
|
424
|
-
|
|
|
425
|
-
|
|
|
426
|
-
|
|
|
427
|
-
|
|
|
428
|
-
|
|
|
429
|
-
|
|
|
430
|
-
|
|
|
431
|
// 节点
|
485
|
// 节点
|
432
|
function newNode(scene,x, y, w, h, text) {
|
486
|
function newNode(scene,x, y, w, h, text) {
|
433
|
var node = new JTopo.Node(text);
|
487
|
var node = new JTopo.Node(text);
|