代理操控业务部分功能提交配置、导入、导出
This commit is contained in:
140
src/main/java/com/nis/domain/maat/ManipulatActionParam.java
Normal file
140
src/main/java/com/nis/domain/maat/ManipulatActionParam.java
Normal file
@@ -0,0 +1,140 @@
|
|||||||
|
package com.nis.domain.maat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 管控策略动作参数
|
||||||
|
*/
|
||||||
|
public class ManipulatActionParam implements Serializable{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7282481538239386968L;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private String method;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private Integer code;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private String to;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private String message;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private Integer html_profile;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private List<ReplaceCfg> rules;
|
||||||
|
|
||||||
|
public static class ReplaceCfg{
|
||||||
|
@Expose
|
||||||
|
private String search_in;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private String find;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private String replace_with;
|
||||||
|
|
||||||
|
public String getSearch_in() {
|
||||||
|
return search_in;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSearch_in(String search_in) {
|
||||||
|
this.search_in = search_in;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFind() {
|
||||||
|
return find;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFind(String find) {
|
||||||
|
this.find = find;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReplace_with() {
|
||||||
|
return replace_with;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReplace_with(String replace_with) {
|
||||||
|
this.replace_with = replace_with;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private Integer hijack_profile;
|
||||||
|
|
||||||
|
@Expose
|
||||||
|
private Integer insert_profile;
|
||||||
|
|
||||||
|
public String getMethod() {
|
||||||
|
return method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethod(String method) {
|
||||||
|
this.method = method;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTo() {
|
||||||
|
return to;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTo(String to) {
|
||||||
|
this.to = to;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getHtml_profile() {
|
||||||
|
return html_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHtml_profile(Integer html_profile) {
|
||||||
|
this.html_profile = html_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ReplaceCfg> getRules() {
|
||||||
|
return rules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRules(List<ReplaceCfg> rules) {
|
||||||
|
this.rules = rules;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getHijack_profile() {
|
||||||
|
return hijack_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHijack_profile(Integer hijack_profile) {
|
||||||
|
this.hijack_profile = hijack_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getInsert_profile() {
|
||||||
|
return insert_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInsert_profile(Integer insert_profile) {
|
||||||
|
this.insert_profile = insert_profile;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -295,7 +295,7 @@ public class ExportExcel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*** HTTP(s)替换 搜索区域 ***/
|
/*** HTTP(s)替换 搜索区域 ***/
|
||||||
if(("replace_zone".equals(headerStr)) && (region.getFunctionId().equals(209))){
|
if(("replace_zone".equals(headerStr)) && (region.getFunctionId().equals(209) || region.getAction().equals(80))){
|
||||||
commentStr="";
|
commentStr="";
|
||||||
List<SysDataDictionaryItem> dict=DictUtils.getDictList("CONTROL_REPLACE_ZONE");
|
List<SysDataDictionaryItem> dict=DictUtils.getDictList("CONTROL_REPLACE_ZONE");
|
||||||
if(dict !=null && dict.size()>0){
|
if(dict !=null && dict.size()>0){
|
||||||
@@ -1170,12 +1170,18 @@ public class ExportExcel {
|
|||||||
headerStr="";
|
headerStr="";
|
||||||
commentStr="";
|
commentStr="";
|
||||||
}else{
|
}else{
|
||||||
|
if((region.getAction()!=null) && (region.getAction()==85 || region.getAction()==90)) {
|
||||||
|
commentStr=commentStr+"Content-Type"+"\n";
|
||||||
|
index++;
|
||||||
|
defaultValue="Content-Type";
|
||||||
|
}else {
|
||||||
for (String districtStr : region.getConfigDistrict().split(",")) {
|
for (String districtStr : region.getConfigDistrict().split(",")) {
|
||||||
commentStr=commentStr+districtStr+"\n";
|
commentStr=commentStr+districtStr+"\n";
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
defaultValue=region.getConfigDistrict().split(",")[0];
|
defaultValue=region.getConfigDistrict().split(",")[0];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(StringUtil.isEmpty(commentStr)){
|
if(StringUtil.isEmpty(commentStr)){
|
||||||
headerStr="";
|
headerStr="";
|
||||||
commentStr="";
|
commentStr="";
|
||||||
|
|||||||
@@ -91,6 +91,10 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
throw new RuntimeException("Found String region,but mulityKeywords is Empty");
|
throw new RuntimeException("Found String region,but mulityKeywords is Empty");
|
||||||
}
|
}
|
||||||
String dirtrictP = regionDict.getConfigDistrict();
|
String dirtrictP = regionDict.getConfigDistrict();
|
||||||
|
// 代理-操控业务hijack、insert
|
||||||
|
if(regionDict.getAction().equals(85) || regionDict.getAction().equals(90)) {
|
||||||
|
dirtrictP = "Content-Type";
|
||||||
|
}
|
||||||
StringBuffer errTip = new StringBuffer();
|
StringBuffer errTip = new StringBuffer();
|
||||||
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
|
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
@@ -127,7 +131,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 代理HTTP(s)阻断
|
// 代理HTTP(s)阻断
|
||||||
if (regionDict.getFunctionId().equals(207)) {
|
if (regionDict.getFunctionId().equals(207) || regionDict.getAction().equals(16)) {
|
||||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||||
baseStringCfg.setUserRegion1("404");
|
baseStringCfg.setUserRegion1("404");
|
||||||
}
|
}
|
||||||
@@ -153,7 +157,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
|
|
||||||
}
|
}
|
||||||
// 代理 HTTP(s)重定向
|
// 代理 HTTP(s)重定向
|
||||||
if (regionDict.getFunctionId().equals(208)) {
|
if (regionDict.getFunctionId().equals(208) || regionDict.getAction().equals(48)) {
|
||||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||||
baseStringCfg.setUserRegion1("302");
|
baseStringCfg.setUserRegion1("302");
|
||||||
}
|
}
|
||||||
@@ -188,7 +192,7 @@ public class CheckComplexStringFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 代理HTTP(s)替换
|
// 代理HTTP(s)替换
|
||||||
if (regionDict.getFunctionId().equals(209)) {
|
if (regionDict.getFunctionId().equals(209) || regionDict.getAction().equals(80)) {
|
||||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||||
baseStringCfg.setUserRegion1("http_resp_body");
|
baseStringCfg.setUserRegion1("http_resp_body");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -426,7 +426,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 代理HTTP(s)阻断
|
// 代理HTTP(s)阻断
|
||||||
if (regionDict.getFunctionId().equals(207)) {
|
if (regionDict.getFunctionId().equals(207) || regionDict.getAction().equals(16)) {
|
||||||
if(StringUtils.isBlank(baseIpCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseIpCfg.getUserRegion1())) {
|
||||||
baseIpCfg.setUserRegion1("404");
|
baseIpCfg.setUserRegion1("404");
|
||||||
}
|
}
|
||||||
@@ -452,7 +452,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
|||||||
|
|
||||||
}
|
}
|
||||||
// 代理 HTTP(s)重定向
|
// 代理 HTTP(s)重定向
|
||||||
if (regionDict.getFunctionId().equals(208)) {
|
if (regionDict.getFunctionId().equals(208) || regionDict.getAction().equals(48)) {
|
||||||
if(StringUtils.isBlank(baseIpCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseIpCfg.getUserRegion1())) {
|
||||||
baseIpCfg.setUserRegion1("302");
|
baseIpCfg.setUserRegion1("302");
|
||||||
}
|
}
|
||||||
@@ -487,7 +487,7 @@ public class CheckIpFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 代理HTTP(s)替换
|
// 代理HTTP(s)替换
|
||||||
if (regionDict.getFunctionId().equals(209)) {
|
if (regionDict.getFunctionId().equals(209) || regionDict.getAction().equals(80)) {
|
||||||
if(StringUtils.isBlank(baseIpCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseIpCfg.getUserRegion1())) {
|
||||||
baseIpCfg.setUserRegion1("http_resp_body");
|
baseIpCfg.setUserRegion1("http_resp_body");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
|
|
||||||
}
|
}
|
||||||
// 代理HTTP(s)阻断
|
// 代理HTTP(s)阻断
|
||||||
if (regionDict.getFunctionId().equals(207)) {
|
if (regionDict.getFunctionId().equals(207) || regionDict.getAction().equals(16)) {
|
||||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||||
baseStringCfg.setUserRegion1("404");
|
baseStringCfg.setUserRegion1("404");
|
||||||
}
|
}
|
||||||
@@ -203,7 +203,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
|
|
||||||
}
|
}
|
||||||
// 代理 HTTP(s)重定向
|
// 代理 HTTP(s)重定向
|
||||||
if (regionDict.getFunctionId().equals(208)) {
|
if (regionDict.getFunctionId().equals(208) || regionDict.getAction().equals(48)) {
|
||||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||||
baseStringCfg.setUserRegion1("302");
|
baseStringCfg.setUserRegion1("302");
|
||||||
}
|
}
|
||||||
@@ -238,7 +238,7 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 代理HTTP(s)替换
|
// 代理HTTP(s)替换
|
||||||
if (regionDict.getFunctionId().equals(209)) {
|
if (regionDict.getFunctionId().equals(209) || regionDict.getAction().equals(80)) {
|
||||||
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
if(StringUtils.isBlank(baseStringCfg.getUserRegion1())) {
|
||||||
baseStringCfg.setUserRegion1("http_resp_body");
|
baseStringCfg.setUserRegion1("http_resp_body");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -347,6 +347,7 @@ public class BaseController {
|
|||||||
protected AsnGroupInfoService asnGroupInfoService;// asn组
|
protected AsnGroupInfoService asnGroupInfoService;// asn组
|
||||||
@Autowired
|
@Autowired
|
||||||
protected InnerProtectionListService innerProtectionListService;
|
protected InnerProtectionListService innerProtectionListService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 管理基础路径
|
* 管理基础路径
|
||||||
*/
|
*/
|
||||||
@@ -1354,9 +1355,11 @@ public class BaseController {
|
|||||||
* @param requestId
|
* @param requestId
|
||||||
* @param classify
|
* @param classify
|
||||||
* @param attribute
|
* @param attribute
|
||||||
|
* @param manipulatType 操控业务动作类型(伪)
|
||||||
|
* @param profileId 操控业务ProfileId
|
||||||
*/
|
*/
|
||||||
public void _import(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes,
|
public void _import(HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes,
|
||||||
MultipartFile[] files, Integer serviceDictId, String regionDictIds, Integer requestId, String attribute, String classify) {
|
MultipartFile[] files, Integer serviceDictId, String regionDictIds, Integer requestId, String attribute, String classify, Integer manipulatType, Integer profileId) {
|
||||||
logger.warn("import start...");
|
logger.warn("import start...");
|
||||||
long start=System.currentTimeMillis();
|
long start=System.currentTimeMillis();
|
||||||
ImportBigExcel ei=null;
|
ImportBigExcel ei=null;
|
||||||
@@ -1406,6 +1409,7 @@ public class BaseController {
|
|||||||
ei = new ImportBigExcel(file, 0, 1);
|
ei = new ImportBigExcel(file, 0, 1);
|
||||||
FunctionRegionDict regionDict = DictUtils
|
FunctionRegionDict regionDict = DictUtils
|
||||||
.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||||
|
regionDict.setAction(manipulatType);
|
||||||
//加载模板
|
//加载模板
|
||||||
loadTemplate(ei,regionDict, serviceDict);
|
loadTemplate(ei,regionDict, serviceDict);
|
||||||
//------------------------------------check format start----------------------------
|
//------------------------------------check format start----------------------------
|
||||||
@@ -1457,6 +1461,21 @@ public class BaseController {
|
|||||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
BlockingQueue<HttpsReplaceIpTemplate> list = ei.getDataList(HttpsReplaceIpTemplate.class );
|
BlockingQueue<HttpsReplaceIpTemplate> list = ei.getDataList(HttpsReplaceIpTemplate.class );
|
||||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(215)) {// HTTP(s)操控(阻断+重定向+替换)
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
BlockingQueue<HttpsRejectIpTemplate> list = ei.getDataList(HttpsRejectIpTemplate.class );
|
||||||
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
BlockingQueue<HttpsRedirectIpTemplate> list = ei.getDataList(HttpsRedirectIpTemplate.class );
|
||||||
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
BlockingQueue<HttpsReplaceIpTemplate> list = ei.getDataList(HttpsReplaceIpTemplate.class );
|
||||||
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||||
|
}else {
|
||||||
|
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
|
||||||
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||||
|
}
|
||||||
|
|
||||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
BlockingQueue<IpAllNotDoLogTemplate> list = ei.getDataList(IpAllNotDoLogTemplate.class );
|
BlockingQueue<IpAllNotDoLogTemplate> list = ei.getDataList(IpAllNotDoLogTemplate.class );
|
||||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||||
@@ -1515,6 +1534,21 @@ public class BaseController {
|
|||||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
BlockingQueue<HttpsReplaceTemplate> list = ei.getDataList(HttpsReplaceTemplate.class);
|
BlockingQueue<HttpsReplaceTemplate> list = ei.getDataList(HttpsReplaceTemplate.class);
|
||||||
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getFunctionId().equals(215)) {// HTTP(s)操控(阻断+重定向+替换)
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
BlockingQueue<HttpsRejectTemplate> list = ei.getDataList(HttpsRejectTemplate.class);
|
||||||
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
BlockingQueue<HttpsRedirectTemplate> list = ei.getDataList(HttpsRedirectTemplate.class);
|
||||||
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
BlockingQueue<HttpsReplaceTemplate> list = ei.getDataList(HttpsReplaceTemplate.class);
|
||||||
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else {
|
||||||
|
BlockingQueue<StringAllTemplate> list = ei.getDataList(StringAllTemplate.class );
|
||||||
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}
|
||||||
|
|
||||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
BlockingQueue<StringAllNotDoLogTemplate> list = ei.getDataList(StringAllNotDoLogTemplate.class);
|
BlockingQueue<StringAllNotDoLogTemplate> list = ei.getDataList(StringAllNotDoLogTemplate.class);
|
||||||
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
@@ -1540,6 +1574,21 @@ public class BaseController {
|
|||||||
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
BlockingQueue<HttpsReplaceComplexTemplate> list = ei.getDataList(HttpsReplaceComplexTemplate.class);
|
BlockingQueue<HttpsReplaceComplexTemplate> list = ei.getDataList(HttpsReplaceComplexTemplate.class);
|
||||||
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
} else if(regionDict.getFunctionId().equals(215)) {// HTTP(s)操控(阻断+重定向+替换)
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
BlockingQueue<HttpsRejectComplexTemplate> list = ei.getDataList(HttpsRejectComplexTemplate.class);
|
||||||
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
BlockingQueue<HttpsRedirectComplexTemplate> list = ei.getDataList(HttpsRedirectComplexTemplate.class);
|
||||||
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
BlockingQueue<HttpsReplaceComplexTemplate> list = ei.getDataList(HttpsReplaceComplexTemplate.class);
|
||||||
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}else {
|
||||||
|
BlockingQueue<ComplexStringAllTemplate> list = ei.getDataList(ComplexStringAllTemplate.class);
|
||||||
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
}
|
||||||
|
|
||||||
} else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
} else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
BlockingQueue<ComplexStringAllNotDoLogTemplate> list = ei.getDataList(ComplexStringAllNotDoLogTemplate.class);
|
BlockingQueue<ComplexStringAllNotDoLogTemplate> list = ei.getDataList(ComplexStringAllNotDoLogTemplate.class);
|
||||||
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
@@ -1850,6 +1899,14 @@ public class BaseController {
|
|||||||
if(StringUtils.isNotBlank(behaviorId))
|
if(StringUtils.isNotBlank(behaviorId))
|
||||||
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
||||||
}
|
}
|
||||||
|
// 代理-操控业务
|
||||||
|
if(regionDict.getAction() != null) {
|
||||||
|
cfg.setUserRegion5(regionDict.getAction()+"");
|
||||||
|
if(regionDict.getAction()!=48 && regionDict.getAction()!=80) {
|
||||||
|
cfg.setUserRegion4(profileId+"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33
|
if (serviceDict!=null&&(serviceDict.getServiceId().intValue() == 33
|
||||||
|| serviceDict.getServiceId().intValue() == 145
|
|| serviceDict.getServiceId().intValue() == 145
|
||||||
|| serviceDict.getServiceId().intValue() == 1056
|
|| serviceDict.getServiceId().intValue() == 1056
|
||||||
@@ -1991,6 +2048,14 @@ public class BaseController {
|
|||||||
if(StringUtils.isNotBlank(behaviorId))
|
if(StringUtils.isNotBlank(behaviorId))
|
||||||
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
||||||
}
|
}
|
||||||
|
// 代理-操控业务
|
||||||
|
if(regionDict.getAction() != null) {
|
||||||
|
cfg.setUserRegion5(regionDict.getAction()+"");
|
||||||
|
if(regionDict.getAction()!=48 && regionDict.getAction()!=80) {
|
||||||
|
cfg.setUserRegion4(profileId+"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (serviceDict.getServiceId().intValue() == 33
|
if (serviceDict.getServiceId().intValue() == 33
|
||||||
|| serviceDict.getServiceId().intValue() == 145
|
|| serviceDict.getServiceId().intValue() == 145
|
||||||
|| serviceDict.getServiceId().intValue() == 35
|
|| serviceDict.getServiceId().intValue() == 35
|
||||||
@@ -2150,6 +2215,14 @@ public class BaseController {
|
|||||||
if(StringUtils.isNotBlank(behaviorId))
|
if(StringUtils.isNotBlank(behaviorId))
|
||||||
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
||||||
}
|
}
|
||||||
|
// 代理-操控业务
|
||||||
|
if(regionDict.getAction() != null) {
|
||||||
|
cfg.setUserRegion5(regionDict.getAction()+"");
|
||||||
|
if(regionDict.getAction()!=48 && regionDict.getAction()!=80) {
|
||||||
|
cfg.setUserRegion4(profileId+"");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (serviceDict.getServiceId().intValue() == 33
|
if (serviceDict.getServiceId().intValue() == 33
|
||||||
|| serviceDict.getServiceId().intValue() == 145
|
|| serviceDict.getServiceId().intValue() == 145
|
||||||
|| serviceDict.getServiceId().intValue() == 35
|
|| serviceDict.getServiceId().intValue() == 35
|
||||||
@@ -2425,6 +2498,17 @@ public class BaseController {
|
|||||||
ei.loadInitParams(HttpsRedirectIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsRedirectIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
ei.loadInitParams(HttpsReplaceIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsReplaceIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
} else if(regionDict.getFunctionId().equals(215)){// HTTP(s)操控(阻断+重定向+替换)
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
ei.loadInitParams(HttpsRejectIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
ei.loadInitParams(HttpsRedirectIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
ei.loadInitParams(HttpsReplaceIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else {
|
||||||
|
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
|
}
|
||||||
|
|
||||||
} else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
} else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(IpAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
} else if(regionDict.getFunctionId().equals(200)){// 拦截策略
|
} else if(regionDict.getFunctionId().equals(200)){// 拦截策略
|
||||||
@@ -2465,6 +2549,17 @@ public class BaseController {
|
|||||||
ei.loadInitParams(HttpsRedirectTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsRedirectTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
ei.loadInitParams(HttpsReplaceTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsReplaceTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(215)){// HTTP(s)操控(阻断+重定向+替换)
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
ei.loadInitParams(HttpsRejectTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
ei.loadInitParams(HttpsRedirectTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
ei.loadInitParams(HttpsReplaceTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else {
|
||||||
|
ei.loadInitParams(StringAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
|
}
|
||||||
|
|
||||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
ei.loadInitParams(StringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(StringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else if(regionDict.getFunctionId().equals(560)){// 主题网站
|
}else if(regionDict.getFunctionId().equals(560)){// 主题网站
|
||||||
@@ -2482,6 +2577,17 @@ public class BaseController {
|
|||||||
ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(215)){// HTTP(s)操控(阻断+重定向+替换)
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
ei.loadInitParams(HttpsRejectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else {
|
||||||
|
ei.loadInitParams(ComplexStringAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
|
}
|
||||||
|
|
||||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
ei.loadInitParams(ComplexStringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(ComplexStringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else if(regionDict.getFunctionId().equals(563)) {// APP Payload
|
}else if(regionDict.getFunctionId().equals(563)) {// APP Payload
|
||||||
|
|||||||
@@ -338,10 +338,12 @@ public class IpController extends BaseController{
|
|||||||
,Integer serviceDictId
|
,Integer serviceDictId
|
||||||
,Integer regionDictId
|
,Integer regionDictId
|
||||||
,Integer requestId
|
,Integer requestId
|
||||||
|
,Integer manipulatType
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
FunctionRegionDict regionDict=DictUtils.getFunctionRegionDict(regionDictId);
|
FunctionRegionDict regionDict=DictUtils.getFunctionRegionDict(regionDictId);
|
||||||
FunctionServiceDict serviceDict=DictUtils.getFunctionServiceDict(serviceDictId);
|
FunctionServiceDict serviceDict=DictUtils.getFunctionServiceDict(serviceDictId);
|
||||||
|
regionDict.setAction(manipulatType);
|
||||||
exportTemplate(request,response,redirectAttributes,regionDict,serviceDict,requestId);
|
exportTemplate(request,response,redirectAttributes,regionDict,serviceDict,requestId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("export_failed", e);
|
logger.error("export_failed", e);
|
||||||
@@ -443,6 +445,29 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceIpTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceIpTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(215)){// HTTP(s)操控(阻断+重定向+替换)
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
List<HttpsRejectIpTemplate> classList=new ArrayList<HttpsRejectIpTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRejectIpTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
List<HttpsRedirectIpTemplate> classList=new ArrayList<HttpsRedirectIpTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRedirectIpTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
List<HttpsReplaceIpTemplate> classList=new ArrayList<HttpsReplaceIpTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceIpTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else {
|
||||||
|
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}
|
||||||
|
|
||||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
List<IpAllNotDoLogTemplate> classList=new ArrayList<IpAllNotDoLogTemplate>();
|
List<IpAllNotDoLogTemplate> classList=new ArrayList<IpAllNotDoLogTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllNotDoLogTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpAllNotDoLogTemplate.class, 2);
|
||||||
@@ -527,6 +552,29 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(215)){// HTTP(s)操控
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
List<HttpsRejectTemplate> classList=new ArrayList<HttpsRejectTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRejectTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
List<HttpsRedirectTemplate> classList=new ArrayList<HttpsRedirectTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRedirectTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
List<HttpsReplaceTemplate> classList=new ArrayList<HttpsReplaceTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else {
|
||||||
|
List<StringAllTemplate> classList=new ArrayList<StringAllTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, StringAllTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}
|
||||||
|
|
||||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
List<StringAllNotDoLogTemplate> classList=new ArrayList<StringAllNotDoLogTemplate>();
|
List<StringAllNotDoLogTemplate> classList=new ArrayList<StringAllNotDoLogTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllNotDoLogTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllNotDoLogTemplate.class, 2);
|
||||||
@@ -567,6 +615,29 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceComplexTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceComplexTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(215)){// HTTP(s)操控
|
||||||
|
if(regionDict.getAction() == 16) {
|
||||||
|
List<HttpsRejectComplexTemplate> classList=new ArrayList<HttpsRejectComplexTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRejectComplexTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getAction() == 48) {
|
||||||
|
List<HttpsRedirectComplexTemplate> classList=new ArrayList<HttpsRedirectComplexTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsRedirectComplexTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getAction() == 80) {
|
||||||
|
List<HttpsReplaceComplexTemplate> classList=new ArrayList<HttpsReplaceComplexTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceComplexTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else {
|
||||||
|
List<ComplexStringAllTemplate> classList=new ArrayList<ComplexStringAllTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, ComplexStringAllTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}
|
||||||
|
|
||||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||||
List<ComplexStringAllNotDoLogTemplate> classList=new ArrayList<ComplexStringAllNotDoLogTemplate>();
|
List<ComplexStringAllNotDoLogTemplate> classList=new ArrayList<ComplexStringAllNotDoLogTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, ComplexStringAllNotDoLogTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, ComplexStringAllNotDoLogTemplate.class, 2);
|
||||||
@@ -608,8 +679,11 @@ public class IpController extends BaseController{
|
|||||||
,String attribute
|
,String attribute
|
||||||
,String classify
|
,String classify
|
||||||
,String regionDictIds
|
,String regionDictIds
|
||||||
,String importPath) {
|
,String importPath
|
||||||
this._import(request,response,redirectAttributes, files,serviceDictId,regionDictIds,requestId,attribute,classify);
|
,Integer manipulatType
|
||||||
|
,Integer profileId) {
|
||||||
|
|
||||||
|
this._import(request,response,redirectAttributes, files,serviceDictId,regionDictIds,requestId,attribute,classify,manipulatType,profileId);
|
||||||
return "redirect:" + adminPath+ importPath;
|
return "redirect:" + adminPath+ importPath;
|
||||||
}
|
}
|
||||||
//ip配置导出
|
//ip配置导出
|
||||||
|
|||||||
@@ -0,0 +1,566 @@
|
|||||||
|
package com.nis.web.controller.configuration.proxy;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.InvocationHandler;
|
||||||
|
import java.lang.reflect.Proxy;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.ResponseBody;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import com.nis.domain.FunctionRegionDict;
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.callback.ProxyFileStrategyCfg;
|
||||||
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
|
import com.nis.domain.configuration.HttpBodyCfg;
|
||||||
|
import com.nis.domain.configuration.HttpReqHeadCfg;
|
||||||
|
import com.nis.domain.configuration.HttpResHeadCfg;
|
||||||
|
import com.nis.domain.configuration.HttpUrlCfg;
|
||||||
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
|
import com.nis.domain.configuration.ManipulatCfg;
|
||||||
|
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DictUtils;
|
||||||
|
import com.nis.util.LogUtils;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.dao.configuration.ProxyFileHijackDao;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
import com.nis.web.service.configuration.ManipulatPolicyService;
|
||||||
|
|
||||||
|
import jersey.repackaged.com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 操控策略业务
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("${adminPath}/proxy/control/manipulatPolicy")
|
||||||
|
public class ManipulatPolicyController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected ManipulatPolicyService manipulatPolicyService;
|
||||||
|
|
||||||
|
@RequestMapping("list")
|
||||||
|
public String list(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
Page<CfgIndexInfo> page = manipulatPolicyService.getPolicyList(searchPage, cfg);
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
initPageCondition(model, cfg);
|
||||||
|
|
||||||
|
// 获取所有的响应文件内容,Block可以选择
|
||||||
|
/*List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||||
|
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);*/
|
||||||
|
|
||||||
|
return "/cfg/proxy/control/manipulatPolicyList";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("form")
|
||||||
|
public String form(Model model, @ModelAttribute("cfg") CfgIndexInfo entity, HttpServletRequest request, HttpServletResponse response, String ids) {
|
||||||
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
|
entity = manipulatPolicyService.getPolicyCfg(Long.parseLong(ids), null);
|
||||||
|
|
||||||
|
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||||
|
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
||||||
|
entity.setHttpUrl(urlCfg);
|
||||||
|
HttpReqHeadCfg reqHdrCfg = new HttpReqHeadCfg();
|
||||||
|
reqHdrCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_HEAD_REGION);
|
||||||
|
entity.setHttpReqHdr(reqHdrCfg);
|
||||||
|
HttpResHeadCfg resHdrCfg = new HttpResHeadCfg();
|
||||||
|
resHdrCfg.setCfgType(Constants.HTTP_REDIRECT_RES_HEAD_REGION);
|
||||||
|
entity.setHttpResHdr(resHdrCfg);
|
||||||
|
HttpBodyCfg reqBodyCfg = new HttpBodyCfg();
|
||||||
|
reqBodyCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
|
||||||
|
entity.setHttpReqBody(reqBodyCfg);
|
||||||
|
HttpBodyCfg resBodyCfg = new HttpBodyCfg();
|
||||||
|
resBodyCfg.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
|
||||||
|
entity.setHttpResBody(resBodyCfg);
|
||||||
|
IpPortCfg ipPortCfg = new IpPortCfg();
|
||||||
|
ipPortCfg.setCfgType(Constants.HTTP_REDIRECT_IP_REGION);
|
||||||
|
entity.setIpPort(ipPortCfg);
|
||||||
|
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
||||||
|
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
||||||
|
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
||||||
|
|
||||||
|
if (entity.getHttpUrlList().size() == 0) {
|
||||||
|
entity.getHttpUrlList().add(urlCfg);
|
||||||
|
}
|
||||||
|
if (entity.getHttpReqHdrList().size() == 0) {
|
||||||
|
entity.getHttpReqHdrList().add(reqHdrCfg);
|
||||||
|
}
|
||||||
|
if (entity.getHttpResHdrList().size() == 0) {
|
||||||
|
entity.getHttpResHdrList().add(resHdrCfg);
|
||||||
|
}
|
||||||
|
if (entity.getHttpReqBodyList().size() == 0) {
|
||||||
|
entity.getHttpReqBodyList().add(reqBodyCfg);
|
||||||
|
}
|
||||||
|
if (entity.getHttpResBodyList().size() == 0) {
|
||||||
|
entity.getHttpResBodyList().add(resBodyCfg);
|
||||||
|
}
|
||||||
|
if (entity.getIpPortList().size() == 0) {
|
||||||
|
entity.getIpPortList().add(ipPortCfg);
|
||||||
|
}
|
||||||
|
if (entity.getNtcSubscribeIdCfgList().size() == 0) {
|
||||||
|
entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg);
|
||||||
|
}
|
||||||
|
initUpdateFormCondition(model, entity);
|
||||||
|
} else {
|
||||||
|
// 设置http各类配置的配置域类型
|
||||||
|
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||||
|
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
||||||
|
entity.setHttpUrl(urlCfg);
|
||||||
|
HttpReqHeadCfg reqHdrCfg = new HttpReqHeadCfg();
|
||||||
|
reqHdrCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_HEAD_REGION);
|
||||||
|
entity.setHttpReqHdr(reqHdrCfg);
|
||||||
|
HttpResHeadCfg resHdrCfg = new HttpResHeadCfg();
|
||||||
|
resHdrCfg.setCfgType(Constants.HTTP_REDIRECT_RES_HEAD_REGION);
|
||||||
|
entity.setHttpResHdr(resHdrCfg);
|
||||||
|
HttpBodyCfg reqBodyCfg = new HttpBodyCfg();
|
||||||
|
reqBodyCfg.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
|
||||||
|
entity.setHttpReqBody(reqBodyCfg);
|
||||||
|
HttpBodyCfg resBodyCfg = new HttpBodyCfg();
|
||||||
|
resBodyCfg.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
|
||||||
|
entity.setHttpResBody(resBodyCfg);
|
||||||
|
IpPortCfg ipPortCfg = new IpPortCfg();
|
||||||
|
ipPortCfg.setCfgType(Constants.HTTP_IP_REGION);
|
||||||
|
entity.setIpPort(ipPortCfg);
|
||||||
|
// subscribeId
|
||||||
|
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
||||||
|
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
||||||
|
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
||||||
|
|
||||||
|
List<HttpUrlCfg> urlList = new ArrayList<HttpUrlCfg>();
|
||||||
|
urlList.add(urlCfg);
|
||||||
|
entity.setHttpUrlList(urlList);
|
||||||
|
List<HttpReqHeadCfg> reqHdrList = new ArrayList<HttpReqHeadCfg>();
|
||||||
|
reqHdrList.add(reqHdrCfg);
|
||||||
|
entity.setHttpReqHdrList(reqHdrList);
|
||||||
|
List<HttpResHeadCfg> resHdrList = new ArrayList<HttpResHeadCfg>();
|
||||||
|
resHdrList.add(resHdrCfg);
|
||||||
|
entity.setHttpResHdrList(resHdrList);
|
||||||
|
List<HttpBodyCfg> reqBodyList = new ArrayList<HttpBodyCfg>();
|
||||||
|
reqBodyList.add(reqBodyCfg);
|
||||||
|
entity.setHttpReqBodyList(reqBodyList);
|
||||||
|
List<HttpBodyCfg> resBodyList = new ArrayList<HttpBodyCfg>();
|
||||||
|
resBodyList.add(resBodyCfg);
|
||||||
|
entity.setHttpResBodyList(resBodyList);
|
||||||
|
|
||||||
|
List<IpPortCfg> ipPortList = new ArrayList<IpPortCfg>();
|
||||||
|
ipPortList.add(ipPortCfg);
|
||||||
|
entity.setIpPortList(ipPortList);
|
||||||
|
|
||||||
|
List<NtcSubscribeIdCfg> subscribeCfgList = Lists.newArrayList();
|
||||||
|
subscribeCfgList.add(subscribeIdCfg);
|
||||||
|
entity.setNtcSubscribeIdCfgList(subscribeCfgList);
|
||||||
|
|
||||||
|
initFormCondition(model, entity);
|
||||||
|
}
|
||||||
|
// 获取所有的响应文件内容,Block可以选择
|
||||||
|
/*List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||||
|
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);*/
|
||||||
|
model.addAttribute("_cfg", entity);
|
||||||
|
return "/cfg/proxy/control/manipulatPolicyForm";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("saveOrUpdate")
|
||||||
|
public String saveOrUpdate(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
manipulatPolicyService.savePolicyCfg(cfg);
|
||||||
|
if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) { // 配置仅保存
|
||||||
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
|
}else { // 配置直接生效
|
||||||
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("save_failed", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "save_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:" + adminPath + "/proxy/control/manipulatPolicy/list?functionId=" + cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("ajaxPolicySubList")
|
||||||
|
public String ajaxPolicySubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
|
CfgIndexInfo cfg = manipulatPolicyService.getPolicyCfg(cfgId, compileId);
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
model.addAttribute("index", index);
|
||||||
|
return "/cfg/proxy/control/httpRedirectSubList";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("delete")
|
||||||
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response, @ModelAttribute("cfg")CfgIndexInfo cfg) {
|
||||||
|
try {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
manipulatPolicyService.updatePolicyCfgValid(isValid, ids, functionId);
|
||||||
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
|
}else {
|
||||||
|
// 批量删除
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
deleteAll(searchPage, functionId, cfg);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置删除失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath + "/proxy/control/manipulatPolicy/list?functionId=" + functionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("audit")
|
||||||
|
public String audit(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit, String ids,
|
||||||
|
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,HttpServletRequest request) {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
|
String[] idArray = ids.split(",");
|
||||||
|
for (String id : idArray) {
|
||||||
|
entity = manipulatPolicyService.getPolicyCfg(Long.parseLong(id), null);
|
||||||
|
entity.setIsAudit(isAudit);
|
||||||
|
entity.setIsValid(isValid);
|
||||||
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
entity.setAuditTime(new Date());
|
||||||
|
entity.setFunctionId(functionId);
|
||||||
|
try {
|
||||||
|
manipulatPolicyService.auditPolicyCfg(entity, isAudit,Constants.INSERT_ACTION);
|
||||||
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("http重定向配置下发失败:" + e.getMessage());
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {// 条件下所有配置审核
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
|
try {
|
||||||
|
auditAll(auditPage, isValid, cfg);
|
||||||
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("配置下发失败:", e);
|
||||||
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
return list(model, cfg, request, response);
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath + "/proxy/control/manipulatPolicy/list?functionId=" + functionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// http配置导出
|
||||||
|
@RequestMapping(value = "exportPolicy")
|
||||||
|
public void exportPolicy(Model model,@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
// export data info
|
||||||
|
List<String> titleList = new ArrayList<String>();
|
||||||
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
|
|
||||||
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
|
// 导出选中记录
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
ipLists = ipCfgService.getByIdsList(ids);
|
||||||
|
} else {
|
||||||
|
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
pageInfo.setPageNo(1);
|
||||||
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
Page<CfgIndexInfo> page = manipulatPolicyService.getPolicyList(pageInfo, entity);
|
||||||
|
ipLists = page.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//日志总量
|
||||||
|
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||||
|
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||||
|
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||||
|
|
||||||
|
Map<String, String> blockDict = DictUtils.getDictMap("RESPONSE_CODE"); // Block
|
||||||
|
Map<String, String> redirectDict = DictUtils.getDictMap("REDIRECT_RESPONSE_CODE"); // Redirect
|
||||||
|
Map<String, String> replaceDict = DictUtils.getDictMap("CONTROL_REPLACE_ZONE"); // Replace
|
||||||
|
|
||||||
|
Properties prop = getMsgProp();
|
||||||
|
for (CfgIndexInfo str : ipLists) {
|
||||||
|
//str.setAction(Integer.valueOf(str.getUserRegion5()));
|
||||||
|
|
||||||
|
if(str.getIsAudit()!=0){
|
||||||
|
set.add(str.getServiceId());
|
||||||
|
compileIds.append(str.getCompileId()+",");
|
||||||
|
}else{
|
||||||
|
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||||
|
logTotal.put("compileId", str.getCompileId()+"");
|
||||||
|
logTotal.put("sum",0L);
|
||||||
|
logTotals.add(logTotal);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!str.getUserRegion5().equals("85") && !str.getUserRegion5().equals("90")) {
|
||||||
|
|
||||||
|
/*String type = "RESPONSE_CODE";
|
||||||
|
if (entity.getFunctionId() == 207) { // Block
|
||||||
|
type = "RESPONSE_CODE";
|
||||||
|
} else if (entity.getFunctionId() == 208) { // Redirect
|
||||||
|
type = "REDIRECT_RESPONSE_CODE";
|
||||||
|
} else if (entity.getFunctionId() == 209) { // Replace
|
||||||
|
type = "CONTROL_REPLACE_ZONE";
|
||||||
|
}*/
|
||||||
|
|
||||||
|
String value = "";
|
||||||
|
if(str.getUserRegion5().equals("16")) {// Block
|
||||||
|
value = blockDict.get(str.getUserRegion1());
|
||||||
|
str.setDetail(prop.getProperty(value));
|
||||||
|
str.setUserRegion1(str.getUserRegion2());
|
||||||
|
str.setUserRegion2(null);
|
||||||
|
|
||||||
|
}else if(str.getUserRegion5().equals("48")) {// Redirect
|
||||||
|
value = redirectDict.get(str.getUserRegion1());
|
||||||
|
str.setDetail(prop.getProperty(value));
|
||||||
|
str.setUserRegion1(null);
|
||||||
|
|
||||||
|
}else if(str.getUserRegion5().equals("80")) {// Replace
|
||||||
|
value = replaceDict.get(str.getUserRegion1());
|
||||||
|
str.setUserRegion5(str.getUserRegion3());
|
||||||
|
str.setUserRegion3(prop.getProperty(value));
|
||||||
|
str.setUserRegion4(str.getUserRegion2());
|
||||||
|
str.setUserRegion1(null);
|
||||||
|
str.setUserRegion2(null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (str.getUserRegion5().equals("16") || str.getUserRegion5().equals("48")) {
|
||||||
|
if (!StringUtil.isEmpty(str.getUserRegion4())) { // 是否存在文件策略
|
||||||
|
ProxyFileStrategyCfg file = new ProxyFileStrategyCfg();
|
||||||
|
file.setCompileId(Integer.valueOf(str.getUserRegion4()));
|
||||||
|
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(file);
|
||||||
|
if (allProxyFileStrategys != null && allProxyFileStrategys.size() > 0) {
|
||||||
|
str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc());
|
||||||
|
}
|
||||||
|
str.setUserRegion4(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(str.getUserRegion5().equals("16") || str.getUserRegion5().equals("48") || str.getUserRegion5().equals("85") ||
|
||||||
|
str.getUserRegion5().equals("90")) {
|
||||||
|
if(str.getUserRegion5().equals("85") || str.getUserRegion5().equals("90")) {
|
||||||
|
str.setUserRegion1(null);
|
||||||
|
str.setUserRegion4(null);
|
||||||
|
}
|
||||||
|
str.setUserRegion5(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//获取日志总量
|
||||||
|
StringBuilder serviceIds=new StringBuilder(",");
|
||||||
|
if(set.size()>0) {
|
||||||
|
for (Integer id : set) {
|
||||||
|
serviceIds.append(id+",");
|
||||||
|
}
|
||||||
|
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||||
|
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||||
|
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||||
|
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||||
|
logTotals.addAll(logs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String cfgIndexInfoNoExport = ",block_type,policy_name,group_name,&detail:response_code-userregion1:response_content-userregion2:redirect_url-userregion3:replace_zone-userregion4:replaced_content-userregion5:replace_content-";
|
||||||
|
/*if (entity.getFunctionId() == 207) {
|
||||||
|
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
||||||
|
} else if (entity.getFunctionId() == 208) {
|
||||||
|
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-";
|
||||||
|
} else if (entity.getFunctionId() == 209) {
|
||||||
|
cfgIndexInfoNoExport = ",policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
||||||
|
} else if (entity.getFunctionId() == 211) {
|
||||||
|
cfgIndexInfoNoExport = ",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
}*/
|
||||||
|
String httpUrlCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
String httpReqHeadCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
String httpResHeadCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
String httpReqBodyCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
String httpResBodyCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
String ipPortCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
|
String ntcSubscribeIdCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
|
|
||||||
|
// 时间过滤
|
||||||
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
||||||
|
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
||||||
|
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
||||||
|
List<BaseStringCfg> httpReqBodyList = new ArrayList<>();
|
||||||
|
List<BaseStringCfg> httpResBodyList = new ArrayList<>();
|
||||||
|
List<IpPortCfg> ipPortList = new ArrayList<>();
|
||||||
|
List<BaseStringCfg> subscribeIdList = new ArrayList<>();
|
||||||
|
for (CfgIndexInfo cfg : ipLists) {
|
||||||
|
Map<String, List> maps = manipulatPolicyService.exportHttpCfg(cfg);
|
||||||
|
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
||||||
|
httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR"));
|
||||||
|
httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR"));
|
||||||
|
httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY"));
|
||||||
|
httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY"));
|
||||||
|
ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||||
|
subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||||
|
|
||||||
|
for (Map<String,Object> logTotal : logTotals) {
|
||||||
|
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||||
|
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
httpUrlList = BaseStringCfg.replaceBaseKeyList(httpUrlList);
|
||||||
|
httpReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList);
|
||||||
|
httpResHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList);
|
||||||
|
httpReqBodyList = BaseStringCfg.replaceBaseKeyList(httpReqBodyList);
|
||||||
|
httpResBodyList = BaseStringCfg.replaceBaseKeyList(httpResBodyList);
|
||||||
|
subscribeIdList = BaseStringCfg.baseHexList(subscribeIdList);
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
|
titleList.add("NTC_HTTP_URL");
|
||||||
|
titleList.add("NTC_HTTP_REQ_HDR");
|
||||||
|
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||||
|
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||||
|
classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class);
|
||||||
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
|
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||||
|
noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport);
|
||||||
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
|
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||||
|
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
|
||||||
|
if (entity.getFunctionId() != 208 && entity.getFunctionId() != 211) {
|
||||||
|
titleList.add("NTC_HTTP_RES_BODY");
|
||||||
|
classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class);
|
||||||
|
noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport);
|
||||||
|
dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList);
|
||||||
|
} else if (entity.getFunctionId() != 211) {
|
||||||
|
titleList.add("NTC_HTTP_RES_HDR");
|
||||||
|
titleList.add("NTC_HTTP_REQ_BODY");
|
||||||
|
classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class);
|
||||||
|
classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class);
|
||||||
|
noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport);
|
||||||
|
noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport);
|
||||||
|
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||||
|
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
||||||
|
}
|
||||||
|
titleList.add("NTC_UNIVERSAL_IP");
|
||||||
|
titleList.add("NTC_SUBSCRIBE_ID");
|
||||||
|
classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class);
|
||||||
|
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||||
|
noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport);
|
||||||
|
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||||
|
dataMap.put("NTC_UNIVERSAL_IP", ipPortList);
|
||||||
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||||
|
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
String timeRange = initTimeMap(entity);
|
||||||
|
noExportMap.put("timeRange", timeRange);
|
||||||
|
if ("csv".equals(entity.getExType())) {
|
||||||
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
} else {
|
||||||
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
|
classMap, dataMap, noExportMap);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("http export failed", e);
|
||||||
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
|
LogUtils.saveLog(request, null, e, null);
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* return "redirect:" + adminPath
|
||||||
|
* +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@RequestMapping("ajaxGetProfileInfo")
|
||||||
|
public List<BaseCfg> ajaxGetProfileInfo(Integer source, HttpServletRequest request, HttpServletResponse response){
|
||||||
|
return manipulatPolicyService.getProfileInfo(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -21,5 +21,5 @@ public interface ProxyFileStrategyDao {
|
|||||||
public void insert(ProxyFileStrategyCfg entity);
|
public void insert(ProxyFileStrategyCfg entity);
|
||||||
public void update(ProxyFileStrategyCfg entity);
|
public void update(ProxyFileStrategyCfg entity);
|
||||||
|
|
||||||
|
public List<ProxyFileStrategyCfg> fingResPages(ProxyFileStrategyCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -310,6 +310,22 @@
|
|||||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="fingResPages" parameterType="com.nis.domain.callback.ProxyFileStrategyCfg" resultMap="ProxyFileStrategyCfg">
|
||||||
|
SELECT
|
||||||
|
<include refid="ProxyFileStrategyCfgColumn" />
|
||||||
|
FROM
|
||||||
|
pxy_profile_response_pages a
|
||||||
|
<where>
|
||||||
|
<if test="isValid != null">
|
||||||
|
AND a.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid == null">
|
||||||
|
AND a.IS_VALID != -1
|
||||||
|
</if>
|
||||||
|
<if test="isAudit != null">
|
||||||
|
AND a.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -92,11 +92,13 @@ import com.nis.domain.configuration.WebsiteDomainTopic;
|
|||||||
import com.nis.domain.maat.GroupReuseAddBean;
|
import com.nis.domain.maat.GroupReuseAddBean;
|
||||||
import com.nis.domain.maat.GroupReuseCfg;
|
import com.nis.domain.maat.GroupReuseCfg;
|
||||||
import com.nis.domain.maat.MaatCfg;
|
import com.nis.domain.maat.MaatCfg;
|
||||||
|
import com.nis.domain.maat.ManipulatActionParam;
|
||||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||||
|
import com.nis.domain.maat.ManipulatActionParam.ReplaceCfg;
|
||||||
import com.nis.domain.maat.ToMaatBean;
|
import com.nis.domain.maat.ToMaatBean;
|
||||||
import com.nis.domain.maat.ToMaatResult;
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
import com.nis.domain.specific.ConfigGroupInfo;
|
import com.nis.domain.specific.ConfigGroupInfo;
|
||||||
@@ -1660,14 +1662,15 @@ public abstract class BaseService {
|
|||||||
// HTTP(s) URL
|
// HTTP(s) URL
|
||||||
else if(regionDict.getDictId().intValue()==97 || regionDict.getDictId().intValue()==79 ||
|
else if(regionDict.getDictId().intValue()==97 || regionDict.getDictId().intValue()==79 ||
|
||||||
regionDict.getDictId().intValue()==85 || regionDict.getDictId().intValue()==91 ||
|
regionDict.getDictId().intValue()==85 || regionDict.getDictId().intValue()==91 ||
|
||||||
regionDict.getDictId().intValue()==99){
|
regionDict.getDictId().intValue()==99 || regionDict.getDictId().intValue()==633){
|
||||||
this.saveStringCfgBatch(regionDict,serviceDict,listPage, "http_url_cfg",send);
|
this.saveStringCfgBatch(regionDict,serviceDict,listPage, "http_url_cfg",send);
|
||||||
}
|
}
|
||||||
// HTTP(s) 请求/应答内容
|
// HTTP(s) 请求/应答内容
|
||||||
else if(regionDict.getDictId().intValue()==94 || regionDict.getDictId().intValue()==95 ||
|
else if(regionDict.getDictId().intValue()==94 || regionDict.getDictId().intValue()==95 ||
|
||||||
regionDict.getDictId().intValue()==88 || regionDict.getDictId().intValue()==89 ||
|
regionDict.getDictId().intValue()==88 || regionDict.getDictId().intValue()==89 ||
|
||||||
regionDict.getDictId().intValue()==82 || regionDict.getDictId().intValue()==83 ||
|
regionDict.getDictId().intValue()==82 || regionDict.getDictId().intValue()==83 ||
|
||||||
regionDict.getDictId().intValue()==103 || regionDict.getDictId().intValue()==104){
|
regionDict.getDictId().intValue()==103 || regionDict.getDictId().intValue()==104 ||
|
||||||
|
regionDict.getDictId().intValue()==636 || regionDict.getDictId().intValue()==637){
|
||||||
this.saveStringCfgBatch(regionDict,serviceDict,listPage, "http_body_cfg",send);
|
this.saveStringCfgBatch(regionDict,serviceDict,listPage, "http_body_cfg",send);
|
||||||
}
|
}
|
||||||
}else if("ComplexkeywordCfg".equals(type)) {
|
}else if("ComplexkeywordCfg".equals(type)) {
|
||||||
@@ -1704,12 +1707,13 @@ public abstract class BaseService {
|
|||||||
// HTTP(s)请求头域
|
// HTTP(s)请求头域
|
||||||
if(regionDict.getDictId().intValue()==98 || regionDict.getDictId().intValue()==80 ||
|
if(regionDict.getDictId().intValue()==98 || regionDict.getDictId().intValue()==80 ||
|
||||||
regionDict.getDictId().intValue()==86 || regionDict.getDictId().intValue()==92 ||
|
regionDict.getDictId().intValue()==86 || regionDict.getDictId().intValue()==92 ||
|
||||||
regionDict.getDictId().intValue()==100) {
|
regionDict.getDictId().intValue()==100 || regionDict.getDictId().intValue()==634) {
|
||||||
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_req_head_cfg",send);
|
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_req_head_cfg",send);
|
||||||
}else
|
}else
|
||||||
// HTTP(s)响应头域
|
// HTTP(s)响应头域
|
||||||
if(regionDict.getDictId().intValue()==102 || regionDict.getDictId().intValue()==81 ||
|
if(regionDict.getDictId().intValue()==102 || regionDict.getDictId().intValue()==81 ||
|
||||||
regionDict.getDictId().intValue()==87 || regionDict.getDictId().intValue()==93) {
|
regionDict.getDictId().intValue()==87 || regionDict.getDictId().intValue()==93 ||
|
||||||
|
regionDict.getDictId().intValue()==635) {
|
||||||
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_res_head_cfg",send);
|
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_res_head_cfg",send);
|
||||||
}
|
}
|
||||||
}else if("DnsResStrategy".equals(type)) {
|
}else if("DnsResStrategy".equals(type)) {
|
||||||
@@ -2543,6 +2547,34 @@ public abstract class BaseService {
|
|||||||
|
|
||||||
userRegion=userRegion+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
userRegion=userRegion+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
||||||
maatCfg.setUserRegion(userRegion);
|
maatCfg.setUserRegion(userRegion);
|
||||||
|
}else if(regionDict.getFunctionId()==215) {
|
||||||
|
ManipulatActionParam actionParam = new ManipulatActionParam();
|
||||||
|
if(regionDict.getAction().equals(48)) {
|
||||||
|
actionParam.setMethod("redirect");
|
||||||
|
actionParam.setCode(Integer.valueOf(_cfg.getUserRegion1()));
|
||||||
|
actionParam.setTo(_cfg.getUserRegion2());
|
||||||
|
}else if(regionDict.getAction().equals(80)) {
|
||||||
|
List<ReplaceCfg> ReplaceCfgList = new ArrayList();
|
||||||
|
ReplaceCfg replaceCfg = new ReplaceCfg();
|
||||||
|
replaceCfg.setSearch_in(_cfg.getUserRegion1());
|
||||||
|
replaceCfg.setFind(_cfg.getUserRegion2());
|
||||||
|
replaceCfg.setReplace_with(_cfg.getUserRegion3());
|
||||||
|
ReplaceCfgList.add(replaceCfg);
|
||||||
|
actionParam.setMethod("replace");
|
||||||
|
actionParam.setRules(ReplaceCfgList);
|
||||||
|
}else if(regionDict.getAction().equals(16)) {
|
||||||
|
actionParam.setMethod("block");
|
||||||
|
actionParam.setCode(Integer.valueOf(_cfg.getUserRegion1()));
|
||||||
|
actionParam.setMessage(_cfg.getUserRegion2());
|
||||||
|
actionParam.setHtml_profile(Integer.valueOf(_cfg.getUserRegion4()));
|
||||||
|
}else if(regionDict.getAction().equals(85)) {
|
||||||
|
actionParam.setMethod("hijack");
|
||||||
|
actionParam.setHijack_profile(Integer.valueOf(_cfg.getUserRegion4()));
|
||||||
|
}else if(regionDict.getAction().equals(90)) {
|
||||||
|
actionParam.setMethod("insert");
|
||||||
|
actionParam.setInsert_profile(Integer.valueOf(_cfg.getUserRegion4()));
|
||||||
|
}
|
||||||
|
maatCfg.setUserRegion(gsonToJson(actionParam));
|
||||||
}
|
}
|
||||||
|
|
||||||
configCompileList.add(maatCfg);
|
configCompileList.add(maatCfg);
|
||||||
@@ -2659,6 +2691,34 @@ public abstract class BaseService {
|
|||||||
userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
userRegion = Constants.REPLACE_ZONE_KEY+"="+_cfg.getUserRegion1()+";"+Constants.REPLACE_SUBSTITUTE_KEY+"="+substitute;
|
||||||
}
|
}
|
||||||
maatCfg.setUserRegion(userRegion);
|
maatCfg.setUserRegion(userRegion);
|
||||||
|
}else if(regionDict.getFunctionId()==215) {
|
||||||
|
ManipulatActionParam actionParam = new ManipulatActionParam();
|
||||||
|
if(regionDict.getAction().equals(48)) {
|
||||||
|
actionParam.setMethod("redirect");
|
||||||
|
actionParam.setCode(Integer.valueOf(_cfg.getUserRegion1()));
|
||||||
|
actionParam.setTo(_cfg.getUserRegion2());
|
||||||
|
}else if(regionDict.getAction().equals(80)) {
|
||||||
|
List<ReplaceCfg> ReplaceCfgList = new ArrayList();
|
||||||
|
ReplaceCfg replaceCfg = new ReplaceCfg();
|
||||||
|
replaceCfg.setSearch_in(_cfg.getUserRegion1());
|
||||||
|
replaceCfg.setFind(_cfg.getUserRegion2());
|
||||||
|
replaceCfg.setReplace_with(_cfg.getUserRegion3());
|
||||||
|
ReplaceCfgList.add(replaceCfg);
|
||||||
|
actionParam.setMethod("replace");
|
||||||
|
actionParam.setRules(ReplaceCfgList);
|
||||||
|
}else if(regionDict.getAction().equals(16)) {
|
||||||
|
actionParam.setMethod("block");
|
||||||
|
actionParam.setCode(Integer.valueOf(_cfg.getUserRegion1()));
|
||||||
|
actionParam.setMessage(_cfg.getUserRegion2());
|
||||||
|
actionParam.setHtml_profile(Integer.valueOf(_cfg.getUserRegion4()));
|
||||||
|
}else if(regionDict.getAction().equals(85)) {
|
||||||
|
actionParam.setMethod("hijack");
|
||||||
|
actionParam.setHijack_profile(Integer.valueOf(_cfg.getUserRegion4()));
|
||||||
|
}else if(regionDict.getAction().equals(90)) {
|
||||||
|
actionParam.setMethod("insert");
|
||||||
|
actionParam.setInsert_profile(Integer.valueOf(_cfg.getUserRegion4()));
|
||||||
|
}
|
||||||
|
maatCfg.setUserRegion(gsonToJson(actionParam));
|
||||||
}
|
}
|
||||||
configCompileList.add(maatCfg);
|
configCompileList.add(maatCfg);
|
||||||
}
|
}
|
||||||
@@ -2762,6 +2822,34 @@ public abstract class BaseService {
|
|||||||
maatCfg.setUserRegion(userRegion);
|
maatCfg.setUserRegion(userRegion);
|
||||||
}else if(regionDict.getFunctionId()==564 || regionDict.getFunctionId()==565 || regionDict.getFunctionId()==566) {// APP HTTP、DNS、SSL Admin
|
}else if(regionDict.getFunctionId()==564 || regionDict.getFunctionId()==565 || regionDict.getFunctionId()==566) {// APP HTTP、DNS、SSL Admin
|
||||||
maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+cfg.getAppCode());
|
maatCfg.setUserRegion(Constants.APP_ID_REGION+"="+cfg.getAppCode());
|
||||||
|
}else if(regionDict.getFunctionId()==215) {
|
||||||
|
ManipulatActionParam actionParam = new ManipulatActionParam();
|
||||||
|
if(regionDict.getAction().equals(48)) {
|
||||||
|
actionParam.setMethod("redirect");
|
||||||
|
actionParam.setCode(Integer.valueOf(cfg.getUserRegion1()));
|
||||||
|
actionParam.setTo(cfg.getUserRegion2());
|
||||||
|
}else if(regionDict.getAction().equals(80)) {
|
||||||
|
List<ReplaceCfg> ReplaceCfgList = new ArrayList();
|
||||||
|
ReplaceCfg replaceCfg = new ReplaceCfg();
|
||||||
|
replaceCfg.setSearch_in(cfg.getUserRegion1());
|
||||||
|
replaceCfg.setFind(cfg.getUserRegion2());
|
||||||
|
replaceCfg.setReplace_with(cfg.getUserRegion3());
|
||||||
|
ReplaceCfgList.add(replaceCfg);
|
||||||
|
actionParam.setMethod("replace");
|
||||||
|
actionParam.setRules(ReplaceCfgList);
|
||||||
|
}else if(regionDict.getAction().equals(16)) {
|
||||||
|
actionParam.setMethod("block");
|
||||||
|
actionParam.setCode(Integer.valueOf(cfg.getUserRegion1()));
|
||||||
|
actionParam.setMessage(cfg.getUserRegion2());
|
||||||
|
actionParam.setHtml_profile(Integer.valueOf(cfg.getUserRegion4()));
|
||||||
|
}else if(regionDict.getAction().equals(85)) {
|
||||||
|
actionParam.setMethod("hijack");
|
||||||
|
actionParam.setHijack_profile(Integer.valueOf(cfg.getUserRegion4()));
|
||||||
|
}else if(regionDict.getAction().equals(90)) {
|
||||||
|
actionParam.setMethod("insert");
|
||||||
|
actionParam.setInsert_profile(Integer.valueOf(cfg.getUserRegion4()));
|
||||||
|
}
|
||||||
|
maatCfg.setUserRegion(gsonToJson(actionParam));
|
||||||
}
|
}
|
||||||
configCompileList.add(maatCfg);
|
configCompileList.add(maatCfg);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,624 @@
|
|||||||
|
package com.nis.web.service.configuration;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.callback.ProxyFileHijackCfg;
|
||||||
|
import com.nis.domain.callback.ProxyFileInsertScriptCfg;
|
||||||
|
import com.nis.domain.callback.ProxyFileStrategyCfg;
|
||||||
|
import com.nis.domain.configuration.AreaIpCfg;
|
||||||
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.HttpBodyCfg;
|
||||||
|
import com.nis.domain.configuration.HttpReqHeadCfg;
|
||||||
|
import com.nis.domain.configuration.HttpResHeadCfg;
|
||||||
|
import com.nis.domain.configuration.HttpUrlCfg;
|
||||||
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
|
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||||
|
import com.nis.domain.maat.ManipulatActionParam;
|
||||||
|
import com.nis.domain.maat.ManipulatActionParam.ReplaceCfg;
|
||||||
|
import com.nis.domain.maat.ToMaatBean;
|
||||||
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.web.dao.configuration.AreaIpCfgDao;
|
||||||
|
import com.nis.web.dao.configuration.ProxyFileHijackDao;
|
||||||
|
import com.nis.web.dao.configuration.ProxyFileInsertScriptDao;
|
||||||
|
import com.nis.web.dao.configuration.ProxyFileStrategyDao;
|
||||||
|
import com.nis.web.dao.configuration.StringCfgDao;
|
||||||
|
import com.nis.web.dao.configuration.WebsiteCfgDao;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
|
import com.nis.web.service.BaseService;
|
||||||
|
import com.nis.web.service.CrudService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理控制策略操控业务 事务类
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ManipulatPolicyService extends CrudService<WebsiteCfgDao,CfgIndexInfo> {
|
||||||
|
@Autowired
|
||||||
|
protected WebsiteCfgDao websiteCfgDao;
|
||||||
|
@Autowired
|
||||||
|
protected AreaIpCfgDao areaIpCfgDao;
|
||||||
|
@Autowired
|
||||||
|
protected StringCfgDao stringCfgDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected ProxyFileStrategyDao proxyFileDao;
|
||||||
|
@Autowired
|
||||||
|
protected ProxyFileHijackDao proxyFileHijackDao;
|
||||||
|
@Autowired
|
||||||
|
protected ProxyFileInsertScriptDao proxyFileInsertDao;
|
||||||
|
|
||||||
|
public List<CfgIndexInfo> getCfgIndexInfos(CfgIndexInfo entity){
|
||||||
|
return websiteCfgDao.getCfgIndexInfos(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CfgIndexInfo getPolicyCfg(Long cfgId,Integer compileId){
|
||||||
|
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId,compileId);
|
||||||
|
List<HttpUrlCfg> httpUrlList = websiteCfgDao.getHttpUrlList(entity);
|
||||||
|
List<HttpReqHeadCfg> httpReqHdrList = websiteCfgDao.getHttpReqHdrList(entity);
|
||||||
|
List<HttpResHeadCfg> httpResHdrList = websiteCfgDao.getHttpResHdrList(entity);
|
||||||
|
List<IpPortCfg> ipPortCfgList = websiteCfgDao.getIpPortList(entity);
|
||||||
|
entity.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
|
||||||
|
List<HttpBodyCfg> httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity);
|
||||||
|
entity.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
|
||||||
|
List<HttpBodyCfg> httpResBodyList = websiteCfgDao.getHttpResBodyList(entity);
|
||||||
|
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||||
|
entity.setHttpReqBodyList(httpReqBodyList);
|
||||||
|
entity.setHttpReqHdrList(httpReqHdrList);
|
||||||
|
entity.setHttpResBodyList(httpResBodyList);
|
||||||
|
entity.setHttpResHdrList(httpResHdrList);
|
||||||
|
entity.setHttpUrlList(httpUrlList);
|
||||||
|
entity.setIpPortList(ipPortCfgList);
|
||||||
|
entity.setNtcSubscribeIdCfgList(subscribeIdList);
|
||||||
|
return entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, List> exportHttpCfg(CfgIndexInfo entity){
|
||||||
|
Map<String, List> dataMap=new HashMap<String, List>();
|
||||||
|
List<HttpUrlCfg> httpUrlList = websiteCfgDao.getHttpUrlList(entity);
|
||||||
|
List<HttpReqHeadCfg> httpReqHdrList = websiteCfgDao.getHttpReqHdrList(entity);
|
||||||
|
List<HttpResHeadCfg> httpResHdrList = websiteCfgDao.getHttpResHdrList(entity);
|
||||||
|
List<IpPortCfg> ipPortCfgList = websiteCfgDao.getIpPortList(entity);
|
||||||
|
entity.setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
|
||||||
|
List<HttpBodyCfg> httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity);
|
||||||
|
entity.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
|
||||||
|
List<HttpBodyCfg> httpResBodyList = websiteCfgDao.getHttpResBodyList(entity);
|
||||||
|
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||||
|
dataMap.put("NTC_UNIVERSAL_IP", ipPortCfgList);
|
||||||
|
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||||
|
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
|
||||||
|
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||||
|
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
||||||
|
dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList);
|
||||||
|
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||||
|
return dataMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Page<CfgIndexInfo> getPolicyList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
|
||||||
|
// 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL)
|
||||||
|
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
|
||||||
|
entity.setPage(page);
|
||||||
|
// 设置cfg_type,用于列表检索时区分
|
||||||
|
if(entity.getHttpReqHdr() != null){
|
||||||
|
entity.getHttpReqHdr().setCfgType(Constants.HTTP_REDIRECT_REQ_HEAD_REGION);
|
||||||
|
}
|
||||||
|
if(entity.getHttpReqBody() != null){
|
||||||
|
entity.getHttpReqBody().setCfgType(Constants.HTTP_REDIRECT_REQ_BODY_REGION);
|
||||||
|
}
|
||||||
|
if(entity.getHttpResHdr() != null){
|
||||||
|
entity.getHttpResHdr().setCfgType(Constants.HTTP_REDIRECT_RES_HEAD_REGION);
|
||||||
|
}
|
||||||
|
if(entity.getHttpResBody() != null){
|
||||||
|
entity.getHttpResBody().setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
|
||||||
|
}
|
||||||
|
List<CfgIndexInfo> list = websiteCfgDao.getWebsiteList(entity);
|
||||||
|
page.setList(list);
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
public void savePolicyCfg(CfgIndexInfo entity){
|
||||||
|
//设置区域运营商信息
|
||||||
|
setAreaEffectiveIds(entity);
|
||||||
|
|
||||||
|
int isValid=0;
|
||||||
|
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
|
||||||
|
isValid=1;
|
||||||
|
}
|
||||||
|
|
||||||
|
entity.setIsValid(0);
|
||||||
|
entity.setIsAudit(0);
|
||||||
|
|
||||||
|
if(entity.getCfgId()==null){
|
||||||
|
Integer compileId = 0;
|
||||||
|
try {
|
||||||
|
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
|
||||||
|
if(idList!=null && idList.size()>0){
|
||||||
|
compileId = idList.get(0);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
entity.setCompileId(compileId);
|
||||||
|
entity.setCreateTime(new Date());
|
||||||
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
|
websiteCfgDao.saveCfgIndex(entity);
|
||||||
|
if(entity.getHttpUrlList()!=null){
|
||||||
|
for(HttpUrlCfg cfg:entity.getHttpUrlList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveHttpUrlCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpReqHdrList()!=null){
|
||||||
|
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||||
|
cfg.setDistrict(cfg.getDistrictShowName());
|
||||||
|
}
|
||||||
|
websiteCfgDao.saveHttpReqHdrCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpResHdrList()!=null){
|
||||||
|
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||||
|
cfg.setDistrict(cfg.getDistrictShowName());
|
||||||
|
}
|
||||||
|
websiteCfgDao.saveHttpResHdrCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpReqBodyList()!=null){
|
||||||
|
for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpResBodyList()!=null){
|
||||||
|
for(HttpBodyCfg cfg:entity.getHttpResBodyList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getIpPortList()!=null){
|
||||||
|
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveIpPortCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||||
|
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
stringCfgDao.saveSubscribeIdCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//保存区域IP信息
|
||||||
|
if(entity.getAreaCfg()!=null){
|
||||||
|
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||||
|
cfg.initDefaultValue();
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理定时任务
|
||||||
|
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||||
|
|
||||||
|
if(isValid==1) {
|
||||||
|
entity.setIsAudit(1);
|
||||||
|
entity.setIsValid(1);
|
||||||
|
auditPolicyCfg(entity, entity.getIsAudit(),Constants.INSERT_ACTION);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
|
entity.setEditTime(new Date());
|
||||||
|
websiteCfgDao.updateCfgIndex(entity);
|
||||||
|
//无效子配置后,再新增子配置
|
||||||
|
websiteCfgDao.deleteHttpUrlCfg(entity);
|
||||||
|
websiteCfgDao.deleteHttpReqHdrCfg(entity);
|
||||||
|
websiteCfgDao.deleteHttpResHdrCfg(entity);
|
||||||
|
websiteCfgDao.deleteHttpBodyCfg(entity);
|
||||||
|
websiteCfgDao.deleteHttpIpCfg(entity);
|
||||||
|
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
|
||||||
|
|
||||||
|
AreaIpCfg area = new AreaIpCfg();
|
||||||
|
area.setCompileId(entity.getCompileId());
|
||||||
|
area.setFunctionId(entity.getFunctionId());
|
||||||
|
areaIpCfgDao.deleteAreaIpCfg(area);
|
||||||
|
entity.setCreateTime(new Date());
|
||||||
|
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||||
|
if(entity.getHttpUrlList()!=null){
|
||||||
|
for(HttpUrlCfg cfg:entity.getHttpUrlList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveHttpUrlCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpReqHdrList()!=null){
|
||||||
|
for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||||
|
cfg.setDistrict(cfg.getDistrictShowName());
|
||||||
|
}
|
||||||
|
websiteCfgDao.saveHttpReqHdrCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpResHdrList()!=null){
|
||||||
|
for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){
|
||||||
|
cfg.setDistrict(cfg.getDistrictShowName());
|
||||||
|
}
|
||||||
|
websiteCfgDao.saveHttpResHdrCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpReqBodyList()!=null){
|
||||||
|
for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpResBodyList()!=null){
|
||||||
|
for(HttpBodyCfg cfg:entity.getHttpResBodyList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveHttpBodyCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getIpPortList()!=null){
|
||||||
|
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
websiteCfgDao.saveIpPortCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||||
|
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
stringCfgDao.saveSubscribeIdCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//保存区域IP信息
|
||||||
|
if(entity.getAreaCfg()!=null){
|
||||||
|
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||||
|
cfg.initDefaultValue();
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
|
||||||
|
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 处理定时任务
|
||||||
|
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||||
|
|
||||||
|
if(isValid==1) {
|
||||||
|
entity.setIsAudit(1);
|
||||||
|
entity.setIsValid(1);
|
||||||
|
auditPolicyCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public void updatePolicyCfgValid(Integer isValid,String ids,Integer functionId){
|
||||||
|
String[] idArray = ids.split(",");
|
||||||
|
for(String id :idArray){
|
||||||
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
|
entity.setCfgId(Long.parseLong(id));
|
||||||
|
entity.setIsValid(isValid);
|
||||||
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
|
entity.setEditTime(new Date());
|
||||||
|
entity.setTableName(CfgIndexInfo.getTablename());
|
||||||
|
entity.setFunctionId(functionId);
|
||||||
|
websiteCfgDao.updateCfgValid(entity);
|
||||||
|
//查询子配置
|
||||||
|
entity = this.getPolicyCfg(Long.parseLong(id),entity.getCompileId());
|
||||||
|
|
||||||
|
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||||
|
IpPortCfg cfg = new IpPortCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(IpPortCfg.getTablename());
|
||||||
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
|
}
|
||||||
|
if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
|
||||||
|
HttpUrlCfg cfg = new HttpUrlCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||||
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
|
}
|
||||||
|
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
|
||||||
|
HttpReqHeadCfg cfg = new HttpReqHeadCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpReqHeadCfg.getTablename());
|
||||||
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
|
}
|
||||||
|
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
|
||||||
|
HttpResHeadCfg cfg = new HttpResHeadCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpResHeadCfg.getTablename());
|
||||||
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
|
}
|
||||||
|
if((entity.getHttpReqBodyList()!=null && entity.getHttpReqBodyList().size()>0) ||
|
||||||
|
(entity.getHttpResBodyList()!=null && entity.getHttpResBodyList().size()>0)){
|
||||||
|
HttpBodyCfg cfg = new HttpBodyCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpBodyCfg.getTablename());
|
||||||
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
|
}
|
||||||
|
if((entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)){
|
||||||
|
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
|
||||||
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
|
}
|
||||||
|
//保存区域IP信息
|
||||||
|
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
|
||||||
|
AreaIpCfg cfg = new AreaIpCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(AreaIpCfg.getTablename());
|
||||||
|
websiteCfgDao.updateCfgValid(cfg);
|
||||||
|
}
|
||||||
|
// 处理定时任务
|
||||||
|
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public void auditPolicyCfg(CfgIndexInfo entity,Integer isAudit,Integer opAction) throws MaatConvertException{
|
||||||
|
//修改数据库审核状态信息
|
||||||
|
entity.setTableName(CfgIndexInfo.getTablename());
|
||||||
|
entity.setIsAudit(isAudit);
|
||||||
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
entity.setAuditTime(new Date());
|
||||||
|
websiteCfgDao.auditCfg(entity);
|
||||||
|
|
||||||
|
ToMaatBean maatBean = new ToMaatBean();
|
||||||
|
MaatCfg maatCfg = new MaatCfg();
|
||||||
|
List<MaatCfg> configCompileList = new ArrayList();
|
||||||
|
List<GroupCfg> groupRelationList = new ArrayList();
|
||||||
|
List<IpCfg> ipRegionList = new ArrayList();
|
||||||
|
List<StringCfg> strRegionList = new ArrayList();
|
||||||
|
List<NumBoundaryCfg> numRegionList = new ArrayList();
|
||||||
|
List<DigestCfg> digestRegionList = new ArrayList();
|
||||||
|
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||||
|
|
||||||
|
//查询子配置并修改审核状态
|
||||||
|
entity = this.getPolicyCfg(entity.getCfgId(),entity.getCompileId());
|
||||||
|
|
||||||
|
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
|
||||||
|
IpPortCfg cfg = new IpPortCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(IpPortCfg.getTablename());
|
||||||
|
websiteCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1){
|
||||||
|
Map<String,List> map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
ipRegionList=map.get("dstList");
|
||||||
|
if(map.get("numRegionList")!=null){
|
||||||
|
numRegionList.addAll(map.get("numRegionList"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
|
||||||
|
HttpUrlCfg cfg = new HttpUrlCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||||
|
websiteCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1){
|
||||||
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpUrlList(),2,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
strRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpReqHdrList()!=null && entity.getHttpReqHdrList().size()>0){
|
||||||
|
HttpReqHeadCfg cfg = new HttpReqHeadCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpReqHeadCfg.getTablename());
|
||||||
|
websiteCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1){
|
||||||
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpReqHdrList(),2,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
strRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getHttpResHdrList()!=null && entity.getHttpResHdrList().size()>0){
|
||||||
|
HttpResHeadCfg cfg = new HttpResHeadCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpResHeadCfg.getTablename());
|
||||||
|
websiteCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1){
|
||||||
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpResHdrList(),2,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
strRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if((entity.getHttpReqBodyList()!=null && entity.getHttpReqBodyList().size()>0) ||
|
||||||
|
(entity.getHttpResBodyList()!=null && entity.getHttpResBodyList().size()>0)){
|
||||||
|
HttpBodyCfg cfg = new HttpBodyCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(HttpBodyCfg.getTablename());
|
||||||
|
websiteCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1){
|
||||||
|
if(entity.getHttpReqBodyList()!=null && entity.getHttpReqBodyList().size()>0){
|
||||||
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpReqBodyList(),2,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
strRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
if(entity.getHttpResBodyList()!=null && entity.getHttpResBodyList().size()>0){
|
||||||
|
Map<String,List> map = cfgConvert(strRegionList,entity.getHttpResBodyList(),2,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
strRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
|
||||||
|
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
|
||||||
|
websiteCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1){
|
||||||
|
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
strRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//保存区域IP信息
|
||||||
|
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||||
|
if(!StringUtil.isEmpty(areaIpCfgList)){
|
||||||
|
AreaIpCfg cfg = new AreaIpCfg();
|
||||||
|
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||||
|
cfg.setTableName(AreaIpCfg.getTablename());
|
||||||
|
websiteCfgDao.auditCfg(cfg);
|
||||||
|
if(isAudit==1){
|
||||||
|
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||||
|
groupRelationList=map.get("groupList");
|
||||||
|
areaIpRegionList=map.get("dstList");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isAudit != 1) {
|
||||||
|
// 处理定时任务【如果有定时任务则删除旧的,新增新的】
|
||||||
|
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
//构造提交综合服务参数格式,一条配置提交一次综合服务
|
||||||
|
if(isAudit==1){
|
||||||
|
maatCfg.initDefaultValue();
|
||||||
|
BeanUtils.copyProperties(entity, maatCfg);
|
||||||
|
maatCfg.setAction(entity.getAction());
|
||||||
|
maatCfg.setAuditTime(entity.getAuditTime());
|
||||||
|
maatCfg.setIpRegionList(ipRegionList);
|
||||||
|
maatCfg.setStrRegionList(strRegionList);
|
||||||
|
maatCfg.setNumRegionList(numRegionList);
|
||||||
|
maatCfg.setDigestRegionList(digestRegionList);
|
||||||
|
maatCfg.setGroupRelationList(groupRelationList);
|
||||||
|
maatCfg.setGroupNum(groupRelationList.size());
|
||||||
|
maatCfg.setAreaIpRegionList(areaIpRegionList);
|
||||||
|
maatCfg.setIsValid(entity.getIsValid());
|
||||||
|
|
||||||
|
// 自定义域参数
|
||||||
|
String userRegion = "";
|
||||||
|
ManipulatActionParam actionParam = new ManipulatActionParam();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 除原自定义参数外
|
||||||
|
* user_region4 profile
|
||||||
|
* user_region5 action(伪)
|
||||||
|
**/
|
||||||
|
// Block
|
||||||
|
if(Integer.valueOf(entity.getUserRegion5()).equals(16)){
|
||||||
|
actionParam.setMethod("block");
|
||||||
|
actionParam.setCode(Integer.valueOf(entity.getUserRegion1()));
|
||||||
|
actionParam.setMessage(entity.getUserRegion2());
|
||||||
|
actionParam.setHtml_profile(Integer.valueOf(entity.getUserRegion4()));
|
||||||
|
}
|
||||||
|
// Redirect
|
||||||
|
if(Integer.valueOf(entity.getUserRegion5()).equals(48)){
|
||||||
|
actionParam.setMethod("redirect");
|
||||||
|
actionParam.setCode(Integer.valueOf(entity.getUserRegion1()));
|
||||||
|
actionParam.setTo(entity.getUserRegion2());
|
||||||
|
}
|
||||||
|
// Replace
|
||||||
|
if(Integer.valueOf(entity.getUserRegion5()).equals(80)){
|
||||||
|
List<ReplaceCfg> ReplaceCfgList = new ArrayList();
|
||||||
|
ReplaceCfg replaceCfg = new ReplaceCfg();
|
||||||
|
replaceCfg.setSearch_in(entity.getUserRegion1());
|
||||||
|
replaceCfg.setFind(entity.getUserRegion2());
|
||||||
|
replaceCfg.setReplace_with(entity.getUserRegion3());
|
||||||
|
ReplaceCfgList.add(replaceCfg);
|
||||||
|
actionParam.setMethod("replace");
|
||||||
|
actionParam.setRules(ReplaceCfgList);
|
||||||
|
}
|
||||||
|
if(Integer.valueOf(entity.getUserRegion5()).equals(85)){
|
||||||
|
actionParam.setMethod("hijack");
|
||||||
|
actionParam.setHijack_profile(Integer.valueOf(entity.getUserRegion4()));
|
||||||
|
}
|
||||||
|
if(Integer.valueOf(entity.getUserRegion5()).equals(90)){
|
||||||
|
actionParam.setMethod("insert");
|
||||||
|
actionParam.setInsert_profile(Integer.valueOf(entity.getUserRegion4()));
|
||||||
|
}
|
||||||
|
|
||||||
|
userRegion = gsonToJson(actionParam);
|
||||||
|
if(StringUtil.isEmpty(userRegion)){
|
||||||
|
userRegion = Constants.USER_REGION_PLACEHOLDER;
|
||||||
|
}
|
||||||
|
maatCfg.setUserRegion(userRegion);
|
||||||
|
|
||||||
|
configCompileList.add(maatCfg);
|
||||||
|
maatBean.setConfigCompileList(configCompileList);
|
||||||
|
maatBean.setAuditTime(entity.getAuditTime());
|
||||||
|
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||||
|
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||||
|
maatBean.setOpAction(opAction);
|
||||||
|
//调用服务接口下发配置数据
|
||||||
|
String json=gsonToJson(maatBean);
|
||||||
|
logger.info("操控策略配置下发配置参数:"+json);
|
||||||
|
//调用服务接口下发配置
|
||||||
|
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
|
||||||
|
logger.info("操控策略配置下发响应信息:"+result.getMsg());
|
||||||
|
|
||||||
|
}else if(isAudit==3) {
|
||||||
|
maatCfg.setCompileId(entity.getCompileId());
|
||||||
|
maatCfg.setServiceId(entity.getServiceId());
|
||||||
|
maatCfg.setIsValid(0);//无效
|
||||||
|
configCompileList.add(maatCfg);
|
||||||
|
maatBean.setConfigCompileList(configCompileList);
|
||||||
|
maatBean.setAuditTime(entity.getAuditTime());
|
||||||
|
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||||
|
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||||
|
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||||
|
//调用服务接口取消配置
|
||||||
|
String json=gsonToJson(maatBean);
|
||||||
|
logger.info("操控策略配置下发配置参数:"+json);
|
||||||
|
//调用服务接口下发配置
|
||||||
|
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||||
|
logger.info("操控策略配置取消配置响应信息:"+result.getMsg());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询可用的Profile信息
|
||||||
|
* @param source 16 Block / 85 Hijack / 90 Insert
|
||||||
|
* @return List<CfgIndexInfo>
|
||||||
|
*/
|
||||||
|
public List<BaseCfg> getProfileInfo(Integer source) {
|
||||||
|
List<BaseCfg> resultList = new ArrayList<BaseCfg>();
|
||||||
|
if(source == 16) {
|
||||||
|
ProxyFileStrategyCfg searchEntity = new ProxyFileStrategyCfg();
|
||||||
|
searchEntity.setIsAudit(1);
|
||||||
|
List<ProxyFileStrategyCfg> list = proxyFileDao.fingResPages(searchEntity);
|
||||||
|
for (BaseCfg cfg : list) {
|
||||||
|
resultList.add(cfg);
|
||||||
|
}
|
||||||
|
}else if(source == 85) {
|
||||||
|
ProxyFileHijackCfg searchEntity = new ProxyFileHijackCfg();
|
||||||
|
searchEntity.setIsAudit(1);
|
||||||
|
List<ProxyFileHijackCfg> list = proxyFileHijackDao.findPage(searchEntity);
|
||||||
|
for (BaseCfg cfg : list) {
|
||||||
|
resultList.add(cfg);
|
||||||
|
}
|
||||||
|
}else if(source == 90) {
|
||||||
|
ProxyFileInsertScriptCfg searchEntity = new ProxyFileInsertScriptCfg();
|
||||||
|
searchEntity.setIsAudit(1);
|
||||||
|
List<ProxyFileInsertScriptCfg> list = proxyFileInsertDao.findPage(searchEntity);
|
||||||
|
for (BaseCfg cfg : list) {
|
||||||
|
resultList.add(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return resultList;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1542,3 +1542,4 @@ mirror_addr_type=Address Type
|
|||||||
target_name=Target Name
|
target_name=Target Name
|
||||||
traffic_mirror_address=Traffic Mirror Address
|
traffic_mirror_address=Traffic Mirror Address
|
||||||
content_name=Content Name
|
content_name=Content Name
|
||||||
|
none_profile_tip=Please Choose Profile Info!
|
||||||
@@ -1544,3 +1544,4 @@ mirror_addr_type=Address Type
|
|||||||
target_name=Target Name
|
target_name=Target Name
|
||||||
traffic_mirror_address=Traffic Mirror Address
|
traffic_mirror_address=Traffic Mirror Address
|
||||||
content_name=Content Name
|
content_name=Content Name
|
||||||
|
none_profile_tip=Please Choose Profile Info!
|
||||||
@@ -1542,3 +1542,4 @@ mirror_addr_type=\u76EE\u6807\u6807\u8BC6\u7C7B\u578B
|
|||||||
target_name=\u76EE\u6807\u540D\u79F0
|
target_name=\u76EE\u6807\u540D\u79F0
|
||||||
traffic_mirror_address=\u6D41\u91CF\u8F6C\u53D1\u76EE\u7684\u5730\u5740
|
traffic_mirror_address=\u6D41\u91CF\u8F6C\u53D1\u76EE\u7684\u5730\u5740
|
||||||
content_name=\u5185\u5BB9\u540D\u79F0
|
content_name=\u5185\u5BB9\u540D\u79F0
|
||||||
|
none_profile_tip=Please Choose Profile Info!
|
||||||
@@ -426,4 +426,12 @@
|
|||||||
<service id="645" functionId="515" serviceType="2" tableName="pxy_profile_traffic_mirror" className="ProxyFileTrafficMirrorCfg" desc="流量转发目的地址"></service>
|
<service id="645" functionId="515" serviceType="2" tableName="pxy_profile_traffic_mirror" className="ProxyFileTrafficMirrorCfg" desc="流量转发目的地址"></service>
|
||||||
<service id="608" functionId="512" serviceType="2" tableName="proxy_file_strategy_cfg" className="ProxyFileStrategyCfg" desc="http代理文件策略"></service>
|
<service id="608" functionId="512" serviceType="2" tableName="proxy_file_strategy_cfg" className="ProxyFileStrategyCfg" desc="http代理文件策略"></service>
|
||||||
|
|
||||||
|
<service id="656" functionId="215" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="https操控业务">
|
||||||
|
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||||
|
<serviceCfg cfgType="2" tableName="http_url_cfg" ></serviceCfg>
|
||||||
|
<serviceCfg cfgType="2" tableName="http_body_cfg" ></serviceCfg>
|
||||||
|
<serviceCfg cfgType="3" tableName="http_req_head_cfg" ></serviceCfg>
|
||||||
|
<serviceCfg cfgType="3" tableName="http_res_head_cfg" ></serviceCfg>
|
||||||
|
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||||
|
</service>
|
||||||
</serviceList>
|
</serviceList>
|
||||||
14
src/main/resources/sql/20190521/http_manipulation.sql
Normal file
14
src/main/resources/sql/20190521/http_manipulation.sql
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
-- 菜单
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('724', '0,1,86,719,724,', 'http_manipulation', 'HTTP操控', '330', '/proxy/control/manipulatPolicy/list', '', '', '1', 'http_manipulation:config', '1', '2019-05-07 15:04:51', '1', '2019-05-07 15:53:45', '', '1', NULL, '0', '0', '215');
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('757', '0,1,150,748,757,', 'http_manipulation', 'HTTP操控', '180', '/proxy/control/manipulatPolicy/list', '', '', '1', 'http_manipulation:confirm', '1', '2019-05-10 15:05:33', '1', '2019-05-10 15:05:33', '', '1', NULL, '0', '0', '215');
|
||||||
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('852', '0,1,151,850,852,', 'http_manipulation', 'HTTP操控', '180', '/proxy/control/manipulatPolicy/list', '', '', '1', 'http_manipulation:audit', '1', '2019-05-10 15:06:30', '1', '2019-05-10 15:06:30', '', '1', NULL, '0', '0', '215');
|
||||||
|
|
||||||
|
-- 配置表(region dict_id有用)
|
||||||
|
INSERT INTO `function_service_dict` (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('215', '0', '48', 'redirect', '656', 'http_manipulation', NULL, '1', '1', '2019-05-07 15:46:17', NULL, NULL, '1,2,3,4,5,6', '1', '0', '1;0,1,2;2');
|
||||||
|
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('633', '215', '', '2', 'PXY_CTRL_HTTP_URL', 'HTTP URL管控配置', '1', '1', '2', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', 'https_url', '0,1', '0,1,2,3', '', '0', '1', '', '', '', '', '', '1', '1');
|
||||||
|
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('634', '215', 'User-Agent,Cookie,others', '3', 'PXY_CTRL_HTTP_REQ_HDR', 'HTTP请求头域管控配置', '1', '1', '3', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '0,1', '0,1,2,3', '', '0,1,2', '1', '', '', '', '', '', '2', '1');
|
||||||
|
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('635', '215', 'set-cookie,Content-Type,others', '4', 'PXY_CTRL_HTTP_RES_HDR', 'HTTP应答头域管控配置', '1', '1', '3', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '0,1', '0,1,2,3', '', '0,1,2', '1', '', '', '', '', '', '3', '1');
|
||||||
|
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('636', '215', '', '5', 'PXY_CTRL_HTTP_REQ_BODY', 'HTTP请求内容管控配置', '1', '1', '2', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '0,1', '0,1,2,3', '', '0,1,2', '1', '', '', '', '', '', '4', '1');
|
||||||
|
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('637', '215', '', '6', 'PXY_CTRL_HTTP_RES_BODY', 'HTTP应答内容管控配置', '1', '1', '2', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '0,1', '0,1,2,3', '', '0,1,2', '1', '', '', '', '', '', '5', '1');
|
||||||
|
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('638', '215', '', '1', 'PXY_CTRL_IP', 'HTTP IP管控配置', '1', '1', '1', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', '', '', '', '4,6', '', '', '1,2,3;1,2,3', '1,2;1,2', '0', '0,6,17', '1,2,3,4', '6', '1');
|
||||||
|
INSERT INTO `function_region_dict` (`dict_id`, `function_id`, `config_district`, `config_region_code`, `config_region_value`, `config_desc`, `is_valid`, `is_maat`, `region_type`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('639', '215', '', '3', 'PXY_CTRL_SUBSCRIBE_ID', 'proxy SUBSCRIBE字符串配置', '1', '1', '2', NULL, '0000-00-00 00:00:00', NULL, '0000-00-00 00:00:00', 'subscribe_id', '0', '3', '', '0', '0', '', '', '', '', '', '7', '0');
|
||||||
@@ -1,11 +1,17 @@
|
|||||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<style>
|
||||||
|
.radio-inline{
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
<script src="${pageContext.request.contextPath}/static/pages/scripts/importExcel.js" type="text/javascript"></script>
|
<script src="${pageContext.request.contextPath}/static/pages/scripts/importExcel.js" type="text/javascript"></script>
|
||||||
<div class="modal fade" id="import_modal" tabindex="-1" role="dialog" aria-labelledby="mo" aria-hidden="true">
|
<div class="modal fade" id="import_modal" tabindex="-1" role="dialog" aria-labelledby="mo" aria-hidden="true">
|
||||||
<form id="importForm1" action="${ctx}/ntc/iplist/import?importPath=${importPath}" method="post" enctype="multipart/form-data" class="form-horizontal"
|
<form id="importForm1" action="${ctx}/ntc/iplist/import?importPath=${importPath}" method="post" enctype="multipart/form-data" class="form-horizontal"
|
||||||
onsubmit="loading('<spring:message code='loading'/>');">
|
onsubmit="loading('<spring:message code='loading'/>');">
|
||||||
<input type="hidden" id="noneFileTip" value="<spring:message code='none_file_tip'/>">
|
<input type="hidden" id="noneFileTip" value="<spring:message code='none_file_tip'/>">
|
||||||
<input type="hidden" id="fileVersionErrorTip" value="<spring:message code='import_tip_excel'/>">
|
<input type="hidden" id="fileVersionErrorTip" value="<spring:message code='import_tip_excel'/>">
|
||||||
|
<input type="hidden" id="noneProfileTip" value="<spring:message code='none_profile_tip'/>">
|
||||||
<div class="modal-dialog" role="document" style="width:700px;">
|
<div class="modal-dialog" role="document" style="width:700px;">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
@@ -85,6 +91,35 @@
|
|||||||
<div for="action"></div>
|
<div for="action"></div>
|
||||||
</div>
|
</div>
|
||||||
</c:if>
|
</c:if>
|
||||||
|
|
||||||
|
<c:if test="${cfg.functionId eq 215 }">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3">
|
||||||
|
<spring:message code="action" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode == 16 || dict.itemCode == 48 || dict.itemCode == 80 }">
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="manipulatType" class="userRegion5" value="${dict.itemCode }" class="required"
|
||||||
|
<c:if test="${dict.itemCode == 48}">checked</c:if>>
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</label>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<label class="radio-inline"><%-- HiJack标识为85 --%>
|
||||||
|
<input type="radio" name="manipulatType" class="userRegion5" value="85" class="required">
|
||||||
|
<spring:message code="HiJack"/>
|
||||||
|
</label>
|
||||||
|
<label class="radio-inline"><%-- Insert标识为90 --%>
|
||||||
|
<input type="radio" name="manipulatType" class="userRegion5" value="90" class="required">
|
||||||
|
<spring:message code="Insert"/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div for="manipulatType"></div>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
<div class="form-group region">
|
<div class="form-group region">
|
||||||
<label class="control-label col-md-3"> <spring:message
|
<label class="control-label col-md-3"> <spring:message
|
||||||
code="cfg_type" />
|
code="cfg_type" />
|
||||||
@@ -120,6 +155,22 @@
|
|||||||
</div>
|
</div>
|
||||||
<div for="action"></div>
|
<div for="action"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<c:if test="${cfg.functionId eq 215 }">
|
||||||
|
<div class="row profileInfo hidden">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="profile_info"/>
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select id="profileSelId" name="profileId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
|
<option value=""><spring:message var="select"/></option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="profileId"></div>
|
||||||
|
</div>
|
||||||
|
</br>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
<!-- 600 asn ip、 3:IP白名单、 405:APP协议IP、 403:APP域名特征、 563 APP Payload、 565 APP HTTP、 564 APP DNS、 566 APP SSL -->
|
<!-- 600 asn ip、 3:IP白名单、 405:APP协议IP、 403:APP域名特征、 563 APP Payload、 565 APP HTTP、 564 APP DNS、 566 APP SSL -->
|
||||||
<c:if test="${(cfg.functionId eq 600) || (cfg.functionId eq 3) || (cfg.functionId eq 405) || (cfg.functionId eq 403) || (cfg.functionId eq 563) || (cfg.functionId eq 565) || (cfg.functionId eq 564) || (cfg.functionId eq 566) ||
|
<c:if test="${(cfg.functionId eq 600) || (cfg.functionId eq 3) || (cfg.functionId eq 405) || (cfg.functionId eq 403) || (cfg.functionId eq 563) || (cfg.functionId eq 565) || (cfg.functionId eq 564) || (cfg.functionId eq 566) ||
|
||||||
(cfg.functionId eq 560) }">
|
(cfg.functionId eq 560) }">
|
||||||
|
|||||||
@@ -0,0 +1,382 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title></title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<!-- block -->
|
||||||
|
<div class="actionParam" >
|
||||||
|
<h4 class="form-section">
|
||||||
|
<spring:message code="action_region" />
|
||||||
|
<small></small>
|
||||||
|
</h4>
|
||||||
|
<c:if test="${_cfg.userRegion5 == 16 }">
|
||||||
|
<div class="row blockInfoDiv" action_value="16">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3">
|
||||||
|
<spring:message code="response_code" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="userRegion1" class="selectpicker show-tick form-control">
|
||||||
|
<c:forEach items="${fns:getDictList('RESPONSE_CODE')}" var="responseCodeC">
|
||||||
|
<option value="${responseCodeC.itemCode}" <c:if test="${_cfg.userRegion1 eq responseCodeC.itemCode || (empty _cfg.userRegion1 && responseCodeC.itemCode eq 404)}">selected</c:if>>${responseCodeC.itemCode} <spring:message code="${responseCodeC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion1"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3">
|
||||||
|
<spring:message code="response_content" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="" name="userRegion2" class="form-control" type="text" value="${_cfg.userRegion2 }" maxlength="1024">
|
||||||
|
</div>
|
||||||
|
<div for="userRegion2"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%-- <div class="row blockInfoDiv" action_value="16">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="profile_info" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select id="" name="userRegion4" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
|
<option value=""><spring:message code="select"/></option>
|
||||||
|
<c:forEach items="${allProxyFileStrategys}" var="file">
|
||||||
|
<c:if test="${file.isValid!=0 and file.isAudit!=3}">
|
||||||
|
<option action="${file.action }" value="${file.compileId}"
|
||||||
|
<c:if test="${file.compileId eq _cfg.userRegion4 }">selected</c:if>>${file.fileDesc}</option>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> --%>
|
||||||
|
<div class="row profileSelDiv" action_value="16">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="profile_info" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select id="profileSelId" name="userRegion4" class="selectpicker show-tick form-control required">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
<c:if test="${_cfg.userRegion5 == 48 }">
|
||||||
|
<div class="row redirectDiv" action_value="48">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="redirect_response_code" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select id="redirectResponseCode" name="userRegion1" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE')}" var="redirectResponseCodeC">
|
||||||
|
<option value="${redirectResponseCodeC.itemCode}" <c:if test="${_cfg.userRegion1==redirectResponseCodeC.itemCode || (_cfg.userRegion1==null && redirectResponseCodeC.itemCode==1)}">selected</c:if>>${redirectResponseCodeC.itemCode} <spring:message code="${redirectResponseCodeC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion1"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label id="responseLabel" class="control-label col-md-3 "><font color="red">*</font>
|
||||||
|
<spring:message code="redirect_url" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="responseContent" name="userRegion2" class="form-control required httpCheck" type="text" value="${_cfg.userRegion2 }" maxlength="1024">
|
||||||
|
<select id="responseFile" name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
|
<option value=""><spring:message code="select"/></option>
|
||||||
|
<c:forEach items="${allProxyFileStrategys}" var="file">
|
||||||
|
<c:if test="${file.isValid!=0 and file.isAudit!=3}">
|
||||||
|
<option action="${file.action }" value="${file.compileId}"
|
||||||
|
<c:if test="${file.compileId eq _cfg.userRegion3 }">selected</c:if>>${file.fileDesc}</option>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
/* //清除没用的 file 信息
|
||||||
|
var action = $("input[name='action']").val();
|
||||||
|
$("#responseFile option").each(function(i,n){
|
||||||
|
var oa = $(this).attr("action");
|
||||||
|
if(oa != action && i != 0){
|
||||||
|
$(this).remove();
|
||||||
|
}
|
||||||
|
}); */
|
||||||
|
//页面加载时触发初始化操作
|
||||||
|
var code = $("#redirectResponseCode").val();
|
||||||
|
if(code == 200){//响应文件
|
||||||
|
$("#responseContent").hide();//隐藏输入框
|
||||||
|
$("#responseFile").selectpicker("show");//显示选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="response_file" />');
|
||||||
|
}else{
|
||||||
|
$("#responseContent").show();//显示输入框
|
||||||
|
$("#responseFile").selectpicker("hide");//隐藏选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="redirect_url" />');
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#redirectResponseCode").on("change",function(){
|
||||||
|
var $this = $(this);
|
||||||
|
var code = $this.val();
|
||||||
|
if(code == 200){//重定向 应答码 为 200 时可以选择 应答文件
|
||||||
|
$("#responseContent").hide();//隐藏输入框
|
||||||
|
$("#responseFile").selectpicker("show");//显示选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="response_file" />');
|
||||||
|
}else{
|
||||||
|
$("#responseContent").show();//显示输入框
|
||||||
|
$("#responseFile").selectpicker("hide");//隐藏选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="redirect_url" />');
|
||||||
|
}
|
||||||
|
$("#responseContent").val("");//清空
|
||||||
|
$("#responseFile").selectpicker("val","");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div for="userRegion2"></div>
|
||||||
|
<div for="userRegion3"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
<c:if test="${_cfg.userRegion5 == 80 }">
|
||||||
|
<div class="row replaceDiv" action_value="80">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="replace_zone" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="userRegion1" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('CONTROL_REPLACE_ZONE')}" var="replaceZoneC">
|
||||||
|
<option value="${replaceZoneC.itemCode}" <c:if test="${_cfg.userRegion1==replaceZoneC.itemCode || (_cfg.userRegion1==null && replaceZoneC.itemCode eq 'http_resp_body')}">selected</c:if>><spring:message code="${replaceZoneC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion1"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row replaceDiv" action_value="80">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="replaced_content" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required" type="text" maxlength="1024"
|
||||||
|
name="userRegion2"
|
||||||
|
value="${_cfg.userRegion2 }">
|
||||||
|
</div>
|
||||||
|
<div for="userRegion2"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="replace_content" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required" type="text" maxlength="1024"
|
||||||
|
name="userRegion3"
|
||||||
|
value="${_cfg.userRegion3 }">
|
||||||
|
</div>
|
||||||
|
<div for="userRegion3"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
</div>
|
||||||
|
<div class="row blockInfoDivBak hidden" action_value="16">
|
||||||
|
<div class="col-md-6 blockInfoDiv" action_value="16">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3">
|
||||||
|
<spring:message code="response_code" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="userRegion1" class="selectpicker show-tick form-control">
|
||||||
|
<c:forEach items="${fns:getDictList('RESPONSE_CODE')}" var="responseCodeC">
|
||||||
|
<option value="${responseCodeC.itemCode}" >${responseCodeC.itemCode} <spring:message code="${responseCodeC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion1"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 blockInfoDiv" action_value="16">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3">
|
||||||
|
<spring:message code="response_content" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="responseContentA" name="userRegion2" class="form-control" type="text" maxlength="1024">
|
||||||
|
</div>
|
||||||
|
<div for="userRegion2"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<%-- <div class="row blockInfoDiv" action_value="16">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="profile_info" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select id="" name="userRegion4" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
|
<option value=""><spring:message code="select"/></option>
|
||||||
|
<c:forEach items="${allProxyFileStrategys}" var="file">
|
||||||
|
<c:if test="${file.isValid!=0 and file.isAudit!=3}">
|
||||||
|
<option action="${file.action }" value="${file.compileId}">${file.fileDesc}</option>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div> --%>
|
||||||
|
<div class="row profileSelDiv" action_value="16">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="profile_info" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select id="profileSelId" name="userRegion4" class="selectpicker show-tick form-control required">
|
||||||
|
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion4"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row redirectDivBak hidden" action_value="48">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="redirect_response_code" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select id="redirectResponseCode" name="userRegion1" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE')}" var="redirectResponseCodeC">
|
||||||
|
<option value="${redirectResponseCodeC.itemCode}">${redirectResponseCodeC.itemCode} <spring:message code="${redirectResponseCodeC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion1"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label id="responseLabel" class="control-label col-md-3 "><font color="red">*</font>
|
||||||
|
<spring:message code="redirect_url" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input id="responseContent" name="userRegion2" class="form-control required httpCheck" type="text" value="" maxlength="1024">
|
||||||
|
<select id="responseFile" name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
|
<option value=""><spring:message code="select"/></option>
|
||||||
|
<c:forEach items="${allProxyFileStrategys}" var="file">
|
||||||
|
<c:if test="${file.isValid!=0 and file.isAudit!=3}">
|
||||||
|
<option action="${file.action }" value="${file.compileId}">${file.fileDesc}</option>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
//页面加载时触发初始化操作
|
||||||
|
var code = $("#redirectResponseCode").val();
|
||||||
|
if(code == 200){//响应文件
|
||||||
|
$("#responseContent").hide();//隐藏输入框
|
||||||
|
$("#responseFile").selectpicker("show");//显示选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="response_file" />');
|
||||||
|
}else{
|
||||||
|
$("#responseContent").show();//显示输入框
|
||||||
|
$("#responseFile").selectpicker("hide");//隐藏选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="redirect_url" />');
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#redirectResponseCode").on("change",function(){
|
||||||
|
var $this = $(this);
|
||||||
|
var code = $this.val();
|
||||||
|
if(code == 200){//重定向 应答码 为 200 时可以选择 应答文件
|
||||||
|
$("#responseContent").hide();//隐藏输入框
|
||||||
|
$("#responseFile").selectpicker("show");//显示选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="response_file" />');
|
||||||
|
}else{
|
||||||
|
$("#responseContent").show();//显示输入框
|
||||||
|
$("#responseFile").selectpicker("hide");//隐藏选择框
|
||||||
|
$("#responseLabel").html('<font color="red">*</font><spring:message code="redirect_url" />');
|
||||||
|
}
|
||||||
|
$("#responseContent").val("");//清空
|
||||||
|
$("#responseFile").selectpicker("val","");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div for="userRegion2"></div>
|
||||||
|
<div for="userRegion3"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row replaceDivBak hidden" action_value="80">
|
||||||
|
<div class="row replaceDiv">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="replace_zone" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="userRegion1" class="selectpicker show-tick form-control required">
|
||||||
|
<c:forEach items="${fns:getDictList('CONTROL_REPLACE_ZONE')}" var="replaceZoneC">
|
||||||
|
<option value="${replaceZoneC.itemCode}"><spring:message code="${replaceZoneC.itemValue}"/></option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion1"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row replaceDiv">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="replaced_content" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required" type="text" maxlength="1024" name="userRegion2">
|
||||||
|
</div>
|
||||||
|
<div for="userRegion2"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group ">
|
||||||
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
|
<spring:message code="replace_content" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required" type="text" maxlength="1024" name="userRegion3">
|
||||||
|
</div>
|
||||||
|
<div for="userRegion3"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,576 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.boxSolid {
|
||||||
|
border: 1px solid #eeeeee
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
// user_region5表示为所选action(伪)
|
||||||
|
switchAction($(".userRegion5:checked"));
|
||||||
|
$(".userRegion5").on("change", function() {
|
||||||
|
switchAction($(this));
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
|
|
||||||
|
$("#cfgFrom").validate({
|
||||||
|
errorPlacement : function(error, element) {
|
||||||
|
console.log(error);
|
||||||
|
if($(element).parents().hasClass("tagsinput")){
|
||||||
|
$(element).parents(".col-md-6").next("div").append(error);
|
||||||
|
}else{
|
||||||
|
$(element).parents(".form-group").find("div[for='" + element.attr("name") + "']").append(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
submitHandler : function(form) {
|
||||||
|
var flag = true;
|
||||||
|
|
||||||
|
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||||
|
if(!$(".httpReqCfg").hasClass("hidden")){
|
||||||
|
if($(".httpReqCfg").find(".boxSolid").length==$(".httpReqCfg").find(".boxSolid.hidden").length){
|
||||||
|
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//代表所有区域都隐藏了,提示必须增加个区域信息
|
||||||
|
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
|
||||||
|
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
|
||||||
|
if($("#areaIp").hasClass("hidden")) $("#areaIsp").find(".glyphicon-plus").click();
|
||||||
|
top.$.jBox.tip("<spring:message code='one_more_area'/>", "<spring:message code='info'/>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
|
||||||
|
if($(this).val()==''){
|
||||||
|
$(this).parents(".form-group").find(
|
||||||
|
"div[for='"
|
||||||
|
+ $(this).attr("name")
|
||||||
|
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//keywords非空校验完成校验二进制字符串
|
||||||
|
$(".boxSolid:visible").find("select[name$='isHexbin']").each(function(){
|
||||||
|
var isHexbin=$(this).val();
|
||||||
|
if(isHexbin == 1){ //十六进制
|
||||||
|
var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
|
||||||
|
keywords=keywords.replace("***and***","")
|
||||||
|
if(keywords != ''){
|
||||||
|
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
|
||||||
|
$(this).parents(".boxSolid").find(
|
||||||
|
"div[for='"
|
||||||
|
+ $(this).attr("name").replace("isHexbin","cfgKeywords")
|
||||||
|
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
|
||||||
|
flag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
var flag1=validateInvisibleCharTag();
|
||||||
|
if(flag){
|
||||||
|
flag=flag1;
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
// 将disable属性的元素删除
|
||||||
|
$(".disabled").each(function(){
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
$("input[name$='exprType']").attr("disabled",false);
|
||||||
|
|
||||||
|
// 因存在多个相同Name属性值的标签,提交前删除无用的标签
|
||||||
|
$("div[action_value]").each(function(){
|
||||||
|
if($(this).hasClass("hidden")){
|
||||||
|
$(this).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// 删除无用的域配置
|
||||||
|
$("div[class~='httpReqCfg']").each(function(){
|
||||||
|
if($(this).hasClass("hidden")){
|
||||||
|
$(this).remove();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
loading('onloading...');
|
||||||
|
form.submit();
|
||||||
|
}else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
errorContainer : "#messageBox",
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
var switchAction = function(element){
|
||||||
|
var selValue = $(element).val();
|
||||||
|
// 初始显示所有域配置
|
||||||
|
$(".reqHdrCfg,.resHdrCfg,.reqBodyCfg,.resBodyCfg,.ntcSubscribeIdCfgCfg").each(function(){
|
||||||
|
$(this).removeClass("hidden");
|
||||||
|
});
|
||||||
|
|
||||||
|
$("select[name='httpResHdrList[0].district']").find("option").each(function(){
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
});
|
||||||
|
$("select[name='httpResHdrList[0].district']").selectpicker("refresh");
|
||||||
|
$("select[name='httpResHdrList[0].district']").change();
|
||||||
|
|
||||||
|
// 域配置隐藏/显示
|
||||||
|
if(selValue == 48){ // Redirect 隐藏响应体
|
||||||
|
$(".resBodyCfg").addClass("hidden");
|
||||||
|
}else if(selValue == 80){ // Replace 隐藏请求响应体
|
||||||
|
$(".reqBodyCfg").addClass("hidden");
|
||||||
|
$(".resBodyCfg").addClass("hidden");
|
||||||
|
}else if(selValue == 85 || selValue == 90){ // Hijack/Insert 隐藏请求头、请求体和响应体
|
||||||
|
$(".reqHdrCfg").addClass("hidden");
|
||||||
|
$(".resBodyCfg").addClass("hidden");
|
||||||
|
$(".reqBodyCfg").addClass("hidden");
|
||||||
|
$(".ntcSubscribeIdCfgCfg").addClass("hidden");
|
||||||
|
// 且响应头匹配区域只能为Content-Type
|
||||||
|
$("select[name='httpResHdrList[0].district']").find("option").each(function(){
|
||||||
|
if($(this).val() != "Content-Type"){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
$(this).attr("selected",false);
|
||||||
|
}else{
|
||||||
|
$(this).attr("selected",true);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
$("select[name='httpResHdrList[0].district']").selectpicker("refresh");
|
||||||
|
$("select[name='httpResHdrList[0].district']").change();
|
||||||
|
}
|
||||||
|
|
||||||
|
var flag = false;
|
||||||
|
if(selValue == 16 ||selValue == 85 || selValue == 90){
|
||||||
|
$(".profileSelDiv").attr("source",selValue);
|
||||||
|
if(selValue != 16){
|
||||||
|
selValue = 16;
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 备份片段移动(用于新增)
|
||||||
|
if(selValue == 16 && "${_cfg.userRegion5}" != 16 ){
|
||||||
|
var blockBak = $(".blockInfoDivBak").removeClass("hidden");
|
||||||
|
$(".actionParam").append(blockBak);
|
||||||
|
}
|
||||||
|
if(selValue == 48 && "${_cfg.userRegion5}" != 48 ){
|
||||||
|
var redirectBak = $(".redirectDivBak").removeClass("hidden");
|
||||||
|
$(".actionParam").append(redirectBak);
|
||||||
|
}
|
||||||
|
if(selValue == 80 && "${_cfg.userRegion5}" != 80 ){
|
||||||
|
var replaceBak = $(".replaceDivBak").removeClass("hidden");
|
||||||
|
$(".actionParam").append(replaceBak);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 参数切换
|
||||||
|
$(".actionParam").find("div[action_value]").each(function(){
|
||||||
|
var value = $(this).attr("action_value");
|
||||||
|
if(value == selValue){
|
||||||
|
$(this).removeClass("hidden");
|
||||||
|
}else{
|
||||||
|
$(this).addClass("hidden");
|
||||||
|
}
|
||||||
|
if(flag){
|
||||||
|
$(".blockInfoDiv").addClass("hidden");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Get Policy Profile Info
|
||||||
|
$(".actionParam").find(".profileSelDiv").each(function(){
|
||||||
|
if(!$(this).hasClass("hidden")){
|
||||||
|
var source = $(this).attr("source");
|
||||||
|
var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4);
|
||||||
|
$.ajax({
|
||||||
|
type:'get',
|
||||||
|
url:pathName+'/proxy/control/manipulatPolicy/ajaxGetProfileInfo?source='+source,
|
||||||
|
dataType:'json',
|
||||||
|
success:function(data){
|
||||||
|
if(data != null){
|
||||||
|
$("#profileSelId").empty();
|
||||||
|
var falseAction = $(".userRegion5:checked").val();
|
||||||
|
$.each(data, function(i, n){
|
||||||
|
if("${_cfg.userRegion4}" == data[i].compileId && "${_cfg.userRegion5}" == falseAction){ // 修改时选中
|
||||||
|
var option = new Option(data[i].cfgDesc, data[i].compileId, null, true);
|
||||||
|
}else{
|
||||||
|
var option = new Option(data[i].cfgDesc, data[i].compileId);
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#profileSelId")[0].options.add(option);
|
||||||
|
});
|
||||||
|
$("#profileSelId").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务窗口打开
|
||||||
|
var addContent = function(obj, contentClassName) {
|
||||||
|
$("." + contentClassName + "0").removeClass("hidden").removeClass(
|
||||||
|
"disabled");
|
||||||
|
$(obj).addClass("hidden");
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务窗口关闭
|
||||||
|
var delContent = function(contentClassName, addBtnClassName) {
|
||||||
|
$("." + contentClassName).addClass("hidden").addClass("disabled");
|
||||||
|
$("." + addBtnClassName).removeClass("hidden");
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
|
||||||
|
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
|
||||||
|
<div class="page-content">
|
||||||
|
<h3 class="page-title">
|
||||||
|
<spring:message code="${_cfg.menuNameCode }"></spring:message>
|
||||||
|
</h3>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet box blue">
|
||||||
|
<div class="portlet-title">
|
||||||
|
<div class="caption">
|
||||||
|
<i class="fa fa-gift"></i>
|
||||||
|
<c:if test="${empty _cfg.cfgId}">
|
||||||
|
<spring:message code="add"></spring:message>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${not empty _cfg.cfgId}">
|
||||||
|
<spring:message code="edit"></spring:message>
|
||||||
|
</c:if>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body form">
|
||||||
|
<!-- BEGIN FORM-->
|
||||||
|
<form id="cfgFrom" action="${ctx}/proxy/control/manipulatPolicy/saveOrUpdate"
|
||||||
|
method="post" class="form-horizontal">
|
||||||
|
<input type="hidden" name="cfgId" id="cfgId" value="${_cfg.cfgId}">
|
||||||
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||||
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||||
|
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||||
|
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||||
|
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||||
|
<div class="form-body">
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><spring:message
|
||||||
|
code="config_describe" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control" type="text" name="cfgDesc"
|
||||||
|
value="${_cfg.cfgDesc}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 hidden">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><spring:message
|
||||||
|
code="action" /></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<c:forEach items="${serviceList}" var="service"
|
||||||
|
varStatus="satus">
|
||||||
|
<label class="radio-inline"> <c:if
|
||||||
|
test="${_cfg.functionId eq service.functionId}">
|
||||||
|
<input type="radio" name="action"
|
||||||
|
serviceId="${service.serviceId }" class="action"
|
||||||
|
protocolId="${service.protocolId }"
|
||||||
|
regionCode="${service.regionCode }"
|
||||||
|
configDolog="${service.configDoLog }"
|
||||||
|
value="${service.action }" class="required action"
|
||||||
|
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq service.action }">
|
||||||
|
<c:set var="action" value="${dict.itemCode }"></c:set>
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
</label>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<div for="action"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3">
|
||||||
|
<spring:message code="action" />
|
||||||
|
</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode == 16 || dict.itemCode == 48 || dict.itemCode == 80 }">
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="userRegion5" class="userRegion5" value="${dict.itemCode }" class="required"
|
||||||
|
<c:if test="${_cfg.userRegion5 == dict.itemCode || (_cfg.userRegion5==null && dict.itemCode==48)}">checked</c:if>>
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</label>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<%-- Hijack标识为85 --%>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="userRegion5" class="userRegion5" value="85" class="required"
|
||||||
|
<c:if test="${_cfg.userRegion5 == 85}">checked</c:if>>
|
||||||
|
<spring:message code="HiJack"/>
|
||||||
|
</label>
|
||||||
|
<%-- Insert标识为90 --%>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="userRegion5" class="userRegion5" value="90" class="required"
|
||||||
|
<c:if test="${_cfg.userRegion5 == 90}">checked</c:if>>
|
||||||
|
<spring:message code="Insert"/>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
<div for="userRegion5"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<c:if test="${empty _cfg.cfgId }">
|
||||||
|
<c:set var="doLog" value="1"/>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${!empty _cfg.cfgId }">
|
||||||
|
<c:set var="doLog" value="${_cfg.doLog }"/>
|
||||||
|
</c:if>
|
||||||
|
<!-- 记录日志begin -->
|
||||||
|
<div class="row doLog">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
|
||||||
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${dict.itemCode eq _cfg.doLog}">
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||||
|
</label>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<label class="radio-inline">
|
||||||
|
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||||
|
</label>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 记录日志end -->
|
||||||
|
|
||||||
|
<%@include file="/WEB-INF/views/cfg/proxy/control/manipulatPolicyActionForm.jsp"%>
|
||||||
|
<br>
|
||||||
|
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||||
|
<c:if test="${region.regionType eq 1 }">
|
||||||
|
<!--ip info-->
|
||||||
|
<div class="httpReqCfg">
|
||||||
|
<c:set var="tabName" value="httpIpTab"></c:set>
|
||||||
|
<h4 class="form-section" >
|
||||||
|
<spring:message code="http_ip_title" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<c:forEach items="${_cfg.ipPortList}" var="ipPort"
|
||||||
|
varStatus="status">
|
||||||
|
<c:set var="cfgName" value="ipPortList[${status.index}]"></c:set>
|
||||||
|
<div class="row boxSolid ${tabName}${status.index}
|
||||||
|
<c:if test="${empty ipPort.cfgId}">hidden disabled </c:if>" >
|
||||||
|
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
<c:set var="ipCfgIndex" value="${ipCfgIndex+1}"></c:set>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<!--/ip info-->
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
<c:if test="${region.regionType eq 2 }">
|
||||||
|
<c:if test="${region.configRegionValue eq _cfg.httpUrl.cfgType }">
|
||||||
|
<!--url info-->
|
||||||
|
<div class="httpReqCfg">
|
||||||
|
<c:set var="tabName" value="httpUrlTab"></c:set>
|
||||||
|
<h4 class="form-section" >
|
||||||
|
<spring:message code="http_url_title" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<%-- <c:set var="regionValue" value="${_cfg.httpUrl.cfgType}"></c:set> --%>
|
||||||
|
<c:forEach items="${_cfg.httpUrlList}" var="cfg"
|
||||||
|
varStatus="status">
|
||||||
|
<c:set var="cfgName" value="httpUrlList[${status.index}]"></c:set>
|
||||||
|
<div class="row boxSolid ${tabName}${status.index}
|
||||||
|
<c:if test="${empty cfg.cfgId}">hidden disabled </c:if>" >
|
||||||
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<!--/url info-->
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${region.configRegionValue eq _cfg.httpReqBody.cfgType }">
|
||||||
|
<!--request body info-->
|
||||||
|
<div class="httpReqCfg reqBodyCfg">
|
||||||
|
<c:set var="tabName" value="httpReqBodyTab"></c:set>
|
||||||
|
<h4 class="form-section" >
|
||||||
|
<spring:message code="http_req_body_title" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<%-- <c:set var="regionValue" value="${_cfg.httpReqBody.cfgType}"></c:set> --%>
|
||||||
|
<c:forEach items="${_cfg.httpReqBodyList}" var="cfg"
|
||||||
|
varStatus="status">
|
||||||
|
<c:set var="cfgName" value="httpReqBodyList[${status.index}]"></c:set>
|
||||||
|
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty cfg.cfgId}">hidden disabled </c:if>" >
|
||||||
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<!--/request body info-->
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${region.configRegionValue eq _cfg.httpResBody.cfgType }">
|
||||||
|
<!--response body info-->
|
||||||
|
<div class="httpReqCfg resBodyCfg">
|
||||||
|
<c:set var="tabName" value="httpResBodyTab"></c:set>
|
||||||
|
<h4 class="form-section" >
|
||||||
|
<spring:message code="http_res_body_title" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<%-- <c:set var="regionValue" value="${_cfg.httpResBody.cfgType}"></c:set> --%>
|
||||||
|
<c:forEach items="${_cfg.httpResBodyList}" var="cfg"
|
||||||
|
varStatus="status">
|
||||||
|
<c:set var="cfgName" value="httpResBodyList[${status.index}]"></c:set>
|
||||||
|
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty cfg.cfgId}">hidden disabled </c:if>" >
|
||||||
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${region.configRegionValue eq _cfg.ntcSubscribeIdCfg.cfgType }">
|
||||||
|
<!--response body info-->
|
||||||
|
<div class="httpReqCfg ntcSubscribeIdCfgCfg">
|
||||||
|
<c:set var="tabName" value="ntcSubscribeIdCfgTab"></c:set>
|
||||||
|
<h4 class="form-section">
|
||||||
|
<spring:message code="NTC_SUBSCRIBE_ID" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<%-- <c:set var="regionValue" value="${_cfg.httpResBody.cfgType}"></c:set> --%>
|
||||||
|
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg" varStatus="status">
|
||||||
|
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${status.index}]"></c:set>
|
||||||
|
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty cfg.cfgId}">hidden disabled </c:if>" >
|
||||||
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${region.regionType eq 3 }">
|
||||||
|
<c:if test="${region.configRegionValue eq _cfg.httpReqHdr.cfgType }">
|
||||||
|
<!--request header info-->
|
||||||
|
<div class="httpReqCfg reqHdrCfg">
|
||||||
|
<c:set var="tabName" value="httpReqHdrTab"></c:set>
|
||||||
|
<h4 class="form-section" >
|
||||||
|
<spring:message code="http_req_hdr_title" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
|
||||||
|
<%-- <c:set var="regionValue" value="${_cfg.httpReqHdr.cfgType}"></c:set> --%>
|
||||||
|
<c:forEach items="${_cfg.httpReqHdrList}" var="cfg"
|
||||||
|
varStatus="status">
|
||||||
|
<c:set var="cfgName" value="httpReqHdrList[${status.index}]"></c:set>
|
||||||
|
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty cfg.cfgId}">hidden disabled </c:if>">
|
||||||
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<!--/request header info-->
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${region.configRegionValue eq _cfg.httpResHdr.cfgType }">
|
||||||
|
<!--response header info-->
|
||||||
|
<div class="httpReqCfg resHdrCfg">
|
||||||
|
<c:set var="tabName" value="httpResHdrTab"></c:set>
|
||||||
|
<h4 class="form-section" >
|
||||||
|
<spring:message code="http_res_hdr_title" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||||
|
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
<%-- <c:set var="regionValue" value="${_cfg.httpResHdr.cfgType}"></c:set> --%>
|
||||||
|
<c:forEach items="${_cfg.httpResHdrList}" var="cfg"
|
||||||
|
varStatus="status">
|
||||||
|
<c:set var="cfgName" value="httpResHdrList[${status.index}]"></c:set>
|
||||||
|
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty cfg.cfgId}">hidden disabled </c:if>">
|
||||||
|
|
||||||
|
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||||
|
</div>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<!--/response header info-->
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
||||||
|
<br>
|
||||||
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
|
||||||
|
<br>
|
||||||
|
<%@include file="/WEB-INF/include/form/scheduleNew.jsp"%>
|
||||||
|
<div class="form-actions">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-offset-3 col-md-8">
|
||||||
|
<c:set var="auditPermission" value="false"></c:set>
|
||||||
|
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||||
|
<shiro:hasPermission name="save:audit:permission">
|
||||||
|
<c:set var="auditPermission" value="true"></c:set>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||||
|
<button id="audit" type="submit" class="btn green">
|
||||||
|
<spring:message code="submit" />
|
||||||
|
</button>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<button id="save" type="submit" class="btn green">
|
||||||
|
<spring:message code="submit" />
|
||||||
|
</button>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
<button id="cancel" type="button" class="btn default">
|
||||||
|
<spring:message code="cancel" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<!-- END FORM-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,629 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
//搜索框提示语初始化
|
||||||
|
if("${cfg.cfgDesc}"){
|
||||||
|
$("#intype").val("${cfg.cfgDesc}");
|
||||||
|
}else if("${cfg.compileIdNew}"){
|
||||||
|
$("#intype").val("${cfg.compileIdNew}");
|
||||||
|
}else if("${cfg.ipPort.srcIpAddress}"){
|
||||||
|
$("#intype").val("${cfg.ipPort.srcIpAddress}");
|
||||||
|
}else if("${cfg.ipPort.destIpAddress}"){
|
||||||
|
$("#intype").val("${cfg.ipPort.destIpAddress}");
|
||||||
|
}else if("${cfg.httpUrl.cfgKeywords}"){
|
||||||
|
$("#intype").val("${cfg.httpUrl.cfgKeywords}");
|
||||||
|
}else if("${cfg.httpReqHdr.cfgKeywords}"){
|
||||||
|
$("#intype").val("${cfg.httpReqHdr.cfgKeywords}");
|
||||||
|
}else if("${cfg.httpResHdr.cfgKeywords}"){
|
||||||
|
$("#intype").val("${cfg.httpResHdr.cfgKeywords}");
|
||||||
|
}else if("${cfg.httpReqBody.cfgKeywords}"){
|
||||||
|
$("#intype").val("${cfg.httpReqBody.cfgKeywords}");
|
||||||
|
}else if("${cfg.httpResBody.cfgKeywords}"){
|
||||||
|
$("#intype").val("${cfg.httpResBody.cfgKeywords}");
|
||||||
|
}else{
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||||
|
}
|
||||||
|
$("#seltype").change(function(){
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||||
|
});
|
||||||
|
//筛选功能初始化
|
||||||
|
filterActionInit();
|
||||||
|
$("#isAudit").change(function(){
|
||||||
|
page();
|
||||||
|
});
|
||||||
|
//reset
|
||||||
|
$("#resetBtn").on("click",function(){
|
||||||
|
$("select.selectpicker").each(function(){
|
||||||
|
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||||
|
$(this).find("option").attr("selected",false);
|
||||||
|
$(this).find("option:first").attr("selected",true);
|
||||||
|
});
|
||||||
|
$(".Wdate").attr("value",'');
|
||||||
|
$("#level").attr("value",'');
|
||||||
|
$("#searchForm")[0].reset();
|
||||||
|
});
|
||||||
|
//异步获取配置相关信息
|
||||||
|
$("span[id^=open]").click(function(){
|
||||||
|
var openId=$(this).attr("id");
|
||||||
|
var closeId=$(this).attr("id").replace("open","close");
|
||||||
|
var index=$(this).attr("id").replace("open","");
|
||||||
|
$("#"+openId).hide();
|
||||||
|
$("#"+closeId).show();
|
||||||
|
//var compileId=$(this).attr("compileId");
|
||||||
|
var cfgId=$(this).attr("cfgId");
|
||||||
|
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
|
||||||
|
$("#"+openId).parent().parent().next("tr").show();
|
||||||
|
}else{
|
||||||
|
$.ajax({
|
||||||
|
type:'post',
|
||||||
|
async:false,
|
||||||
|
url:'${ctx}/proxy/control/httpRedirect/ajaxHttpSubList',
|
||||||
|
data:{"cfgId":cfgId,"index":index},
|
||||||
|
dataType:"html",
|
||||||
|
success:function(data){
|
||||||
|
var subTab="<tr class='child'>"+
|
||||||
|
"<td style='border-right: 1px solid #FFFFFF;'>"+
|
||||||
|
"<input type='checkbox' hidden='hidden'/>"+
|
||||||
|
"</td>"+
|
||||||
|
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
|
||||||
|
var html="";
|
||||||
|
html+="<div class='row'>";
|
||||||
|
html = html+data;
|
||||||
|
subTab=subTab+html;
|
||||||
|
subTab+="</td>";
|
||||||
|
subTab+="</tr>";
|
||||||
|
$("#"+openId).parent().parent().after(subTab);
|
||||||
|
$("div[name='tabTitle"+index+"']").get(0).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$("span[id^=close]").on("click",function(){
|
||||||
|
var closeId=$(this).attr("id");
|
||||||
|
var openId=$(this).attr("id").replace("close","open");
|
||||||
|
$("#"+closeId).hide();
|
||||||
|
$("#"+openId).show();
|
||||||
|
$("#"+closeId).parent().parent().next("tr").hide();
|
||||||
|
});
|
||||||
|
|
||||||
|
if($("#exportType").val() != null && $("#exportType").val() != ""){
|
||||||
|
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||||
|
$("#exportValue").val($("#intype").val());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<c:forEach items="${serviceList }" var="serviceDict">
|
||||||
|
<c:if test="${serviceDict.functionId== cfg.functionId}">
|
||||||
|
<c:set var="serviceName1" value="${serviceDict.serviceName }"/>
|
||||||
|
<c:set var="action" value="${serviceDict.action }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
|
|
||||||
|
<%-- 配置权限 --%>
|
||||||
|
<c:set var="configPermissionName" value="http_manipulation:config"/>
|
||||||
|
<%-- 审核权限 --%>
|
||||||
|
<c:set var="confirmPermissionName" value="http_manipulation:confirm"/>
|
||||||
|
<c:set var="actionPath" value="${ctx}/proxy/control/manipulatPolicy/list?functionId=${cfg.functionId}"></c:set>
|
||||||
|
|
||||||
|
<shiro:hasPermission name="${configPermissionName }">
|
||||||
|
<button type="button" class="btn btn-primary addId" onClick="javascript:window.location='${ctx}/proxy/control/manipulatPolicy/form?functionId=${cfg.functionId}'">
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="add"></spring:message>
|
||||||
|
</button>
|
||||||
|
<c:set var="serviceImport" value="false"></c:set>
|
||||||
|
<c:set var="regionImport" value="false"></c:set>
|
||||||
|
<c:forEach items="${serviceList}" var="service" >
|
||||||
|
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||||
|
<c:set var="serviceImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:forEach items="${regionList}" var="region" >
|
||||||
|
<c:if test="${(cfg.functionId eq region.functionId) && region.isImport eq 1}">
|
||||||
|
<c:set var="regionImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${serviceImport eq 'true' && regionImport eq 'true'}">
|
||||||
|
<button type="button" class="btn btn-primary import importId" >
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="import"></spring:message>
|
||||||
|
</button>
|
||||||
|
</c:if>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3 class="page-title">
|
||||||
|
<spring:message code="${cfg.menuNameCode }"></spring:message>
|
||||||
|
</h3>
|
||||||
|
<h5 class="page-header"></h5>
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<div class="row" >
|
||||||
|
<form:form id="searchForm" modelAttribute="cfg" action="${actionPath }" method="post" class="form-search">
|
||||||
|
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
||||||
|
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||||
|
<input id="exportType" type="hidden" value="${cfg.seltype}"/>
|
||||||
|
<input id="exportValue" type="hidden" value=""/>
|
||||||
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||||
|
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||||
|
callback="page();" />
|
||||||
|
<!-- 筛选按钮展开状态-->
|
||||||
|
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||||
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="pull-left">
|
||||||
|
<c:set var="state"><spring:message code='state'/></c:set>
|
||||||
|
<form:select path="isAudit" class="selectpicker select2 input-small">
|
||||||
|
<form:option value=""><spring:message code="all_states"/></form:option>
|
||||||
|
<form:option value="0"><spring:message code="created"></spring:message></form:option>
|
||||||
|
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
|
||||||
|
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
|
||||||
|
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pull-left">
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||||
|
<form:option value="compileIdNew"><spring:message code="cfg_id"></spring:message></form:option>
|
||||||
|
<form:option value="ipPort.srcIpAddress"><spring:message code="clientip"></spring:message></form:option>
|
||||||
|
<form:option value="ipPort.destIpAddress"><spring:message code="serverip"></spring:message></form:option>
|
||||||
|
<form:option value="httpUrl.cfgKeywords"><spring:message code="URL"></spring:message></form:option>
|
||||||
|
<form:option value="httpReqHdr.cfgKeywords"><spring:message code="http_req_hdr_keywords"></spring:message></form:option>
|
||||||
|
<c:if test="${cfg.functionId ne 211}">
|
||||||
|
<c:if test="${cfg.functionId ne 209}">
|
||||||
|
<form:option value="httpReqBody.cfgKeywords"><spring:message code="http_req_body_keywords"></spring:message></form:option>
|
||||||
|
</c:if>
|
||||||
|
<form:option value="httpResHdr.cfgKeywords"><spring:message code="http_res_hdr_keywords"></spring:message></form:option>
|
||||||
|
<c:if test="${cfg.functionId ne 208 && cfg.functionId ne 209}">
|
||||||
|
<form:option value="httpResBody.cfgKeywords"><spring:message code="http_res_body_keywords"></spring:message></form:option>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
<form:option value="action"><spring:message code="block_type"></spring:message></form:option>
|
||||||
|
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<form:select id="actionSelect" path="action" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${serviceList}" var="service">
|
||||||
|
<form:option value="${service.action }"><spring:message code="action_${service.actionCode }"/></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
<form:select path="isValid" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<form:option value="1"><spring:message code="yes"/></form:option>
|
||||||
|
<form:option value="0"><spring:message code="no"/></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<shiro:hasPermission name="${configPermissionName }">
|
||||||
|
<sys:delRow url="${ctx}/proxy/control/manipulatPolicy/form" id="contentTable" label="update"></sys:delRow>
|
||||||
|
<sys:delRow url="${ctx}/proxy/control/manipulatPolicy/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||||
|
<i class="fa fa-angle-down"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/control/manipulatPolicy/exportPolicy?functionId=${cfg.functionId }&exType=excel" id="contentTable" searchUrl="${actionPath }" label="cfg_excel"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/control/manipulatPolicy/exportPolicy?functionId=${cfg.functionId }&exType=csv" id="contentTable" searchUrl="${actionPath }" label="cfg_csv"></sys:delRow></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<shiro:hasPermission name="${confirmPermissionName }">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
|
||||||
|
<i class="fa fa-angle-down"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu pull-right">
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/control/manipulatPolicy/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/control/manipulatPolicy/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/control/manipulatPolicy/audit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||||
|
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||||
|
<i class="icon-wrench"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- /搜索内容与操作按钮栏 -->
|
||||||
|
|
||||||
|
<!-- 筛选搜索内容栏默认隐藏-->
|
||||||
|
<div class="col-md-12 filter-action-select-panle hide" >
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='letter'/></label>
|
||||||
|
<c:set var="select"><spring:message code='select'/></c:set>
|
||||||
|
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${requestInfos}" var="requestInfo" >
|
||||||
|
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='classification'/></label>
|
||||||
|
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${fls}" var="fl" >
|
||||||
|
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='attribute'/></label>
|
||||||
|
<c:set var="select"><spring:message code='select'/></c:set>
|
||||||
|
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${xzs}" var="xz" >
|
||||||
|
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label"><spring:message code='label'/></label>
|
||||||
|
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code="select"/></form:option>
|
||||||
|
<c:forEach items="${lables}" var="lable" >
|
||||||
|
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="config_time"/>:</label>
|
||||||
|
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> </label>
|
||||||
|
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="edit_time"/>:</label>
|
||||||
|
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> </label>
|
||||||
|
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="audit_time"/>:</label>
|
||||||
|
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> </label>
|
||||||
|
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<c:forEach items="${serviceList}" var="service" varStatus="satus">
|
||||||
|
<c:if test="${cfg.functionId eq service.functionId}">
|
||||||
|
<c:set var="action" value="${service.action }"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<!-- /筛选搜索内容栏 结束-->
|
||||||
|
</form:form>
|
||||||
|
</div>
|
||||||
|
<sys:message content="${message}" type="${messageType }"/>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
|
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||||
|
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||||
|
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
|
|
||||||
|
<th><spring:message code="response_code"/></th>
|
||||||
|
<th><spring:message code="response_content"/></th>
|
||||||
|
<th><spring:message code="redirect_url"/></th>
|
||||||
|
<th><spring:message code="replace_zone"/></th>
|
||||||
|
<th><spring:message code="replaced_content"/></th>
|
||||||
|
<th><spring:message code="replace_content"/></th>
|
||||||
|
|
||||||
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
|
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
|
<th><spring:message code="is_schduler"/></th>
|
||||||
|
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
|
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||||
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
|
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||||
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
|
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||||
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
|
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
|
||||||
|
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
|
||||||
|
</td>
|
||||||
|
<td>${indexCfg.compileId }</td>
|
||||||
|
<td>${indexCfg.cfgDesc }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq indexCfg.userRegion5 }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${indexCfg.userRegion5 eq 85 }">
|
||||||
|
<spring:message code="HiJack"/>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${indexCfg.userRegion5 eq 90 }">
|
||||||
|
<spring:message code="Insert"/>
|
||||||
|
</c:if>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<c:if test="${indexCfg.userRegion5 == 16}">
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('RESPONSE_CODE') }" var="dict1">
|
||||||
|
<c:if test="${dict1.itemCode eq indexCfg.userRegion1 }">
|
||||||
|
${dict1.itemCode}
|
||||||
|
<spring:message code="${dict1.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td <c:if test="${not empty indexCfg.userRegion2 }"> title="${indexCfg.userRegion2 }"</c:if>"><!-- 阻断 响应内容 -->
|
||||||
|
<c:if test="${not empty indexCfg.userRegion2 }">${fns:abbr(indexCfg.userRegion2,20)}</c:if>
|
||||||
|
<%-- <c:if test="${not empty indexCfg.userRegion4 }">
|
||||||
|
<c:forEach items="${allProxyFileStrategys}" var="file">
|
||||||
|
<c:if test="${file.compileId eq indexCfg.userRegion3}">
|
||||||
|
<a href="${file.url }" target="_blank">${file.fileDesc }</a>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:if> --%>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${indexCfg.userRegion5 == 48}">
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('REDIRECT_RESPONSE_CODE') }" var="dict2">
|
||||||
|
<c:if test="${dict2.itemCode eq indexCfg.userRegion1 }">
|
||||||
|
${dict2.itemCode}
|
||||||
|
<spring:message code="${dict2.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td <c:if test="${not empty indexCfg.userRegion2 }"> title="${indexCfg.userRegion2 }"</c:if>><!-- 重定向 响应内容 ,userRegion3 不为空 响应文件-->
|
||||||
|
<c:if test="${not empty indexCfg.userRegion2 }">${fns:abbr(indexCfg.userRegion2,20)}</c:if>
|
||||||
|
<%-- <c:if test="${not empty indexCfg.userRegion3 }">
|
||||||
|
<c:forEach items="${allProxyFileStrategys}" var="file">
|
||||||
|
<c:if test="${file.compileId eq indexCfg.userRegion3}">
|
||||||
|
<a href="${file.url }" target="_blank">${file.fileDesc }</a>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:if> --%>
|
||||||
|
</td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
<c:if test="${indexCfg.userRegion5 == 80}">
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td></td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('CONTROL_REPLACE_ZONE') }" var="dict3">
|
||||||
|
<c:if test="${dict3.itemCode eq indexCfg.userRegion1 }">
|
||||||
|
<spring:message code="${dict3.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td title="${indexCfg.userRegion2 }">${fns:abbr(indexCfg.userRegion2,20)}</td>
|
||||||
|
<td title="${indexCfg.userRegion3 }">${fns:abbr(indexCfg.userRegion3,20)}</td>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
<c:if test="${indexCfg.userRegion5 != 16 && indexCfg.userRegion5 != 48 && indexCfg.userRegion5 != 80}">
|
||||||
|
<td></td><td></td><td></td><td></td><td></td><td></td>
|
||||||
|
</c:if>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${indexCfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||||
|
<c:when test="${indexCfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||||
|
<c:when test="${indexCfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||||
|
<c:when test="${indexCfg.isAudit eq '3'}"><span indexTable="${indexCfg.indexTable}" data-placement="right" data-original-title="<spring:message code='letter_cancel_info'/>: " class="label le-ca-fo label-warning tooltips" data-icon=""> <spring:message code="cancel_approved"/></span></c:when>
|
||||||
|
</c:choose>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:if test="${indexCfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||||
|
<c:if test="${indexCfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||||
|
<c:if test="${indexCfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||||
|
</td>
|
||||||
|
<td class="schedulerFlag">
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${not empty indexCfg.schedule }">
|
||||||
|
<span isScheduler="yes">
|
||||||
|
<i class="icon-clock icon-state-danger"></i>
|
||||||
|
</span>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<span isScheduler="no">
|
||||||
|
</span>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq indexCfg.doLog and indexCfg.action!=64 }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td audit="${indexCfg.isAudit}" functionId="${indexCfg.functionId}" compileId="${indexCfg.compileId}" action="${indexCfg.action}" serviceId="${indexCfg.serviceId}"><div class="loading-total"></div></td>
|
||||||
|
<td>
|
||||||
|
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="all"/></c:if>
|
||||||
|
<c:if test="${indexCfg.isAreaEffective==1}">
|
||||||
|
<a href="javascript:viewAreaInfo('${ctx}','${indexCfg.areaEffectiveIds }','${indexCfg.compileId }')" >
|
||||||
|
<spring:message code="selective"/>
|
||||||
|
</a>
|
||||||
|
</c:if>
|
||||||
|
</td>
|
||||||
|
<td>${indexCfg.requestName }</td>
|
||||||
|
<td>
|
||||||
|
<c:set var="classify"></c:set>
|
||||||
|
<c:forEach items="${fn:split(indexCfg.classify,',')}" var="classifyId" varStatus="status">
|
||||||
|
<c:forEach items="${fls}" var="fl">
|
||||||
|
<c:if test="${classifyId eq fn:trim(fl.serviceDictId)}">
|
||||||
|
<c:if test="${status.index+1 eq 1}">
|
||||||
|
<c:set var="classify" value="${fl.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${status.index+1 ne 1}">
|
||||||
|
<c:set var="classify" value="${classify},${fl.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
<a href="javascript:;" data-original-title="${classify}"
|
||||||
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
|
${fns:abbr(classify,20)}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:set var="attribute"></c:set>
|
||||||
|
<c:forEach items="${fn:split(indexCfg.attribute,',')}" var="attributeId" varStatus="status">
|
||||||
|
<c:forEach items="${xzs}" var="xz">
|
||||||
|
<c:if test="${attributeId eq fn:trim(xz.serviceDictId)}">
|
||||||
|
<c:if test="${status.index+1 eq 1}">
|
||||||
|
<c:set var="attribute" value="${xz.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${status.index+1 ne 1}">
|
||||||
|
<c:set var="attribute" value="${attribute},${xz.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
<a href="javascript:;" data-original-title="${attribute}"
|
||||||
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
|
${fns:abbr(attribute,20)}
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:set var="lableInfo"></c:set>
|
||||||
|
<c:forEach items="${fn:split(indexCfg.lable,',')}" var="lableId" varStatus="status">
|
||||||
|
<c:forEach items="${lables}" var="lable">
|
||||||
|
<c:if test="${lableId eq fn:trim(lable.serviceDictId)}">
|
||||||
|
<c:if test="${status.index+1 eq 1}">
|
||||||
|
<c:set var="lableInfo" value="${lable.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${status.index+1 ne 1}">
|
||||||
|
<c:set var="lableInfo" value="${lableInfo},${lable.itemValue}"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
<a href="javascript:;" data-original-title="${lableInfo}"
|
||||||
|
class="tooltips" data-flag="false" data-html="true" data-placement="top">
|
||||||
|
${fns:abbr(lableInfo,20)}
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td>${indexCfg.creatorName }</td>
|
||||||
|
<td><fmt:formatDate value="${indexCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
<td>${indexCfg.editorName }</td>
|
||||||
|
<td><fmt:formatDate value="${indexCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
<td>${indexCfg.auditorName }</td>
|
||||||
|
<td><fmt:formatDate value="${indexCfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="page" >${page}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<c:set var="importPath" value="/proxy/control/manipulatPolicy/list?functionId=${cfg.functionId}"/>
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -14,6 +14,7 @@ $(function(){
|
|||||||
$("input[name='serviceDictId']").click(function(){
|
$("input[name='serviceDictId']").click(function(){
|
||||||
switchService();
|
switchService();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("input[name='regionDictIds']").click(function(){
|
$("input[name='regionDictIds']").click(function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -36,12 +37,21 @@ $(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($("#functionId").val() == 215){
|
||||||
|
profileChange($("input[name='manipulatType']:checked").val());
|
||||||
|
$("input[name='manipulatType']").click(function(){
|
||||||
|
profileChange($(this).val());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* action动作切换
|
* action动作切换
|
||||||
*/
|
*/
|
||||||
function switchService(){
|
function switchService(){
|
||||||
var functionId=$("#functionId").val();
|
var functionId=$("#functionId").val();
|
||||||
|
|
||||||
if(functionId==5){//IP配置特殊处理
|
if(functionId==5){//IP配置特殊处理
|
||||||
var cfgRegionCodeS=$("input[name='serviceDictId']:checked").attr("cfgRegionCodeS");
|
var cfgRegionCodeS=$("input[name='serviceDictId']:checked").attr("cfgRegionCodeS");
|
||||||
var cfgRegionCode=cfgRegionCodeS.split(",")[0];
|
var cfgRegionCode=cfgRegionCodeS.split(",")[0];
|
||||||
@@ -78,6 +88,7 @@ function switchService(){
|
|||||||
$(label).show();
|
$(label).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 模板下载
|
* 模板下载
|
||||||
@@ -85,9 +96,10 @@ function switchService(){
|
|||||||
* */
|
* */
|
||||||
function downLoadTemplate(path){
|
function downLoadTemplate(path){
|
||||||
var obj={
|
var obj={
|
||||||
"regionDictId":$("input[name='regionDictIds']:checked").val()
|
"regionDictId":$("input[name='regionDictIds']:checked").val(),
|
||||||
,"serviceDictId":$("input[name='serviceDictId']:checked").val()
|
"serviceDictId":$("input[name='serviceDictId']:checked").val(),
|
||||||
,"requestId":$("select[name='requestId']").val()
|
"requestId":$("select[name='requestId']").val(),
|
||||||
|
"manipulatType":$("input[name='manipulatType']:checked").val()
|
||||||
};
|
};
|
||||||
var params = $.param(obj);
|
var params = $.param(obj);
|
||||||
document.location.href = path+'/ntc/iplist/import/template?' + params;
|
document.location.href = path+'/ntc/iplist/import/template?' + params;
|
||||||
@@ -151,6 +163,7 @@ var importCfg=function(){
|
|||||||
appFlag=false;
|
appFlag=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileName = $(".fileupload-preview", $("#importForm1")).text();
|
var fileName = $(".fileupload-preview", $("#importForm1")).text();
|
||||||
var $error = $('.alert-error', $("#importForm1"));
|
var $error = $('.alert-error', $("#importForm1"));
|
||||||
if(!appFlag){
|
if(!appFlag){
|
||||||
@@ -160,6 +173,14 @@ var importCfg=function(){
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 代理-操控业务Profile Info
|
||||||
|
if($("#profileSelId").val() == "" || $("#profileSelId").val() == null){
|
||||||
|
$("span",$error).html($("#noneProfileTip").val());
|
||||||
|
$error.removeClass("hide");
|
||||||
|
$error.addClass("show");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(fileName==""){
|
if(fileName==""){
|
||||||
$("span",$error).html($("#noneFileTip").val());
|
$("span",$error).html($("#noneFileTip").val());
|
||||||
$error.removeClass("hide");
|
$error.removeClass("hide");
|
||||||
@@ -172,6 +193,7 @@ var importCfg=function(){
|
|||||||
$error.addClass("show");
|
$error.addClass("show");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#import_modal").modal('hide');//导入文件隐藏
|
$("#import_modal").modal('hide');//导入文件隐藏
|
||||||
$("#importForm1").submit();
|
$("#importForm1").submit();
|
||||||
}
|
}
|
||||||
@@ -182,3 +204,66 @@ var closeTip = function(){
|
|||||||
$error.removeClass("show");
|
$error.removeClass("show");
|
||||||
$error.addClass("hide");
|
$error.addClass("hide");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function profileChange(val){
|
||||||
|
if(typeof val == 'undefined'){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(".region").find("label[class='radio-inline']").each(function(){
|
||||||
|
$(this).show();
|
||||||
|
});
|
||||||
|
|
||||||
|
var reqHdrInput = $(".region").find("input[regionvalue='PXY_CTRL_HTTP_REQ_HDR']");
|
||||||
|
var resBodyInput = $(".region").find("input[regionvalue='PXY_CTRL_HTTP_RES_BODY']");
|
||||||
|
var reqBodyInput = $(".region").find("input[regionvalue='PXY_CTRL_HTTP_REQ_BODY']");
|
||||||
|
|
||||||
|
// 根据动作隐藏配置域,若该域隐藏前已被选中则默认选中首个
|
||||||
|
var resetFlag = false;
|
||||||
|
if(val == 48){
|
||||||
|
if($(resBodyInput).prop("checked") == true){
|
||||||
|
resetFlag = true;
|
||||||
|
}
|
||||||
|
$(resBodyInput).parents("label:first").hide();
|
||||||
|
}else if(val == 80){
|
||||||
|
if($(reqBodyInput).prop("checked") == true || $(resBodyInput).prop("checked") == true){
|
||||||
|
resetFlag = true;
|
||||||
|
}
|
||||||
|
$(reqBodyInput).parents("label:first").hide();
|
||||||
|
$(resBodyInput).parents("label:first").hide();
|
||||||
|
}else if(val == 85 || val == 90){
|
||||||
|
if($(reqHdrInput).prop("checked") == true || $(reqBodyInput).prop("checked") == true || $(resBodyInput).prop("checked") == true){
|
||||||
|
resetFlag = true;
|
||||||
|
}
|
||||||
|
$(reqHdrInput).parents("label:first").hide();
|
||||||
|
$(reqBodyInput).parents("label:first").hide();
|
||||||
|
$(resBodyInput).parents("label:first").hide();
|
||||||
|
}
|
||||||
|
if(resetFlag){
|
||||||
|
$("input[name='regionDictIds']:first").prop("checked",true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(val == 48 || val == 80){ // 重定向和替换动作无Profile属性
|
||||||
|
$(".profileInfo").addClass("hidden");
|
||||||
|
}else{
|
||||||
|
$(".profileInfo").removeClass("hidden");
|
||||||
|
// Get Policy Profile Info
|
||||||
|
var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4);
|
||||||
|
$.ajax({
|
||||||
|
type:'get',
|
||||||
|
url:pathName+'/proxy/control/manipulatPolicy/ajaxGetProfileInfo?source='+val,
|
||||||
|
dataType:'json',
|
||||||
|
success:function(data){
|
||||||
|
if(data != null){
|
||||||
|
$("#profileSelId").empty();
|
||||||
|
$.each(data, function(i, n){
|
||||||
|
var option = new Option(data[i].cfgDesc, data[i].compileId);
|
||||||
|
$("#profileSelId")[0].options.add(option);
|
||||||
|
});
|
||||||
|
$("#profileSelId").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user