①协议由于数量增加,现改为字典
②增加邮件协议下发逻辑
This commit is contained in:
@@ -1034,7 +1034,7 @@ public class SchedulerTaskUtil {
|
||||
logger.info("定时器修改配置状态:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("定时器修改配置状态响应时间:"+result.getMsg());
|
||||
logger.info("定时器修改配置状态响应:"+result.getMsg());
|
||||
}
|
||||
|
||||
}else if("2".equals(serviceType)){//回调类配置
|
||||
|
||||
@@ -107,6 +107,12 @@ public class ObjectGroupService extends BaseService {
|
||||
}else if(entity.getAction().equals(16)){
|
||||
entity.setServiceId(17);
|
||||
}
|
||||
}else if("MAIL".equalsIgnoreCase(protocolType)){
|
||||
if(entity.getAction().equals(1)){
|
||||
entity.setServiceId(132);
|
||||
}else if(entity.getAction().equals(16)){
|
||||
entity.setServiceId(20);
|
||||
}
|
||||
}else if(StringUtils.isBlank(protocolType)){
|
||||
if(MapUtils.isNotEmpty(entity.getUserRegion())&&entity.getUserRegion().containsKey("ipGroup")){
|
||||
if(entity.getAction().equals(1)){
|
||||
@@ -585,6 +591,7 @@ public class ObjectGroupService extends BaseService {
|
||||
StringBuffer groupIds=new StringBuffer();
|
||||
List<PolicyGroupInfo> policyGroupInfos=new ArrayList<>();
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(functionId);
|
||||
Map<String,String> dicts=DictUtils.getDictMap("OBJ_GROUP_PROTOCOL");
|
||||
for (ObjGroupCfg c : list) {
|
||||
if(!StringUtil.isBlank(c.getCommonGroupIds())) {
|
||||
Map<String,String> groupIdMap=ConfigConvertUtil.gsonFromJson(c.getCommonGroupIds(),Map.class);
|
||||
@@ -600,12 +607,8 @@ public class ObjectGroupService extends BaseService {
|
||||
c.setActionCode(msgProp.getProperty("action_"+service.getActionCode(),"action_"+service.getActionCode()));
|
||||
}
|
||||
}
|
||||
if(c.getUserRegion1().equalsIgnoreCase("https")){
|
||||
c.setUserRegion1("HTTPS");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("http")){
|
||||
c.setUserRegion1("HTTP");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("intercept")){
|
||||
c.setUserRegion1(msgProp.getProperty("intercept","intercept"));
|
||||
if(dicts.containsKey(c.getUserRegion1())){
|
||||
c.setUserRegion1(msgProp.getProperty(dicts.get(c.getUserRegion1()),dicts.get(c.getUserRegion1())));
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(groupIds.toString())){
|
||||
@@ -653,7 +656,7 @@ public class ObjectGroupService extends BaseService {
|
||||
List<ObjGroupCfg> list = commonPolicyDao.getObjGroupPagedList(entity);
|
||||
List<PolicyGroupInfo> policyGroupInfos=new ArrayList<>();
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
|
||||
Map<String,String> dicts=DictUtils.getDictMap("OBJ_GROUP_PROTOCOL");
|
||||
for (ObjGroupCfg c : list) {
|
||||
if(StringUtils.isNotBlank(c.getCommonGroupIds())) {
|
||||
Map<String,String> groupIdMap=ConfigConvertUtil.gsonFromJson(c.getCommonGroupIds(),Map.class);
|
||||
@@ -669,12 +672,8 @@ public class ObjectGroupService extends BaseService {
|
||||
c.setActionCode(msgProp.getProperty("action_"+service.getActionCode(),"action_"+service.getActionCode()));
|
||||
}
|
||||
}
|
||||
if(c.getUserRegion1().equalsIgnoreCase("https")){
|
||||
c.setUserRegion1("HTTPS");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("http")){
|
||||
c.setUserRegion1("HTTP");
|
||||
}else if(c.getUserRegion1().equalsIgnoreCase("intercept")){
|
||||
c.setUserRegion1(msgProp.getProperty("intercept","intercept"));
|
||||
if(dicts.containsKey(c.getUserRegion1())){
|
||||
c.setUserRegion1(msgProp.getProperty(dicts.get(c.getUserRegion1()),dicts.get(c.getUserRegion1())));
|
||||
}
|
||||
}
|
||||
if(StringUtils.isNotBlank(groupIds.toString())){
|
||||
|
||||
@@ -180,14 +180,14 @@
|
||||
</service> -->
|
||||
|
||||
<service id="132" functionId="35" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="邮件监测">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="3" tableName="mail_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID" ></serviceCfg>
|
||||
</service>
|
||||
<service id="20" functionId="35" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="邮件封堵">
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="1" tableName="ip_port_cfg" maatTable="NTC_UNIVERSAL_IP" protocolMaatTable="NTC_UNIVERSAL_PROTO_TYPE"></serviceCfg>
|
||||
<serviceCfg cfgType="3" tableName="mail_keyword_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" maatTable="NTC_SUBSCRIBE_ID"></serviceCfg>
|
||||
</service>
|
||||
|
||||
<service id="133" functionId="51" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="FTP监测">
|
||||
@@ -435,6 +435,6 @@
|
||||
<serviceCfg cfgType="3" tableName="http_res_head_cfg" ></serviceCfg>
|
||||
<serviceCfg cfgType="2" tableName="ntc_subscribe_id_cfg" ></serviceCfg>
|
||||
</service>
|
||||
<service id="0" serviceIds="512,592,128,129" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组监测"></service>
|
||||
<service id="-1" serviceIds="576,16,17" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组阻断"></service>
|
||||
<service id="0" serviceIds="512,592,128,129,132" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组监测"></service>
|
||||
<service id="-1" serviceIds="576,16,17,20" functionId="888" serviceType="1" tableName="cfg_index_info" className="CfgIndexInfo" desc="公共分组阻断"></service>
|
||||
</serviceList>
|
||||
8
src/main/resources/sql/20190701/obj_protocol.sql
Normal file
8
src/main/resources/sql/20190701/obj_protocol.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
#字典值
|
||||
INSERT INTO `sys_data_dictionary_name`(`module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ( '策略对象的几种协议', 'OBJ_GROUP_PROTOCOL', '', '', '2019-07-02 09:29:10', '2019-07-02 09:29:10', 1);
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'ftp', 'FTP', 'FTP协议', 6, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO`sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'dns', 'DNS', 'DNS协议', 5, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'mail', 'mail', '邮件协议', 4, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'intercept', 'intercept', 'HTTPS拦截', 3, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'https', 'HTTPS', 'HTTPS协议', 2, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
INSERT INTO `sys_data_dictionary_item`(`item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) select 'http', 'HTTP', 'HTTP协议', 1, 1, 1, sn.id from `sys_data_dictionary_name` sn where sn.mark='OBJ_GROUP_PROTOCOL';
|
||||
@@ -42,13 +42,12 @@ $(function(){
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").addClass("hidden").addClass("disabled");
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
}else if($("[name=userRegion1]").val()!="intercept"){
|
||||
}else if($("[name=userRegion1]").val()=="mail"){
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".urlGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
}
|
||||
|
||||
|
||||
$(".action").on("change", function() {
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
$("#protocolId").val($(this).attr("protocolId"));
|
||||
@@ -58,8 +57,8 @@ $(function(){
|
||||
processDoLog($(this).attr("configDoLog"));
|
||||
//处理页面协议
|
||||
if($(this).val()!="1"){
|
||||
if($("[name='userRegion1']").val()=="intercept"){
|
||||
$("[name='userRegion1']").selectpicker("val","https");
|
||||
if($("[name='userRegion1']").val()=="intercept"){//拦截隐藏
|
||||
$("[name='userRegion1']").selectpicker("val","");
|
||||
$("[name='userRegion1']").change();
|
||||
}
|
||||
$("[name='userRegion1'] option[value=intercept]").addClass("hidden").addClass("disabled");
|
||||
@@ -117,6 +116,12 @@ $(function(){
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").removeClass("hidden");
|
||||
}else if("mail"==$(this).val()){
|
||||
$(".urlGroup").addClass("hidden").addClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".domainGroup").addClass("hidden").addClass("disabled");
|
||||
//处理do_log
|
||||
$(".doLog").removeClass("hidden");
|
||||
}else{
|
||||
$(".urlGroup").removeClass("hidden").removeClass("disabled");
|
||||
$(".subscribeIdGroup").removeClass("hidden").removeClass("disabled");
|
||||
@@ -342,9 +347,20 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<div class="col-md-6">
|
||||
<select name="userRegion1" data-live-search="true" class="selectpicker form-control">
|
||||
<option value="" <c:if test="${_cfg.userRegion1 eq ''}">selected</c:if>> <spring:message code="select"/></option>
|
||||
<c:forEach items="${fns:getDictList('OBJ_GROUP_PROTOCOL')}" var="protocol">
|
||||
<c:choose>
|
||||
<c:when test="${protocol.itemCode eq 'https'}"></c:when>
|
||||
<c:when test="${protocol.itemCode eq 'intercept'}"></c:when>
|
||||
<c:when test="${protocol.itemCode eq 'ftp'}"></c:when>
|
||||
<c:when test="${protocol.itemCode eq 'dns'}"></c:when>
|
||||
<c:otherwise>
|
||||
<option value="${protocol.itemCode}" <c:if test="${_cfg.userRegion1 eq protocol.itemCode}">selected</c:if>> <spring:message code="${protocol.itemValue}"/></option>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
<%--<option value="https" <c:if test="${_cfg.userRegion1 eq 'https'}">selected</c:if>><spring:message code="HTTPS"/></option>
|
||||
<option value="intercept" <c:if test="${_cfg.userRegion1 eq 'intercept'}">selected</c:if>> <spring:message code="intercept"/></option>--%>
|
||||
<option value="http" <c:if test="${_cfg.userRegion1 eq 'http'}">selected</c:if>> <spring:message code="HTTP"/></option>
|
||||
<option value="intercept" <c:if test="${_cfg.userRegion1 eq 'intercept'}">selected</c:if>> <spring:message code="intercept"/></option>
|
||||
<option value="http" <c:if test="${_cfg.userRegion1 eq 'http'}">selected</c:if>> <spring:message code="HTTP"/></option>--%>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -482,9 +482,9 @@
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.userRegion1 eq 'http'}">HTTP</c:if>
|
||||
<c:if test="${cfg.userRegion1 eq 'https'}">HTTPS</c:if>
|
||||
<c:if test="${cfg.userRegion1 eq 'intercept'}"><spring:message code="intercept"/></c:if>
|
||||
<c:forEach items="${fns:getDictList('OBJ_GROUP_PROTOCOL')}" var="protocol">
|
||||
<c:if test="${cfg.userRegion1 eq protocol.itemCode}"><spring:message code="${protocol.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td commonGroupIds='${cfg.commonGroupIds}'>${fn:substring(cfg.userRegion.ipGroup,1,fn:length(cfg.userRegion.ipGroup)-1)}</td>
|
||||
<td subscribeIdGroup>${fn:substring(cfg.userRegion.subscribeIdGroup,1,fn:length(cfg.userRegion.subscribeIdGroup)-1)}</td>
|
||||
|
||||
Reference in New Issue
Block a user