代理-控制策略修改

1.白名单增加应答头域
2.操控:Redirect增加响应体域,Hijack/Inser增加SubscriberID域,修正URL必选
3.以上涉及导入相应修改
This commit is contained in:
zhangwenqing
2019-07-02 17:24:27 +08:00
parent dd0133b2d2
commit d587c67c03
8 changed files with 25 additions and 30 deletions

View File

@@ -1716,9 +1716,7 @@ public abstract class BaseService {
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_req_head_cfg",send);
}else
// HTTP(s)响应头域
if(regionDict.getDictId().intValue()==102 || regionDict.getDictId().intValue()==81 ||
regionDict.getDictId().intValue()==87 || regionDict.getDictId().intValue()==93 ||
regionDict.getDictId().intValue()==702) {
if(regionDict.getConfigRegionValue().equals(Constants.HTTP_REDIRECT_RES_HEAD_REGION)) {
this.saveComplexkeywordCfgBatch(regionDict,serviceDict,listPage, "http_res_head_cfg",send);
}
}else if("DnsResStrategy".equals(type)) {

View File

@@ -191,11 +191,11 @@ public class DomainCommGroupService extends CrudService<CrudDao<DomainCommCfg>,
serviceGroupIds = "";
for (String groupId : strings) {
Integer size = domainCommGroupDao.getCfgInfoByGroupIds(groupId);
if(size == 0) { // 需配置取消
if(size == 0) {
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.DOMAIN_OBJ_GROUP_TYPE);
if(flag) { // 需配置更新
if(flag) { // 需配置取消
serviceGroupIds += ","+groupId;
}else {
}else { // 需配置更新
groupIds += ","+groupId;
}
}else { // 需配置更新

View File

@@ -184,11 +184,11 @@ public class IpCommGroupCfgService extends BaseService {
serviceGroupIds = "";
for (String groupId : strings) {
Integer size = ipCommGroupCfgDao.getCfgInfoByGroupIds(groupId);
if(size == 0) { // 需配置取消
if(size == 0) {
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.IP_OBJ_GROUP_TYPE);
if(flag) { // 需配置更新
if(flag) { // 需配置取消
serviceGroupIds += ","+groupId;
}else {
}else { // 需配置更新
groupIds += ","+groupId;
}
}else { // 需配置更新

View File

@@ -191,11 +191,11 @@ public class ScriberIdCommGroupService extends CrudService<CrudDao<ScriberIdComm
serviceGroupIds = "";
for (String groupId : strings) {
Integer size = scriberIdCommGroupDao.getCfgInfoByGroupIds(groupId);
if(size == 0) { // 需配置取消
if(size == 0) {
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.SUBID_OBJ_GROUP_TYPE);
if(flag) { // 需配置更新
if(flag) { // 需配置取消
serviceGroupIds += ","+groupId;
}else {
}else { // 需配置更新
groupIds += ","+groupId;
}
}else { // 需配置更新

View File

@@ -191,11 +191,11 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
serviceGroupIds = "";
for (String groupId : strings) {
Integer size = urlCommGroupDao.getCfgInfoByGroupIds(groupId);
if(size == 0) { // 需配置取消
if(size == 0) {
boolean flag = groupManageService.checkCancelCfg(groupId, Constants.URL_OBJ_GROUP_TYPE);
if(flag) { // 需配置更新
if(flag) { // 需配置取消
serviceGroupIds += ","+groupId;
}else {
}else { // 需配置更新
groupIds += ","+groupId;
}
}else { // 需配置更新

View File

@@ -0,0 +1,6 @@
# HTTP(s)WhiteList 增加应答头域
INSERT INTO `function_region_dict` (`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 ('211', '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');
# HTTP(s)WhiteList 修改域配置排序
UPDATE function_region_dict SET config_region_sort = 4 WHERE function_id = 211 AND config_region_value = 'PXY_CTRL_IP';
UPDATE function_region_dict SET config_region_sort = 5 WHERE function_id = 211 AND config_region_value = 'PXY_CTRL_SUBSCRIBE_ID';

View File

@@ -120,17 +120,13 @@
$("select[name='httpResHdrList[0].district']").selectpicker("refresh");
// 域配置隐藏/显示
if(selValue == 48){ // Redirect 隐藏响应体
$(".resBodyCfg").addClass("hidden");
addContent(this,'httpUrlTab');
}else if(selValue == 80){ // Replace 隐藏请求响应体
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"){
@@ -197,6 +193,9 @@
getFileInfo("profileSelId",$(".profileSelDiv").attr("source"));
}
// URL域必选打开URL域并隐藏关闭按钮
addContent(document.getElementById("httpUrlAddButton"),'httpUrlTab');
$(".httpUrlTab0").find("span[title='remove']").hide();
}
var getFileInfo = function(selectId,source){
@@ -255,9 +254,6 @@
var delContent = function(contentClassName, addBtnClassName) {
$("." + contentClassName).addClass("hidden").addClass("disabled");
$("." + addBtnClassName).removeClass("hidden");
if($(".userRegion5:checked").val()==48){
addContent(this,"httpUrlTab");
}
}
</script>
</head>
@@ -433,7 +429,7 @@
<spring:message code="http_url_title" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
onClick="addContent(this,'${tabName}')" title="add" id="httpUrlAddButton"></span></small>
</h4>
<%-- <c:set var="regionValue" value="${_cfg.httpUrl.cfgType}"></c:set> --%>

View File

@@ -229,12 +229,7 @@ function profileChange(val){
// 根据动作隐藏配置域,若该域隐藏前已被选中则默认选中首个
var resetFlag = false;
if(val == 48){
if($(resBodyInput).prop("checked") == true){
resetFlag = true;
}
$(resBodyInput).parents("label:first").hide();
}else if(val == 80){
if(val == 80){
if($(reqBodyInput).prop("checked") == true || $(resBodyInput).prop("checked") == true){
resetFlag = true;
}