1.基础协议添加关键字域,dolog,配置id查询

This commit is contained in:
zhanghongqing
2018-08-22 15:20:14 +08:00
parent 82a5d6696b
commit 8087741d05
8 changed files with 376 additions and 89 deletions

View File

@@ -25,6 +25,7 @@ import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg; import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.specific.SpecificServiceCfg; import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants; import com.nis.util.Constants;
@@ -102,6 +103,15 @@ public class AppCfgController extends BaseController {
} }
} }
} }
if(cfg.getNtcSubscribeIdCfgList()!=null){
String cfgType = null;
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
if(!ntc.getCfgType().equals(cfgType)){
tabList.add(new String[]{"2",ntc.getCfgType()});
cfgType = ntc.getCfgType();
}
}
}
model.addAttribute("_cfg", cfg); model.addAttribute("_cfg", cfg);
model.addAttribute("index", index); model.addAttribute("index", index);
model.addAttribute("tabList", tabList); model.addAttribute("tabList", tabList);

View File

@@ -18,7 +18,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.specific.SpecificServiceCfg; import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.CallExternalProceduresException;
import com.nis.exceptions.MaatConvertException; import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
@@ -72,6 +74,15 @@ public class BasicProtocolController extends BaseController {
} }
} }
} }
if(cfg.getNtcSubscribeIdCfgList()!=null){
String cfgType = null;
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
if(!ntc.getCfgType().equals(cfgType)){
tabList.add(new String[]{"2",ntc.getCfgType()});
cfgType = ntc.getCfgType();
}
}
}
model.addAttribute("_cfg", cfg); model.addAttribute("_cfg", cfg);
model.addAttribute("index", index); model.addAttribute("index", index);
model.addAttribute("tabList", tabList); model.addAttribute("tabList", tabList);
@@ -115,9 +126,16 @@ public class BasicProtocolController extends BaseController {
entity.setAppCode(specificService.getSpecServiceCode()); entity.setAppCode(specificService.getSpecServiceCode());
} }
appCfgService.saveOrUpdateAppPolicyCfg(entity); appCfgService.saveOrUpdateAppPolicyCfg(entity);
addMessage(redirectAttributes,"save_success");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
addMessage(redirectAttributes, e.getMessage()); logger.error("基础协议信息保存失败",e);
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
// addMessage(redirectAttributes,e.getMessage());
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}else {
addMessage(redirectAttributes,"save_failed");
}
} }
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+entity.getFunctionId(); return "redirect:" + adminPath +"/basicprotocol/list?functionId="+entity.getFunctionId();
@@ -146,10 +164,18 @@ public class BasicProtocolController extends BaseController {
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
try { try {
appCfgService.auditAppPolicyCfg(entity,isAudit); appCfgService.auditAppPolicyCfg(entity,isAudit);
} catch (MaatConvertException e) { addMessage(redirectAttributes,"audit_success");
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace(); e.printStackTrace();
logger.info("app策略配置下发失败"+e.getMessage()); logger.info("app策略配置下发失败"+e.getMessage());;
addMessage(redirectAttributes, e.getMessage()); throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}else {
e.printStackTrace();
logger.error("auditAvAudioSignSample failed",e);
addMessage(redirectAttributes,"audit_failed");
}
} }
} }
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId; return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
@@ -163,8 +189,20 @@ public class BasicProtocolController extends BaseController {
*/ */
@RequestMapping(value = {"updateValid"}) @RequestMapping(value = {"updateValid"})
@RequiresPermissions(value={"basicprotocol:config"}) @RequiresPermissions(value={"basicprotocol:config"})
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) { public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
try {
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId); appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
addMessage(redirectAttributes,"delete_success");
} catch (Exception e) {
logger.error("基础协议信息保存失败",e);
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
e.printStackTrace();
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}else {
e.printStackTrace();
addMessage(redirectAttributes,"delete_failed");
}
}
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId; return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
} }
} }

View File

