Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

This commit is contained in:
duandongmei
2018-08-23 09:36:09 +08:00
61 changed files with 2692 additions and 1551 deletions

View File

@@ -30,7 +30,14 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
private Date beginDate; // 开始日期 private Date beginDate; // 开始日期
private Date endDate; // 结束日期 private Date endDate; // 结束日期
private String showSequence; //显示序号 private String showSequence; //显示序号
private String businessType;
public String getBusinessType() {
return businessType;
}
public void setBusinessType(String businessType) {
this.businessType = businessType;
}
public Integer getParentType() { public Integer getParentType() {
return parentType; return parentType;
} }

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());
addMessage(redirectAttributes,"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()); addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("app策略配置下发失败",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();
addMessage(redirectAttributes,"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

@@ -19,7 +19,9 @@ import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.SysDataDictionaryItem;
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.util.DictUtils; import com.nis.util.DictUtils;
@@ -96,6 +98,15 @@ public class EncryptedTunnelBehaviorController 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);
@@ -139,9 +150,15 @@ public class EncryptedTunnelBehaviorController 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) {
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}else {
addMessage(redirectAttributes,"save_failed");
}
} }
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId(); return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId();
@@ -170,10 +187,17 @@ public class EncryptedTunnelBehaviorController extends BaseController {
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR); entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
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("加密隧道配置下发失败:"+e.getMessage());;
addMessage(redirectAttributes, e.getMessage()); throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}else {
e.printStackTrace();
logger.error("加密隧道配置下发失败",e);
addMessage(redirectAttributes,"audit_failed");
}
} }
} }
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId; return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
@@ -187,8 +211,19 @@ public class EncryptedTunnelBehaviorController extends BaseController {
*/ */
@RequestMapping(value = {"updateValid"}) @RequestMapping(value = {"updateValid"})
@RequiresPermissions(value={"encryptedtunnelbehav:config"}) @RequiresPermissions(value={"encryptedtunnelbehav: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);
} 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 +"/encryptedtunnelbehav/list?functionId="+functionId; return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
} }
} }

View File

@@ -94,9 +94,16 @@ public class AvContentController extends BaseController {
avContentCfgService.saveOrUpdateAvVoip(cfg); avContentCfgService.saveOrUpdateAvVoip(cfg);
addMessage(redirectAttributes,"save_success"); addMessage(redirectAttributes,"save_success");
}catch(Exception e){ }catch(Exception e){
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.error("voip IP信息保存失败",e);
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("voip IP信息保存失败",e); logger.error("voip IP信息保存失败",e);
addMessage(redirectAttributes,"save_failed"); addMessage(redirectAttributes,"save_failed");
} }
}
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId(); return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId();
} }
//保存voip Account信息 //保存voip Account信息
@@ -107,9 +114,16 @@ public class AvContentController extends BaseController {
avContentCfgService.saveOrUpdateAvVoipAccount(cfg); avContentCfgService.saveOrUpdateAvVoipAccount(cfg);
addMessage(redirectAttributes,"save_success"); addMessage(redirectAttributes,"save_success");
}catch(Exception e){ }catch(Exception e){
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.error("voip Account信息保存失败",e);
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("voip Account信息保存失败",e); logger.error("voip Account信息保存失败",e);
addMessage(redirectAttributes,"save_failed"); addMessage(redirectAttributes,"save_failed");
} }
}
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId(); return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId();
} }
//视频文本VOIP IP配置列表 //视频文本VOIP IP配置列表
@@ -155,7 +169,19 @@ public class AvContentController extends BaseController {
public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
,RedirectAttributes redirectAttributes ,RedirectAttributes redirectAttributes
) { ) {
try {
avContentCfgService.updateAvVoipValid(isAudit,isValid,compileIds,functionId); avContentCfgService.updateAvVoipValid(isAudit,isValid,compileIds,functionId);
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.error("voip IP信息审核失败",e);
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("voip IP信息审核失败",e);
addMessage(redirectAttributes,"audit_failed");
}
}
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId;
} }
//修改VOIP account配置状态 //修改VOIP account配置状态
@@ -164,7 +190,19 @@ public class AvContentController extends BaseController {
public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
,RedirectAttributes redirectAttributes ,RedirectAttributes redirectAttributes
) { ) {
try {
avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,functionId); avContentCfgService.updateAvVoipAccountValid(isAudit,isValid,compileIds,functionId);
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.error("voip Account信息审核失败",e);
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("voip Account信息审核失败",e);
addMessage(redirectAttributes,"audit_failed");
}
}
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId;
} }
//修改VOIP IP配置审核状态 //修改VOIP IP配置审核状态
@@ -180,8 +218,16 @@ public class AvContentController extends BaseController {
try { try {
avContentCfgService.auditAvVoip(isAudit,isValid,functionId,id,auditTime); avContentCfgService.auditAvVoip(isAudit,isValid,functionId,id,auditTime);
} catch (MaatConvertException e) { } catch (MaatConvertException e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("VOIP配置下发失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("VOIP配置下发失败",e); logger.error("VOIP配置下发失败",e);
addMessage(redirectAttributes, e.getMessage()); addMessage(redirectAttributes,"audit_failed");
}
} }
} }
@@ -201,8 +247,15 @@ public class AvContentController extends BaseController {
try { try {
avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id,auditTime); avContentCfgService.auditAvVoipAccount(isAudit,isValid,functionId,id,auditTime);
} catch (MaatConvertException e) { } catch (MaatConvertException e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("VOIPAccount配置下发失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("VOIPAccount配置下发失败",e); logger.error("VOIPAccount配置下发失败",e);
addMessage(redirectAttributes, e.getMessage()); addMessage(redirectAttributes,"audit_failed");
}
} }
} }

View File

@@ -61,7 +61,7 @@ public class FileTransferCfgController extends BaseController{
} }
@RequestMapping(value = {"ftpForm"}) @RequestMapping(value = {"ftpForm"})
@RequiresPermissions(value={"fileTransfer:ftp:config"}) @RequiresPermissions(value={"fileTransfer:ftp:config"})
public String ftpForm(Model model,String ids,CfgIndexInfo entity) { public String ftpForm(Model model,String compileIds,String ids,CfgIndexInfo entity) {
if(StringUtils.isNotBlank(ids)){ if(StringUtils.isNotBlank(ids)){
entity = fileTransferCfgService.getFtpCfg(Long.parseLong(ids)); entity = fileTransferCfgService.getFtpCfg(Long.parseLong(ids));
initUpdateFormCondition(model,entity); initUpdateFormCondition(model,entity);
@@ -74,8 +74,21 @@ public class FileTransferCfgController extends BaseController{
@RequestMapping(value = {"saveFtpCfg"}) @RequestMapping(value = {"saveFtpCfg"})
@RequiresPermissions(value={"fileTransfer:ftp:config"}) @RequiresPermissions(value={"fileTransfer:ftp:config"})
public String saveFtpCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids, public String saveFtpCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
CfgIndexInfo entity) { CfgIndexInfo entity,RedirectAttributes redirectAttributes) {
try {
fileTransferCfgService.saveFtpCfg(entity); fileTransferCfgService.saveFtpCfg(entity);
addMessage(redirectAttributes,"save_success");
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.error("ftp信息保存失败",e);
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("ftp信息保存失败",e);
addMessage(redirectAttributes,"save_failed");
}
}
return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+entity.getFunctionId(); return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+entity.getFunctionId();
} }
@RequestMapping(value = {"ajaxFtpSubList"}) @RequestMapping(value = {"ajaxFtpSubList"})
@@ -100,15 +113,45 @@ public class FileTransferCfgController 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);
return "/cfg/fileTransfer/ftpSubList"; return "/cfg/fileTransfer/ftpSubList";
} }
/**
* 做删除操作
* @param isValid
* @param ids
* @param functionId
* @return
*/
@RequestMapping(value = {"updateFtpCfgValid"}) @RequestMapping(value = {"updateFtpCfgValid"})
@RequiresPermissions(value={"fileTransfer:ftp:config"}) @RequiresPermissions(value={"fileTransfer:ftp:config"})
public String updateFtpCfgValid(Integer isValid,String ids,Integer functionId) { public String updateFtpCfgValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
try {
fileTransferCfgService.updateFtpCfgValid(isValid,ids,functionId); fileTransferCfgService.updateFtpCfgValid(isValid,ids,functionId);
addMessage(redirectAttributes,"delete_success");
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("ftp配置删除失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("ftp配置删除失败",e);
addMessage(redirectAttributes,"delete_failed");
}
}
return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId; return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId;
} }
@RequestMapping(value = {"auditFtpCfg"}) @RequestMapping(value = {"auditFtpCfg"})
@@ -125,10 +168,17 @@ public class FileTransferCfgController extends BaseController{
entity.setFunctionId(functionId); entity.setFunctionId(functionId);
try { try {
fileTransferCfgService.auditFtpCfg(entity,isAudit); fileTransferCfgService.auditFtpCfg(entity,isAudit);
addMessage(redirectAttributes,"audit_success");
} catch (MaatConvertException e) { } catch (MaatConvertException e) {
if(e instanceof MaatConvertException) {
e.printStackTrace(); e.printStackTrace();
logger.info("ftp配置下发失败"+e.getMessage()); logger.info("ftp配置下发失败"+e.getMessage());;
addMessage(redirectAttributes, e.getMessage()); addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("ftp配置下发失败",e);
addMessage(redirectAttributes,"audit_failed");
}
} }
} }
return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId; return "redirect:" + adminPath +"/ntc/fileTransfer/ftpList?functionId="+functionId;

View File

