group添加默认空的选项,列表与导出添加协议
This commit is contained in:
@@ -14,6 +14,9 @@ public class ObjGroupCfg extends BaseCfg<ObjGroupCfg> {
|
|||||||
private String domainGroup;
|
private String domainGroup;
|
||||||
@ExcelField(title="block_type",sort=2)//这里没有使用公共方法处理,直接将字典值set进去了,不用使用dictType
|
@ExcelField(title="block_type",sort=2)//这里没有使用公共方法处理,直接将字典值set进去了,不用使用dictType
|
||||||
protected String actionCode;
|
protected String actionCode;
|
||||||
|
@ExcelField(title="protocol",sort=3)
|
||||||
|
protected String userRegion1;
|
||||||
|
|
||||||
public String getActionCode() {
|
public String getActionCode() {
|
||||||
return actionCode;
|
return actionCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,17 +103,17 @@ public class ObjectGroupController extends BaseController {
|
|||||||
urlGroup=formatMultSelect(request.getParameterValues("urlGroup"));
|
urlGroup=formatMultSelect(request.getParameterValues("urlGroup"));
|
||||||
|
|
||||||
Map<String,Object> map = new HashMap();
|
Map<String,Object> map = new HashMap();
|
||||||
if(StringUtils.isNotBlank(ipGroup)){
|
if(StringUtils.isNotBlank(ipGroup)&&StringUtils.isNotBlank(ipGroup.replaceAll(",",""))){
|
||||||
map.put("ipGroup", ipGroup.toString());
|
map.put("ipGroup", ipGroup);
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(subscribeIdGroup)){
|
if(StringUtils.isNotBlank(subscribeIdGroup)&&StringUtils.isNotBlank(subscribeIdGroup.replaceAll(",",""))){
|
||||||
map.put("subscribeIdGroup", subscribeIdGroup.toString());
|
map.put("subscribeIdGroup", subscribeIdGroup);
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(domainGroup)){
|
if(StringUtils.isNotBlank(domainGroup)&&StringUtils.isNotBlank(domainGroup.replaceAll(",",""))){
|
||||||
map.put("domainGroup", domainGroup.toString());
|
map.put("domainGroup", domainGroup);
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(urlGroup)){
|
if(StringUtils.isNotBlank(urlGroup)&&StringUtils.isNotBlank(urlGroup.replaceAll(",",""))){
|
||||||
map.put("urlGroup", urlGroup.toString());
|
map.put("urlGroup", urlGroup);
|
||||||
}
|
}
|
||||||
cfg.setUserRegion(map);
|
cfg.setUserRegion(map);
|
||||||
objectGroupService.saveOrUpdate(cfg);
|
objectGroupService.saveOrUpdate(cfg);
|
||||||
|
|||||||
@@ -209,7 +209,10 @@ public class ObjectGroupService extends BaseService {
|
|||||||
}else{
|
}else{
|
||||||
if(StringUtils.isNotBlank(e.getValue().toString())){
|
if(StringUtils.isNotBlank(e.getValue().toString())){
|
||||||
String val=e.getValue().toString().substring(0,e.getValue().toString().length()-1);
|
String val=e.getValue().toString().substring(0,e.getValue().toString().length()-1);
|
||||||
canceledGroup.append(val);
|
if(StringUtils.isNotBlank(val)){
|
||||||
|
canceledGroup.append(val);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,20 +222,32 @@ public class ObjectGroupService extends BaseService {
|
|||||||
for(Object val:newMap.values()){
|
for(Object val:newMap.values()){
|
||||||
String _val=(String)val;
|
String _val=(String)val;
|
||||||
if(StringUtils.isNotBlank(_val)){
|
if(StringUtils.isNotBlank(_val)){
|
||||||
if(_val.startsWith(",")){
|
if(_val.startsWith(",")&&!",".equals(_val.trim())){
|
||||||
okGroup.append(_val.substring(1));
|
okGroup.append(_val.substring(1));
|
||||||
}else{
|
}else if(StringUtils.isNotBlank(_val)){
|
||||||
okGroup.append(_val);
|
okGroup.append(_val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//取消勾选的组更新UD_FLAG
|
//取消勾选的组更新UD_FLAG
|
||||||
if(StringUtils.isNotBlank(canceledGroup.toString())){
|
if(StringUtils.isNotBlank(canceledGroup.toString())){
|
||||||
policyGroupInfoDao.updateUdFlag(canceledGroup.toString().substring(1),1,null);
|
if(canceledGroup.toString().startsWith(",")){
|
||||||
|
canceledGroup.deleteCharAt(0);
|
||||||
|
}
|
||||||
|
if(canceledGroup.toString().endsWith(",")){
|
||||||
|
canceledGroup.deleteCharAt(canceledGroup.toString().length()-1);
|
||||||
|
}
|
||||||
|
policyGroupInfoDao.updateUdFlag(canceledGroup.toString(),1,null);
|
||||||
}
|
}
|
||||||
//新选择的组更新UD_FALG
|
//新选择的组更新UD_FALG
|
||||||
if(StringUtils.isNotBlank(okGroup.toString())){
|
if(StringUtils.isNotBlank(okGroup.toString())){
|
||||||
okGroup.deleteCharAt(okGroup.toString().length()-1);
|
if(okGroup.toString().startsWith(",")){
|
||||||
|
okGroup.deleteCharAt(0);
|
||||||
|
}
|
||||||
|
if(okGroup.toString().endsWith(",")){
|
||||||
|
okGroup.deleteCharAt(okGroup.toString().length()-1);
|
||||||
|
}
|
||||||
|
|
||||||
policyGroupInfoDao.updateUdFlag(okGroup.toString(),2,null);
|
policyGroupInfoDao.updateUdFlag(okGroup.toString(),2,null);
|
||||||
}
|
}
|
||||||
}else if(MapUtils.isNotEmpty(entity.getUserRegion())){
|
}else if(MapUtils.isNotEmpty(entity.getUserRegion())){
|
||||||
@@ -545,9 +560,9 @@ public class ObjectGroupService extends BaseService {
|
|||||||
StringBuffer buf=new StringBuffer();
|
StringBuffer buf=new StringBuffer();
|
||||||
for(Object val:dataMap.values()){
|
for(Object val:dataMap.values()){
|
||||||
String _val=(String)val;
|
String _val=(String)val;
|
||||||
if(_val.startsWith(",")){
|
if(_val.startsWith(",")&&!",".equals(_val)){
|
||||||
buf.append(_val.substring(1));
|
buf.append(_val.substring(1));
|
||||||
}else{
|
}else if(StringUtils.isNotBlank(_val)){
|
||||||
buf.append(_val);
|
buf.append(_val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -577,6 +592,13 @@ public class ObjectGroupService extends BaseService {
|
|||||||
c.setActionCode(msgProp.getProperty("action_"+service.getActionCode(),"action_"+service.getActionCode()));
|
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("Intercept");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(groupIds.toString())){
|
if(StringUtils.isNotBlank(groupIds.toString())){
|
||||||
groupIds.deleteCharAt(groupIds.toString().length()-1);
|
groupIds.deleteCharAt(groupIds.toString().length()-1);
|
||||||
@@ -639,6 +661,13 @@ public class ObjectGroupService extends BaseService {
|
|||||||
c.setActionCode(msgProp.getProperty("action_"+service.getActionCode(),"action_"+service.getActionCode()));
|
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("Intercept");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(StringUtils.isNotBlank(groupIds.toString())){
|
if(StringUtils.isNotBlank(groupIds.toString())){
|
||||||
groupIds.deleteCharAt(groupIds.toString().length()-1);
|
groupIds.deleteCharAt(groupIds.toString().length()-1);
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ $(function(){
|
|||||||
// return;
|
// return;
|
||||||
//}
|
//}
|
||||||
//限制组必选一个,并且最多选择8个组
|
//限制组必选一个,并且最多选择8个组
|
||||||
var ipGroupLen=$("[name='ipGroup'] option:selected").length,subscribeIdGroupLen=$("[name='subscribeIdGroup'] option:selected").length,urlGroupLen=$("[name='urlGroup'] option:selected").length,domainGroupLen=$("[name='domainGroup'] option:selected").length;
|
var ipGroupLen=$("[name='ipGroup'] option[value!='']:selected").length,subscribeIdGroupLen=$("[name='subscribeIdGroup'] option[value!='']:selected").length,urlGroupLen=$("[name='urlGroup'] option[value!='']:selected").length,domainGroupLen=$("[name='domainGroup'] option[value!='']:selected").length;
|
||||||
var grouplen=0;
|
var grouplen=0;
|
||||||
if($(".ipGroup").is(":visible")){
|
if($(".ipGroup").is(":visible")){
|
||||||
grouplen+=ipGroupLen;
|
grouplen+=ipGroupLen;
|
||||||
@@ -356,6 +356,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
|||||||
<label class="control-label col-md-3"><spring:message code="ip_group"/></label>
|
<label class="control-label col-md-3"><spring:message code="ip_group"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="ipGroup" data-live-search="true" class="selectpicker form-control">
|
<select name="ipGroup" data-live-search="true" class="selectpicker form-control">
|
||||||
|
<option value="" <c:if test="${fn:indexOf(_cfg.commonGroupIds,'ipGroup')==-1}">selected</c:if>> <spring:message code="select"/></option>
|
||||||
<c:forEach items="${ipGroups}" var="ipGroup">
|
<c:forEach items="${ipGroups}" var="ipGroup">
|
||||||
<option value="${ipGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(ipGroup.serviceGroupId).concat(','))>-1}">selected</c:if>> <spring:message code="${ipGroup.groupName}"/></option>
|
<option value="${ipGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(ipGroup.serviceGroupId).concat(','))>-1}">selected</c:if>> <spring:message code="${ipGroup.groupName}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
@@ -369,6 +370,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
|||||||
<label class="control-label col-md-3"><spring:message code="subscribe_id_group"/></label>
|
<label class="control-label col-md-3"><spring:message code="subscribe_id_group"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="subscribeIdGroup" data-live-search="true" class="selectpicker form-control ">
|
<select name="subscribeIdGroup" data-live-search="true" class="selectpicker form-control ">
|
||||||
|
<option value="" <c:if test="${fn:indexOf(_cfg.commonGroupIds,'subscribeIdGroup')==-1}">selected</c:if>> <spring:message code="select"/></option>
|
||||||
<c:forEach items="${subscribeIdGroups}" var="subscribeIdGroup">
|
<c:forEach items="${subscribeIdGroups}" var="subscribeIdGroup">
|
||||||
<option value="${subscribeIdGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(subscribeIdGroup.serviceGroupId).concat(','))>-1}">selected</c:if> ><spring:message code="${subscribeIdGroup.groupName}"/></option>
|
<option value="${subscribeIdGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(subscribeIdGroup.serviceGroupId).concat(','))>-1}">selected</c:if> ><spring:message code="${subscribeIdGroup.groupName}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
@@ -385,6 +387,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
|||||||
<label class="control-label col-md-3"><spring:message code="url_group"/></label>
|
<label class="control-label col-md-3"><spring:message code="url_group"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="urlGroup" data-live-search="true" class="selectpicker form-control " >
|
<select name="urlGroup" data-live-search="true" class="selectpicker form-control " >
|
||||||
|
<option value="" <c:if test="${fn:indexOf(_cfg.commonGroupIds,'urlGroup')==-1}">selected</c:if>> <spring:message code="select"/></option>
|
||||||
<c:forEach items="${urlGroups}" var="urlGroup">
|
<c:forEach items="${urlGroups}" var="urlGroup">
|
||||||
<option value="${urlGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(urlGroup.serviceGroupId).concat(','))>-1}">selected</c:if> ><spring:message code="${urlGroup.groupName}"/></option>
|
<option value="${urlGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(urlGroup.serviceGroupId).concat(','))>-1}">selected</c:if> ><spring:message code="${urlGroup.groupName}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
@@ -398,6 +401,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
|||||||
<label class="control-label col-md-3"><spring:message code="domain_group"/></label>
|
<label class="control-label col-md-3"><spring:message code="domain_group"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="domainGroup" data-live-search="true" class="selectpicker form-control " >
|
<select name="domainGroup" data-live-search="true" class="selectpicker form-control " >
|
||||||
|
<option value="" <c:if test="${fn:indexOf(_cfg.commonGroupIds,'domainGroup')==-1}">selected</c:if>> <spring:message code="select"/></option>
|
||||||
<c:forEach items="${domainGroups}" var="domainGroup">
|
<c:forEach items="${domainGroups}" var="domainGroup">
|
||||||
<option value="${domainGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(domainGroup.serviceGroupId).concat(','))>-1}">selected</c:if> ><spring:message code="${domainGroup.groupName}"/></option>
|
<option value="${domainGroup.serviceGroupId}" <c:if test="${fn:indexOf(_cfg.commonGroupIds,','.concat(domainGroup.serviceGroupId).concat(','))>-1}">selected</c:if> ><spring:message code="${domainGroup.groupName}"/></option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
@@ -435,6 +435,7 @@
|
|||||||
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></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="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 column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
|
<th column="userRegion1" ><spring:message code="protocol"/></th>
|
||||||
<th column="ip_group" ><spring:message code="ip_group"/></th>
|
<th column="ip_group" ><spring:message code="ip_group"/></th>
|
||||||
<th column="subscribe_id_group" ><spring:message code="subscribe_id_group"/></th>
|
<th column="subscribe_id_group" ><spring:message code="subscribe_id_group"/></th>
|
||||||
<th column="url_group" ><spring:message code="url_group"/></th>
|
<th column="url_group" ><spring:message code="url_group"/></th>
|
||||||
@@ -480,6 +481,11 @@
|
|||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</td>
|
</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'}">Intercept</c:if>
|
||||||
|
</td>
|
||||||
<td commonGroupIds='${cfg.commonGroupIds}'>${fn:substring(cfg.userRegion.ipGroup,1,fn:length(cfg.userRegion.ipGroup)-1)}</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>
|
<td subscribeIdGroup>${fn:substring(cfg.userRegion.subscribeIdGroup,1,fn:length(cfg.userRegion.subscribeIdGroup)-1)}</td>
|
||||||
<td urlGroup>${fn:substring(cfg.userRegion.urlGroup,1,fn:length(cfg.userRegion.urlGroup)-1)}</td>
|
<td urlGroup>${fn:substring(cfg.userRegion.urlGroup,1,fn:length(cfg.userRegion.urlGroup)-1)}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user