@@ -28,13 +28,13 @@
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" /> <result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" /> <result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" /> <result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" /> <result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" /> <result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" /> <result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" /> <result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" /> <result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" /> <result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="AppIpCfgMap" type="com.nis.domain.configuration.AppIpCfg" > <resultMap id="AppIpCfgMap" type="com.nis.domain.configuration.AppIpCfg" >
@@ -71,7 +71,6 @@
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" /> <result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" /> <result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" /> <result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="AppHttpCfgMap" type="com.nis.domain.configuration.AppHttpCfg" > <resultMap id="AppHttpCfgMap" type="com.nis.domain.configuration.AppHttpCfg" >
@@ -104,7 +103,6 @@
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" /> <result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" /> <result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" /> <result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="AppDomainCfgMap" type="com.nis.domain.configuration.AppDomainCfg" > <resultMap id="AppDomainCfgMap" type="com.nis.domain.configuration.AppDomainCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -135,7 +133,6 @@
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" /> <result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" /> <result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" /> <result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="AppByteCfgMap" type="com.nis.domain.configuration.AppByteCfg" > <resultMap id="AppByteCfgMap" type="com.nis.domain.configuration.AppByteCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -166,7 +163,6 @@
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" /> <result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" /> <result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" /> <result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="AppInnerRuleCfgMap" type="com.nis.domain.configuration.AppInnerRuleCfg" > <resultMap id="AppInnerRuleCfgMap" type="com.nis.domain.configuration.AppInnerRuleCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -304,7 +300,7 @@
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID, r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,
r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2, r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2,
r.USER_REGION3,r.USER_REGION4,r.USER_REGION5 r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.do_log
</sql> </sql>
<sql id="AppIpCfg_Column" > <sql id="AppIpCfg_Column" >
@@ -313,7 +309,7 @@
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, r.ATTRIBUTE,r.LABLE,AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT, r.IP_TYPE, r.IP_PATTERN, r.SRC_IP_ADDRESS,r.DEST_IP_ADDRESS, r.PORT_PATTERN,r.SRC_PORT,DEST_PORT,
r.DIRECTION,r.PROTOCOL,r.DO_LOG r.DIRECTION,r.PROTOCOL
</sql> </sql>
<sql id="AppHttpCfg_Column" > <sql id="AppHttpCfg_Column" >
@@ -321,7 +317,7 @@
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG r.DISTRICT,r.CFG_KEYWORDS,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
</sql> </sql>
<sql id="AppDomainCfg_Column" > <sql id="AppDomainCfg_Column" >
@@ -329,7 +325,7 @@
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
</sql> </sql>
<sql id="AppByteCfg_Column" > <sql id="AppByteCfg_Column" >
@@ -337,7 +333,7 @@
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE, r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.BYTES,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG r.BYTES,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN
</sql> </sql>
<sql id="AppInnerRuleCfg_Column" > <sql id="AppInnerRuleCfg_Column" >
@@ -481,6 +477,9 @@
</if> </if>
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=BIGINT}
</if> </if>
<if test="cfgDesc != null and cfgDesc != ''"> <if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
@@ -619,9 +618,6 @@
</if> </if>
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=BIGINT}
</if> </if>
<if test="cfgDesc != null and cfgDesc != ''"> <if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
@@ -744,9 +740,6 @@
</if> </if>
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=BIGINT}
</if> </if>
<if test="cfgDesc != null and cfgDesc != ''"> <if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
@@ -847,9 +840,6 @@
</if> </if>
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=BIGINT}
</if> </if>
<if test="cfgDesc != null and cfgDesc != ''"> <if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
@@ -947,9 +937,6 @@
</if> </if>
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=BIGINT}
</if> </if>
<if test="cfgDesc != null and cfgDesc != ''"> <if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
@@ -1140,9 +1127,6 @@
</if> </if>
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=INTEGER}
</if> </if>
<if test="cfgDesc != null and cfgDesc != ''"> <if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
@@ -1244,9 +1228,6 @@
</if> </if>
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=BIGINT}
</if> </if>
<if test="cfgDesc != null and cfgDesc != ''"> <if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
@@ -1340,12 +1321,12 @@
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID, ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,
CFG_TYPE,CFG_REGION_CODE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,USER_REGION1 CFG_TYPE,CFG_REGION_CODE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,USER_REGION1
,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5 ,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5,DO_LOG
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR} ,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR}
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ,#{doLog,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertAppIpCfg" parameterType="com.nis.domain.configuration.AppIpCfg" > <insert id="insertAppIpCfg" parameterType="com.nis.domain.configuration.AppIpCfg" >
@@ -1358,12 +1339,12 @@
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT, IP_TYPE, IP_PATTERN, SRC_IP_ADDRESS,DEST_IP_ADDRESS, PORT_PATTERN,SRC_PORT,DEST_PORT,
DIRECTION,PROTOCOL,DO_LOG DIRECTION,PROTOCOL
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR}, #{ipType,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},#{srcIpAddress,jdbcType=VARCHAR},#{destIpAddress,jdbcType=VARCHAR},
#{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER}, #{portPattern,jdbcType=INTEGER},#{srcPort,jdbcType=VARCHAR},#{destPort,jdbcType=VARCHAR},#{direction,jdbcType=INTEGER},
#{protocol,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} #{protocol,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertAppHttpCfg" parameterType="com.nis.domain.configuration.AppHttpCfg" > <insert id="insertAppHttpCfg" parameterType="com.nis.domain.configuration.AppHttpCfg" >
@@ -1375,11 +1356,11 @@
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER}, #{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},
#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertAppDomainCfg" parameterType="com.nis.domain.configuration.AppDomainCfg" > <insert id="insertAppDomainCfg" parameterType="com.nis.domain.configuration.AppDomainCfg" >
@@ -1391,11 +1372,11 @@
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{domain,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER}, #{domain,jdbcType=VARCHAR},
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertAppByteCfg" parameterType="com.nis.domain.configuration.AppByteCfg" > <insert id="insertAppByteCfg" parameterType="com.nis.domain.configuration.AppByteCfg" >
@@ -1407,11 +1388,11 @@
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE, ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
BYTES,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG BYTES,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
)values ( )values (
<include refid="AppCommonCfg_Value_List" />, <include refid="AppCommonCfg_Value_List" />,
#{bytes,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER}, #{bytes,jdbcType=VARCHAR},
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="insertAppInnerRuleCfg" parameterType="com.nis.domain.configuration.AppInnerRuleCfg" > <insert id="insertAppInnerRuleCfg" parameterType="com.nis.domain.configuration.AppInnerRuleCfg" >
@@ -1629,6 +1610,7 @@
<if test="userRegion5 != null and userRegion5 != ''"> --> <if test="userRegion5 != null and userRegion5 != ''"> -->
USER_REGION1 =#{userRegion5,jdbcType=VARCHAR}, USER_REGION1 =#{userRegion5,jdbcType=VARCHAR},
<!-- </if> --> <!-- </if> -->
DO_LOG=#{doLog,jdbcType=INTEGER}
</trim> </trim>
</set> </set>
where cfg_id = #{cfgId,jdbcType=BIGINT} where cfg_id = #{cfgId,jdbcType=BIGINT}
@@ -1740,9 +1722,6 @@
<if test="protocol != null" > <if test="protocol != null" >
protocol = #{protocol,jdbcType=INTEGER}, protocol = #{protocol,jdbcType=INTEGER},
</if> </if>
<if test="doLog != null" >
do_log = #{doLog,jdbcType=INTEGER},
</if>
</trim> </trim>
</set> </set>
where cfg_id = #{cfgId,jdbcType=BIGINT} where cfg_id = #{cfgId,jdbcType=BIGINT}
@@ -1841,9 +1820,6 @@
<if test="isHexbin != null"> <if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER}, is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if> </if>
<if test="doLog != null">
do_log=#{doLog,jdbcType=INTEGER},
</if>
</trim> </trim>
</set> </set>
where cfg_id = #{cfgId,jdbcType=BIGINT} where cfg_id = #{cfgId,jdbcType=BIGINT}
@@ -1939,9 +1915,6 @@
<if test="isHexbin != null"> <if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER}, is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if> </if>
<if test="doLog != null">
do_log=#{doLog,jdbcType=INTEGER},
</if>
</trim> </trim>
</set> </set>
where cfg_id = #{cfgId,jdbcType=BIGINT} where cfg_id = #{cfgId,jdbcType=BIGINT}
@@ -2037,9 +2010,6 @@
<if test="isHexbin != null"> <if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER}, is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if> </if>
<if test="doLog != null">
do_log=#{doLog,jdbcType=INTEGER},
</if>
</trim> </trim>
</set> </set>
where cfg_id = #{cfgId,jdbcType=BIGINT} where cfg_id = #{cfgId,jdbcType=BIGINT}