@@ -1,7 +1,9 @@
package com.nis.web.controller.specific; package com.nis.web.controller.specific;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
@@ -18,7 +20,9 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.specific.SpecificServiceCfg; import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.util.DictUtils;
import com.nis.util.StringUtils; import com.nis.util.StringUtils;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
@@ -198,9 +202,29 @@ public class SpecificServiceCfgController extends BaseController {
map2.put("id", 0); map2.put("id", 0);
map2.put("pId", 0); map2.put("pId", 0);
map2.put("type",0); map2.put("type",0);
map2.put("business",-2);
map2.put("name","root_node"); map2.put("name","root_node");
//map2.put("placeholder","0"); //map2.put("placeholder","0");
mapList.add(map2); mapList.add(map2);
Properties props=this.getMsgProp();
List<SysDataDictionaryItem> businessTypeList=Lists.newArrayList();
if(cfgType==1) {
businessTypeList=DictUtils.getDictList("APP_BUSINESS_TYPE");
}else if(cfgType==3) {
businessTypeList=DictUtils.getDictList("BASIC_PROTOCOL_BUSINESS_TYPE");
}
List<Map<String, Object>> businessList = Lists.newArrayList();
for(SysDataDictionaryItem dict:businessTypeList) {
Map<String, Object> map = Maps.newHashMap();
map.put("id", "businessType"+dict.getItemCode());
map.put("pId", 0);
map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue()));
map.put("serviceType",cfgType);
map.put("businessType","-1");
map.put("nodes", new ArrayList<Map<String, Object>>());
businessList.add(map);
}
mapList.addAll(businessList);
List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),""); List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
for (int i=0; i<list.size(); i++){ for (int i=0; i<list.size(); i++){
SpecificServiceCfg specificServiceCfg = list.get(i); SpecificServiceCfg specificServiceCfg = list.get(i);
@@ -210,14 +234,57 @@ public class SpecificServiceCfgController extends BaseController {
(cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){ (cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){
continue; continue;
} }
if(businessTypeList.size()>0) {
for(SysDataDictionaryItem business:businessTypeList) {
if(String.valueOf(business.getItemCode()).equals(specificServiceCfg.getBusinessType())) {
Map<String, Object> map = Maps.newHashMap();
map.put("id", specificServiceCfg.getSpecServiceId());
map.put("pId", "businessType"+business.getItemCode());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("serviceType",specificServiceCfg.getCfgType());
map.put("businessType",specificServiceCfg.getBusinessType());
mapList.add(map);
break;
}
}
}else {
Map<String, Object> map = Maps.newHashMap(); Map<String, Object> map = Maps.newHashMap();
map.put("id", specificServiceCfg.getSpecServiceId()); map.put("id", specificServiceCfg.getSpecServiceId());
map.put("pId", specificServiceCfg.getParent().getSpecServiceId()); map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
map.put("name",specificServiceCfg.getSpecServiceName()); map.put("name",specificServiceCfg.getSpecServiceName());
map.put("type",specificServiceCfg.getCfgType()); map.put("serviceType",specificServiceCfg.getCfgType());
mapList.add(map); mapList.add(map);
} }
} }
}
// List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
//
// for (int i=0; i<list.size(); i++){
// SpecificServiceCfg specificServiceCfg = list.get(i);
// if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){
// if(specificServiceCfg.getIsValid().equals(0)||
// (!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))||
// (cfgType.intValue()!=0&&specificServiceCfg.getCfgType().intValue()!=cfgType)){
// continue;
// }
// for(Map<String, Object> business:businessList) {
// if(String.valueOf(business.get("id")).equals(specificServiceCfg.getBusinessType())) {
// Map<String, Object> map = Maps.newHashMap();
// map.put("id", specificServiceCfg.getSpecServiceId());
// map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
// map.put("name",specificServiceCfg.getSpecServiceName());
// map.put("type",specificServiceCfg.getCfgType());
// map.put("business",specificServiceCfg.getBusinessType());
// ((List<Map<String, Object>>)business.get("nodes")).add(map);
// break;
// }
// }
//
//
// }
// }
// map2.put("nodes", businessList);
return mapList; return mapList;
} }
/** /**

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" >
@@ -300,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" >
@@ -477,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}),'%')
@@ -1318,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" >
@@ -1607,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}

View File

@@ -209,6 +209,9 @@
<if test="cfgId != null"> <if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if> </if>
<if test="compileId != null">
AND r.compile_id=#{compileId,jdbcType=BIGINT}
</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}),'%')
</if> </if>

View File

@@ -23,6 +23,7 @@
<result column="lable" property="lable" jdbcType="VARCHAR" /> <result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" /> <result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<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="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" > <resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" /> <id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -260,6 +261,9 @@
<if test="functionId != null"> <if test="functionId != null">
AND a.function_id=#{functionId,jdbcType=INTEGER} AND a.function_id=#{functionId,jdbcType=INTEGER}
</if> </if>
<if test="doLog != null">
AND a.do_log=#{doLog,jdbcType=INTEGER}
</if>
<if test="ipPort!=null"> <if test="ipPort!=null">
AND a.compile_id in (select t.compile_id from ip_port_cfg t AND a.compile_id in (select t.compile_id from ip_port_cfg t
<where> <where>
@@ -279,6 +283,18 @@
</where> </where>
) )
</if> </if>
<if test="ntcSubscribeIdCfg != null">
AND r.compile_id in (select f.compile_id from ntc_subscribe_id_cfg f
<where>
<if test="ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != ''">
and f.cfg_keywords like concat(concat('%',#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
<if test="compileId != null">
and f.compile_id =#{compileId,jdbcType=INTEGER}
</if>
</where>
)
</if>
<!-- <if test="ftp!=null"> <!-- <if test="ftp!=null">
AND a.compile_id in (select f.compile_id from ftp_keyword_cfg f AND a.compile_id in (select f.compile_id from ftp_keyword_cfg f
<where> <where>

View File

@@ -12,6 +12,7 @@
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" /> <result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
<result column="group_id" property="groupId" jdbcType="INTEGER" /> <result column="group_id" property="groupId" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="INTEGER" /> <result column="cfg_type" property="cfgType" jdbcType="INTEGER" />
<result column="business_type" property="businessType" jdbcType="VARCHAR" />
<!-- 父id --> <!-- 父id -->
<association property="parent" javaType="com.nis.domain.specific.SpecificServiceCfg"> <association property="parent" javaType="com.nis.domain.specific.SpecificServiceCfg">
<id column="parent_id" property="specServiceId" jdbcType="INTEGER" /> <id column="parent_id" property="specServiceId" jdbcType="INTEGER" />
@@ -28,7 +29,8 @@
s.parent_id AS "parent.specServiceId", s.parent_id AS "parent.specServiceId",
s.is_leaf AS isLeaf, s.is_leaf AS isLeaf,
s.group_id AS groupId, s.group_id AS groupId,
s.cfg_type AS cfgType s.cfg_type AS cfgType,
s.business_type AS businessType
</sql> </sql>
@@ -73,6 +75,9 @@
<if test="cfgType != null and cfgType != '' "> <if test="cfgType != null and cfgType != '' ">
AND cfg_type =#{cfgType,jdbcType=INTEGER} AND cfg_type =#{cfgType,jdbcType=INTEGER}
</if> </if>
<if test="businessType != null and businessType != '' ">
AND business_type =#{businessType,jdbcType=VARCHAR}
</if>
<if test="beginDate != null" > <if test="beginDate != null" >
AND s.op_time &gt;= #{beginDate,jdbcType=TIMESTAMP} AND s.op_time &gt;= #{beginDate,jdbcType=TIMESTAMP}
</if> </if>
@@ -138,6 +143,9 @@
<if test="specificServiceCfg.isLeaf != null and specificServiceCfg.isLeaf != '' "> <if test="specificServiceCfg.isLeaf != null and specificServiceCfg.isLeaf != '' ">
AND is_leaf = #{specificServiceCfg.isLeaf} AND is_leaf = #{specificServiceCfg.isLeaf}
</if> </if>
<if test="specificServiceCfg.businessType != null and specificServiceCfg.businessType != '' ">
AND business_type =#{specificServiceCfg.businessType}
</if>
<if test="specificServiceCfg.beginDate != null"> <if test="specificServiceCfg.beginDate != null">
AND op_time &gt; #{specificServiceCfg.beginDate} AND op_time &gt; #{specificServiceCfg.beginDate}
</if> </if>
@@ -171,7 +179,8 @@
s.parent_id = #{parent.specServiceId}, s.parent_id = #{parent.specServiceId},
s.is_leaf = #{isLeaf}, s.is_leaf = #{isLeaf},
s.group_id = #{groupId}, s.group_id = #{groupId},
s.cfg_type = #{cfgType} s.cfg_type = #{cfgType},
s.business_type = #{businessType}
WHERE s.spec_service_id = #{specServiceId} WHERE s.spec_service_id = #{specServiceId}
</update> </update>

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,13 @@ public class AppCfgService extends BaseService {
} }
} }
} }
if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){
if(isAudit==1){
Map<String,List> ntcMap = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),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 +1093,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

@@ -54,7 +54,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
if(!StringUtil.isEmpty(compileIds)){ if(!StringUtil.isEmpty(compileIds)){
compileId = compileIds.get(0); compileId = compileIds.get(0);
} }
} catch (Exception e) { } catch (MaatConvertException e) {
e.printStackTrace(); e.printStackTrace();
logger.info("获取编译ID出错"); logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage()); throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
@@ -79,7 +79,7 @@ public class DomainService extends CrudService<DomainDao,HttpUrlCfg> {
} }
}else{ }else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>"); throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>: compileId is 0");
} }
} }

View File

@@ -43,6 +43,7 @@ import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao; import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.FileTransferCfgDao; import com.nis.web.dao.configuration.FileTransferCfgDao;
import com.nis.web.dao.configuration.MailCfgDao; import com.nis.web.dao.configuration.MailCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.security.UserUtils; import com.nis.web.security.UserUtils;
import com.nis.web.service.CrudService; import com.nis.web.service.CrudService;
@@ -59,6 +60,9 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
protected AreaIpCfgDao areaIpCfgDao; protected AreaIpCfgDao areaIpCfgDao;
@Autowired @Autowired
protected MailCfgDao mailCfgDao; protected MailCfgDao mailCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
public Page<CfgIndexInfo> getFtpList(Page<CfgIndexInfo> page, CfgIndexInfo entity){ public Page<CfgIndexInfo> getFtpList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL // 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
@@ -71,6 +75,13 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
CfgIndexInfo entity = fileTransferCfgDao.getCfgIndexInfo(cfgId); CfgIndexInfo entity = fileTransferCfgDao.getCfgIndexInfo(cfgId);
List<IpPortCfg> ipPortList = fileTransferCfgDao.getIpPortList(entity); List<IpPortCfg> ipPortList = fileTransferCfgDao.getIpPortList(entity);
List<BaseStringCfg> keywordList = fileTransferCfgDao.getFtpKeywordList(entity); List<BaseStringCfg> keywordList = fileTransferCfgDao.getFtpKeywordList(entity);
//设置关键字
if(entity.getCompileId()!=null){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
List<NtcSubscribeIdCfg> ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
entity.setNtcSubscribeIdCfgList(ntcList);
}
entity.setIpPortList(ipPortList); entity.setIpPortList(ipPortList);
entity.setStringList(keywordList); entity.setStringList(keywordList);
return entity; return entity;
@@ -83,6 +94,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
public void saveFtpCfg(CfgIndexInfo entity){ public void saveFtpCfg(CfgIndexInfo entity){
//设置区域运营商信息 //设置区域运营商信息
setAreaEffectiveIds(entity); setAreaEffectiveIds(entity);
entity.setIsValid(0);
entity.setIsAudit(0);
if(entity.getCfgId()==null){ if(entity.getCfgId()==null){
Integer compileId = 0; Integer compileId = 0;
try { try {
@@ -108,6 +121,15 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
} }
} }
} }
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
// entity.setNtcSubscribeIdCfg(cfg);
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()){
@@ -123,11 +145,19 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
} }
}else{ }else{
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
fileTransferCfgDao.updateCfgIndex(entity); fileTransferCfgDao.updateCfgIndex(entity);
//无效子配置后,再新增子配置 //无效子配置后,再新增子配置
fileTransferCfgDao.deleteFtpIpCfg(entity); fileTransferCfgDao.deleteFtpIpCfg(entity);
fileTransferCfgDao.deleteFtpKeywordCfg(entity); fileTransferCfgDao.deleteFtpKeywordCfg(entity);
fileTransferCfgDao.deleteFileDigestCfg(entity); fileTransferCfgDao.deleteFileDigestCfg(entity);
//删除关键字配置后再新增
if(entity!=null&&entity.getCompileId()!=null){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
stringCfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg);
}
AreaIpCfg area = new AreaIpCfg(); AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId()); area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId()); area.setFunctionId(entity.getFunctionId());
@@ -148,6 +178,14 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
} }
} }
} }
if(entity!=null&&entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(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()){
@@ -184,6 +222,14 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
cfg.setTableName(FtpKeywordCfg.getTablename()); cfg.setTableName(FtpKeywordCfg.getTablename());
fileTransferCfgDao.updateCfgValid(cfg); fileTransferCfgDao.updateCfgValid(cfg);
} }
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
{
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, ntc, new String[]{"cfgId"});
ntc.setTableName(ntc.getTablename());
stringCfgDao.updateSubscribeIdCfg(ntc);
}
//保存区域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();
@@ -237,6 +283,18 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
strRegionList=map.get("dstList"); strRegionList=map.get("dstList");
} }
} }
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
{
NtcSubscribeIdCfg ntc = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, ntc, new String[]{"cfgId"});
ntc.setTableName(ntc.getTablename());
stringCfgDao.updateSubscribeIdCfg(ntc);
if(isAudit==1){
Map<String,List> ntcMap = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=ntcMap.get("groupList");
strRegionList=ntcMap.get("dstList");
}
}
if(entity.getDigestList()!=null && entity.getDigestList().size()>0){ if(entity.getDigestList()!=null && entity.getDigestList().size()>0){
FileDigestCfg cfg = new FileDigestCfg(); FileDigestCfg cfg = new FileDigestCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});

View File

@@ -66,7 +66,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
if(!StringUtil.isEmpty(compileIds)){ if(!StringUtil.isEmpty(compileIds)){
compileId = compileIds.get(0); compileId = compileIds.get(0);
} }
} catch (Exception e) { } catch (MaatConvertException e) {
e.printStackTrace(); e.printStackTrace();
logger.info("获取编译ID出错"); logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage()); throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
@@ -86,7 +86,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
} }
ipCfgDao.insert(cfg); ipCfgDao.insert(cfg);
}else{ }else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>"); throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>: compileId is 0");
} }
} }

View File

@@ -3,8 +3,6 @@ package com.nis.web.service.specific;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -13,9 +11,7 @@ import com.beust.jcommander.internal.Lists;
import com.nis.domain.Page; import com.nis.domain.Page;
import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.domain.specific.SpecificServiceCfg; import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.main.ConvertTool;
import com.nis.util.ConfigServiceUtil; import com.nis.util.ConfigServiceUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.specific.SpecificServiceCfgDao; import com.nis.web.dao.specific.SpecificServiceCfgDao;
import com.nis.web.service.BaseService; import com.nis.web.service.BaseService;

View File

@@ -617,7 +617,7 @@ val_dst_ip=Server IP format is incorrect or inconsistent with IP type
val_dst_mask=Server IP mask format is incorrect or inconsistent with IP type val_dst_mask=Server IP mask format is incorrect or inconsistent with IP type
val_dst_port=Server port is empty or incorrectly formatting(0-65535) val_dst_port=Server port is empty or incorrectly formatting(0-65535)
val_dst_port_mask=Server port mask format is incorrect(0-65535) val_dst_port_mask=Server port mask format is incorrect(0-65535)
val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4efb\u610f) val_protocol=Protocol Can't be empty,and should be 6(TCP),17(UDP),0(\u4EFB\u610F)
val_direction=Direction should be 0(bidirectional) or 1(unidirectional) val_direction=Direction should be 0(bidirectional) or 1(unidirectional)
#===============protocol IP Import end================= #===============protocol IP Import end=================
@@ -1089,3 +1089,4 @@ file_desc=File Desc
content_type=Content Type content_type=Content Type
content_length=Content Length content_length=Content Length
response_file=Response File response_file=Response File
APP_SUBSCRIBE_ID=Certification Mark Configuration

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
ALTER TABLE specific_service_cfg ADD COLUMN business_type VARCHAR(10) NULL COMMENT '业务分类';

View File

@@ -55,30 +55,43 @@
}else{ }else{
nodes = tree.getSelectedNodes(); nodes = tree.getSelectedNodes();
} }
for(var i=0; i<nodes.length; i++) {//<c:if test="${checked && notAllowSelectParent}"> //wx提示c:if标签前加了//注释,c:if标签的判断条件仍会生效
for(var i=0; i<nodes.length; i++) {
//<c:if test="${checked && notAllowSelectParent}">
if (nodes[i].isParent && "${checkedPS}"!=''){ if (nodes[i].isParent && "${checkedPS}"!=''){
continue; // 如果为复选框选择,并且父子节点有关联,则过滤掉父节点 continue; // 如果为复选框选择,并且父子节点有关联,则过滤掉父节点
}//</c:if><c:if test="${notAllowSelectRoot}"> }//</c:if>
//<c:if test="${notAllowSelectRoot}">
if (nodes[i].level == 0){ if (nodes[i].level == 0){
top.$.jBox.tip("<spring:message code='no_root'/>"+nodes[i].name+"<spring:message code='reselect'/>"); top.$.jBox.tip("<spring:message code='no_root'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false; return false;
}//</c:if><c:if test="${notAllowSelectParent}"> }//</c:if>
//<c:if test="${notAllowSelectParent}">
if (nodes[i].isParent){ if (nodes[i].isParent){
top.$.jBox.tip("<spring:message code='no_parent'/>"+nodes[i].name+"<spring:message code='reselect'/>"); top.$.jBox.tip("<spring:message code='no_parent'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false; return false;
}//</c:if><c:if test="${not empty module && selectScopeModule}"> }
//wx: 带有business属性的节点特殊处理
if(nodes[i].businessType&&nodes[i].businessType==-1){
top.$.jBox.tip("<spring:message code='no_parent'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false;
}
//</c:if>
//<c:if test="${not empty module && selectScopeModule}">
if (nodes[i].module == ""){ if (nodes[i].module == ""){
top.$.jBox.tip("<spring:message code='no_public_model'/>"+nodes[i].name+"<spring:message code='reselect'/>"); top.$.jBox.tip("<spring:message code='no_public_model'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false; return false;
}else if (nodes[i].module != "${module}"){ }else if (nodes[i].module != "${module}"){
top.$.jBox.tip("<spring:message code='no_outside_column'/><spring:message code='reselect'/>"); top.$.jBox.tip("<spring:message code='no_outside_column'/><spring:message code='reselect'/>");
return false; return false;
}//</c:if><c:if test="${selectDepartment}"> }//</c:if>
//<c:if test="${selectDepartment}">
if (nodes[i].name=="<spring:message code='send_org'/>" || nodes[i].name=="<spring:message code='department'/>" ||nodes[i].name=="<spring:message code='sendind_org'/>"){ if (nodes[i].name=="<spring:message code='send_org'/>" || nodes[i].name=="<spring:message code='department'/>" ||nodes[i].name=="<spring:message code='sendind_org'/>"){
top.$.jBox.tip("<spring:message code='no_node'/>"+nodes[i].name+"<spring:message code='reselect'/>"); top.$.jBox.tip("<spring:message code='no_node'/>"+nodes[i].name+"<spring:message code='reselect'/>");
return false; return false;
}//</c:if> }//</c:if>
ids.push(nodes[i].id);//<c:if test="${showParentName}"> ids.push(nodes[i].id);
//<c:if test="${showParentName}">
if (nodes[i].id != null ){ if (nodes[i].id != null ){
$.ajax({ $.ajax({
type:"post", type:"post",
@@ -98,23 +111,16 @@
}); });
}//</c:if><c:if test="${!showParentName}"> }//</c:if>
//<c:if test="${!showParentName}">
names.push(nodes[i].name); names.push(nodes[i].name);
//if(nodes[i].type){ //</c:if>
// types.push(nodes[i].type); //<c:if test="${!checked}">
//} break; // 如果为非复选框选择,则返回第一个选择
//</c:if><c:if test="${!checked}"> //</c:if>
break; // 如果为非复选框选择,则返回第一个选择 </c:if>
} }
if((nodes.length==1)&&(nodes[0].level == 0)&&('true'=='${notAllowSelectRoot}')){
top.$.jBox.tip("<spring:message code='no_root'/>"+nodes[0].name+"<spring:message code='reselect'/>");
return false;
}
$("#${id}Id").val(ids.join(",").replace(/u_/ig,"")); $("#${id}Id").val(ids.join(",").replace(/u_/ig,""));
//if(types.length>0){
// $("#${id}Id").attr('cfgtype',types.join(","));
//}
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到 $("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val(names.join(",")); $("#${id}Name").val(names.join(","));
if(!$("#${id}Name").val()&&'${value}'){//如果值不存在但是value却有值将placeholder清空 if(!$("#${id}Name").val()&&'${value}'){//如果值不存在但是value却有值将placeholder清空
@@ -122,7 +128,6 @@
} }
}else if (v == "clear"){ }else if (v == "clear"){
$("#${id}Id").val(""); $("#${id}Id").val("");
//$("#${id}Id").removeAttr('cfgtype');
$("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到 $("#${id}Id").change();//手动触发change事件使Id的值得变化可以被监听到
$("#${id}Name").val(""); $("#${id}Name").val("");
$("#${id}Name").attr("placeholder",""); $("#${id}Name").attr("placeholder","");

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title> <title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#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"));
}); });
@@ -85,7 +82,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6"> <div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}" labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/> cssClass="form-control required"/>
@@ -145,6 +142,25 @@ $(function(){
<div for="bytes"></div> <div for="bytes"></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:forEach items="${regionList}" var="region"> <c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}"> <c:if test="${_cfg.functionId eq region.functionId}">

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.bytes}"){ }else if("${cfg.bytes}"){
$("#intype").val("${cfg.bytes}"); $("#intype").val("${cfg.bytes}");
}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());
} }
@@ -87,8 +89,8 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set> <c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/> cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn"> <div class="input-group-btn">
<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="bytes"><spring:message code="bytes"></spring:message></form:option> <form:option value="bytes"><spring:message code="bytes"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -257,8 +260,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <!-- /筛选搜索内容栏 结束-->
@@ -275,6 +276,7 @@
<th><spring:message code="whether_hexbinary"/></th> <th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th> <th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th> <th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th> <%-- <th><spring:message code="block_type"/></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>
@@ -313,6 +315,11 @@
<td> <td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC"> <c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if> <c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach> </c:forEach>
</td> </td>
<%-- <td> <%-- <td>

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title> <title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#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"));
}); });
@@ -84,7 +81,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6"> <div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}" labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/> cssClass="form-control required"/>
@@ -145,6 +142,25 @@ $(function(){
<div for="domain"></div> <div for="domain"></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:forEach items="${regionList}" var="region"> <c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}"> <c:if test="${_cfg.functionId eq region.functionId}">

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.domain}"){ }else if("${cfg.domain}"){
$("#intype").val("${cfg.domain}"); $("#intype").val("${cfg.domain}");
}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());
} }
@@ -87,8 +89,8 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set> <c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/> cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn"> <div class="input-group-btn">
<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="domain"><spring:message code="domain"></spring:message></form:option> <form:option value="domain"><spring:message code="domain"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -257,8 +260,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <!-- /筛选搜索内容栏 结束-->
@@ -275,6 +276,7 @@
<th><spring:message code="whether_hexbinary"/></th> <th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th> <th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th> <th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th> <%-- <th><spring:message code="block_type"/></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>
@@ -313,6 +315,11 @@
<td> <td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC"> <c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if> <c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach> </c:forEach>
</td> </td>
<%-- <td> <%-- <td>

View File

@@ -96,7 +96,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6"> <div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}" labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/> cssClass="form-control required"/>

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfgKeywords}"){ }else if("${cfg.cfgKeywords}"){
$("#intype").val("${cfg.cfgKeywords}"); $("#intype").val("${cfg.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());
} }
@@ -87,8 +89,8 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set> <c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/> cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn"> <div class="input-group-btn">
<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="cfgKeywords"><spring:message code="keywords"></spring:message></form:option> <form:option value="cfgKeywords"><spring:message code="keywords"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -257,8 +260,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <!-- /筛选搜索内容栏 结束-->

View File

@@ -5,9 +5,6 @@
<title><spring:message code="${cfgName}"></spring:message></title> <title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#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"));
}); });
@@ -99,7 +96,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6"> <div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}" labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/> cssClass="form-control required"/>
@@ -173,6 +170,25 @@ $(function(){
</div> </div>
</div> </div>
</c:if> </c:if>
<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>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfgKeywords}"){ }else if("${cfg.cfgKeywords}"){
$("#intype").val("${cfg.cfgKeywords}"); $("#intype").val("${cfg.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());
} }
@@ -87,8 +89,8 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set> <c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/> cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn"> <div class="input-group-btn">
<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="cfgKeywords"><spring:message code="keywords"></spring:message></form:option> <form:option value="cfgKeywords"><spring:message code="keywords"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -258,7 +261,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <!-- /筛选搜索内容栏 结束-->
@@ -276,6 +278,7 @@
<th><spring:message code="whether_hexbinary"/></th> <th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th> <th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th> <th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th> <%-- <th><spring:message code="block_type"/></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>
@@ -320,6 +323,11 @@
<td> <td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC"> <c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if> <c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach> </c:forEach>
</td> </td>
<%-- <td> <%-- <td>

View File

@@ -5,7 +5,10 @@
<title><spring:message code="${cfgName}"></spring:message></title> <title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
initCommIpVal(); //initCommIpVal();
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({ $("#cfgFrom").validate({
errorPlacement: function(error,element){ errorPlacement: function(error,element){
@@ -75,7 +78,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6"> <div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}" labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/> cssClass="form-control required"/>
@@ -181,6 +184,28 @@ $(function(){
</div> </div>
</div> </div>
</div> </div>
<!-- doLog -->
<div class="row">
<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 class="row hidden"> <div class="row hidden">
<div class="col-md-6"> <div class="col-md-6">
<div class="form-group"> <div class="form-group">

View File

@@ -14,6 +14,8 @@
$("#intype").val("${cfg.destPort}"); $("#intype").val("${cfg.destPort}");
} else if("${cfg.cfgDesc}"){ } else if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
} 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());
} }
@@ -90,8 +92,8 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set> <c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/> cssClass="form-control input-small"/>
@@ -103,6 +105,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" > <form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="destIpAddress"><spring:message code="server_ip"></spring:message></form:option> <form:option value="destIpAddress"><spring:message code="server_ip"></spring:message></form:option>
<form:option value="destPort"><spring:message code="server_port"></spring:message></form:option> <form:option value="destPort"><spring:message code="server_port"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<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:select> </form:select>
@@ -262,7 +265,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <!-- /筛选搜索内容栏 结束-->
@@ -281,6 +283,7 @@
<th><spring:message code="server_ip"/></th> <th><spring:message code="server_ip"/></th>
<th><spring:message code="server_port"/></th> <th><spring:message code="server_port"/></th>
<th><spring:message code="protocol"/></th> <th><spring:message code="protocol"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th> --%> <%-- <th><spring:message code="block_type"/></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>
@@ -320,6 +323,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:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict"> <c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq cfg.action }"> <c:if test="${dict.itemCode eq cfg.action }">

View File

@@ -199,7 +199,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6"> <div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}" labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0"
notAllowSelectRoot="true" cssClass="form-control required"/> notAllowSelectRoot="true" cssClass="form-control required"/>

View File

@@ -130,8 +130,8 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set> <c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/> cssClass="form-control input-small"/>

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

@@ -96,7 +96,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label> <label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6"> <div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}" labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/> cssClass="form-control required"/>

View File

@@ -12,6 +12,8 @@
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.cfgKeywords}"){ }else if("${cfg.cfgKeywords}"){
$("#intype").val("${cfg.cfgKeywords}"); $("#intype").val("${cfg.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());
} }
@@ -87,8 +89,8 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set> <c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/> cssClass="form-control input-small"/>
@@ -98,8 +100,9 @@
<div class="input-group-btn"> <div class="input-group-btn">
<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="cfgKeywords"><spring:message code="keywords"></spring:message></form:option> <form:option value="cfgKeywords"><spring:message code="keywords"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -257,8 +260,6 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <!-- /筛选搜索内容栏 结束-->

View File

@@ -5,7 +5,10 @@
<title><spring:message code="${cfgName}"></spring:message></title> <title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
initCommIpVal(); $(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId")); $("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({ $("#cfgFrom").validate({

View File

@@ -5,7 +5,11 @@
<title><spring:message code="${cfgName}"></spring:message></title> <title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
initCommIpVal(); //initCommIpVal();
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId")); $("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({ $("#cfgFrom").validate({

View File

@@ -27,6 +27,8 @@
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){ }else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}"); $("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else if("${cfg.voipAccount.cfgKeywords}"){ }else if("${cfg.voipAccount.cfgKeywords}"){
$("#intype").val("${cfg.voipAccount.cfgKeywords}"); $("#intype").val("${cfg.voipAccount.cfgKeywords}");
}else{ }else{
@@ -360,6 +362,7 @@
<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"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="account"/></form:option> <form:option value="voipAccount.cfgKeywords"><spring:message code="account"/></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option> <form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
</form:select> </form:select>
@@ -533,6 +536,7 @@
<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="block_type"/></th> <th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th> <th><spring:message code="do_log"/></th>
@@ -559,6 +563,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span> <span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" compileId="${indexCfg.compileId}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" compileId="${indexCfg.compileId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td> <td>${indexCfg.cfgDesc }</td>
<td> <td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict"> <c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">

View File

@@ -13,14 +13,13 @@
$(document) $(document)
.ready( .ready(
function() { function() {
initCommIpVal();
/* $("#cancel").on("click", function() { /* $("#cancel").on("click", function() {
window.history.back(); 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"));
}); */ });
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId")); $("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate( $("#cfgFrom").validate(

View File

@@ -27,6 +27,8 @@
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.voipIp.srcIpAddress}"){ }else if("${cfg.voipIp.srcIpAddress}"){
$("#intype").val("${cfg.voipIp.srcIpAddress}"); $("#intype").val("${cfg.voipIp.srcIpAddress}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else if("${cfg.voipIp.srcPort}"){ }else if("${cfg.voipIp.srcPort}"){
$("#intype").val("${cfg.voipIp.srcPort}"); $("#intype").val("${cfg.voipIp.srcPort}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){ }else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
@@ -426,6 +428,7 @@
<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"/></form:option>
<form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option> <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option> <form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option> <form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
@@ -601,6 +604,7 @@
<tr> <tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th> <th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th> <th class="cfgDesc"><spring:message code="config_describe"/></th>
<th style="display: none"><spring:message code="cfg_id"/></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="do_log"/></th>
<th><spring:message code="whether_area_block"/></th> <th><spring:message code="whether_area_block"/></th>
@@ -626,6 +630,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span> <span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" compileId="${indexCfg.compileId}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" compileId="${indexCfg.compileId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td> <td>${indexCfg.cfgDesc }</td>
<td> <td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict"> <c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">

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,27 @@ 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">
<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 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">
@@ -203,6 +249,49 @@ var delContent = function(contentClassName, addBtnClassName) {
</div> </div>
</c:if> </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 test="${region.regionType eq 1 }"> <c:if test="${region.regionType eq 1 }">
<h4 class="form-section"> <h4 class="form-section">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set> <c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>

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());
} }
@@ -31,6 +35,7 @@
$(".Wdate").attr("value",''); $(".Wdate").attr("value",'');
$("#level").attr("value",''); $("#level").attr("value",'');
$("#searchForm")[0].reset(); $("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}); });
//异步获取策略ip相关信息 //异步获取策略ip相关信息
$("span[id^=open]").click(function(){ $("span[id^=open]").click(function(){
@@ -130,7 +135,7 @@
<div class="pull-left"> <div class="pull-left">
<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>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
@@ -142,6 +147,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="APP_SUBSCRIBE_ID"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -311,11 +318,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 +348,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 +360,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}">

View File

@@ -9,7 +9,245 @@ $(function(){
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId")); $("#protocolId").val($(".action:checked").attr("protocolId"));
} }
initCommIpVal(); //initCommIpVal();
var serviceType=$("input[name='cfgRegionCode']").attr("serviceType");
if(serviceType){
if(serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']:checked").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType&&serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
$(".areaInfo").addClass("hidden");
}else{
$(".areaInfo").removeClass("hidden");
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($("input[name$='action']").val()==64||$("input[name$='action']:checked").val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
}
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
var actionCode=$(this).val();
var regionCode=$(this).attr("regionCode");
if(!regionCode){
regionCode=$("input[name='action']").attr("regionCode");
}
if(regionCode){
if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType");
$("[id^='cfgRegionCode']").each(function(){
if($(this).attr("id")==("cfgRegionCode"+regionCode)){
$(this).attr("name","cfgRegionCode");
}else{
$(this).removeAttr("name");
}
});
$("[id^='cfgType']").each(function(){
if($(this).attr("id")==("cfgType"+regionCode)){
$(this).attr("name","cfgType");
}else{
$(this).removeAttr("name");
}
});
}else{
var _region='';
var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){
if($(this).val()==regionArr[re]){
serviceType=$(this).attr("serviceType");
_region=regionArr[re];
break;
}
}
});
if(_region!=''){
regionCode=_region;
}
}
var ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
//ip端口处理
if(ipPortShow){
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
$("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden");
$("input[name$='srcPort']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden");
$("input[name$='srcPort']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口
$("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden");
$("input[name$='destPort']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='destIpAddress']").parents(".form-group").addClass("hidden");
$("input[name$='destPort']").parents(".form-group").addClass("hidden");
}
}
if(ipType){
var arr=ipType.split(',');
$("select[name$='ipType'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='ipType']").selectpicker("refresh");
}
if(ipPattern){
arr=ipPattern.split(',');
$("select[name$='ipPattern'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='ipPattern']").selectpicker("refresh");
}
if(portPattern){
arr=portPattern.split(',');
$("select[name$='portPattern'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='portPattern']").selectpicker("refresh");
}
if(direction){
arr=direction.split(',');
$("select[name$='direction'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='direction']").selectpicker("refresh");
}
if(protocol){
arr=protocol.split(',');
$("select[name$='protocol'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
//处理自定义字段
var serviceType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("serviceType");
if(serviceType){
if(serviceType.indexOf("ipaddr")>-1){
if($(this).val()==32){
$("select[name$='protocol'] option[value='1']").removeAttr("disabled")
}else{
$("select[name$='protocol'] option[value='1']").attr("disabled",true);
}
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
}else{
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($(this).val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
if($(this).val()==0x20||$(this).val()==0x60){
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
}
}
}
});
$("#ipCfgFrom").validate({ $("#ipCfgFrom").validate({
errorPlacement: function(error,element){ errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error); $(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);

View File

@@ -5,14 +5,14 @@
<title><spring:message code="${cfgName}"></spring:message></title> <title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
initCommIpVal(); //initCommIpVal();
/* $("#cancel").on("click",function(){ /* $("#cancel").on("click",function(){
window.history.back(); 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"));
}); */ });
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId")); $("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({ $("#cfgFrom").validate({

View File

@@ -5,9 +5,10 @@
<title><spring:message code="encrypted_tunnel_behavior"></spring:message></title> <title><spring:message code="encrypted_tunnel_behavior"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
$("#cancel").on("click",function(){ initCommIpVal();
/* $("#cancel").on("click",function(){
window.history.back(); 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"));
@@ -181,6 +182,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<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">
@@ -231,6 +233,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">
@@ -245,6 +248,26 @@ var delContent = function(contentClassName, addBtnClassName) {
<div for="action"></div> <div for="action"></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 class="col-md-6" id="ratelimit"> <div class="col-md-6" 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>
@@ -254,9 +277,50 @@ var delContent = function(contentClassName, addBtnClassName) {
<div for="ratelimit"></div> <div for="ratelimit"></div>
</div> </div>
</div> </div>
</div> </div>
</c:if> </c:if>
<!-- 关键字 -->
<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 test="${region.regionType eq 1 }"> <c:if test="${region.regionType eq 1 }">
<h4 class="form-section"> <h4 class="form-section">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set> <c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
@@ -285,6 +349,7 @@ var delContent = function(contentClassName, addBtnClassName) {
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</c:if> </c:if>
</c:forEach> </c:forEach>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %> <%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %> <%@include file="/WEB-INF/include/form/basicInfo.jsp" %>

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

@@ -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());
} }
@@ -31,6 +35,7 @@
$(".Wdate").attr("value",''); $(".Wdate").attr("value",'');
$("#level").attr("value",''); $("#level").attr("value",'');
$("#searchForm")[0].reset(); $("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}); });
//异步获取策略ip相关信息 //异步获取策略ip相关信息
$("span[id^=open]").click(function(){ $("span[id^=open]").click(function(){
@@ -130,7 +135,7 @@
<div class="pull-left"> <div class="pull-left">
<c:set var="spec_service_id"><spring:message code="encrypted_tunnel_behavior"/></c:set> <c:set var="spec_service_id"><spring:message code="encrypted_tunnel_behavior"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}" <sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" labelName="parent.specServiceName"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}" labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="" title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
@@ -142,6 +147,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="APP_SUBSCRIBE_ID"></spring:message></form:option>
</form:select> </form:select>
</div> </div>
@@ -311,11 +318,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="encrypted_tunnel_behavior"/></th> <th><spring:message code="encrypted_tunnel_behavior"/></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 +348,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 +360,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}">

View File

@@ -11,9 +11,6 @@ $(function(){
$("#file").on('change',function(){ $("#file").on('change',function(){
$("#fileInfo").val($("#file").val()); $("#fileInfo").val($("#file").val());
}); });
$("#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"));
}); });

View File

@@ -13,7 +13,7 @@
$(document) $(document)
.ready( .ready(
function() { function() {
initCommIpVal(); // initCommIpVal();
/* $("#cancel").on("click", function() { /* $("#cancel").on("click", function() {
window.history.back(); window.history.back();
}); });
@@ -191,6 +191,28 @@
</div> </div>
</div> </div>
</div> </div>
<!-- dolog begin-->
<div class="row">
<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>
<c:set var="ipCfgIndex" value="0"></c:set> <c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set> <c:set var="strCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status"> <c:forEach items="${regionList}" var="region" varStatus="status">
@@ -226,6 +248,7 @@
<!--/ip info--> <!--/ip info-->
</c:if> </c:if>
<c:if test="${region.regionType eq 2 }"> <c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'keywords' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set> <c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section"> <h4 class="form-section">
<spring:message code="${region.configRegionValue}" /> <spring:message code="${region.configRegionValue}" />
@@ -264,6 +287,48 @@
</c:otherwise> </c:otherwise>
</c:choose> </c:choose>
</c:if> </c:if>
<!-- 关键字 -->
<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:forEach> </c:forEach>
<br> <br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> <%@include file="/WEB-INF/include/form/areaInfo.jsp"%>

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());
} }
@@ -31,6 +35,7 @@
$(".Wdate").attr("value",''); $(".Wdate").attr("value",'');
$("#level").attr("value",''); $("#level").attr("value",'');
$("#searchForm")[0].reset(); $("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}); });
//异步获取voip相关信息 //异步获取voip相关信息
$("span[id^=open]").click(function(){ $("span[id^=open]").click(function(){
@@ -132,6 +137,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="APP_SUBSCRIBE_ID"></spring:message></form:option>
<%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option> <%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option> <form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option> <form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
@@ -305,8 +312,10 @@
<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="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>
@@ -330,6 +339,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span> <span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td> <td>${indexCfg.cfgDesc }</td>
<td> <td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict"> <c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
@@ -338,6 +348,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="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if> <c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}"> <c:if test="${indexCfg.isAreaEffective==1}">

View File

@@ -172,6 +172,59 @@
</div> </div>
</c:if> </c:if>
</c:forEach> </c:forEach>
<!-- subscribe_id-->
<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:if>
<%-- <c:if test="${region[0] eq 5 }"> <%-- <c:if test="${region[0] eq 5 }">
<c:forEach items="${_cfg.digestList}" var="cfg"> <c:forEach items="${_cfg.digestList}" var="cfg">

View File

@@ -9,6 +9,8 @@
//搜索框提示语初始化 //搜索框提示语初始化
if("${cfg.cfgDesc}"){ if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}"); $("#intype").val("${cfg.cfgDesc}");
}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());
} }
@@ -132,6 +134,7 @@
<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="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option> <%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option> <form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option> <form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
@@ -306,6 +309,7 @@
<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="block_type"/></th> <th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th> <th><spring:message code="do_log"/></th>
@@ -332,6 +336,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span> <span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}"> <input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td> </td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td> <td>${indexCfg.cfgDesc }</td>
<td> <td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict"> <c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">

View File

@@ -13,14 +13,14 @@
$(document) $(document)
.ready( .ready(
function() { function() {
initCommIpVal(); //initCommIpVal();
/* $("#cancel").on("click", function() { /* $("#cancel").on("click", function() {
window.history.back(); 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"));
}); */ });
$("#serviceId").val($(".action:checked").attr("serviceId")); $("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId")); $("#protocolId").val($(".action:checked").attr("protocolId"));

View File

@@ -5,38 +5,6 @@
<title><spring:message code="domain_whitelist"></spring:message></title> <title><spring:message code="domain_whitelist"></spring:message></title>
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
switchIpType($("select[name$='ipType']"));
areaControlInit();
$("input[name='isAreaEffective']").on('change',function(){
var val=$(this).val();
if(val==1){
$(".areaType").removeClass("hidden");
if($("input[name='areaType']:checked").val()==1){//areaISP
$("#areaIsp").removeClass("hidden");
}else if($("input[name='areaType']:checked").val()==0){//areaIp
$("#areaIp").removeClass("hidden");
}
}else{
$(".areaType").addClass("hidden");
$("#areaIp").addClass("hidden");
$("#areaIsp").addClass("hidden");
}
});
$("input[name='areaType']").on('change',function(){
var val=$(this).val();
if($(this).is(":visible")){
if(val==0){
$("#areaIp").removeClass("hidden");
$("#areaIsp").addClass("hidden");
}else{
$("#areaIsp").removeClass("hidden");
$("#areaIp").addClass("hidden");
}
}else{
$("#areaIsp").addClass("hidden");
$("#areaIp").addClass("hidden");
}
});
$(".action").on("change",function(){ $(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId")); $("#serviceId").val($(this).attr("serviceId"));
}); });
@@ -50,12 +18,6 @@ $(function(){
}, },
errorContainer: "#messageBox", errorContainer: "#messageBox",
}); });
$("select[name$='ipType']").on("change",function(){
switchIpType($(this));
});
$("#cancel").on("click",function(){
window.history.back();
});
}); });
</script> </script>
</head> </head>

View File

@@ -6,7 +6,9 @@
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
switchIpInfo($("select[name$='ipType']"),"ipType"); switchIpInfo($("select[name$='ipType']"),"ipType");
initCommIpVal(); $(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});
$("#ipCfgFrom").validate({ $("#ipCfgFrom").validate({
errorPlacement: function(error,element){ errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error); $(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);

View File

@@ -6,6 +6,7 @@
P2P<spring:message code="log"></spring:message> P2P<spring:message code="log"></spring:message>
</title> </title>
<script> <script>
$(document).ready(function() { $(document).ready(function() {
//reset //reset
$("#resetBtn").on("click",function(){ $("#resetBtn").on("click",function(){
@@ -48,15 +49,27 @@
<!-- 搜索内容与操作按钮栏 --> <!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12"> <div class="col-md-12">
<div class="pull-left"> <div class="pull-left">
<select path="action" class="selectpicker select2 input-small"> <select id="action" path="action" class="selectpicker select2 input-small">
<option value=""><spring:message code="action"/></option>
<c:forEach items="${serviceList}" var="service" <c:set var="actionIndex" value="0"></c:set>
varStatus="satus"> <c:forEach items="${serviceList}" var="service" varStatus="satus">
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict"> <c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${(dict.itemCode eq service.action) && (service.action ne 128) && (service.action ne 32)}"> --%> <c:if test="${(dict.itemCode eq service.action) && (service.action ne 128) && (service.action ne 32)}">
<c:set var="actionIndex" value="${actionIndex+1}"></c:set>
</c:if>
</c:forEach>
</c:forEach>
<c:if test="${ (actionIndex > 1) || (actionIndex == 0) }">
<option value=""><spring:message code="action"/></option>
</c:if>
<c:forEach items="${serviceList}" var="service" varStatus="satus">
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${(dict.itemCode eq service.action) && (service.action ne 128) && (service.action ne 32)}">
<option value="${dict.itemCode}" <option value="${dict.itemCode}"
<c:if test="${log.action eq dict.itemCode}"> <c:if test="${log.action eq dict.itemCode}">
selected selected="selected"
</c:if> </c:if>
> >
<spring:message code="${dict.itemValue}"/> <spring:message code="${dict.itemValue}"/>

View File

@@ -81,6 +81,14 @@
$(this).addClass("hidden"); $(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name"); $(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name"); $(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}else{
var cfgType=$(this).attr("cfgType");
if("${specificServiceCfg.parent.specServiceId}"&& "${specificServiceCfg.parent.specServiceId}"!="0"){
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}else{
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}
} }
}); });
$(".protocol_code").html('<font color="red">*</font><spring:message code="app_code"/>:'); $(".protocol_code").html('<font color="red">*</font><spring:message code="app_code"/>:');
@@ -92,6 +100,15 @@
$(this).addClass("hidden"); $(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name"); $(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name"); $(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
}else{
var cfgType=$(this).attr("cfgType");
if("${specificServiceCfg.parent.specServiceId}"&& "${specificServiceCfg.parent.specServiceId}"!="0"){
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}else{
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}
} }
}); });
if($("[name='cfgType']").val()==1){ if($("[name='cfgType']").val()==1){
@@ -113,13 +130,25 @@
$("[name=cfgType]").val(cfgType); $("[name=cfgType]").val(cfgType);
$(".cfgType").each(function(){ $(".cfgType").each(function(){
if($(this).attr("cfgType")==cfgType){ if($(this).attr("cfgType")==cfgType){
$(this).removeClass("hidden");
$("#specificServiceCfg"+cfgType+"Id").attr("name","parent.specServiceId"); $("#specificServiceCfg"+cfgType+"Id").attr("name","parent.specServiceId");
$("#specificServiceCfg"+cfgType+"Name").attr("name","parent.specServiceName"); $("#specificServiceCfg"+cfgType+"Name").attr("name","parent.specServiceName");
$("#businessType"+cfgType).attr("name","businessType");
if($(this).hasClass("businessType")){
var parentId=$("#specificServiceCfg"+cfgType+"Id").val();
if(parentId!=0){
$(this).addClass("hidden");
}else{
$(this).removeClass("hidden");
}
}else{
$(this).removeClass("hidden");
}
}else{ }else{
$(this).addClass("hidden"); $(this).addClass("hidden");
$(this).find("[name='parent.specServiceId']").removeAttr("name"); $(this).find("[name='parent.specServiceId']").removeAttr("name");
$(this).find("[name='parent.specServiceName']").removeAttr("name"); $(this).find("[name='parent.specServiceName']").removeAttr("name");
$(this).find("[name='businessType']").removeAttr("name");
} }
}); });
if(cfgType==1){ if(cfgType==1){
@@ -136,6 +165,15 @@
$(".protocol_desc").html('<spring:message code="protocol_desc"/>:'); $(".protocol_desc").html('<spring:message code="protocol_desc"/>:');
} }
}); });
$("#specificServiceCfg1Id,#specificServiceCfg2Id,#specificServiceCfg3Id").on("change",function(){
var cfgType=$(this).parents(".cfgType").attr("cfgType");
if($(this).val()==0){
$("#businessType"+cfgType).parents(".businessType").removeClass("hidden");
}else{
$("#businessType"+cfgType).selectpicker("val","");
$("#businessType"+cfgType).parents(".businessType").addClass("hidden");
}
});
}); });
</script> </script>
</head> </head>
@@ -197,6 +235,49 @@
</div> </div>
<div for="parent.specServiceName"></div> <div for="parent.specServiceName"></div>
</div> </div>
<div class="form-group cfgType businessType
<c:if test='${specificServiceCfg.parent.specServiceId ne null or specificServiceCfg.parent.specServiceId ne 0}'>hidden</c:if>" cfgType="${dict.itemCode}">
<c:if test="${dict.itemCode==1}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="app_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType1" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<c:if test="${dict.itemCode==3}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="basic_protocol_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType3" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<c:if test="${dict.itemCode==2}">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="tunnel_behavior_business_type"/>:</label>
<div class="col-md-4">
<select id="businessType2" name="businessType" class="form-control required">
<option value=""><spring:message code="select"/></option>
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE')}" var="dict">
<option value="${dict.itemCode}"
<c:if test="${dict.itemCode==specificServiceCfg.businessType or (specificServiceCfg.parent.specServiceId eq null or specificServiceCfg.parent.specServiceId eq 0)}">selected</c:if>
><spring:message code="${dict.itemValue}"/></option>
</c:forEach>
</select>
</div>
</c:if>
<div for="businessType"></div>
</div>
</c:forEach> </c:forEach>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label protocol_code"><font color="red">*</font><spring:message code="protocol_code"/>:</label> <label class="col-md-3 control-label protocol_code"><font color="red">*</font><spring:message code="protocol_code"/>:</label>
@@ -219,6 +300,7 @@
</div> </div>
<div for="groupId"></div> <div for="groupId"></div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label> <label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label>
<div class="col-md-4"> <div class="col-md-4">
@@ -248,7 +330,7 @@
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-9"> <div class="col-md-offset-3 col-md-9">
<shiro:hasPermission name="specific:service:edit"><button type="submit" class="btn btn-circle blue"><spring:message code="submit"/></button></shiro:hasPermission> <shiro:hasPermission name="specific:service:edit"><button type="submit" class="btn btn-circle blue"><spring:message code="submit"/></button></shiro:hasPermission>
<button type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"/></button> <button type="button" class="btn btn-circle grey-salsa btn-outline" id="cancel" ><spring:message code="cancel"/></button>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -213,32 +213,44 @@
<!-- 筛选搜索内容栏默认隐藏--> <!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" > <div class="col-md-12 filter-action-select-panle hide" >
<div class="row"> <div class="row">
<div class="col-md-2"> <div class="col-md-2">
<div class="form-group"> <div class="form-group">
<label><spring:message code="operate_time"/></label> <label><spring:message code="operate_time"/></label>
<input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate" <input id="beginDate" name="beginDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${specificServiceCfg.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> value="<fmt:formatDate value="${specificServiceCfg.beginDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div> </div>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<div class="form-group"> <div class="form-group">
<label>&nbsp;</label> <label>&nbsp;</label>
<input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate" <input id="endDate" name="endDate" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${specificServiceCfg.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> value="<fmt:formatDate value="${specificServiceCfg.endDate}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div> </div>
</div> </div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="business_type"/></label>
<form:select path="businessType" class="selectpicker select2 input-middle" >
<form:option value=""><spring:message code='business_type'/></form:option>
<c:if test="${specificServiceCfg.cfgType==1}">
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==2}">
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==3}">
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE') }" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}'/></form:option>
</c:forEach>
</c:if>
</form:select>
</div>
</div>
</div> </div>
</div> </div>
<!-- /筛选搜索内容栏 结束--> <!-- /筛选搜索内容栏 结束-->
@@ -258,6 +270,7 @@
<tr> <tr>
<th><input type="checkbox" class="ckboxs" id="selAll" onclick="selectAll()"></th> <th><input type="checkbox" class="ckboxs" id="selAll" onclick="selectAll()"></th>
<!-- <th>序号</th> --> <!-- <th>序号</th> -->
<th><spring:message code="business_type"/></th>
<th><spring:message code="protocol_code"/></th> <th><spring:message code="protocol_code"/></th>
<th><spring:message code="protocol_name"/></th> <th><spring:message code="protocol_name"/></th>
<th><spring:message code="protocol_desc"/></th> <th><spring:message code="protocol_desc"/></th>
@@ -272,6 +285,29 @@
<tr id="${specificServiceCfg.specServiceId}" pId="${specificServiceCfg.parent.specServiceId ne 0?specificServiceCfg.parent.specServiceId:0}"> <tr id="${specificServiceCfg.specServiceId}" pId="${specificServiceCfg.parent.specServiceId ne 0?specificServiceCfg.parent.specServiceId:0}">
<td><input type="checkbox" class="ckbox" name="check" value="${specificServiceCfg.specServiceId}"></td> <td><input type="checkbox" class="ckbox" name="check" value="${specificServiceCfg.specServiceId}"></td>
<%-- <td>${specificServiceCfg.showSequence}</td> --%> <%-- <td>${specificServiceCfg.showSequence}</td> --%>
<td title="${specificServiceCfg.businessType}">
<c:if test="${specificServiceCfg.cfgType==1}">
<c:forEach items="${fns:getDictList('APP_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==2}">
<c:forEach items="${fns:getDictList('TUNNEL_BEHAV_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
<c:if test="${specificServiceCfg.cfgType==3}">
<c:forEach items="${fns:getDictList('BASIC_PROTOCOL_BUSINESS_TYPE') }" var="dict">
<c:if test="${specificServiceCfg.businessType==dict.itemCode}">
<spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</c:if>
</td>
<td nowrap><i class="icon-icon-tablet"></i><%--<a href="${ctx}/specific/specificServiceCfg/form?specServiceId=${specificServiceCfg.specServiceId}&doAction=0">--%>${specificServiceCfg.specServiceCode}<%--</a>--%></td> <td nowrap><i class="icon-icon-tablet"></i><%--<a href="${ctx}/specific/specificServiceCfg/form?specServiceId=${specificServiceCfg.specServiceId}&doAction=0">--%>${specificServiceCfg.specServiceCode}<%--</a>--%></td>
<td title="${specificServiceCfg.specServiceName}">${specificServiceCfg.specServiceName}</td> <td title="${specificServiceCfg.specServiceName}">${specificServiceCfg.specServiceName}</td>
<td title="${specificServiceCfg.specServiceDesc}">${fns:abbr(specificServiceCfg.specServiceDesc,15)}</td> <td title="${specificServiceCfg.specServiceDesc}">${fns:abbr(specificServiceCfg.specServiceDesc,15)}</td>

