...
|
...
|
@@ -180,8 +180,6 @@ |
|
|
* @param resp 切换后的响应数据
|
|
|
*/
|
|
|
function viewCurrentConf(data) {
|
|
|
/* console.log(resp);
|
|
|
var data = JSON.parse(resp);*/
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
size:"modal-lg",
|
...
|
...
|
@@ -201,17 +199,103 @@ |
|
|
}
|
|
|
|
|
|
//线下店服务切换
|
|
|
function storeServiceSwitch(switchTarget) {
|
|
|
alert(switchTarget+"开发中");
|
|
|
function storeServiceSwitch(onlineOrGray) {
|
|
|
serviceSwitch("store","线下店服务",onlineOrGray);
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//延展服务切换
|
|
|
function extendServiceSwitch(switchTarget) {
|
|
|
alert(switchTarget+"开发中");
|
|
|
function extendServiceSwitch(onlineOrGray) {
|
|
|
serviceSwitch("extend","延展服务",onlineOrGray);
|
|
|
}
|
|
|
|
|
|
function serviceSwitch(serviceType,serviceName,onlineOrGray){
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
title: "你确定切换吗",
|
|
|
backdrop: "static",
|
|
|
content: "你确定要将 "+serviceName+" 流量切向" + onlineOrGray + "吗?",
|
|
|
buttons: [{
|
|
|
text: "否",
|
|
|
className: "btn-danger",
|
|
|
onclick: function () {
|
|
|
dialog.dialog("hide");
|
|
|
}
|
|
|
}, {
|
|
|
text: "是",
|
|
|
className: "btn-success",
|
|
|
onclick: function () {
|
|
|
var param = {
|
|
|
serviceType: serviceType,
|
|
|
onlineOrGray: onlineOrGray
|
|
|
};
|
|
|
storeNginxConfToChangeView(param);
|
|
|
dialog.dialog("hide");
|
|
|
}
|
|
|
}]
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//线下店服务,切换预览
|
|
|
function storeNginxConfToChangeView(paramFront) {
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: contextPath+"/storeSwitch/viewStoreNginxToChangeConf",
|
|
|
data: paramFront,
|
|
|
dataType: "json",
|
|
|
success: function(resp){
|
|
|
nginxViewToChangeSuccess(resp);
|
|
|
},
|
|
|
error: function(){
|
|
|
layer.msg("获取线下店nginx配置信息异常", {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 打开对话框,展示切换后的配置
|
|
|
* @param resp 切换后的响应数据
|
|
|
*/
|
|
|
function nginxViewToChangeSuccess(resp) {
|
|
|
var dialog = $("<div>").appendTo($("body"));
|
|
|
dialog.dialog({
|
|
|
size:"modal-lg",
|
|
|
title: "切换结果预览",
|
|
|
backdrop: "static",
|
|
|
content: "<pre>" + resp.data + "</pre>",
|
|
|
buttons: [{
|
|
|
text: "否",
|
|
|
className: "btn-danger",
|
|
|
onclick: function () {
|
|
|
dialog.dialog("hide");
|
|
|
}
|
|
|
}, {
|
|
|
text: "再次确认",
|
|
|
className: "btn-success",
|
|
|
onclick: function () {
|
|
|
alert("开始切换");
|
|
|
$.ajax({
|
|
|
type: "post",
|
|
|
url: contextPath+"/storeSwitch/switchStoreNginx",
|
|
|
data: {
|
|
|
confContent:resp.data
|
|
|
},
|
|
|
dataType: "json",
|
|
|
success: function(resp){
|
|
|
|
|
|
},
|
|
|
error: function(){
|
|
|
layer.msg("切换nginx异常", {icon: 2});
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}]
|
|
|
}).find(".modal-body").css({
|
|
|
height: "650px"
|
|
|
});
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 展示画布 和 数据
|
|
|
* @param resp
|
...
|
...
|
|