View File

@@ -34,6 +34,7 @@ import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants; import com.nis.util.Constants;
import com.nis.util.DictUtils; import com.nis.util.DictUtils;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.util.StringUtils;
import com.nis.web.dao.configuration.AppCfgDao; import com.nis.web.dao.configuration.AppCfgDao;
import com.nis.web.dao.configuration.AreaIpCfgDao; import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.dao.configuration.StringCfgDao;
@@ -146,12 +147,22 @@ public class AppCfgService extends BaseService {
entity.setIsAudit(0); entity.setIsAudit(0);
appCfgDao.insertAppPolicyCfg(entity); appCfgDao.insertAppPolicyCfg(entity);
//保存策略IP配置 //保存策略IP配置
if(entity.getIpPortList()!=null){ if(entity!=null&&entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){ for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
appCfgDao.insertAppPolicyIpCfg(cfg); appCfgDao.insertAppPolicyIpCfg(cfg);
} }
} }
//保存关键字配置
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
entity.setCfgKeywords(cfg.getCfgKeywords());
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringcfgDao.saveSubscribeIdCfg(cfg);
}
}
}
//保存区域IP信息 //保存区域IP信息
if(entity.getAreaCfg()!=null){ if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){ for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -173,6 +184,12 @@ public class AppCfgService extends BaseService {
appCfgDao.updateAppPolicyCfg(entity); appCfgDao.updateAppPolicyCfg(entity);
appCfgDao.deleteAppPolicyIpCfg(entity); appCfgDao.deleteAppPolicyIpCfg(entity);
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
for (NtcSubscribeIdCfg ntcSubscribeIdCfg : entity.getNtcSubscribeIdCfgList()) {
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
}
}
//删除旧的区域IP新增新的区域IP //删除旧的区域IP新增新的区域IP
AreaIpCfg area = new AreaIpCfg(); AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId()); area.setCompileId(entity.getCompileId());
@@ -188,6 +205,15 @@ public class AppCfgService extends BaseService {
appCfgDao.insertAppPolicyIpCfg(cfg); appCfgDao.insertAppPolicyIpCfg(cfg);
} }
} }
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
entity.setCfgKeywords(cfg.getCfgKeywords());
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringcfgDao.saveSubscribeIdCfg(cfg);
}
}
}
//保存区域IP信息 //保存区域IP信息
if(entity.getAreaCfg()!=null){ if(entity.getAreaCfg()!=null){
@@ -494,7 +520,19 @@ public class AppCfgService extends BaseService {
List<DigestCfg> digestRegionList = new ArrayList(); List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList(); List<IpCfg> areaIpRegionList = new ArrayList();
entity.setTableName(AppPolicyCfg.getTablename()); entity.setTableName(AppPolicyCfg.getTablename());
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
appCfgDao.auditCfg(entity); appCfgDao.auditCfg(entity);
//更新关键字表状态
if(entity.getCompileId()!=null){
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
ntc.setCompileId(entity.getCompileId());
ntc.setIsAudit(entity.getIsAudit());
ntc.setIsValid(entity.getIsValid());
ntc.setAuditorId(UserUtils.getUser().getId());
ntc.setAuditTime(entity.getAuditTime());
stringcfgDao.updateSubscribeIdCfg(ntc);
}
if(isAudit==1){ if(isAudit==1){
StringBuffer cfgKeywords=new StringBuffer(); StringBuffer cfgKeywords=new StringBuffer();
if(entity.getBehavCode()!=null){ if(entity.getBehavCode()!=null){
@@ -538,6 +576,19 @@ public class AppCfgService extends BaseService {
} }
} }
} }
if(entity.getCompileId()!=null){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
ntcList = stringcfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
}
if(isAudit==1){
if(!StringUtil.isEmpty(ntcList)){
Map<String,List> ntcMap = cfgConvert(strRegionList,ntcList,2,entity,groupRelationList);
groupRelationList=ntcMap.get("groupList");
strRegionList=ntcMap.get("dstList");
}
}
//保存区域IP信息 //保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
@@ -1048,6 +1099,12 @@ public class AppCfgService extends BaseService {
cfg.setTableName(IpPortCfg.getTablename()); cfg.setTableName(IpPortCfg.getTablename());
appCfgDao.updateCfgValid(cfg); appCfgDao.updateCfgValid(cfg);
} }
//删除关键字
if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, ntcSubscribeIdCfg, new String[]{"cfgId"});
stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
}
//保存区域IP信息 //保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg(); AreaIpCfg cfg = new AreaIpCfg();