View File

@@ -202,6 +202,13 @@ jQuery.validator.addMethod("domainCheck",function(value, element) {
//ip地址校验 //ip地址校验
jQuery.validator.addMethod("ipCheck",function(value, element) { jQuery.validator.addMethod("ipCheck",function(value, element) {
var ipv4_ip_subnet_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\/(3[0-2]|[1-2][0-9]|[0-9])$/;
var ipv6_ip_subnet_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))\/(0|2|4|8|16|32|64|128)$/;
var ipv4_ip_range_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)-(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/;
var ipv6_ip_range_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))$/;
var ipv4_ip_regexp=/^(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|[1-9])\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)\.(0|1\d{2}|2[0-4]\d|25[0-5]|[1-9]\d|\d)$/;
var ipv6_ip_regexp=/^((::)|(([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:)|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}(:[0-9A-Fa-f]{1,4}){1,2})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){1,3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){1,4})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){1,5})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){1,6})|(:(:[0-9A-Fa-f]{1,4}){1,7})|(([0-9A-Fa-f]{1,4}:){6}(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|([0-9A-Fa-f]{1,4}:(:[0-9A-Fa-f]{1,4}){0,4}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3})|(:(:[0-9A-Fa-f]{1,4}){0,5}:(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])(\.(\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])){3}))$/;
if(value.length==0||value.trim().length==0){return true;} if(value.length==0||value.trim().length==0){return true;}
var typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val(); var typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val();
var ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val(); var ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val();
@@ -239,17 +246,24 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
if(ipPattern){ if(ipPattern){
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){ if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){
if(ipv4_ip_subnet_regexp.test(value)){
return true; return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}
}else if(RegExp.$5&&RegExp.$5>32){ }else if(RegExp.$5&&RegExp.$5>32){
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange; $.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
return false; return false;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ipMask; $.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
} }
}else if(ipPattern==2){//ip range }else if(ipPattern==2){//ip range
//A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0 //A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0
//B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0 //B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0
//C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0 //C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0
if(ipv4_ip_range_regexp.test(value)){
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){ if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1; var startPart0= RegExp.$1;
var startPart1= RegExp.$5; var startPart1= RegExp.$5;
@@ -269,12 +283,15 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipRange1; $.validator.messages.ipCheck=$.validator.messages.ipRange1;
return false; return false;
} }
}else{ }else{
return false; return false;
} }
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
}else if(ipPattern==3){//ip格式 }else if(ipPattern==3){//ip格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){ if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
@@ -282,7 +299,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
} }
}else{//兼容原来的验证 }else{//兼容原来的验证
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){ if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
@@ -291,7 +308,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
}else if(typeInt==6){ }else if(typeInt==6){
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/.test(value))){ if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true; return true;
}else if(value.indexOf("/")==-1){ }else if(value.indexOf("/")==-1){
$.validator.messages.ipCheck=$.validator.messages.ipMask; $.validator.messages.ipCheck=$.validator.messages.ipMask;
@@ -302,7 +319,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipMask; $.validator.messages.ipCheck=$.validator.messages.ipMask;
return false; return false;
}else{ }else{
if(!/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(ipMaskArr[0])){ if(!ipv6_ip_regexp.test(ipMaskArr[0])){
$.validator.messages.ipCheck=$.validator.messages.ipPart; $.validator.messages.ipCheck=$.validator.messages.ipPart;
return false; return false;
}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ }else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
@@ -316,9 +333,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
}else if(ipPattern==2){//ip range }else if(ipPattern==2){//ip range
$.validator.messages.ipCheck=$.validator.messages.ipRange; $.validator.messages.ipCheck=$.validator.messages.ipRange;
var _exp="\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*"; if(ipv6_ip_range_regexp.test(value)){
var exp=new RegExp("^"+_exp+"-"+_exp+"$","");
if(exp.test(value)){
var ipArr=value.split("-"); var ipArr=value.split("-");
var startIp=fillIp(ipArr[0]); var startIp=fillIp(ipArr[0]);
var endIp=fillIp(ipArr[1]); var endIp=fillIp(ipArr[1]);
@@ -330,14 +345,14 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
return false; return false;
}else if(ipPattern==3){//ip格式 }else if(ipPattern==3){//ip格式
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(value)){ if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
return false; return false;
} }
}else{//兼容原来的验证 }else{//兼容原来的验证
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$/.test(value)){ if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
@@ -350,7 +365,12 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
console.log("client ip must ipv4"); console.log("client ip must ipv4");
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){ if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){
if(ipv4_ip_subnet_regexp.test(value)){
return true; return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}
}else if(RegExp.$5&&RegExp.$5>32){ }else if(RegExp.$5&&RegExp.$5>32){
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange; $.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
return false; return false;
@@ -362,6 +382,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
//A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0 //A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0
//B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0 //B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0
//C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0 //C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0
if(ipv4_ip_range_regexp.test(value)){
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){ if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1; var startPart0= RegExp.$1;
var startPart1= RegExp.$5; var startPart1= RegExp.$5;
@@ -386,8 +407,12 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
return false; return false;
} }
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
}else if(ipPattern==3){//ip }else if(ipPattern==3){//ip
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){ if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
@@ -397,7 +422,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
}else if(name.indexOf("destIpAddress")>-1){ }else if(name.indexOf("destIpAddress")>-1){
console.log("server ip must ipv6"); console.log("server ip must ipv6");
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/.test(value))){ if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true; return true;
}else if(value.indexOf("/")==-1){ }else if(value.indexOf("/")==-1){
$.validator.messages.ipCheck=$.validator.messages.ipMask; $.validator.messages.ipCheck=$.validator.messages.ipMask;
@@ -408,7 +433,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipMask; $.validator.messages.ipCheck=$.validator.messages.ipMask;
return false; return false;
}else{ }else{
if(!/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(ipMaskArr[0])){ if(!ipv6_ip_regexp.test(ipMaskArr[0])){
$.validator.messages.ipCheck=$.validator.messages.ipPart; $.validator.messages.ipCheck=$.validator.messages.ipPart;
return false; return false;
}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ }else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
@@ -422,9 +447,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
}else if(ipPattern==2){//ip range }else if(ipPattern==2){//ip range
$.validator.messages.ipCheck=$.validator.messages.ipRange; $.validator.messages.ipCheck=$.validator.messages.ipRange;
var _exp="\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*"; if(ipv6_ip_range_regexp.test(value)){
var exp=new RegExp("^"+_exp+"-"+_exp+"$","");
if(exp.test(value)){
var ipArr=value.split("-"); var ipArr=value.split("-");
var startIp=fillIp(ipArr[0]); var startIp=fillIp(ipArr[0]);
var endIp=fillIp(ipArr[1]); var endIp=fillIp(ipArr[1]);
@@ -436,14 +459,14 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
return false; return false;
}else if(ipPattern==3){//ip格式 }else if(ipPattern==3){//ip格式
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(value)){ if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
return false; return false;
} }
}else{//兼容原来的验证 }else{//兼容原来的验证
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$/.test(value)){ if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
@@ -456,7 +479,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
if(name.indexOf("srcIpAddress")>-1){ if(name.indexOf("srcIpAddress")>-1){
console.log("client ip must ipv6"); console.log("client ip must ipv6");
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/.test(value))){ if(this.optional(element)||ipv6_ip_subnet_regexp.test(value)){
return true; return true;
}else if(value.indexOf("/")==-1){ }else if(value.indexOf("/")==-1){
$.validator.messages.ipCheck=$.validator.messages.ipMask; $.validator.messages.ipCheck=$.validator.messages.ipMask;
@@ -467,7 +490,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ipMask; $.validator.messages.ipCheck=$.validator.messages.ipMask;
return false; return false;
}else{ }else{
if(!/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(ipMaskArr[0])){ if(!ipv6_ip_regexp.test(ipMaskArr[0])){
$.validator.messages.ipCheck=$.validator.messages.ipPart; $.validator.messages.ipCheck=$.validator.messages.ipPart;
return false; return false;
}else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){ }else if(!/^(0|2|4|8|16|32|64|128)$/.test(ipMaskArr[1])){
@@ -481,9 +504,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
}else if(ipPattern==2){//ip range }else if(ipPattern==2){//ip range
$.validator.messages.ipCheck=$.validator.messages.ipRange; $.validator.messages.ipCheck=$.validator.messages.ipRange;
var _exp="\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*"; if(ipv6_ip_range_regexp.test(value)){
var exp=new RegExp("^"+_exp+"-"+_exp+"$","");
if(exp.test(value)){
var ipArr=value.split("-"); var ipArr=value.split("-");
var startIp=fillIp(ipArr[0]); var startIp=fillIp(ipArr[0]);
var endIp=fillIp(ipArr[1]); var endIp=fillIp(ipArr[1]);
@@ -495,14 +516,14 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
return false; return false;
}else if(ipPattern==3){//ip格式 }else if(ipPattern==3){//ip格式
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:)|((:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/.test(value)){ if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
return false; return false;
} }
}else{//兼容原来的验证 }else{//兼容原来的验证
if(this.optional(element)||/^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$/.test(value)){ if(this.optional(element)||ipv6_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
@@ -513,7 +534,12 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
console.log("server ip must ipv4"); console.log("server ip must ipv4");
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){ if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\/(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5<=32))){
if(ipv4_ip_subnet_regexp.test(value)){
return true; return true;
}else{
$.validator.messages.ipCheck=$.validator.messages.ipMask;
return false;
}
}else if(RegExp.$5&&RegExp.$5>32){ }else if(RegExp.$5&&RegExp.$5>32){
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange; $.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
return false; return false;
@@ -525,6 +551,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
//A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0 //A类 0.0.0.0-127.255.255.255 默认掩码255.0.0.0
//B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0 //B类128.0.0.0-191.255.255.255 默认掩码255.255.0.0
//C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0 //C类192.0.0.0-223.255.255.255 默认掩码255.255.255.0
if(ipv4_ip_range_regexp.test(value)){
if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){ if(/^(\d+)\.(\d+)\.(\d+)\.(\d+)\-(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value)&&(RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256 && RegExp.$5 <256 && RegExp.$6<256 && RegExp.$7<256 && RegExp.$8<256)){
var startPart0= RegExp.$1; var startPart0= RegExp.$1;
var startPart1= RegExp.$5; var startPart1= RegExp.$5;
@@ -549,8 +576,12 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
return false; return false;
} }
}else{
$.validator.messages.ipCheck=$.validator.messages.ipRange;
return false;
}
}else if(ipPattern==3){//ip }else if(ipPattern==3){//ip
if(this.optional(element)||(/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(value) && (RegExp.$1 <256 && RegExp.$2<256 && RegExp.$3<256 && RegExp.$4<256))){ if(this.optional(element)||ipv4_ip_regexp.test(value)){
return true; return true;
}else{ }else{
$.validator.messages.ipCheck=$.validator.messages.ip; $.validator.messages.ipCheck=$.validator.messages.ip;
@@ -559,12 +590,6 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
} }
} }
}else if(typeInt==10){ }else if(typeInt==10){
var ipv4_ip_subnet_regexp=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}\/(3[0-2]|[1-2][0-9]|[0-9])$/;
var ipv6_ip_subnet_regexp=/^\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*\/(0|2|4|8|16|32|64|128)$/;
var ipv4_ip_range_regexp=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}-(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/;
var ipv6_ip_range_regexp=/^\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*-\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/;
var ipv4_ip_regexp=/^(25[0-5]|2[0-4]\d|[0-1]?\d?\d)(\.(25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}$/;
var ipv6_ip_regexp=/^\s*((([0-9A-Fa-f]{1,4}\:){7}(([0-9A-Fa-f]{1,4})|\:))|(([0-9A-Fa-f]{1,4}\:){6}(\:|(\:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}\:){5}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){4}(\:[0-9A-Fa-f]{1,4}){0,1}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){3}(\:[0-9A-Fa-f]{1,4}){0,2}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:){2}(\:[0-9A-Fa-f]{1,4}){0,3}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}\:)(\:[0-9A-Fa-f]{1,4}){0,4}((\:?)|((\:[0-9A-Fa-f]{1,4}){1,2})))|(\:(\:[0-9A-Fa-f]{1,4}){0,5}((\:)|((\:[0-9A-Fa-f]{1,4}){1,2}))))(%.+)?\s*$/;
if(ipPattern){ if(ipPattern){
if(ipPattern==1){//ip/掩码格式 if(ipPattern==1){//ip/掩码格式
if(ipv4_ip_subnet_regexp.test(value)){ if(ipv4_ip_subnet_regexp.test(value)){

View File

@@ -358,219 +358,8 @@ $(function(){
} }
}); });
$(".action").on("change", function() { $(".action").on("change", function() {
//DNS REJECT 时选择dnsStrategyId
var action=$("input[name='action']:checked").val();
switchAction(action);
//拦截根据action切换动作部分
setInterceptDefaultInfo("");
//dolog 白名单默认不显示,不记录日志
if(action == 128 || action == 32){
$(".doLog").addClass("hidden");
$("input[name='doLog'][value=0]").prop("checked",true);
}else{
$(".doLog").removeClass("hidden");
$("input[name='doLog'][value=2]").prop("checked",true);
}
$("#serviceId").val($(this).attr("serviceId")); $("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId")); $("#protocolId").val($(this).attr("protocolId"));
var actionCode=$(this).val();
var regionCode=$(this).attr("regionCode");
if(!regionCode){
regionCode=$("input[name='action']").attr("regionCode");
}
if(regionCode){
if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType");
$("[id^='cfgRegionCode']").each(function(){
if($(this).attr("id")==("cfgRegionCode"+regionCode)){
$(this).attr("name","cfgRegionCode");
}else{
$(this).removeAttr("name");
}
});
$("[id^='cfgType']").each(function(){
if($(this).attr("id")==("cfgType"+regionCode)){
$(this).attr("name","cfgType");
}else{
$(this).removeAttr("name");
}
});
}else{
var _region='';
var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){
if($(this).val()==regionArr[re]){
serviceType=$(this).attr("serviceType");
_region=regionArr[re];
break;
}
}
});
if(_region!=''){
regionCode=_region;
}
}
var ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
//ip端口处理
if(ipPortShow){
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
$("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden");
$("input[name$='srcPort']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden");
$("input[name$='srcPort']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口
$("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden");
$("input[name$='destPort']").parents(".form-group").removeClass("hidden");
}else{
$("input[name$='destIpAddress']").parents(".form-group").addClass("hidden");
$("input[name$='destPort']").parents(".form-group").addClass("hidden");
}
}
if(ipType){
var arr=ipType.split(',');
$("select[name$='ipType'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='ipType']").selectpicker("refresh");
}
if(ipPattern){
arr=ipPattern.split(',');
$("select[name$='ipPattern'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='ipPattern']").selectpicker("refresh");
}
if(portPattern){
arr=portPattern.split(',');
$("select[name$='portPattern'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='portPattern']").selectpicker("refresh");
}
if(direction){
arr=direction.split(',');
$("select[name$='direction'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='direction']").selectpicker("refresh");
}
if(protocol){
arr=protocol.split(',');
$("select[name$='protocol'] option").each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
if($(this).attr("disabled")){
$(this).removeAttr("disabled")
}
break;
}
}
if(!has){
$(this).attr("disabled",true);
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
//处理自定义字段
var serviceType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("serviceType");
if(serviceType){
if(serviceType.indexOf("ipaddr")>-1){
if($(this).val()==32){
$("select[name$='protocol'] option[value='1']").removeAttr("disabled")
}else{
$("select[name$='protocol'] option[value='1']").attr("disabled",true);
}
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
}else{
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($(this).val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
if($(this).val()==0x20||$(this).val()==0x60){
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
}
}
}
}); });
//选择hex cfgkeywords需校验十六进制 //选择hex cfgkeywords需校验十六进制
$("select[name$='isHexbin']").each(function(){ $("select[name$='isHexbin']").each(function(){
@@ -642,6 +431,7 @@ $(function(){
window.history.back(); window.history.back();
return false; return false;
}); });
initCommIpVal();
}); });
window.onload=function(){ window.onload=function(){
//日志查询IP类型增加格式提示 //日志查询IP类型增加格式提示
@@ -1474,6 +1264,9 @@ var validateInvisibleCharTag=function(){
} }
return true; return true;
} }
/**
* ip默认选项处理
*/
var initCommIpVal=function(){ var initCommIpVal=function(){
var regionCode,serviceType,ipPortShow,ipType, var regionCode,serviceType,ipPortShow,ipType,
ipPattern,portPattern,direction,protocol,regionType; ipPattern,portPattern,direction,protocol,regionType;
@@ -1486,14 +1279,12 @@ var initCommIpVal=function(){
if(regionCode.indexOf(",")==-1){ if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode"); $("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType"); $("#cfgType"+regionCode).attr("name","cfgType");
serviceType=$("input[name$='cfgRegionCode'][regionType='1'][value='"+regionCode+"']").attr("serviceType");
}else{ }else{
var _region=''; var _region='';
var regionArr=regionCode.split(','); var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){ $("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){ for(var re in regionArr){
if($(this).val()==regionArr[re]){ if($(this).val()==regionArr[re]){
serviceType=$(this).attr("serviceType");
_region=regionArr[re]; _region=regionArr[re];
break; break;
} }
@@ -1504,45 +1295,7 @@ var initCommIpVal=function(){
} }
} }
} }
if(serviceType){ if(regionCode){//IP域大于1个根据action获取ip属性
if(serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']:checked").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType&&serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']").val()==32){
$("select[name$='protocol'] option").each(function(){
if($(this).attr("value")==1){
$(this).removeAttr("disabled");
}
});
$("select[name$='protocol']").selectpicker("refresh");
}
if(serviceType.indexOf("ipmulitiplex")>-1){
$(".ipmulitiplex").removeClass("hidden");
$("input[name$='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
$(".areaInfo").addClass("hidden");
}else{
$(".areaInfo").removeClass("hidden");
$(".ipmulitiplex").addClass("hidden");
}
if(serviceType.indexOf("ratelimit")>-1){
if($("input[name$='action']").val()==64||$("input[name$='action']:checked").val()==64){
$(".ratelimit").removeClass("hidden");
}else{
$(".ratelimit").addClass("hidden");
}
}else{
$(".ratelimit").addClass("hidden");
}
}
ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"), ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"), ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"), ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
@@ -1550,6 +1303,15 @@ var initCommIpVal=function(){
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"), direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"), protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType"); regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
}else{//IP域只有一个获取regionType为1的
ipPortShow=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPortShow"),
ipType=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipType"),
ipPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("ipPattern"),
portPattern=$("input[name$='cfgRegionCode'][regionType='1']").attr("portPattern"),
direction=$("input[name$='cfgRegionCode'][regionType='1']").attr("direction"),
protocol=$("input[name$='cfgRegionCode'][regionType='1']").attr("protocol"),
regionType=$("input[name$='cfgRegionCode'][regionType='1']").attr("regionType");
}
//ip端口处理 //ip端口处理
if(ipPortShow){ if(ipPortShow){
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口 if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
@@ -1567,6 +1329,7 @@ var initCommIpVal=function(){
$("input[name$='destPort']").parents(".form-group").addClass("hidden"); $("input[name$='destPort']").parents(".form-group").addClass("hidden");
} }
} }
//ip类型处理
if(ipType){ if(ipType){
var arr=ipType.split(','); var arr=ipType.split(',');
$("select[name$='ipType'] option").each(function(){ $("select[name$='ipType'] option").each(function(){
@@ -1585,6 +1348,7 @@ var initCommIpVal=function(){
} }
}); });
} }
//ip格式处理
if(ipPattern){ if(ipPattern){
arr=ipPattern.split(','); arr=ipPattern.split(',');
$("select[name$='ipPattern'] option").each(function(){ $("select[name$='ipPattern'] option").each(function(){
@@ -1603,6 +1367,7 @@ var initCommIpVal=function(){
} }
}); });
} }
//端口格式处理
if(portPattern){ if(portPattern){
arr=portPattern.split(','); arr=portPattern.split(',');
$("select[name$='portPattern'] option").each(function(){ $("select[name$='portPattern'] option").each(function(){
@@ -1621,6 +1386,7 @@ var initCommIpVal=function(){
} }
}); });
} }
//方向处理
if(direction){ if(direction){
arr=direction.split(','); arr=direction.split(',');
$("select[name$='direction'] option").each(function(){ $("select[name$='direction'] option").each(function(){
@@ -1639,6 +1405,7 @@ var initCommIpVal=function(){
} }
}); });
} }
//协议处理
if(protocol){ if(protocol){
arr=protocol.split(','); arr=protocol.split(',');
$("select[name$='protocol'] option").each(function(){ $("select[name$='protocol'] option").each(function(){
@@ -1657,5 +1424,4 @@ var initCommIpVal=function(){
} }
}); });
} }
return regionCode;
} }