代理操控业务配置批量操作、定时任务相关修改提交.
This commit is contained in:
@@ -238,6 +238,12 @@ public class SchedulerTaskUtil {
|
||||
userRegion = userRegion.substring(0, userRegion.length()-1);
|
||||
}
|
||||
}
|
||||
|
||||
// Proxy Manipulate
|
||||
if(entity.getServiceId().equals(656)) {
|
||||
userRegion = BaseService.setUserRegionOfMantipulateCfg(cfg, userRegion);
|
||||
}
|
||||
|
||||
for(AsnIpCfg ip:asnIpList){//asn不需要再次获取regionId,groupId
|
||||
if(ip.getAsnIpGroup().toString().equals(cfg.getUserRegion4())){//根据组号对应
|
||||
ip.setIsValid(entity.getIsValid());
|
||||
|
||||
@@ -190,6 +190,7 @@ import com.nis.web.service.configuration.IpAddrPoolCfgService;
|
||||
import com.nis.web.service.configuration.IpCfgService;
|
||||
import com.nis.web.service.configuration.IpMultiplexPoolCfgService;
|
||||
import com.nis.web.service.configuration.MailCfgService;
|
||||
import com.nis.web.service.configuration.ManipulatPolicyService;
|
||||
import com.nis.web.service.configuration.NumCfgService;
|
||||
import com.nis.web.service.configuration.ProxyFileHijackService;
|
||||
import com.nis.web.service.configuration.ProxyFileInsertScriptService;
|
||||
@@ -350,6 +351,9 @@ public class BaseController {
|
||||
@Autowired
|
||||
protected InnerProtectionListService innerProtectionListService;
|
||||
|
||||
@Autowired
|
||||
protected ManipulatPolicyService manipulatPolicyService;
|
||||
|
||||
/**
|
||||
* 管理基础路径
|
||||
*/
|
||||
@@ -3919,6 +3923,8 @@ public class BaseController {
|
||||
||baseCfg.getFunctionId().equals(210)
|
||||
||baseCfg.getFunctionId().equals(211)) {
|
||||
pageResult=httpRedirectCfgService.getHttpRedirectList(searchPage, searchCfg);
|
||||
}else if(baseCfg.getFunctionId().equals(215)) { // Proxy Manipulate
|
||||
pageResult = manipulatPolicyService.getPolicyList(searchPage, searchCfg);
|
||||
}else if(baseCfg.getFunctionId().equals(213)) {// cache
|
||||
pageResult=cachePolicyService.getCachePolicyList(searchPage, searchCfg);
|
||||
}else if(baseCfg.getFunctionId().equals(563) //app payload
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
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;
|
||||
@@ -17,7 +14,6 @@ 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;
|
||||
@@ -43,11 +39,8 @@ 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;
|
||||
|
||||
@@ -58,9 +51,6 @@ import jersey.repackaged.com.google.common.collect.Lists;
|
||||
@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");
|
||||
|
||||
@@ -3246,5 +3246,37 @@ public abstract class BaseService {
|
||||
fileTemp.setOpTime(cfg.getAuditTime());
|
||||
return fileTemp;
|
||||
}
|
||||
|
||||
// Proxy Manipulate
|
||||
public static String setUserRegionOfMantipulateCfg(CfgIndexInfo cfg, String userRegion) {
|
||||
|
||||
ManipulatActionParam actionParam = new ManipulatActionParam();
|
||||
if(cfg.getUserRegion5().equals("48")) {
|
||||
actionParam.setMethod("redirect");
|
||||
actionParam.setCode(Integer.valueOf(cfg.getUserRegion1()));
|
||||
actionParam.setTo(cfg.getUserRegion2());
|
||||
}else if(cfg.getUserRegion5().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(cfg.getUserRegion5().equals("16")) {
|
||||
actionParam.setMethod("block");
|
||||
actionParam.setCode(Integer.valueOf(cfg.getUserRegion1()));
|
||||
actionParam.setMessage(cfg.getUserRegion2());
|
||||
actionParam.setHtml_profile(Integer.valueOf(cfg.getUserRegion4()));
|
||||
}else if(cfg.getUserRegion5().equals("85")) {
|
||||
actionParam.setMethod("hijack");
|
||||
actionParam.setHijack_profile(Integer.valueOf(cfg.getUserRegion4()));
|
||||
}else if(cfg.getUserRegion5().equals("90")) {
|
||||
actionParam.setMethod("insert");
|
||||
actionParam.setInsert_profile(Integer.valueOf(cfg.getUserRegion4()));
|
||||
}
|
||||
return gsonToJson(actionParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -461,6 +461,11 @@ public class ConfigSynchronizationService extends BaseService{
|
||||
userRegion = userRegion.substring(0, userRegion.length()-1);
|
||||
}
|
||||
}
|
||||
// Proxy Manipulation
|
||||
if(entity.getServiceId().equals(656)) {
|
||||
userRegion = BaseService.setUserRegionOfMantipulateCfg(cfg, userRegion);
|
||||
}
|
||||
|
||||
for(AsnIpCfg ip:asnIpList){//asn不需要再次获取regionId,groupId
|
||||
if(ip.getAsnIpGroup().toString().equals(cfg.getUserRegion4())){//根据组号对应
|
||||
ip.setIsValid(entity.getIsValid());
|
||||
|
||||
@@ -45,7 +45,6 @@ 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;
|
||||
|
||||
/**
|
||||
|
||||
@@ -123,6 +123,7 @@ function isBatch(url){
|
||||
|| url.indexOf("functionId=514&") > -1 //File Insert Script
|
||||
|| url.indexOf("functionId=515&") > -1 //Traffic Mirror
|
||||
|| url.indexOf("functionId=512&") > -1 //PXY OBJ FILE
|
||||
|| url.indexOf("functionId=215&") > -1 //Proxy Manipulate
|
||||
){
|
||||
flag = true;
|
||||
}
|
||||
|
||||
@@ -103,57 +103,18 @@
|
||||
<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">
|
||||
<%-- <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: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>
|
||||
</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 for="userRegion3"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -291,49 +252,17 @@
|
||||
<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">
|
||||
<%-- <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>
|
||||
</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 for="userRegion3"></div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user