View File

@@ -126,5 +126,60 @@
</c:if> </c:if>
</c:forEach> </c:forEach>
</c:if> </c:if>
<!-- keywords -->
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
</c:forEach> </c:forEach>
</html> </html>

View File

@@ -3,11 +3,17 @@
<html> <html>
<head> <head>
<title><spring:message code="basic_protocol"></spring:message></title> <title><spring:message code="basic_protocol"></spring:message></title>
<style type="text/css">
.boxSolid {
border: 1px solid #eeeeee
}
</style>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#cancel").on("click",function(){ initCommIpVal();
window.history.back(); // $("#cancel").on("click",function(){
}); // window.history.back();
// });
$(".action").on("change", function() { $(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId")); $("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId")); $("#protocolId").val($(this).attr("protocolId"));
@@ -34,7 +40,17 @@ $(function(){
}, },
submitHandler: function(form){ submitHandler: function(form){
var flag = true; var flag = true;
$("input[name$='cfgKeywords']").each(function(){ //代表所有区域都隐藏了,提示必须增加个区域信息
/* 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;
}
*/
var flag = true;
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){ if($(this).val()==''){
$(this).parents(".form-group").find( $(this).parents(".form-group").find(
"div[for='" "div[for='"
@@ -43,19 +59,26 @@ $(function(){
flag = false; flag = false;
} }
}) })
$("select[name$='isHexbin']").each(function(){ //keywords非空校验完成校验二进制字符串
$(".boxSolid:visible").find("select[name$='isHexbin']").each(function(){
var isHexbin=$(this).val(); var isHexbin=$(this).val();
if(isHexbin == 1){ //十六进制 if(isHexbin == 1){ //十六进制
var keywords=$($(this).attr("name").replace("isHexbin","cfgKeywords")).val(); var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
if(keywords != ''){
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){ if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
$(this).parents(".form-body").find( $(this).parents(".boxSolid").find(
"div[for='" "div[for='"
+ $(this).attr("name").replace("isHexbin","cfgKeywords") + $(this).attr("name").replace("isHexbin","cfgKeywords")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>"); + "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
flag = false; flag = false;
} }
} }
}
}); });
var flag1=validateInvisibleCharTag();
if(flag){
flag=flag1;
}
if(flag){ if(flag){
//将disable属性的元素删除 //将disable属性的元素删除
$(".disabled").each(function(){ $(".disabled").each(function(){
@@ -130,8 +153,10 @@ var delContent = function(contentClassName, addBtnClassName) {
<!-- desc and action --> <!-- desc and action -->
<c:set var="ipCfgIndex" value="0"></c:set> <c:set var="ipCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status"> <c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 2 }"> <c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'app_policy' }">
<input type="hidden" name="cfgType" value="${region.configRegionValue}"> <input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}"> <input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
<div class="row"> <div class="row">
@@ -143,8 +168,7 @@ var delContent = function(contentClassName, addBtnClassName) {
</div> </div>
</div> </div>
</div> </div>
</div>
<div class="row">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">
<c:set var="spec_service_id"><spring:message code="basic_protocol"/></c:set> <c:set var="spec_service_id"><spring:message code="basic_protocol"/></c:set>
@@ -164,6 +188,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<div class="col-md-6" id="behaviour"> <div class="col-md-6" id="behaviour">
</div> </div>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
@@ -177,6 +202,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<input type="radio" name="action" <input type="radio" name="action"
serviceId="${service.serviceId }" serviceId="${service.serviceId }"
protocolId="${service.protocolId }" protocolId="${service.protocolId }"
regionCode="${service.regionCode }"
value="${service.action }" class="required action" value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>> <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:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
@@ -191,7 +217,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<div for="action"></div> <div for="action"></div>
</div> </div>
</div> </div>
<div class="col-md-6" id="ratelimit"> <div class="col-md-6 ratelimit" id="ratelimit">
<div class="form-group"> <div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
<div class="col-md-6"> <div class="col-md-6">
@@ -200,8 +226,69 @@ var delContent = function(contentClassName, addBtnClassName) {
<div for="ratelimit"></div> <div for="ratelimit"></div>
</div> </div>
</div> </div>
<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>
</div>
</c:if>
<!-- 关键字 -->
<c:set var="strCfgIndex" value="0"></c:set>
<c:set var="subscribeIndex" value="0"></c:set>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIndex}]"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
<!-- 关键字结束 -->
</c:if> </c:if>
<c:if test="${region.regionType eq 1 }"> <c:if test="${region.regionType eq 1 }">
<h4 class="form-section"> <h4 class="form-section">

View File

@@ -126,5 +126,59 @@
</c:if> </c:if>
</c:forEach> </c:forEach>
</c:if> </c:if>
<!-- keywords -->
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
</c:forEach> </c:forEach>
</html> </html>

View File

@@ -10,6 +10,10 @@
//搜索框提示语初始化 //搜索框提示语初始化
if("${cfg.cfgDesc}"){ if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else{ }else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text()); $("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
} }
@@ -142,6 +146,8 @@
<form:select path="seltype" class="selectpicker select2 input-small" > <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="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -311,11 +317,13 @@
<thead> <thead>
<tr> <tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th> <th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th> <th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="basic_protocol"/></th> <th><spring:message code="basic_protocol"/></th>
<%-- <th><spring:message code="behaviour_type"/></th> --%> <%-- <th><spring:message code="behaviour_type"/></th> --%>
<th><spring:message code="ratelimit"/></th> <th><spring:message code="ratelimit"/></th>
<th><spring:message code="block_type"/></th> <th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th> <th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th> <th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th> <th><spring:message code="classification"/></th>
@@ -339,6 +347,7 @@
<span id="open${status.index}" class="" compileId="${cfg.compileId}" cfgId="${cfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span> <span id="open${status.index}" class="" compileId="${cfg.compileId}" cfgId="${cfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td> </td>
<td>${cfg.compileId }</td>
<td>${cfg.cfgDesc }</td> <td>${cfg.cfgDesc }</td>
<td>${cfg.appName }</td> <td>${cfg.appName }</td>
<%-- <td>${cfg.behavName }</td> --%> <%-- <td>${cfg.behavName }</td> --%>
@@ -350,6 +359,13 @@
</c:if> </c:if>
</c:forEach> </c:forEach>
</td> </td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq cfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td> <td>
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if> <c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isAreaEffective==1}"> <c:if test="${cfg.isAreaEffective==1}">