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

Conflicts:
	src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp
ip_payload功能新增
This commit is contained in:
duandongmei
2018-09-30 10:01:52 +08:00
84 changed files with 2932 additions and 1130 deletions

View File

@@ -27,7 +27,7 @@ public class IpMultiplexPoolCfg extends BaseCfg<IpMultiplexPoolCfg> {
private Integer protocol;
@Expose
@SerializedName("ip")
private String srcIpAddress;
private String destIpAddress;
@Expose
private String port;
@Expose
@@ -58,11 +58,12 @@ public class IpMultiplexPoolCfg extends BaseCfg<IpMultiplexPoolCfg> {
this.protocol = protocol;
}
public String getSrcIpAddress() {
return srcIpAddress;
public String getDestIpAddress() {
return destIpAddress;
}
public void setSrcIpAddress(String srcIpAddress) {
this.srcIpAddress = srcIpAddress;
public void setDestIpAddress(String destIpAddress) {
this.destIpAddress = destIpAddress;
}
public String getPort() {
return port;

View File

@@ -47,9 +47,8 @@ public class IpMultiplexPoolCfgController extends BaseController {
}
//查询ip复用地址池配置的policyGroup列表
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(2);
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(3);
model.addAttribute("policyGroups", policyGroups);
model.addAttribute("_cfg", cfg);
return "/cfg/maintenance/ipMultiplexPool/form";
}
@@ -92,7 +91,6 @@ public class IpMultiplexPoolCfgController extends BaseController {
}catch(Exception e){
addMessage(redirectAttributes,"delete_failed");
}
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
}
@@ -125,4 +123,89 @@ public class IpMultiplexPoolCfgController extends BaseController {
return true;
}
}
@RequestMapping(value = {"/snatlist"})
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
//查询时left join policyGroup
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
model.addAttribute("page", page);
initPageCondition(model,entity);
return "/cfg/maintenance/ipMultiplexPool/snatlist";
}
@RequestMapping(value = {"/snatform"})
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
public String snatfrom(Model model,
HttpServletRequest request,
HttpServletResponse response,
String ids,
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
if(cfg == null){
cfg=new IpMultiplexPoolCfg();
}
if(!StringUtil.isEmpty(ids)){
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
initFormCondition(model, cfg);
}else{
initFormCondition(model, cfg);
}
//查询ip复用地址池配置的policyGroup列表
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(2);
model.addAttribute("policyGroups", policyGroups);
model.addAttribute("_cfg", cfg);
return "/cfg/maintenance/ipMultiplexPool/snatform";
}
@RequestMapping(value = {"/snatsaveOrUpdate"})
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
public String snatsaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
try{
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
addMessage(redirectAttributes,"save_success");
}catch(Exception e){
e.printStackTrace();
addMessage(redirectAttributes,"save_failed");
}
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId();
}
@RequestMapping(value = {"/snataudit"})
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
if(!StringUtil.isEmpty(ids)){
String[] idArray = ids.split(",");
Date auditTime=new Date();
for(String id :idArray){
try {
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
} catch (MaatConvertException e) {
e.printStackTrace();
logger.info("SNAT地址池管理配置下发失败"+e.getMessage());
addMessage(redirectAttributes, e.getMessage());
}
}
}
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
}
@RequestMapping(value = {"/snatdelete"})
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
public String snatdelete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
,HttpServletRequest request,HttpServletResponse response){
try{
if(!StringUtil.isEmpty(ids)){
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
}
addMessage(redirectAttributes,"delete_success");
}catch(Exception e){
addMessage(redirectAttributes,"delete_failed");
}
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
}
}

View File

@@ -3,7 +3,6 @@ package com.nis.web.controller.configuration.ntc;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -13,7 +12,6 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
@@ -22,27 +20,22 @@ import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.SysUser;
import com.nis.domain.basics.ServiceDictInfo;
import com.nis.domain.basics.SysDictInfo;
import com.nis.domain.configuration.AreaBean;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.AvContIpCfg;
import com.nis.domain.configuration.AvVoipAccountCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.domain.configuration.AvVoipIpCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.util.Configurations;
import com.nis.util.Constants;
import com.nis.util.DateUtils;
import com.nis.util.StringUtil;
import com.nis.util.excel.ExportExcel;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
/**
* 处理音视频文本业务
@@ -55,11 +48,11 @@ public class AvContentController extends BaseController {
/*****************************voip业务***************/
//音视频VOIP IP配置新增界面
@RequestMapping(value = {"/voipForm"})
@RequiresPermissions(value={"avVoipIp:config"})
@RequiresPermissions(value={"avVoip:config"})
public String voipFrom(Model model,HttpServletRequest request ,HttpServletResponse response
,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
if(!StringUtil.isEmpty(compileIds)){
cfg.setCompileId(Integer.parseInt(compileIds));
if(!StringUtil.isEmpty(ids)){
cfg.setCfgId(Long.parseLong(ids));
cfg = avContentCfgService.getCfgIndexInfo(cfg);
initUpdateFormCondition(model, cfg);
}else{
@@ -70,7 +63,7 @@ public class AvContentController extends BaseController {
return "/cfg/av/voip/voipForm";
}
//音视频VOIP Account配置新增界面
@RequestMapping(value = {"/voipAccountForm"})
/* @RequestMapping(value = {"/voipAccountForm"})
@RequiresPermissions(value={"avVoipAccount:config"})
public String voipAccountForm(Model model,HttpServletRequest request ,HttpServletResponse response
,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
@@ -85,7 +78,7 @@ public class AvContentController extends BaseController {
model.addAttribute("_cfg", cfg);
return "/cfg/av/voip/voipAccountForm";
}
}*/
//保存voip ip信息
@RequestMapping(value = {"/saveVoip"})
@@ -97,18 +90,18 @@ public class AvContentController extends BaseController {
}catch(Exception e){
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.error("voip IP信息保存失败",e);
logger.error("voip 信息保存失败",e);
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("voip IP信息保存失败",e);
logger.error("voip 信息保存失败",e);
addMessage(redirectAttributes,"save_failed");
}
}
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId();
}
//保存voip Account信息
@RequestMapping(value = {"/saveAccountVoip"})
/* @RequestMapping(value = {"/saveAccountVoip"})
public String saveAccountVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids,
CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){
try{
@@ -126,12 +119,10 @@ public class AvContentController extends BaseController {
}
}
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId();
}
//视频文本VOIP IP配置列表
}*/
//视频文本VOIP 配置列表
@RequestMapping(value = {"/voipList"})
public String voipCfgList(Model model,HttpServletRequest request
,HttpServletResponse response
,@ModelAttribute("cfg")CfgIndexInfo entity
public String voipCfgList(Model model,HttpServletRequest request ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity
,RedirectAttributes redirectAttributes){
if(entity.getVoipIp()== null){
entity.setVoipIp(new AvVoipIpCfg());
@@ -148,7 +139,7 @@ public class AvContentController extends BaseController {
return "/cfg/av/voip/voipList";
}
//视频文本VOIP Account配置列表
@RequestMapping(value = {"/voipAccountList"})
/* @RequestMapping(value = {"/voipAccountList"})
public String voipCfgAccountList(Model model,HttpServletRequest request ,HttpServletResponse response
,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){
if(entity.getVoipAccount()== null){
@@ -161,12 +152,12 @@ public class AvContentController extends BaseController {
model.addAttribute("page", page);
initPageCondition(model,entity);
return "/cfg/av/voip/voipAccountList";
}
}*/
//修改VOIP IP配置状态
@RequestMapping(value = {"/updateAvVoipValid"})
@RequiresPermissions(value={"avVoipIp:config"})
@RequiresPermissions(value={"avVoip:config"})
public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
,RedirectAttributes redirectAttributes
) {
@@ -175,18 +166,18 @@ public class AvContentController extends BaseController {
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.error("voip IP信息审核失败",e);
logger.error("voip 信息审核失败",e);
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("voip IP信息审核失败",e);
logger.error("voip 信息审核失败",e);
addMessage(redirectAttributes,"audit_failed");
}
}
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId;
}
//修改VOIP account配置状态
@RequestMapping(value = {"/updateAvVoipAccountValid"})
/* @RequestMapping(value = {"/updateAvVoipAccountValid"})
@RequiresPermissions(value={"avVoipAccount:config"})
public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId
,RedirectAttributes redirectAttributes
@@ -205,15 +196,13 @@ public class AvContentController extends BaseController {
}
}
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId;
}
}*/
//修改VOIP IP配置审核状态
@RequestMapping(value = {"/auditAvVoip"})
@RequiresPermissions(value={"avVoipIp:confirm"})
public String auditVoip(Integer isAudit,Integer isValid,String ids
,String compileIds,Integer functionId
,RedirectAttributes redirectAttributes) {
if(!StringUtil.isEmpty(compileIds)){
String[] idArray = compileIds.split(",");
@RequiresPermissions(value={"avVoip:confirm"})
public String auditVoip(Integer isAudit,Integer isValid,String ids ,String compileIds,Integer functionId ,RedirectAttributes redirectAttributes) {
if(!StringUtil.isEmpty(ids)){
String[] idArray = ids.split(",");
Date auditTime=new Date();
for(String id :idArray){
try {
@@ -221,7 +210,7 @@ public class AvContentController extends BaseController {
} catch (MaatConvertException e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("VOIP配置下发失败"+e.getMessage());;
logger.error("VOIP配置下发失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
@@ -236,7 +225,7 @@ public class AvContentController extends BaseController {
return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId;
}
//修改VOIP IP配置审核状态
@RequestMapping(value = {"/auditAvVoipAccount"})
/* @RequestMapping(value = {"/auditAvVoipAccount"})
@RequiresPermissions(value={"avVoipAccount:confirm"})
public String auditVoipAccount(Integer isAudit,Integer isValid,String ids
,String compileIds,Integer functionId
@@ -262,14 +251,14 @@ public class AvContentController extends BaseController {
}
return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId;
}
}*/
/**
* 账号account
* 根据索引表信息异步获取子表信息
* @return
*/
@ResponseBody
/*@ResponseBody
@RequestMapping(value = "ajaxVoipAccountInfo")
public Map getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) {
Map<String, Object> voipAndAccountInfoMap=new HashMap<String, Object>();
@@ -282,25 +271,50 @@ public class AvContentController extends BaseController {
voipAndAccountInfoMap.put("account", voipAccountCfgList);
voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList);
return voipAndAccountInfoMap;
}
}*/
/**
* 根据索引表信息异步获取子表信息
* @return
*/
@ResponseBody
@RequestMapping(value = "ajaxVoipIpInfo")
public Map getVoipIpInfo(CfgIndexInfo cfgIndexInfo) {
Map<String, Object> voipAndAccountInfoMap=new HashMap<String, Object>();
@RequestMapping(value = {"/ajaxVoipIpInfo"})
public String getVoipIpInfo(Model model,Long cfgId,Integer index) {
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
cfgIndexInfo.setCfgId(cfgId);
CfgIndexInfo cfg = avContentCfgService.getCfgIndexInfo(cfgIndexInfo);
List<String[]> tabList = new ArrayList();
//获取voipIpCfg信息
List<AvVoipIpCfg> voipIpCfgList=new ArrayList<AvVoipIpCfg>();
List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList=new ArrayList<NtcSubscribeIdCfg>();
voipIpCfgList = avContentCfgService.getVoipIpCfgList(cfgIndexInfo);
ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(cfgIndexInfo);
voipAndAccountInfoMap.put("ip", voipIpCfgList);
voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList);
return voipAndAccountInfoMap;
if(cfg.getVoipIps()!=null){
String cfgType = null;
for(AvVoipIpCfg ip:cfg.getVoipIps()){
if(!ip.getCfgType().equals(cfgType)){
tabList.add(new String[]{"1",ip.getCfgType()});
cfgType = ip.getCfgType();
}
}
}
if(cfg.getVoipAccounts()!=null){
String cfgType = null;
for(AvVoipAccountCfg account:cfg.getVoipAccounts()){
if(account!=null&&!account.getCfgType().equals(cfgType)){
tabList.add(new String[]{"2",account.getCfgType()});
cfgType = account.getCfgType();
}
}
}
//查询关键字
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("index", index);
model.addAttribute("tabList", tabList);
return "/cfg/av/voip/voipSubList";
}
/*****************************voip业务***************/

View File

@@ -20,12 +20,14 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.configuration.template.IpAddrTemplate;
import com.nis.domain.configuration.template.IpsecTemplate;
import com.nis.domain.configuration.template.TunnelIpTemplate;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.DictUtils;
import com.nis.web.controller.configuration.CommonController;
@@ -57,6 +59,8 @@ public class IpController extends CommonController{
}else{
initFormCondition(model,entity);
}
List<ConfigGroupInfo> policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4);
model.addAttribute("policyGroups", policyGroups);
model.addAttribute("_cfg", entity);
return "/cfg/ipaddr/ipForm";
}
@@ -89,6 +93,9 @@ public class IpController extends CommonController{
}
}
}
if(StringUtils.isNotBlank(cfg.getUserRegion4())) {
tabList.add(new String[]{"3","ASN"});
}
model.addAttribute("_cfg", cfg);
model.addAttribute("index", index);
model.addAttribute("tabList", tabList);
@@ -114,11 +121,21 @@ public class IpController extends CommonController{
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
ipCfgService.auditIpCfg(entity,isAudit);
} catch (MaatConvertException e) {
if(StringUtils.isNoneBlank(entity.getUserRegion4())) {
ipCfgService.auditAsnCfg(entity, isAudit);
}else {
ipCfgService.auditIpCfg(entity,isAudit);
}
} catch (Exception e) {
e.printStackTrace();
logger.info("ssl配置下发失败:"+e.getMessage());
addMessage(redirectAttributes, e.getMessage());
logger.info("ip配置下发失败:"+e.getMessage());
if(e instanceof MaatConvertException) {
addMessage(redirectAttributes, e.getMessage());
}else {
addMessage(redirectAttributes, "audit_failed");
}
}
}
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId;

View File

@@ -13,14 +13,17 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.SysUser;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.PxyObjKeyring;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.StringUtil;
import com.nis.web.controller.configuration.CommonController;
import com.nis.web.security.UserUtils;
@@ -30,9 +33,10 @@ import com.nis.web.security.UserUtils;
*
*/
@Controller
@RequestMapping("${adminPath}/proxy/intercept")
@RequestMapping(value={"${adminPath}/proxy/intercept"})
public class InterceptController extends CommonController{
@RequestMapping(value = {"/ip/list","domain/list"})
@RequestMapping(value = {"/ip/list","/domain/list","/ippayload/list"})
public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
@@ -51,8 +55,7 @@ public class InterceptController extends CommonController{
return "/cfg/intercept/interceptList";
}
@RequestMapping(value = {"/interceptIpForm","interceptDomainForm"})
@RequiresPermissions(value={"intercept:ip:config","intercept:domain:config"})
@RequestMapping(value = {"/interceptIpForm","interceptDomainForm","interceptIpPayloadForm"})
public String interceptIpForm(Model model,String ids,CfgIndexInfo entity) {
if(StringUtils.isNotBlank(ids)){
entity = interceptCfgService.getInterceptCfg(Long.parseLong(ids));
@@ -73,7 +76,7 @@ public class InterceptController extends CommonController{
model.addAttribute("_cfg", entity);
return "/cfg/intercept/interceptForm";
}
@RequestMapping(value = {"/ip/saveOrUpdate","/domain/saveOrUpdate"})
@RequestMapping(value = {"/ip/saveOrUpdate","/domain/saveOrUpdate","/ippayload/SaveOrUpdate"})
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes,Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
try {
interceptCfgService.saveInterceptCfg(entity);
@@ -85,7 +88,7 @@ public class InterceptController extends CommonController{
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+entity.getFunctionId();
}
@RequestMapping(value = {"/ajaxInterceptIpSubList","/ajaxInterceptDomainSubList"})
@RequestMapping(value = {"/ajaxInterceptIpSubList","/ajaxInterceptDomainSubList","/ajaxInterceptIpPayloadSubList"})
public String ajaxInterceptIpSubList(Model model,Long cfgId,Integer index) {
CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId);
List<String[]> tabList = new ArrayList();
@@ -122,8 +125,7 @@ public class InterceptController extends CommonController{
return "/cfg/intercept/interceptSubList";
}
@RequestMapping(value = {"auditInterceptIpCfg","auditInterceptDomainCfg"})
@RequiresPermissions(value={"intercept:ip:confirm","intercept:domain:confirm"})
@RequestMapping(value = {"auditInterceptIpCfg","auditInterceptDomainCfg","auditInterceptIpPayloadCfg"})
public String auditInterceptIpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
CfgIndexInfo entity = new CfgIndexInfo();
String[] idArray = ids.split(",");
@@ -145,8 +147,7 @@ public class InterceptController extends CommonController{
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
}
@RequestMapping(value = {"updateInterceptIpValid","updateInterceptDomainValid"})
@RequiresPermissions(value={"intercept:ip:config","intercept:domain:config"})
@RequestMapping(value = {"updateInterceptIpValid","updateInterceptDomainValid","updateInterceptIpPayloadValid"})
public String updateInterceptIpValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
try {
interceptCfgService.updatInterceptValid(isValid,ids,functionId);

View File

@@ -109,6 +109,18 @@
<if test="userRegion1 != null and userRegion1 !=''">
AND r.user_region1=#{userRegion1,jdbcType=VARCHAR}
</if>
<if test="userRegion2 != null and userRegion2 !=''">
AND r.user_region2=#{userRegion2,jdbcType=VARCHAR}
</if>
<if test="userRegion3 != null and userRegion3 !=''">
AND r.user_region3=#{userRegion3,jdbcType=VARCHAR}
</if>
<if test="userRegion4 != null and userRegion4 !=''">
AND r.user_region4=#{userRegion4,jdbcType=VARCHAR}
</if>
<if test="userRegion5 != null and userRegion5 !=''">
AND r.user_region5=#{userRegion5,jdbcType=VARCHAR}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>

View File

@@ -7,7 +7,7 @@
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="ip" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="ip" property="destIpAddress" jdbcType="VARCHAR" />
<result column="port" property="port" jdbcType="VARCHAR" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="user_region" property="userRegion" jdbcType="VARCHAR" />
@@ -72,8 +72,8 @@
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="srcIpAddress != null and srcIpAddress != ''">
AND r.ip like concat(concat('%',#{srcIpAddress,jdbcType=VARCHAR}),'%')
<if test="destIpAddress != null and destIpAddress != ''">
AND r.ip like concat(concat('%',#{destIpAddress,jdbcType=VARCHAR}),'%')
</if>
<if test="groupName != null and groupName != ''">
AND a.group_name like concat(concat('%',#{groupName,jdbcType=VARCHAR}),'%')
@@ -204,7 +204,7 @@
#{functionId,jdbcType=INTEGER},
#{ipType,jdbcType=INTEGER},
#{protocol,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
#{destIpAddress,jdbcType=VARCHAR},
#{port,jdbcType=VARCHAR},
#{direction,jdbcType=INTEGER},
#{userRegion,jdbcType=VARCHAR},
@@ -277,8 +277,8 @@
<if test="protocol != null" >
protocol = #{protocol,jdbcType=INTEGER},
</if>
<if test="srcIpAddress != null and srcIpAddress!=''" >
ip = #{srcIpAddress,jdbcType=VARCHAR},
<if test="destIpAddress != null and destIpAddress!=''" >
ip = #{destIpAddress,jdbcType=VARCHAR},
</if>
<if test="port != null and port!=''" >
port = #{port,jdbcType=VARCHAR},

View File

@@ -225,78 +225,101 @@ public class SysDictInfoService extends BaseService{
// 组织区域、运营商配置下发格式
public String setEffectiveRange(String areaEffectiveIds){
EffectiveRangeCfg rangeCfg = new EffectiveRangeCfg();
List<AreaIsp> areaIspList = new ArrayList();
List<List<AreaIsp>> effectiveRangeList = new ArrayList();
List<String> locaValueList = new ArrayList();
List<String> ispValueList = new ArrayList();
for (String areaEffectiveId : StringUtils.split(areaEffectiveIds, ",")) {
String area = "";
List<AreaIsp> areaIspList = new ArrayList();
AreaIsp area = new AreaIsp();
area.setTag(Constants.AREA_TAG);
AreaIsp isp = new AreaIsp();
isp.setTag(Constants.ISP_TAG);
String areaStr = "";
// 区域和运营商
if(areaEffectiveId.contains(":")) {
int index = areaEffectiveId.indexOf(":");
String areaCode = areaEffectiveId.substring(0, index);
String ispCode = areaEffectiveId.substring(index+1);
// 查询该区域信息及其所有父节点信息
List<SysDictInfo> list = sysDictInfoDao.getEffectiveArea(areaCode);
for (SysDictInfo sysDictInfo : list) {
area += sysDictInfo.getItemValue();
areaStr += sysDictInfo.getItemValue();
while(sysDictInfo.getParent().getSysDictId() != 0) {
sysDictInfo = sysDictInfoDao.getDictById(sysDictInfo.getParent().getSysDictId());
area += "/"+sysDictInfo.getItemValue();
areaStr += "/"+sysDictInfo.getItemValue();
}
}
String areaItemValue = StringUtils.revertStr(area, "/");
String areaItemValue = StringUtils.revertStr(areaStr, "/");
if(!locaValueList.contains(areaItemValue)) {
locaValueList = new ArrayList();
ispValueList = new ArrayList();
locaValueList.add(areaItemValue);
}else {
// 区域相同就只加运营商信息
SysDictInfo ispStr = sysDictInfoDao.getDictByItemCode(ispCode);
if(!ispValueList.contains(ispStr.getItemValue())) {
ispValueList.add(ispStr.getItemValue());
if(ispValueList.size() < 2) {
isp.setValue(ispValueList);
areaIspList.add(isp);
effectiveRangeList.add(areaIspList);
}
}
continue;
}
// 查询运营商信息
SysDictInfo isp = sysDictInfoDao.getDictByItemCode(ispCode);
if(!ispValueList.contains(isp.getItemValue())) {
ispValueList.add(isp.getItemValue());
SysDictInfo ispStr = sysDictInfoDao.getDictByItemCode(ispCode);
if(!ispValueList.contains(ispStr.getItemValue())) {
ispValueList.add(ispStr.getItemValue());
}
area.setValue(locaValueList);
isp.setValue(ispValueList);
areaIspList.add(area);
areaIspList.add(isp);
effectiveRangeList.add(areaIspList);
}else {
// 区域或运营商
// 区域
SysDictInfo dict = sysDictInfoDao.getDictByItemCode(areaEffectiveId);
if(dict.getItemType() == 1) {
// 查询所有父节点区域信息
area += dict.getItemValue();
while(dict.getParent().getSysDictId() != 0) {
dict = sysDictInfoDao.getDictById(dict.getParent().getSysDictId());
area += "/"+dict.getItemValue();
}
String areaItemValue = StringUtils.revertStr(area, "/");
if(!locaValueList.contains(areaItemValue)) {
locaValueList.add(areaItemValue);
}
}else {
if(!ispValueList.contains(dict.getItemValue())) {
ispValueList.add(dict.getItemValue());
}
// 查询所有父节点区域信息
areaStr += dict.getItemValue();
while(dict.getParent().getSysDictId() != 0) {
dict = sysDictInfoDao.getDictById(dict.getParent().getSysDictId());
areaStr += "/"+dict.getItemValue();
}
String areaItemValue = StringUtils.revertStr(areaStr, "/");
if(!locaValueList.contains(areaItemValue)) {
locaValueList = new ArrayList();
locaValueList.add(areaItemValue);
area.setValue(locaValueList);
areaIspList.add(area);
effectiveRangeList.add(areaIspList);
}
}
}
if(locaValueList.size() > 0) {
AreaIsp area = new AreaIsp();
area.setTag(Constants.AREA_TAG);
area.setValue(locaValueList);
areaIspList.add(area);
}
if(ispValueList.size() > 0) {
AreaIsp isp = new AreaIsp();
isp.setTag(Constants.ISP_TAG);
isp.setValue(ispValueList);
areaIspList.add(isp);
}
List<List<AreaIsp>> effectiveRangeList = new ArrayList();
effectiveRangeList.add(areaIspList);
rangeCfg.setEffectiveRangeList(effectiveRangeList);
return gsonToJson(rangeCfg);
}
public static void main(String[] args) {
SysDictInfoService service = new SysDictInfoService();
String json = service.setEffectiveRange("7182:4,7182:5");
System.err.println(json);
}
}

View File

@@ -78,13 +78,13 @@ public class AvContentCfgService extends BaseService{
* @param entity
* @return
*/
public Page<CfgIndexInfo> findAccountPage(Page<CfgIndexInfo> page, CfgIndexInfo entity) {
/*public Page<CfgIndexInfo> findAccountPage(Page<CfgIndexInfo> page, CfgIndexInfo entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
entity.setPage(page);
List<CfgIndexInfo> list=avContentCfgDao.findAccountList(entity);
page.setList(list);
return page;
}
}*/
/**
* 根据索引表信息获取voipIpCfg信息
* @param entity
@@ -116,20 +116,16 @@ public class AvContentCfgService extends BaseService{
*/
public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity) {
CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity);
List<NtcSubscribeIdCfg> ntcSubscribeList=getSubscribeIdCfgList(entity);
if(ntcSubscribeList ==null || ntcSubscribeList.size() <=0){
ntcSubscribeList.add(new NtcSubscribeIdCfg());
}
List<AvVoipIpCfg> voipIps=getVoipIpCfgList(entity);
if(voipIps ==null || voipIps.size() <=0){
voipIps.add(new AvVoipIpCfg());
}
List<NtcSubscribeIdCfg> ntcSubscribeList=getSubscribeIdCfgList(cfg);
List<AvVoipIpCfg> voipIps=getVoipIpCfgList(cfg);
List<AvVoipAccountCfg> voipAccounts=getVoipAccountCfgList(cfg);
cfg.setNtcSubscribeIdCfgList(ntcSubscribeList);
cfg.setVoipIps(voipIps);
cfg.setVoipAccounts(voipAccounts);
return cfg;
}
public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) {
/* public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) {
CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity);
List<AvVoipAccountCfg> voipAccounts=new ArrayList<>();
voipAccounts=getVoipAccountCfgList(entity);
@@ -145,7 +141,7 @@ public class AvContentCfgService extends BaseService{
cfg.setNtcSubscribeIdCfgList(ntcSubscribeList);
return cfg;
}
}*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvVoip(CfgIndexInfo entity){
@@ -178,6 +174,12 @@ public class AvContentCfgService extends BaseService{
}
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for(AvVoipAccountCfg voipAccount : entity.getVoipAccounts()){
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccountCfg(entity);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -199,6 +201,7 @@ public class AvContentCfgService extends BaseService{
//无效子配置后,再新增子配置
avContentCfgDao.deleteAvVoipIp(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
avContentCfgDao.deleteAvVoipAccountCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
@@ -219,6 +222,12 @@ public class AvContentCfgService extends BaseService{
}
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) {
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccountCfg(entity);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -230,7 +239,7 @@ public class AvContentCfgService extends BaseService{
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
/*@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvVoipAccount(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
@@ -311,7 +320,7 @@ public class AvContentCfgService extends BaseService{
}
}
}
}
}*/
/**
@@ -333,6 +342,7 @@ public class AvContentCfgService extends BaseService{
entity.setEditTime(new Date());
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg);
@@ -345,7 +355,7 @@ public class AvContentCfgService extends BaseService{
* @param isValid
* @param ids compileIds
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void updateAvVoipAccountValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){
String[] idArray = compileIds.split(",");
for(String id :idArray){
@@ -363,7 +373,7 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg);
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
}
}
}*/
/**
*
* @param isAudit
@@ -372,16 +382,17 @@ public class AvContentCfgService extends BaseService{
* @param functionId
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){
public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){
CfgIndexInfo entity = new CfgIndexInfo();
List<CfgIndexInfo> list = new ArrayList();
List<AvVoipIpCfg> voipIpList = new ArrayList();
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
List<AvVoipAccountCfg> accountList = new ArrayList();
List<AreaIpCfg> areaIpCfgList = new ArrayList();
CfgIndexInfo searchCfg=new CfgIndexInfo();
searchCfg.setCompileId(Integer.parseInt(compileId));
searchCfg.setCfgId(Long.parseLong(id));
entity = avContentCfgDao.getCfgIndexInfo(searchCfg);
entity.setIsAudit(isAudit);
@@ -390,6 +401,7 @@ public class AvContentCfgService extends BaseService{
entity.setAuditTime(auditTime);
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
@@ -398,6 +410,7 @@ public class AvContentCfgService extends BaseService{
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
accountList=avContentCfgDao.findVoipAccountCfgList(entity);
ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
@@ -423,6 +436,11 @@ public class AvContentCfgService extends BaseService{
groupRelationList=ntcMap.get("groupList");
strRegionList=ntcMap.get("dstList");
}
if(!StringUtil.isEmpty(accountList)){
Map<String,List> accountMap = cfgConvert(strRegionList,accountList,2,entity,groupRelationList);
groupRelationList=accountMap.get("groupList");
strRegionList=accountMap.get("dstList");
}
if(!StringUtil.isEmpty(areaIpCfgList)){
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
@@ -452,10 +470,10 @@ public class AvContentCfgService extends BaseService{
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("voip IP配置下发配置参数:"+json);
logger.info("voip 配置下发配置参数:"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("voip IP配置下发响应信息:"+result.getMsg());
logger.info("voip 配置下发响应信息:"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
@@ -469,15 +487,15 @@ public class AvContentCfgService extends BaseService{
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("voip IP配置下发配置参数:"+json);
logger.info("voip 配置下发配置参数:"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("voip IP配置取消配置响应信息:"+result.getMsg());
logger.info("voip 配置取消配置响应信息:"+result.getMsg());
}
}
/********************************voip业务*********************************/
/********************************voip account业务*********************************/
/**
*
* @param isAudit
@@ -485,7 +503,7 @@ public class AvContentCfgService extends BaseService{
* @param ids 编译Id
* @param functionId
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void auditAvVoipAccount(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){
CfgIndexInfo entity = new CfgIndexInfo();
@@ -591,7 +609,7 @@ public class AvContentCfgService extends BaseService{
}
}
}*/
/********************************voip业务*********************************/

View File

@@ -15,6 +15,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.nis.domain.FunctionRegionDict;
import com.nis.domain.Page;
import com.nis.domain.basics.AsnIpCfg;
import com.nis.domain.callback.InlineIp;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.BaseIpCfg;
@@ -29,15 +30,18 @@ import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
import com.nis.domain.maat.MaatCfg.StringCfg;
import com.nis.domain.maat.ToMaatBean;
import com.nis.domain.maat.ToMaatResult;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Configurations;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
import com.nis.web.dao.basics.AsnIpCfgDao;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.IpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.dao.specific.SpecificServiceCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.CrudService;
@@ -54,6 +58,10 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
protected StringCfgDao stringCfgDao;
@Autowired
protected AreaIpCfgDao areaIpCfgDao;
@Autowired
protected SpecificServiceCfgDao specificServiceCfgDao;
@Autowired
protected AsnIpCfgDao asnIpCfgDao;
/**
*
* addIpCfg(新增IP类配置)
@@ -344,18 +352,29 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}else if(Constants.SERVICE_IP_RATELIMIT==cfg.getServiceId().intValue()){
maatCfg.setUserRegion(Constants.USERREGION_RATE_LIMIT+"="+cfg.getRatelimit());
}
if(!StringUtil.isEmpty(cfg.getUserRegion1())){
String userRegion = "";
if(cfg.getUserRegion1().startsWith(Constants.REDIRECT_RESPONSE_CODE_STARTWITH)){
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+
Constants.USER_REGION_SPLIT+
Constants.REDIRECT_URL_KEY+"="+cfg.getUserRegion2();
}else{
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+
Constants.USER_REGION_SPLIT+
Constants.REDIRECT_CONTENT_KEY+"="+cfg.getUserRegion2();
//限速需要发Droprate=0.001 暂不支持Bandwidth=200kbps
if(cfg.getAction().equals(Constants.RATELIMIT_ACTION)){
if(cfg.getUserRegion1().equals("0")){//丢包率
cfg.setUserRegion2(StringUtil.isEmpty(cfg.getUserRegion2()) ? "":cfg.getUserRegion2());
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_DROPRATE_USER_REGION_KEY+"="+cfg.getUserRegion2());
}else if(cfg.getUserRegion1().equals("1")){//带宽
cfg.setUserRegion3(StringUtil.isEmpty(cfg.getUserRegion3()) ? "":cfg.getUserRegion3());
maatCfg.setUserRegion(Constants.INTERCEPT_IP_RATELIMIT_BANDWITH_USER_REGION_KEY+"="+cfg.getUserRegion3());
}
}else {
if(!StringUtil.isEmpty(cfg.getUserRegion1())){
String userRegion = "";
if(cfg.getUserRegion1().startsWith(Constants.REDIRECT_RESPONSE_CODE_STARTWITH)){
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+
Constants.USER_REGION_SPLIT+
Constants.REDIRECT_URL_KEY+"="+cfg.getUserRegion2();
}else{
userRegion = Constants.REDIRECT_RESPONSE_CODE_KEY+"="+cfg.getUserRegion1()+
Constants.USER_REGION_SPLIT+
Constants.REDIRECT_CONTENT_KEY+"="+cfg.getUserRegion2();
}
maatCfg.setUserRegion(userRegion);
}
maatCfg.setUserRegion(userRegion);
}
configCompileList.add(maatCfg);
maatBean.setOpAction(Constants.INSERT_ACTION);
@@ -656,6 +675,130 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}
}
}
/**
*
* @param isAudit
* @param isValid
* @param ids cfgId
* @param functionId
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void auditAsnCfg(CfgIndexInfo entity,Integer isAudit){
entity.setTableName(CfgIndexInfo.getTablename());
entity.setIsAudit(isAudit);
ipCfgDao.auditCfg(entity);
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList<>();
List<GroupCfg> groupRelationList = new ArrayList<>();
List<IpCfg> ipRegionList = new ArrayList<>();
List<StringCfg> strRegionList = new ArrayList<>();
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
List<DigestCfg> digestRegionList = new ArrayList<>();
List<IpCfg> areaIpRegionList = new ArrayList<>();
if(isAudit==Constants.AUDIT_YES) {
ConfigGroupInfo group=specificServiceCfgDao.getConfigGroupInfoByGroupId(Integer.parseInt(entity.getUserRegion4()));
if(group.getIsIssued()==1) {//复用,值下编译跟分组
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//group
GroupCfg groupCfg=new GroupCfg();
groupCfg.setCompileId(entity.getCompileId());
groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4()));
groupCfg.setIsValid(Constants.VALID_YES);
groupCfg.setAuditTime(entity.getAuditTime());
groupRelationList.add(groupCfg);
maatCfg.setGroupNum(groupRelationList.size());
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("ipaddr asn组复用配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("ipaddr asn组复用配置下发响应信息"+result.getMsg());
}else {//首次下发
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(entity.getAuditTime());
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
//group
GroupCfg groupCfg=new GroupCfg();
groupCfg.setCompileId(entity.getCompileId());
groupCfg.setGroupId(Integer.parseInt(entity.getUserRegion4()));
groupCfg.setIsValid(Constants.VALID_YES);
groupCfg.setAuditTime(entity.getAuditTime());
groupRelationList.add(groupCfg);
maatCfg.setGroupNum(groupRelationList.size());
//region
//查询asn group id下所有的 ip
AsnIpCfg asnIpCfg=new AsnIpCfg();
asnIpCfg.setAsnIpGroup(Integer.parseInt(entity.getUserRegion4()));
List<AsnIpCfg> allAsnIpCfgs=asnIpCfgDao.findAllList(asnIpCfg);
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(allAsnIpCfgs,Constants.VALID_YES,null));
maatCfg.setIpRegionList(ipRegionList);
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("ipaddr asn配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("ipaddr asn配置下发响应信息"+result.getMsg());
ConfigGroupInfo info=new ConfigGroupInfo();
info.setIsIssued(1);
info.setGroupId(Integer.parseInt(entity.getUserRegion4()));
specificServiceCfgDao.updateConfigGroupInfobyGroupId(info);
AsnIpCfg cfg=new AsnIpCfg();
cfg.setIsValid(Constants.VALID_YES);
cfg.setAsnIpGroup(Integer.parseInt(entity.getUserRegion4()));
asnIpCfgDao.updateIssued(cfg);
}
}else if(isAudit==Constants.AUDIT_NOT_YES) {//取消审核通过
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("ipaddr asn取消下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("ipaddr asn取消配置响应信息"+result.getMsg());
}else {
throw new RuntimeException("unknown isAudit value "+isAudit);
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void deleteIp(String ids,String compileIds,int functionId){
if(StringUtils.isNotBlank(compileIds)){
@@ -723,6 +866,10 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
entity.setIpPortList(ipPortList);
entity.setNtcSubscribeIdCfgList(subscribeIdList);
if(StringUtils.isNotBlank(entity.getUserRegion4())) {
ConfigGroupInfo info=specificServiceCfgDao.getConfigGroupInfoByGroupId(Integer.parseInt(entity.getUserRegion4().trim()));
entity.setAsnIpGroupName(info.getGroupName());
}
return entity;
}
public BaseIpCfg getIpCfgById(String tableName,long id){

View File

@@ -804,7 +804,7 @@ NTC_HTTP_RES_BODY=Response Body Configuration
NTC_UNIVERSAL_IP=IP Configuration
NTC_BGP_AS=AS Configuration
NTC_DNS_REGION=Keyword Configuration
WHITE_LIST_DOMAIN=Domain White List
WHITE_LIST_DOMAIN=URL Configuration
av_voip_account=VoIP Account Configuration
av_cont_ip=Content IP Configuration
NTC_SSL_SNI=SNI Keyword Configuration
@@ -901,6 +901,7 @@ av_voip_ip_reject=Multimedia VoIP Control
av_voip_ip_monit=Multimedia VoIP Monitoring
website_http_reject=Website Http Control
website_http_monit=Website Http Monitoring
website_http_whitelist=Website Http White List
domain_white_whitelist=Global Domain Name White List
av_content_ip_reject=Multimedia Content IP Control
av_content_ip_monit=Multimedia Content IP Monitoring
@@ -1171,4 +1172,9 @@ percentage=Percentage
APP_SSL=APP SSL Feature
APP_IP_RANGE=APP IP RANGE
APP_DK=APP DK Feature
MM_SUBSCRIBE_ID=Subscribe ID
MM_SUBSCRIBE_ID=Subscribe ID
mail_note=Note\uff1aIdentifiable Protocols Include SMTP\u3001POP3\u3001IMAP\u3002
av_content_url_note=Note\uff1aIdentifiable Protocols Include RTSP\u3001TRMP\u3001MMS\u3002
protocol_note=Note:Recognizable Protocols Include SIP,RTCP,RTP\u3002
snat_multiplex=SNAT Address Pool
dnat_multiplex=DNAT Address Pool

View File

@@ -802,7 +802,7 @@ NTC_HTTP_RES_BODY=\u5E94\u7B54\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E
NTC_UNIVERSAL_IP=IP\u914D\u7F6E
NTC_BGP_AS=AS\u914D\u7F6E
NTC_DNS_REGION=\u5173\u952E\u5B57\u914D\u7F6E
WHITE_LIST_DOMAIN=\u57DF\u540D\u767D\u540D\u5355
WHITE_LIST_DOMAIN=URL\u914D\u7F6E
av_voip_account=VoIP\u8D26\u53F7\u914D\u7F6E
av_cont_ip=\u5185\u5BB9IP\u914D\u7F6E
NTC_SSL_SNI=SNI\u5173\u952E\u5B57\u914D\u7F6E
@@ -1168,4 +1168,9 @@ percentage=\u767E\u5206\u6BD4
APP_SSL=APP SSL\u7279\u5F81
APP_IP_RANGE=APP IP RANGE
APP_DK=APP DK\u7279\u5F81
MM_SUBSCRIBE_ID=\u8D26\u53F7
MM_SUBSCRIBE_ID=\u8D26\u53F7
mail_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62ECSMTP\u3001POP3\u3001IMAP\u3002
av_content_url_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62ECRTSP\u3001TRMP\u3001MMS\u3002
protocol_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62ECSIP\u3001RTCP\u3001RTP\u3002
snat_multiplex=SNAT\u5730\u5740\u6C60\u7BA1\u7406
dnat_multiplex=DNAT\u5730\u5740\u6C60\u7BA1\u7406

View File

@@ -0,0 +1,29 @@
UPDATE function_service_dict SET region_code=1 WHERE function_id=5 AND region_code='1,3';
UPDATE function_service_dict SET region_code=2 WHERE function_id=5 AND region_code='2,3';
UPDATE function_service_dict SET is_valid=1 WHERE function_id=5 AND ACTION=1;
UPDATE function_service_dict SET is_valid=0 WHERE function_id=5 AND ACTION=96;
INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code) VALUES(5,0,64,'ratelimit',1057,'ip_ratelimit','ip地址限速',1,1);
#根据PROTOCOL字典查出的值替换63
SELECT id FROM sys_data_dictionary_name WHERE mark= 'PROTOCOL';
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(8,'IPSEC','IPSEC',0,1,1,63);
INSERT INTO sys_data_dictionary_item (item_code,item_value,item_desc,item_sort,STATUS,TYPE,dictionary_id) VALUES(15,'IPSEC','IPSEC',0,1,1,63);
UPDATE function_region_dict SET is_valid=0 WHERE function_id=5 AND config_region_value ='NTC_SUBSCRIBE_ID';
UPDATE function_region_dict SET config_protocol='0,6,17,1,8,15' WHERE function_id=5 AND config_region_value ='INLINE_IP_CB';
UPDATE function_region_dict SET config_protocol='0,6,17,1,8,15' WHERE function_id=5 AND config_region_value ='INLINE_IP_CB';
update function_region_dict set config_ip_type='4,6' where region_type=1 and config_ip_type like '%,46,64,10%';
UPDATE function_service_dict SET region_code=4 WHERE function_id=5 AND action_code='ratelimit';
INSERT INTO function_region_dict (function_id,config_region_code,config_region_value,config_desc,is_valid,is_maat,region_type,config_ip_type,config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_ip_port_show,config_region_sort)VALUES(5,4,'LIMIT_IP','IP限流',1,1,1,'4,6','1,2,3','1,2','0,1','0,6,17','1,2',4);
#asn region
INSERT INTO function_region_dict (config_service_type,function_id,config_region_code,config_region_value,config_desc,is_valid,is_maat,region_type,config_region_sort)
VALUES ('asn',5,5,'NTC_ASN_IP','asn',1,1,1,5);
# asn service
INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code)
VALUES (5,0,16,'reject',37,'ans_reject','ANS_REJECT',1,5);
INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,region_code)
VALUES (5,0,1,'monit',149,'ans_monit','ANS_MONIT',1,5);

View File

@@ -0,0 +1,5 @@
#voip ip跟voip account 合二为一
update sys_menu set href = "/ntc/av/voipList" where id = 831;
update function_service_dict set service_name='av_voip_monit' where dict_id=17
update function_service_dict set service_name='av_voip_reject' where dict_id=16
update function_region_dict set config_region_value='MM_SUBSCRIBE_ID',function_id=24,config_region_code=2 where dict_id=208

View File

@@ -0,0 +1,3 @@
#音视频添加action白名单置位无效
update function_service_dict set is_valid='0' where dict_id='130';
update function_service_dict set is_valid='0' where dict_id='131';

View File

@@ -0,0 +1,8 @@
INSERT INTO `function_service_dict` ( `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) VALUES ( '6', '4', '16', 'reject', '17', 'website_http_reject', NULL, '1', NULL, NULL, NULL, NULL, '1,2,3,4,5,6');
INSERT INTO `function_service_dict` ( `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) VALUES ( '6', '4', '1', 'monit', '129', 'website_http_monit', NULL, '1', NULL, NULL, NULL, NULL, '1,2,3,4,5,6');
update function_region_dict set function_id='6' , config_service_type='http_url' where dict_id='15';
#ip复用地址池
INSERT INTO `function_service_dict` ( `function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`) VALUES ( '633', '0', '96', 'loop', '832', 'ip_reuse_adress_pool_loop', NULL, '1', NULL, NULL, NULL, NULL, NULL);
INSERT INTO `function_region_dict` (`config_service_type`, `config_multi_keywords`, `config_expr_type`, `config_hex`, `config_match_method`, `function_id`, `config_region_code`, `config_region_value`, `config_district`, `config_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `is_maat`, `region_type`, `config_ip_type`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`) VALUES (NULL, NULL, NULL, NULL, NULL, '633', '1', 'IR_STATIC_IP_POOL_CB', NULL, 'IP复用地址池配置', '1', NULL, NULL, NULL, NULL, '2', '2', '4,6', '1,2,3', '1,2', '0', '0', '1', '1');

View File

@@ -0,0 +1,4 @@
update function_service_dict set function_id=212 where dict_id=110;
update function_region_dict set function_id=212 where dict_id=167;
INSERT INTO function_region_dict VALUES
('', '', '', '', '', 230, 212, 1, 'PXY_INTERCEPT_IP', '', 'IP PAYLOAD', 1, NULL, NULL, NULL, NULL, 1, 1, '4,6', '1,2,3', '1,2', '0', '17,1', '1,2', 1);

View File

@@ -95,7 +95,7 @@
<script src="${pageContext.request.contextPath}/static/global/scripts/common.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/scripts/jquery.tagsinput.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/scripts/app.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/scripts/ipRegion.js" type="text/javascript"></script>
<!-- 文件导入 -->
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-fileupload/js/bootstrap-fileupload.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-fileupload/js/jquery.cookie.min.js" type="text/javascript"></script>
@@ -103,4 +103,4 @@
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-tree-multiselect/jquery.tree-multiselect.js" type="text/javascript"></script>
<!-- 日志界面 -->
<script src="${pageContext.request.contextPath}/static/pages/scripts/pageLogs.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/pages/scripts/pageLogs.js" type="text/javascript"></script>

View File

@@ -37,9 +37,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="policy_group_manage"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -153,7 +153,7 @@ label.errorShow {
</div>
<h3 class="page-title">
<%-- <h3 class="page-title">
<c:if test="${itType==1 }">
<spring:message code="classification"/>
<c:set var="title" value="classification"></c:set>
@@ -166,7 +166,7 @@ label.errorShow {
<spring:message code="label"/>
<c:set var="title" value="label"></c:set>
</c:if>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -110,7 +110,7 @@
</div>
<h3 class="page-title">
<%-- <h3 class="page-title">
<c:if test="${itType==1 }">
<spring:message code="area"/>
<c:set var="title" value="area"></c:set>
@@ -119,7 +119,7 @@
<spring:message code="isp"/>
<c:set var="title" value="isp"></c:set>
</c:if>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -9,9 +9,9 @@
<div class="page-content">
<div class="row">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="special_task"/>
</h3>
</h3> --%>
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">

View File

@@ -40,9 +40,9 @@ $(function(){
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_built_in_features_config"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -46,9 +46,9 @@ $(function(){
<div class="page-content">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_byte_config"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -47,9 +47,9 @@ $(function(){
<div class="page-content">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_domain_config"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -61,14 +61,14 @@ $(function(){
<div class="page-content">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<%-- <spring:message code="app_header_config"></spring:message> --%>
<%-- <h3 class="page-title">
<spring:message code="app_header_config"></spring:message>
<c:forEach items="${serviceList}" var="service">
<c:if test="${_cfg.functionId eq service.functionId}">
<spring:message code="${service.serviceName}"></spring:message>
</c:if>
</c:forEach>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -61,9 +61,9 @@ $(function(){
<div class="page-content">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_http_config"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -28,9 +28,9 @@ $(function(){
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_ip_config"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -98,9 +98,9 @@ var delContent = function(contentClassName, addBtnClassName) {
<c:set var="serviceName" value="${service.serviceName}"/>
</c:if>
</c:forEach>
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="${serviceName }"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -167,9 +167,9 @@ var delContent = function(contentClassName, addBtnClassName) {
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="social_app_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -61,9 +61,9 @@ $(function(){
<div class="page-content">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_ssl_config"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -55,9 +55,9 @@ $(function(){
<div class="page-content">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_tcp_config"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -144,9 +144,9 @@ $(function(){
<div class="page-content">
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="app_topic_domain_cfg"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -71,9 +71,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -28,9 +28,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="ASN"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -64,9 +64,9 @@ var delContent = function(contentClassName, addBtnClassName) {
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="av_content_ip_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -96,11 +96,10 @@ var delContent = function(contentClassName, addBtnClassName) {
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="av_content_url_control"></spring:message>
</h3>
</h3> --%>
<span style="color: red;font-size: 14px;letter-spacing: 0px;"> <spring:message code="av_content_url_note"></spring:message></span>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -100,13 +100,13 @@ function hiddenlevel(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<spring:message code="${region.configRegionValue}"></spring:message>
</c:if>
</c:forEach>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -65,9 +65,9 @@ var delContent = function(contentClassName, addBtnClassName) {
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="av_picture_ip_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -88,9 +88,9 @@ var delContent = function(contentClassName, addBtnClassName) {
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="av_picture_url_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -75,13 +75,13 @@ function hiddenlevel(){
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<spring:message code="${region.configRegionValue}"></spring:message>
</c:if>
</c:forEach>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -37,17 +37,27 @@
}
},
submitHandler : function(form) {
var flag = true;
var subscribeId=0;
//存在隐藏的subscribeId不算进域配置
if($(".boxSolid.hidden").hasClass("subscribeId")){
subscribeId=1;
}
//代表所有业务都隐藏了,提示必须增加一种业务数据
if(($(".boxSolid").length - 1) == ($(".boxSolid.hidden").length - subscribeId)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
if($(".boxSolid[class~='subscribeId']").length>0){
if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
if(!$(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length) + 1){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
//代表所有业务都隐藏了,提示必须增加一种业务数据
}else{
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
//代表所有区域都隐藏了,提示必须增加个区域信息
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
@@ -133,9 +143,10 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<spring:message code="av_voip_ip_control"></spring:message>
</h3>
<%-- <h3 class="page-title">
<spring:message code="av_voip_control"></spring:message>
</h3> --%>
<span style="color: red;font-size: 14px;letter-spacing: 0px;"> <spring:message code="protocol_note"></spring:message></span>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
@@ -228,6 +239,7 @@
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:set var="accountCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 1 }">
<!--ip info-->
@@ -260,7 +272,49 @@
</c:choose>
<!--/ip info-->
</c:if>
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'voip_account' }">
<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="voipAccounts[${accountCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.voipAccounts)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.voipAccounts}" 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="accountCfgIndex" value="${accountCfgIndex+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="accountCfgIndex" value="${accountCfgIndex+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="accountCfgIndex" value="${accountCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
<!-- 关键字 -->
<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}" />
@@ -269,7 +323,6 @@
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${strCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
@@ -299,6 +352,7 @@
</c:otherwise>
</c:choose>
</c:if>
</c:if>
</c:forEach>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>

View File

@@ -14,25 +14,28 @@
.ready(
function() {
$(".glyphicon-plus").first().click();
/* $("#cancel").on("click", function() {
window.history.back();
});*/
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
var action=$("input[name='action']:checked").val();
switchAction(action);
});
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate(
{ errorPlacement : function(error, element) {
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find(
"div[for='"
+ element.attr("name")
+ "']").append(error);
}
},
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find(
"div[for='"
+ element.attr("name")
+ "']").append(error);
}
},
submitHandler : function(form) {
var flag = true;
@@ -131,7 +134,7 @@
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<spring:message code="av_voip_account_control"></spring:message>
<spring:message code="av_voip_ip_control"></spring:message>
</h3>
<div class="row">
<div class="col-md-12">
@@ -149,7 +152,7 @@
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/ntc/av/saveAccountVoip"
<form id="cfgFrom" action="${ctx}/ntc/av/saveVoip"
method="post" class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
@@ -158,6 +161,8 @@
value="${_cfg.serviceId}">
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
@@ -169,25 +174,24 @@
</div>
</div>
</div>
<!-- 动作 -->
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="action" /></label>
<label class="control-label col-md-3"><spring:message code="action" /></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
<label class="radio-inline"> <c:if test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action" serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
regionCode="${service.regionCode }"
value="${service.action }" class="required action"
<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:if test="${dict.itemCode eq service.action }">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
@@ -195,8 +199,9 @@
<div for="action"></div>
</div>
</div>
</div>
<!-- dolog begin-->
<!-- dolog begin-->
<div class="row doLog">
<div class="col-md-6">
<div class="form-group">
@@ -214,56 +219,48 @@
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<!-- dolog end-->
<c:set var="accountCfgIndex" value="0"></c:set>
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'voip_account' }">
<c:if test="${region.regionType eq 1 }">
<!--ip info-->
<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"
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="voipAccounts[${accountCfgIndex}]"></c:set>
<c:set var="cfgName" value="voipIps[${ipCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.voipAccounts)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.voipAccounts}" 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="accountCfgIndex" value="${accountCfgIndex+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="accountCfgIndex" value="${accountCfgIndex+1 }"></c:set>
<c:when test="${fn:length(_cfg.voipIps)>0 and ipCfgIndex<fn:length(_cfg.voipIps) }">
<c:forEach items="${_cfg.voipIps}" var="ipPort">
<c:if test="${region.configRegionValue eq ipPort.cfgType }">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1}"></c:set>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="accountCfgIndex" value="${accountCfgIndex+1 }"></c:set>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
<!--/ip info-->
</c:if>
<!-- 关键字 -->
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:if test="${region.regionType eq 2 }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
@@ -272,6 +269,7 @@
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${strCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
@@ -301,7 +299,6 @@
</c:otherwise>
</c:choose>
</c:if>
</c:if>
</c:forEach>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>

View File

@@ -3,9 +3,6 @@
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<link href="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet"/>
<link href="${pageContext.request.contextPath}/static/global/plugins/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
<c:choose>
<c:when test="${cookie.Language.value eq 'zh_CN'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-zh_CN.min.js"></script>
@@ -27,6 +24,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.voipIp.srcIpAddress}"){
$("#intype").val("${cfg.voipIp.srcIpAddress}");
}else if("${cfg.voipAccount.cfgKeywords}"){
$("#intype").val("${cfg.voipAccount.cfgKeywords}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else if("${cfg.voipIp.srcPort}"){
@@ -64,10 +63,8 @@
var index=$(this).attr("id").replace("open","");
$("#"+openId).hide();
$("#"+closeId).show();
var compileId=$(this).attr("compileId");
//var compileId=$(this).attr("compileId");
var cfgId=$(this).attr("cfgId");
var hasIp=false;
var hasSubscribe=false;
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
$("#"+openId).parent().parent().next("tr").show();
}else{
@@ -75,305 +72,22 @@
type:'post',
async:false,
url:'${ctx}/ntc/av/ajaxVoipIpInfo',
data:{"compileId":compileId,"cfgId":cfgId},
data:{"cfgId":cfgId,"index":index},
dataType:"html",
success:function(data){
var voipIpCfgTab="<tr class='child'>"+
"<td style='border-right: 1px solid #FFFFFF;'>"+
"<input type='checkbox' hidden='hidden'/>"+
"</td>"+
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var subTab="<tr class='child'>"+
"<td style='border-right: 1px solid #FFFFFF;'>"+
"<input type='checkbox' hidden='hidden'/>"+
"</td>"+
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var html="";
html+="<div class='row'>";
if(data.subscribe.length >0){
hasSubscribe=true;
html+="<div id='subscribeTitle"+index+"' onclick='switchInfo(\"ip\","+index+")' class='col-md-1 tabInfo badge-info' >";
html+="<spring:message code='NTC_SUBSCRIBE_ID'/>";
html+="<i id='subscribeDown"+index+"' class='fa fa-angle-double-down '></i>";
html+="<i id='subscribeUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
html+="</div>";
}
if(data.ip.length >0){
hasIp=true;
html+="<div id='ipTitle"+index+"' onclick='switchInfo(\"subscribe\","+index+")' class='col-md-1 tabInfo' >";
html+="<spring:message code='av_voip_ip_title'/>";
html+="<i id='ipDown"+index+"' class='fa fa-angle-double-down' style='display:none' ></i>";
html+="<i id='ipUp"+index+"' class='fa fa-angle-double-up '></i>";
html+="</div>";
}
html+="</div>";
//subscribe信息
if(data.subscribe.length > 0){
html+="<div id='subscribeInfo"+index+"' class='content content'>";
$.each(data.subscribe,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-8'>";
html+="<div class='form-group'>";
html+="<label class='keyword-disinline'><spring:message code='NTC_SUBSCRIBE_ID'/> ";
html+=item.cfgKeywords.replace(/\*\*\*and\*\*\*/g , " ");
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
if(item.isHexbin==0){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_hex'/></label>";
html+="<label>"
html+="<spring:message code='not_hex'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_case_insenstive'/></label>";
html+="<label>"
html+="<spring:message code='case_insenstive'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
}
if(item.isHexbin==1){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_hex'/></label>";
html+="<label>"
html+="<spring:message code='hex'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_case_insenstive'/></label>";
html+="<label>"
html+="<spring:message code='case_insenstive'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
}
if(item.isHexbin==2){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_hex'/></label>";
html+="<label>"
html+="<spring:message code='not_hex'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_case_insenstive'/></label>";
html+="<label>"
html+="<spring:message code='case_senstive'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
}
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='expression_type'/></label>";
html+="<label>"
if(item.exprType==1){
html+="<spring:message code='and_expression'/>"
}
if(item.exprType==0){
html+="<spring:message code='null_expression'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='match_method'/></label>";
html+="<label>"
if(item.matchMethod==0){
html+="<spring:message code='substring_match'/>"
}
if(item.matchMethod==1){
html+="<spring:message code='right_match'/>"
}
if(item.matchMethod==2){
html+="<spring:message code='left_match'/>"
}
if(item.matchMethod==3){
html+="<spring:message code='exactly_match'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
//ip信息
if(data.ip.length >0){
html+="<div id='ipInfo"+index+"' class='content' style='display:none'>";
$.each(data.ip,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='ip_type'/></label>";
html+="<label>"
if(item.ipType==4){
html+="<spring:message code='ipv4'/>";
}
if(item.ipType==6){
html+="<spring:message code='ipv6'/>";
}
if(item.ipType==46){
html+="<spring:message code='4over6'/>";
}
if(item.ipType==64){
html+="<spring:message code='6over4'/>";
}
if(item.ipType==10){
html+="<spring:message code='all'/>";
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='ip_pattern'/></label>";
html+="<label>"
if(item.ipPattern==1){
html+="<spring:message code='ip_subnet'/>"
}
if(item.ipPattern==2){
html+="<spring:message code='ip_range'/>"
}
if(item.ipPattern==3){
html+="IP"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='client_ip'/></label>";
html+="<label>"
html+=item.srcIpAddress;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='port_pattern'/></label>";
html+="<label>"
if(item.portPattern==1){
html+="port"
}
if(item.portPattern==2){
html+="<spring:message code='port_mask'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='client_port'/></label>";
html+="<label>"
html+=item.srcPort;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='server_ip'/></label>";
html+="<label>"
html+=item.destIpAddress;
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='server_port'/></label>";
html+="<label>"
html+=item.destPort;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='direction'/></label>";
html+="<label>"
if(item.direction==0){
html+="<spring:message code='twoway'/>"
}
if(item.direction==1){
html+="<spring:message code='oneway'/>"
}
if(item.direction==2){
html+="<spring:message code='egress'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='protocol'/></label>";
html+="<label>"
if(item.protocol==6){
html+="TCP"
}
if(item.protocol==17){
html+="UDP"
}
if(item.protocol==0){
html+="<spring:message code='arbitrary'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
voipIpCfgTab=voipIpCfgTab+html;
voipIpCfgTab+="</td>";
voipIpCfgTab+="</tr>";
$("#"+openId).parent().parent().after(voipIpCfgTab);
if(hasSubscribe && ! hasIp){
switchInfo("ip",index);
}
if(hasIp && ! hasSubscribe){
switchInfo("subscribe",index);
}
html = html+data;
subTab=subTab+html;
subTab+="</td>";
subTab+="</tr>";
$("#"+openId).parent().parent().after(subTab);
$("div[name='tabTitle"+index+"']").eq(0).click();
}
});
}
@@ -389,41 +103,13 @@
});
});
function switchInfo(flag,index){
//关闭ip信息
if("ip" ==flag){
$("#ipInfo"+index).hide();
$("#downIp"+index).hide();
$("#ipTitle"+index).removeClass("badge-info");
$("#subscribeInfo"+index).show();
$("#subscribeDown"+index).show();
$("#subscribeUp"+index).hide();
$("#ipUp"+index).show();
$("#ipDown"+index).hide();
$("#subscribeTitle"+index).addClass("badge-info");
}else{
//关闭subscribe信息
$("#subscribeInfo"+index).hide();
$("#downsubscribe"+index).hide();
$("#subscribeTitle"+index).removeClass("badge-info");
$("#ipInfo"+index).show();
$("#ipDown"+index).show();
$("#subscribeUp"+index).show();
$("#subscribeDown"+index).hide();
$("#ipUp"+index).hide();
$("#ipTitle"+index).addClass("badge-info");
}
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="avVoipIp:config">
<shiro:hasPermission name="avVoip:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/ntc/av/voipForm?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
@@ -432,7 +118,7 @@
</div>
<h3 class="page-title">
<spring:message code="av_voip_ip_control"/>
<spring:message code="av_voip_control"/>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
@@ -470,6 +156,7 @@
<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.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="av_voip_account_control"/></form:option>
<form:option value="action"><spring:message code="action"></spring:message></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
<form:option value="isValid"><spring:message code="is_valid"></spring:message></form:option>
@@ -500,12 +187,12 @@
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="avVoipIp:config">
<shiro:hasPermission name="avVoip:config">
<sys:delRow url="${ctx}/ntc/av/voipForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/ntc/av/updateAvVoipValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<%-- <sys:delRow url="${ctx}/ntc/av/voipExport?functionId=${cfg.functionId }" id="contentTable" label="export" maxRow="${page.maxExportSize }"></sys:delRow> --%>
<shiro:hasPermission name="avVoipIp:confirm">
<shiro:hasPermission name="avVoip:confirm">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
@@ -651,8 +338,8 @@
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<sys:message content="${message}" />
<div class="table-responsive">
<sys:message content="${message}" />
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
@@ -682,7 +369,7 @@
<tr>
<td>
<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" compileId="${indexCfg.compileId}" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td>

View File

@@ -25,12 +25,14 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.voipIp.srcIpAddress}"){
$("#intype").val("${cfg.voipIp.srcIpAddress}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}else if("${cfg.voipAccount.cfgKeywords}"){
$("#intype").val("${cfg.voipAccount.cfgKeywords}");
}else if("${cfg.voipIp.srcPort}"){
$("#intype").val("${cfg.voipIp.srcPort}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -64,15 +66,15 @@
$("#"+closeId).show();
var compileId=$(this).attr("compileId");
var cfgId=$(this).attr("cfgId");
var hasIp=false;
var hasSubscribe=false;
var hasAccount=false;
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
$("#"+openId).parent().parent().next("tr").show();
}else{
$.ajax({
type:'post',
async:false,
url:'${ctx}/ntc/av/ajaxVoipAccountInfo',
url:'${ctx}/ntc/av/ajaxVoipIpInfo',
data:{"compileId":compileId,"cfgId":cfgId},
success:function(data){
var voipIpCfgTab="<tr class='child'>"+
@@ -82,77 +84,38 @@
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var html="";
html+="<div class='row'>";
/* 订阅关键字 */
if(data.subscribe.length >0){
hasSubscribe=true;
html+="<div id='subscribeTitle"+index+"' onclick='switchInfo(\"account\","+index+")' class='col-md-1 tabInfo badge-info' >";
html+="<div id='subscribeTitle"+index+"' onclick='switchInfo(\"ip\","+index+")' class='col-md-1 tabInfo badge-info' >";
html+="<spring:message code='NTC_SUBSCRIBE_ID'/>";
html+="<i id='subscribeDown"+index+"' class='fa fa-angle-double-down '></i>";
html+="<i id='subscribeUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
html+="</div>";
}
if(data.account.length >0){
hasAccount=true;
html+="<div id='accountTitle"+index+"' onclick='switchInfo(\"subscribe\","+index+")' class='col-md-1 tabInfo' >";
html+="<spring:message code='av_voip_account_title'/>";
html+="<i id='accountDown"+index+"' class='fa fa-angle-double-down '></i>";
html+="<i id='accountUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
if(data.ip.length >0){
hasIp=true;
html+="<div id='ipTitle"+index+"' onclick='switchInfo(\"subscribe\","+index+")' class='col-md-1 tabInfo' >";
html+="<spring:message code='av_voip_ip_title'/>";
html+="<i id='ipDown"+index+"' class='fa fa-angle-double-down' style='display:none' ></i>";
html+="<i id='ipUp"+index+"' class='fa fa-angle-double-up '></i>";
html+="</div>";
}
html+="</div>";
//subscribe信息
if(data.subscribe.length > 0){
html+="<div id='subscribeInfo"+index+"' class='content content2'>";
html+="<div id='subscribeInfo"+index+"' class='content content'>";
$.each(data.subscribe,function(index,item){
//console.log(item.cfgKeywords);
html+="<div class='row'>";
html+="<div class='col-md-8'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='NTC_SUBSCRIBE_ID'/> ";
html+="<label class='keyword-disinline'><spring:message code='NTC_SUBSCRIBE_ID'/> ";
html+=item.cfgKeywords.replace(/\*\*\*and\*\*\*/g , " ");
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='expression_type'/></label>";
html+="<label>"
if(item.exprType==1){
html+="<spring:message code='and_expression'/>"
}
if(item.exprType==0){
html+="<spring:message code='null_expression'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='match_method'/></label>";
html+="<label>"
if(item.matchMethod==0){
html+="<spring:message code='substring_match'/>"
}
if(item.matchMethod==1){
html+="<spring:message code='right_match'/>"
}
if(item.matchMethod==2){
html+="<spring:message code='left_match'/>"
}
if(item.matchMethod==3){
html+="<spring:message code='exactly_match'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
if(item.isHexbin==0){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
@@ -219,26 +182,7 @@
html+="</div>";
html+="</div>";
}
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
//account信息
if(data.account.length > 0){
html+="<div id='accountInfo"+index+"' class='content content2' style='display:none'>";
$.each(data.account,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-8'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='account'/> ";
html+=item.cfgKeywords.replace(/\*\*\*and\*\*\*/g , " ");
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
@@ -275,72 +219,6 @@
html+="</div>";
html+="</div>";
html+="</div>";
if(item.isHexbin==0){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_hex'/></label>";
html+="<label>"
html+="<spring:message code='not_hex'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_case_insenstive'/></label>";
html+="<label>"
html+="<spring:message code='case_insenstive'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
}
if(item.isHexbin==1){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_hex'/></label>";
html+="<label>"
html+="<spring:message code='hex'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_case_insenstive'/></label>";
html+="<label>"
html+="<spring:message code='case_insenstive'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
}
if(item.isHexbin==2){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_hex'/></label>";
html+="<label>"
html+="<spring:message code='not_hex'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='is_case_insenstive'/></label>";
html+="<label>"
html+="<spring:message code='case_senstive'/>"
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
}
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
@@ -348,15 +226,152 @@
})
html+="</div>";
}
//ip信息
if(data.ip.length >0){
html+="<div id='ipInfo"+index+"' class='content' style='display:none'>";
$.each(data.ip,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='ip_type'/></label>";
html+="<label>"
if(item.ipType==4){
html+="<spring:message code='ipv4'/>";
}
if(item.ipType==6){
html+="<spring:message code='ipv6'/>";
}
if(item.ipType==46){
html+="<spring:message code='4over6'/>";
}
if(item.ipType==64){
html+="<spring:message code='6over4'/>";
}
if(item.ipType==10){
html+="<spring:message code='all'/>";
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='ip_pattern'/></label>";
html+="<label>"
if(item.ipPattern==1){
html+="<spring:message code='ip_subnet'/>"
}
if(item.ipPattern==2){
html+="<spring:message code='ip_range'/>"
}
if(item.ipPattern==3){
html+="IP"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='client_ip'/></label>";
html+="<label>"
html+=item.srcIpAddress;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='port_pattern'/></label>";
html+="<label>"
if(item.portPattern==1){
html+="port"
}
if(item.portPattern==2){
html+="<spring:message code='port_mask'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='client_port'/></label>";
html+="<label>"
html+=item.srcPort;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='server_ip'/></label>";
html+="<label>"
html+=item.destIpAddress;
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='server_port'/></label>";
html+="<label>"
html+=item.destPort;
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='direction'/></label>";
html+="<label>"
if(item.direction==0){
html+="<spring:message code='twoway'/>"
}
if(item.direction==1){
html+="<spring:message code='oneway'/>"
}
if(item.direction==2){
html+="<spring:message code='egress'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='protocol'/></label>";
html+="<label>"
if(item.protocol==6){
html+="TCP"
}
if(item.protocol==17){
html+="UDP"
}
if(item.protocol==0){
html+="<spring:message code='arbitrary'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
voipIpCfgTab=voipIpCfgTab+html;
voipIpCfgTab+="</td>";
voipIpCfgTab+="</tr>";
$("#"+openId).parent().parent().after(voipIpCfgTab);
if(hasSubscribe && ! hasAccount){
switchInfo("account",index);
if(hasSubscribe && ! hasIp){
switchInfo("ip",index);
}
if(hasAccount && ! hasSubscribe){
if(hasIp && ! hasSubscribe){
switchInfo("subscribe",index);
}
}
@@ -375,30 +390,28 @@
});
function switchInfo(flag,index){
if("account" ==flag){
//关闭account信息
$("#accountInfo"+index).hide();
$("#downAccount"+index).hide();
$("#accountTitle"+index).removeClass("badge-info");
//关闭ip信息
if("ip" ==flag){
$("#ipInfo"+index).hide();
$("#downIp"+index).hide();
$("#ipTitle"+index).removeClass("badge-info");
$("#subscribeInfo"+index).show();
$("#subscribeDown"+index).show();
$("#accountUp"+index).show();
$("#accountDown"+index).hide();
$("#subscribeUp"+index).hide();
$("#ipUp"+index).show();
$("#ipDown"+index).hide();
$("#subscribeTitle"+index).addClass("badge-info");
}else{
//关闭subscribe信息
//关闭subscribe信息
$("#subscribeInfo"+index).hide();
$("#downsubscribe"+index).hide();
$("#subscribeTitle"+index).removeClass("badge-info");
$("#accountInfo"+index).show();
$("#accountDown"+index).show();
$("#ipInfo"+index).show();
$("#ipDown"+index).show();
$("#subscribeUp"+index).show();
$("#subscribeDown"+index).hide();
$("#accountUp"+index).hide();
$("#accountTitle"+index).addClass("badge-info");
$("#ipUp"+index).hide();
$("#ipTitle"+index).addClass("badge-info");
}
@@ -410,23 +423,23 @@
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="avVoipAccount:config">
<shiro:hasPermission name="avVoipIp:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/ntc/av/voipAccountForm?functionId=${cfg.functionId}'">
onClick="javascript:window.location='${ctx}/ntc/av/voipForm?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="av_voip_account_control"/>
<spring:message code="av_voip_ip_control"/>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/ntc/av/voipAccountList?functionId=${cfg.functionId}" method="post" class="form-search">
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/ntc/av/voipList?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
@@ -455,7 +468,8 @@
<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="compileId"><spring:message code="cfg_id"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="account"/></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="action"><spring:message code="action"></spring:message></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
<form:option value="isValid"><spring:message code="is_valid"></spring:message></form:option>
@@ -486,21 +500,21 @@
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="avVoipAccount:config">
<sys:delRow url="${ctx}/ntc/av/voipAccountForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/ntc/av/updateAvVoipAccountValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
<shiro:hasPermission name="avVoipIp:config">
<sys:delRow url="${ctx}/ntc/av/voipForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/ntc/av/updateAvVoipValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<%-- <sys:delRow url="${ctx}/ntc/av/voipExport?functionId=${cfg.functionId }" id="contentTable" label="export" maxRow="${page.maxExportSize }"></sys:delRow> --%>
<shiro:hasPermission name="avVoipAccount:confirm">
<shiro:hasPermission name="avVoipIp:confirm">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoipAccount?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoipAccount?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoipAccount?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoip?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoip?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoip?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
@@ -637,8 +651,8 @@
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<sys:message content="${message}" />
<div class="table-responsive">
<sys:message content="${message}" />
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>

View File

@@ -0,0 +1,331 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<script src="${pageContext.request.contextPath}/static/global/scripts/app.min.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
//$("div[name='tabTitle"+index+"']").get(0).click();
})
</script>
<style type="text/css">
</style>
</head>
<c:forEach items="${tabList}" var="region" varStatus="regionStatus">
<div id="${region[1]}Title${index}" onclick="switchSubCfgTabInfo('${region[1]}',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='${region[1]}' />
<i id="${region[1]}${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:forEach>
</div>
<c:forEach items="${tabList}" var="region">
<c:if test="${region[0] eq 1 }">
<c:forEach items="${_cfg.voipIps}" 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-4">
<div class="form-group">
<label><spring:message code='ip_type'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.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='ip_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
<c:if test="${cfg.ipPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='client_ip'/>:</label>
<label>
${cfg.srcIpAddress}
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='port_pattern'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<c:if test="${cfg.portPattern eq portPatternC.itemCode}"><spring:message code="${portPatternC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='client_port'/>:</label><label>${cfg.srcPort }</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='server_ip'/>:</label><label>${cfg.destIpAddress }</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='server_port'/>:</label><label>${cfg.destPort }</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='direction'/>:</label>
<label>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='protocol'/>:</label>
<label>
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
<c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.voipAccounts}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content content${region[0]}" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:
${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>
<c:if test="${cfg.isHexbin==0 }">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_hex"/>:</label>
<label>
<spring:message code="not_hex"/>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_case_insenstive"/>:</label>
<label>
<spring:message code="case_insenstive"/>
</label>
</div>
</div>
</div>
</c:if>
<c:if test="${cfg.isHexbin==1 }">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_hex"/>:</label>
<label>
<spring:message code="hex"/>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_case_insenstive"/>:</label>
<label>
<spring:message code="case_insenstive"/>
</label>
</div>
</div>
</div>
</c:if>
<c:if test="${cfg.isHexbin==2 }">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_hex"/>:</label>
<label>
<spring:message code="not_hex"/>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_case_insenstive"/>:</label>
<label>
<spring:message code="case_senstive"/>
</label>
</div>
</div>
</div>
</c:if>
</div>
</c:if>
</c:forEach>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content content${region[0]}" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:
${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>
<c:if test="${cfg.isHexbin==0 }">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_hex"/>:</label>
<label>
<spring:message code="not_hex"/>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_case_insenstive"/>:</label>
<label>
<spring:message code="case_insenstive"/>
</label>
</div>
</div>
</div>
</c:if>
<c:if test="${cfg.isHexbin==1 }">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_hex"/>:</label>
<label>
<spring:message code="hex"/>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_case_insenstive"/>:</label>
<label>
<spring:message code="case_insenstive"/>
</label>
</div>
</div>
</div>
</c:if>
<c:if test="${cfg.isHexbin==2 }">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_hex"/>:</label>
<label>
<spring:message code="not_hex"/>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code="is_case_insenstive"/>:</label>
<label>
<spring:message code="case_senstive"/>
</label>
</div>
</div>
</div>
</c:if>
</div>
</c:if>
</c:forEach>
</c:if>
</c:forEach>
</html>

View File

@@ -131,9 +131,9 @@ var delContent = function(contentClassName, addBtnClassName) {
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="basic_protocol"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -56,9 +56,9 @@
</c:forEach>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -280,9 +280,9 @@ $(function(){
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -32,9 +32,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="target_ip_protect"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -32,9 +32,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="ip_spoofing_configuration"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -155,9 +155,9 @@ var delContent = function(contentClassName, addBtnClassName) {
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="encrypted_tunnel_behavior"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -99,9 +99,9 @@
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="file_digest_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -128,9 +128,9 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="ftp_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -122,9 +122,9 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="p2p_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -84,21 +84,22 @@
</head>
<body>
<c:if test="${cfg.functionId eq 200}">
<c:set var="interceptCode" value="ip_intercept"/>
<c:set var="interceptType" value="Ip"/>
</c:if>
<c:if test="${cfg.functionId eq 201}">
<c:set var="interceptCode" value="domain_intercept"/>
<c:set var="interceptType" value="Domain"/>
</c:if>
<c:if test="${cfg.functionId eq 212}">
<c:set var="interceptType" value="IpPayload"/>
</c:if>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="intercept:${fn:toLowerCase(interceptType)}:config">
<customTag:hasAnyPermissions name="intercept:ip:config,intercept:domain:config,ip_payload:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/proxy/intercept/intercept${interceptType}Form?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</customTag:hasAnyPermissions>
</div>
<h3 class="page-title">
@@ -172,11 +173,11 @@
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="intercept:${fn:toLowerCase(interceptType)}:config">
<customTag:hasAnyPermissions name="intercept:ip:config,intercept:domain:config,ip_payload:config">
<sys:delRow url="${ctx}/proxy/intercept/intercept${interceptType}Form" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/proxy/intercept/updateIntercept${interceptType}Valid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="intercept:${fn:toLowerCase(interceptType)}:confirm">
</customTag:hasAnyPermissions>
<customTag:hasAnyPermissions name="intercept:ip:config,intercept:domain:config,ip_payload:confirm">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
@@ -188,7 +189,7 @@
<li><sys:delRow url="${ctx}/proxy/intercept/auditIntercept${interceptType}Cfg?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
</customTag:hasAnyPermissions>
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
@@ -330,10 +331,13 @@
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="ratelimit"/></th>
<%-- <th><spring:message code="bandwith"/></th> --%>
<th><spring:message code="certificate"/></th>
<c:if test="${interceptType eq 'Ip' }">
<c:if test="${cfg.functionId ne 212 }">
<th><spring:message code="ratelimit"/></th>
<%-- <th><spring:message code="bandwith"/></th> --%>
<th><spring:message code="certificate"/></th>
</c:if>
<c:if test="${cfg.functionId eq 212 }">
<th><spring:message code="replace_zone"/></th>
<th><spring:message code="replaced_content"/></th>
<th><spring:message code="replace_content"/></th>
@@ -365,6 +369,7 @@
</td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td>
<c:if test="${cfg.functionId ne 212 }">
<td>
<c:if test="${indexCfg.action eq 64}">
${indexCfg.userRegion2 }
@@ -382,25 +387,21 @@
</c:forEach>
</c:if>
</td>
<c:if test="${interceptType eq 'Ip' }">
<c:if test="${indexCfg.action eq 80}">
<td>
<c:forEach items="${fns:getDictList('INTERCEPT_REPLACE_ZONE')}" var="replaceZoneC">
<c:if test="${indexCfg.userRegion1==replaceZoneC.itemCode}">
<spring:message code="${replaceZoneC.itemValue}"/>
</c:if>
</c:forEach>
</td>
<td>
${indexCfg.userRegion2 }
</td>
<td>
${indexCfg.userRegion3 }
</td>
</c:if>
<c:if test="${indexCfg.action ne 80}">
<td></td><td></td><td></td>
</c:if>
</c:if>
<c:if test="${cfg.functionId eq 212 }">
<td>
<c:forEach items="${fns:getDictList('INTERCEPT_REPLACE_ZONE')}" var="replaceZoneC">
<c:if test="${indexCfg.userRegion1==replaceZoneC.itemCode}">
<spring:message code="${replaceZoneC.itemValue}"/>
</c:if>
</c:forEach>
</td>
<td>
${indexCfg.userRegion2 }
</td>
<td>
${indexCfg.userRegion3 }
</td>
</c:if>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">

View File

@@ -79,9 +79,9 @@ var switchKeyringType=function(){
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="pxy_intercept_monit_keyring"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -9,9 +9,9 @@
<div class="page-content">
<h3 class="page-title">
<!-- <h3 class="page-title">
Managed Datatables <small>managed datatable samples</small>
</h3>
</h3> -->
<div class="row">
<div class="col-md-12">

View File

@@ -69,9 +69,9 @@
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="ip address"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -9,9 +9,9 @@
<div class="page-content">
<h3 class="page-title">
<!-- <h3 class="page-title">
Managed Datatables <small>managed datatable samples</small>
</h3>
</h3> -->
<div class="row">
<div class="col-md-12">

View File

@@ -17,25 +17,64 @@
$("#cancel").on("click", function() {
window.history.back();
});*/
$(".glyphicon-plus").first().click();
$(".ipPortList").find(".glyphicon-remove").addClass("hidden")
var action=$(".action:checked").val();
if(action==32||action==96){
$(".subscribeId").find(".glyphicon-remove").click();
$(".subscribeId").prev("h4").addClass("hidden");
}
var regionCodes=$(".action:checked").attr("regionCode").split(",");
$("h4[class*='ipPortListTitle']").each(function(){
var has=false;
for(var ind in regionCodes){
if($(this).hasClass("ipPortListTitle"+regionCodes[ind])){
has=true;
}
}
if(!has){
$(this).html("");
var asnRegionCode,configType;
$("input[id^='cfgRegionCode']").each(function(){
var regionCode=$(this).val();
if("asn"==$(this).attr("servicetype")){
asnRegionCode=$(this).val();
}
});
$(".configType a").on("click",function(){
if($(this).attr("id")=="ipCfgTab"){
configType="ip";
$(".glyphicon-plus").first().click();
$(".ipPortList").find(".glyphicon-remove").addClass("hidden")
hideAction(1,asnRegionCode);
}else{
configType="asn";
hideAction(0,asnRegionCode);
}
var region = ($(this).attr("for"));
if(region=="ipaddr"){
$(".asn").addClass("hidden").addClass("disabled");
$(".ipaddr").removeClass("hidden").removeClass("disabled");
}else{
$(".ipaddr").addClass("hidden").addClass("disabled");
$(".asn").removeClass("hidden").removeClass("disabled");
}
});
//切换tab
if("${_cfg.cfgId}"==''){
configType='ip';
$("#ipCfgTab").click();
}else if("${_cfg.userRegion4}"==""){
configType='ip';
$("#ipCfgTab").click();
}else{
configType='asn';
$("#ansCfgTab").click();
}
if(configType!='asn'){
$(".glyphicon-plus").first().click();
$(".ipPortList").find(".glyphicon-remove").addClass("hidden")
/*if(action==32){
$(".subscribeId").find(".glyphicon-remove").click();
$(".subscribeId").prev("h4").addClass("hidden");
}*/
var regionCodes=$(".action:checked").attr("regionCode").split(",");
$("h4[class*='ipPortListTitle']").each(function(){
var has=false;
for(var ind in regionCodes){
if($(this).hasClass("ipPortListTitle"+regionCodes[ind])){
has=true;
}
}
if(!has){
$(this).addClass("hidden");
}
});
processAction(configType,$(".ipPortList"));
}
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
@@ -56,17 +95,34 @@
$("h4[class*='ipPortListTitle']").each(function(){
$(this).find(".ipPortTitle").html(i18nCode);
});
$("input[id^='cfgRegionCode']").each(function(){
if($(this).attr("id")!=("cfgRegionCode"+cfgRegionCode)){
$(this).removeAttr("name");
$("#cfgType"+$(this).val()).removeAttr("name");
}else{
$(this).attr("name",'cfgRegionCode');
$("#cfgType"+$(this).val()).attr("name",'cfgType');
}
});
var tabInfo=$(".ipPortList");
if(tabInfo){
tabInfo.find("[name$='cfgType']").val(cfgType);
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
}
if(configType!='asn'){
changeIPVal(tabInfo);
}
processAction(configType,tabInfo);
/* if(tabInfo){
tabInfo.find("[name$='cfgType']").val(cfgType);
tabInfo.find("[name$='cfgRegionCode']").val(cfgRegionCode);
//丢弃回流没有subscribeId
if($(this).val()==32||$(this).val()==96){
if($(this).val()==32||$(this).val()==96){
$(".subscribeId").find(".glyphicon-remove").click();
$(".subscribeId").prev("h4").addClass("hidden");
}else{
$(".subscribeId").prev("h4").removeClass("hidden");
}
}
//处理ICMP
if($(this).val()==32){
$.ipcommon.protocol.each(function(){
@@ -80,10 +136,13 @@
tabInfo.find("select[name$='protocol']").selectpicker("refresh");
}
}
} */
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$(".ratelimitAction").find("input[name='userRegion1']").on("change",function(){
switchRateLimitType();
})
$("#cfgFrom").validate(
{
errorPlacement : function(error, element) {
@@ -101,10 +160,10 @@
subscribeId=1;
}
//代表所有业务都隐藏了,提示必须增加一种业务数据
if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){
/* if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
} */
//代表所有区域都隐藏了,提示必须增加个区域信息
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
@@ -143,11 +202,15 @@
flag=flag1;
}
if(flag){
if(configType!='asn'){
$("input[name='userRegion4']").attr("disabled",true);
}
$("input[name$='userRegion1']").attr("disabled",false);
$("input[name$='exprType']").attr("disabled",false);
//将disable属性的元素删除
$(".disabled").each(function(){
$(this).remove();
});
$("input[name$='exprType']").attr("disabled",false);
loading('onloading...');
form.submit();
}else{
@@ -183,15 +246,136 @@
}); */
$("." + addBtnClassName).removeClass("hidden");
}
var hideAction=function(isHide,regionCode){
var action=$(".action:checked").val();
var serviceId=$(".action:checked").attr("serviceId");
$(".action").each(function(){
var regionCodeArr=$(this).attr("regionCode").split(',');
var has=false;
for(var code in regionCodeArr){
if(regionCode==regionCodeArr[code]){
has=true;
break;
}
}
if(has){
if(isHide==1){
$(this).attr("disabled","disabled");
$(this).parent(".radio-inline").addClass("hidden");
}else{
$(this).removeAttr("disabled");
$(this).parent(".radio-inline").removeClass("hidden");
}
}else{
if(isHide==1){
$(this).removeAttr("disabled");
$(this).parent(".radio-inline").removeClass("hidden");
}else{
$(this).attr("disabled","disabled");
$(this).parent(".radio-inline").addClass("hidden");
}
}
});
if($("[class*='action'][value='"+action+"']:visible").length>0){
$("[class*='action'][value='"+action+"']:visible").click();
}else{
$(".action:visible").get(0).click();
}
var reginosNew=$(".action:checked").attr("regioncode").split(",");
$("input[id^='cfgRegionCode']").each(function(){
var has=false;
for(var code in reginosNew){
if($(this).val()==reginosNew[code]){
has=true;
break;
}
}
if(has){
$(this).attr("name","cfgRegionCode");
$("#cfgType"+$(this).val()).attr("name","cfgType");
}else{
$(this).removeAttr("name");
$("#cfgType"+$(this).val()).removeAttr("name");
}
});
}
var processAction=function(configType,obj){
var action=$(".action:checked").val();
if(configType!='asn'){
var o=$(obj)
if(o){
/*处理协议*/
var selectedProtocol=o.find("select[name$='protocol'] option:selected").attr("value");
if(action==32){
//先清空,再添加
/* o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){
if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17||$(this).attr("value")==1||$(this).attr("value")==8||$(this).attr("value")==15){
o.find("select[name$='protocol']").append($(this));
}
}) */
$(".ratelimitAction").addClass("hidden");
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
}else if(action==16){
//先清空,再添加
o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){
if($(this).attr("value")==0||$(this).attr("value")==6){
o.find("select[name$='protocol']").append($(this));
}
})
$(".ratelimitAction").addClass("hidden");
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
}else if(action==64){
//先清空,再添加
/* o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){
if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){
o.find("select[name$='protocol']").append($(this));
}
}) */
$(".ratelimitAction").removeClass("hidden");
var rateLimitType=$("input[name='userRegion1']:checked").val();
if(rateLimitType == 0){//丢包率
$(".bandwith").find("input[name='userRegion3']").attr("disabled",true);
$(".droprate").find("input[name='userRegion2']").removeAttr("disabled");
}
if(rateLimitType == 1){//带宽
$(".bandwith").find("input[name='userRegion3']").removeAttr("disabled");
$(".droprate").find("input[name='userRegion2']").attr("disabled",true);
}
}else if(action==1){
//先清空,再添加
o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){
if($(this).attr("value")==0||$(this).attr("value")==6||$(this).attr("value")==17){
o.find("select[name$='protocol']").append($(this));
}
})
$(".ratelimitAction").addClass("hidden");
$(".ratelimitAction").find("input[name^='userRegion'],select[name^='userRegion']").attr("disabled",true);
}
o.find("select[name$='protocol']").selectpicker("refresh");
//切换后如果没找到选项,选任意协议
if(o.find("select[name$='protocol'] option[value='"+selectedProtocol+"']").length>0){
o.find("select[name$='protocol']").selectpicker("val",selectedProtocol);
}else{
o.find("select[name$='protocol']").selectpicker("val",0);
}
}
}
}
</script>
</head>
<body>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="ip_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
@@ -232,178 +416,264 @@
value="${region.configRegionCode}">
</c:forEach>
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="config_describe" /></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc"
value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="action" /></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
regionCode="${service.regionCode }"
value="${service.action }" class="required action"
<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:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<!-- dolog begin-->
<div class="row doLog">
<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>
<!-- dolog end-->
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:set var="subscribeIdIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 1 }">
<c:if test="${ipCfgIndex==0}">
<!--ip info-->
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section ipPortListTitle${region.configRegionCode}">
<span class="ipPortTitle"><spring:message code="${region.configRegionValue}" /></span>
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ipPortList[${ipCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.ipPortList)>0 and ipCfgIndex<fn:length(_cfg.ipPortList) }">
<c:forEach items="${_cfg.ipPortList}" var="ipPort">
<c:if test="${region.configRegionValue eq ipPort.cfgType }">
<div class="row boxSolid ipPortList ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1}"></c:set>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<div class="row boxSolid ipPortList ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
<!--/ip info-->
</c:if>
<c:if test="${region.regionType eq 2 }">
<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:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIdIndex}]"></c:set>
</c:if>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></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 subscribeId ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
<div class="portlet-body flip-scroll">
<div class="row-fluid">
<div class="span12">
<div class="tabbable tabbable-custom tabs-left">
<!-- Only required for left/right tabs -->
<ul class="nav nav-tabs tabs-left">
<li class="configType"><a href="#ip_tab" id="ipCfgTab"
data-toggle="tab" for="ipaddr"
data_dldk="<spring:message code="IP"/>"><spring:message
code="IP" /></a></li>
<li class="configType"><a href="#asn_tab" data-toggle="tab" for="asn" id="ansCfgTab"
data_dldk="<spring:message code="ASN"/>"><spring:message
code="ASN" /></a></li>
</ul>
<div class="tab-content">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="config_describe" /></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc"
value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIdIndex" value="${subscribeIdIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid subscribeId ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="subscribeIdIndex" value="${subscribeIdIndex+1 }"></c:set>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="action" /></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
regionCode="${service.regionCode }"
value="${service.action }" class="required action"
<c:if test="${_cfg.serviceId==service.serviceId || (_cfg.serviceId==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<!-- dolog begin-->
<div class="row doLog">
<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 ratelimitAction hidden">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="limit_rate_type"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio"
name="userRegion1" value="0"
<%-- <c:if test="${(userRegion1 eq 0) || (empty userRegion1)}"> --%>
checked
<%-- </c:if> --%>
class="required" >
<spring:message code="ratelimit" />
</label>
<%-- <label class="radio-inline">
<input type="radio"
name="userRegion1" value="1"
<c:if test="${(userRegion1 eq 1)}">
checked
</c:if>
class="required" >
<spring:message code="bandwith" />
</label> --%>
</div>
<div for="userRegion1"></div>
</div>
</div>
<div class="col-md-6 droprate">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
<div class="col-md-6">
<input class="form-control required number" range="[0,1]" type="text" placeholder="0.001" name="userRegion2" value="${_cfg.userRegion2 }">
</div>
<div for="userRegion2"></div>
</div>
</div>
<%-- <div class="col-md-6 bandwith">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="bandwith"/></label>
<div class="col-md-6">
<input class="form-control required number" type="text" name="userRegion3" value="${_cfg.userRegion3 }">
</div>
<div for="userRegion3"></div>
</div>
</div> --%>
</div>
<!-- dolog end-->
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:set var="subscribeIdIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 1 }">
<c:if test="${ipCfgIndex==0}">
<div class="ipaddr">
<!--ip info-->
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section ipPortListTitle${region.configRegionCode}">
<span class="ipPortTitle"><spring:message code="${region.configRegionValue}" /></span>
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ipPortList[${ipCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.ipPortList)>0 and ipCfgIndex<fn:length(_cfg.ipPortList) }">
<c:forEach items="${_cfg.ipPortList}" var="ipPort">
<c:if test="${region.configRegionValue eq ipPort.cfgType }">
<div class="row boxSolid ipPortList ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1}"></c:set>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<div class="row boxSolid ipPortList ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</div>
</c:if>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid subscribeId ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="subscribeIdIndex" value="${subscribeIdIndex+1 }"></c:set>
</c:if>
<c:if test="${region.configServiceType ne 'subscribe_id' }">
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:if>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
<button id="cancel" type="button" class="btn default">
<spring:message code="cancel" />
</button>
<!--/ip info-->
</c:if>
<c:if test="${region.regionType eq 2 }">
<div class="ipaddr">
<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:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIdIndex}]"></c:set>
</c:if>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></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 subscribeId ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIdIndex" value="${subscribeIdIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid subscribeId ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="subscribeIdIndex" value="${subscribeIdIndex+1 }"></c:set>
</c:if>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid subscribeId ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:if test="${region.configServiceType eq 'subscribe_id' }">
<c:set var="subscribeIdIndex" value="${subscribeIdIndex+1 }"></c:set>
</c:if>
<c:if test="${region.configServiceType ne 'subscribe_id' }">
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:if>
</c:otherwise>
</c:choose>
</div>
</c:if>
</c:forEach>
<div class="asn">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group"/></label>
<div class="col-md-6">
<select name="userRegion4" class="selectpicker show-tick form-control required" data-live-search="true" data-live-search-placeholder="search">
<c:forEach items="${policyGroups }" var="policyGroup">
<option value="${policyGroup.groupId}" <c:if test="${_cfg.userRegion1==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
</c:forEach>
</select>
</div>
<div for="userRegion4"></div>
</div>
</div>
</div>
</div>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
<button id="cancel" type="button" class="btn default">
<spring:message code="cancel" />
</button>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</form>
<!-- END FORM-->

View File

@@ -143,7 +143,7 @@
<form:select id="actionSelect" path="action" class="selectpicker select2 input-small" >
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${serviceList}" var="service">
<form:option value="${service.action }"><spring:message code="action_${service.actionCode }"/></form:option>
<form:option value="${service.action }"><spring:message code="${service.serviceName}"/> <spring:message code="action_${service.actionCode }"/></form:option>
</c:forEach>
</form:select>
<form:select path="isValid" class="selectpicker select2 input-small" >
@@ -319,6 +319,7 @@
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
<th class="sort-column a.action"><spring:message code="block_type"/></th>
<th><spring:message code="ratelimit"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
@@ -352,6 +353,7 @@
</c:if>
</c:forEach>
</td>
<td>${indexCfg.userRegion2 }</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq indexCfg.doLog }">

View File

@@ -218,5 +218,19 @@
</c:if>
</c:forEach>
</c:if>
<c:if test="${(region[0] eq 3) && (not empty _cfg.userRegion4)}">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='group'/>:</label>
<label>
${_cfg.asnIpGroupName}
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</html>

View File

@@ -62,9 +62,9 @@ $(function(){
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -134,9 +134,10 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="mail_control"></spring:message>
</h3>
</h3> --%>
<span style="color: red;font-size: 14px;letter-spacing: 0px;"> <spring:message code="mail_note"></spring:message></span>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -72,9 +72,9 @@ $(function(){
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="dns_res_strategy"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -5,8 +5,8 @@
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
$("select[name='protocol']").parents(".form-group").addClass("hidden");
$("select[name='direction']").parents(".form-group").addClass("hidden");
/* $("select[name='protocol']").parents(".form-group").addClass("hidden");
$("select[name='direction']").parents(".form-group").addClass("hidden"); */
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
@@ -32,9 +32,9 @@ $(function(){
<body>
<div class="page-content">
<h3 class="page-title">
<spring:message code="ip_multiplex_pool_config"></spring:message>
</h3>
<%-- <h3 class="page-title">
<spring:message code="snat_multiplex"></spring:message>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
@@ -87,8 +87,8 @@ $(function(){
<div class="col-md-6">
<select name="policyGroup" class="selectpicker show-tick form-control required">
<option value="" <c:if test="${empty _cfg.policyGroup }">selected</c:if>><spring:message code="select"/></option>
<c:forEach items="${policyGroups }" var="policyGroup">
<option value="${policyGroup.groupId}" <c:if test="${_cfg.policyGroup==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
<c:forEach items="${policyGroups}" var="policyGroup">
<option value="${policyGroup.groupId}" <c:if test="${_cfg.policyGroup==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
</c:forEach>
</select>
</div>
@@ -123,7 +123,7 @@ $(function(){
</div>
<div class="row ipInfo">
<div class="row">
<div class="col-md-6">
<div class="col-md-6 hidden" >
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
<div class="col-md-6">
@@ -137,46 +137,6 @@ $(function(){
<div for="ipType"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="ip" /></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text"
name="srcIpAddress"
value="${_cfg.srcIpAddress}">
</div>
<div for="srcIpAddress"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port"/></label>
<div class="col-md-6">
<input class="form-control required digits" name="port" range="[0,65535]" type="text" value="${_cfg.port }">
</div>
<div for="port"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="direction" /></label>
<div class="col-md-6">
<select name="direction"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="direction"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
@@ -191,9 +151,48 @@ $(function(){
<div for="protocol"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="server_ip" /></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text"
name="destIpAddress"
value="${_cfg.destIpAddress}">
</div>
<div for="destIpAddress"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 ">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
<input class="form-control required digits" name="port" range="[0,65535]" type="text" value="${_cfg.port}">
</div>
<div for="port"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="direction" /></label>
<div class="col-md-6">
<select name="direction"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==1)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="direction"></div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="row hidden">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>

View File

@@ -10,8 +10,8 @@
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.groupName}"){
$("#intype").val("${cfg.groupName}");
}else if("${cfg.srcIpAddress}"){
$("#intype").val("${cfg.srcIpAddress}");
}else if("${cfg.destIpAddress}"){
$("#intype").val("${cfg.destIpAddress}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -50,7 +50,7 @@
</div>
<h3 class="page-title">
<spring:message code="ip_multiplex_pool_config"></spring:message>
<spring:message code="dnat_multiplex"></spring:message>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
@@ -87,7 +87,7 @@
<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="srcIpAddress"><spring:message code="ip"></spring:message></form:option>
<form:option value="destIpAddress"><spring:message code="ip"></spring:message></form:option>
<form:option value="groupName"><spring:message code="group"></spring:message></form:option>
<form:option value="action"><spring:message code="action"></spring:message></form:option>
<form:option value="isValid"><spring:message code="is_valid"></spring:message></form:option>
@@ -146,9 +146,7 @@
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='letter'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
@@ -278,12 +276,12 @@
<th class="sort-column r.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
<th class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
<th><spring:message code="group"/></th>
<th><spring:message code="ip"/></th>
<th><spring:message code="port"/></th>
<%-- <th><spring:message code="protocol"/></th>
<th><spring:message code="direction"/></th> --%>
<th><spring:message code="location"/></th>
<th><spring:message code="ip_type"/></th>
<th><spring:message code="server_ip"/></th>
<th><spring:message code="server_port"/></th>
<th><spring:message code="protocol"/></th>
<th><spring:message code="direction"/></th>
<%-- <th><spring:message code="location"/></th>
<th><spring:message code="ip_type"/></th> --%>
<th class="sort-column r.action"><spring:message code="block_type"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="letter"/></th>
@@ -317,9 +315,9 @@
${fns:abbr(cfg.groupName,20)}
</a>
</td>
<td title="${cfg.srcIpAddress }">${fns:abbr(cfg.srcIpAddress, 42)}</td>
<td title="${cfg.destIpAddress }">${fns:abbr(cfg.destIpAddress, 42)}</td>
<td>${cfg.port }</td>
<%-- <td>
<td>
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
<c:if test="${cfg.protocol==protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
</c:forEach>
@@ -328,8 +326,8 @@
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
</c:forEach>
</td> --%>
<td>
</td>
<%-- <td>
<c:forEach items="${fns:getDictList('IP_LOCATION')}" var="locationC">
<c:if test="${cfg.location eq locationC.itemCode}"><spring:message code="${locationC.itemValue }"/></c:if>
</c:forEach>
@@ -338,7 +336,7 @@
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
</c:forEach>
</td>
</td> --%>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq cfg.action }">

View File

@@ -0,0 +1,236 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<script type="text/javascript">
$(function(){
/* $("select[name='protocol']").parents(".form-group").addClass("hidden");
$("select[name='direction']").parents(".form-group").addClass("hidden"); */
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
}
},
submitHandler: function(form){
loading('onloading...');
form.submit();
},
errorContainer: "#messageBox"
});
});
</script>
</head>
<body>
<div class="page-content">
<%-- <h3 class="page-title">
<spring:message code="snat_multiplex"></spring:message>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
<c:if test="${!empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/maintenance/ipMultiplexPoolCfg/snatsaveOrUpdate" method="post" class="form-horizontal">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="compileId" name="compileId" value="${_cfg.compileId}">
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
<!-- 配置域类型 -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode"
isMaat="${region.isMaat}"
serviceType="${region.configServiceType}"
ipPortShow="${region.configIpPortShow}"
ipType="${region.configIpType}"
ipPattern="${region.configIpPattern}"
portPattern="${region.configPortPattern}"
direction="${region.configDirection}"
protocol="${region.configProtocol}"
regionType="${region.regionType}"
value="${region.configRegionCode}">
</c:if>
</c:forEach>
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
</div>
<div for="cfgDesc"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group"/></label>
<div class="col-md-6">
<select name="policyGroup" class="selectpicker show-tick form-control required">
<option value="" <c:if test="${empty _cfg.policyGroup }">selected</c:if>><spring:message code="select"/></option>
<c:forEach items="${policyGroups }" var="policyGroup">
<option value="${policyGroup.groupId}" <c:if test="${_cfg.policyGroup==policyGroup.groupId }">selected</c:if>><spring:message code="${policyGroup.groupName}"/></option>
</c:forEach>
</select>
</div>
<div for="policyGroup"></div>
</div>
</div>
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="action"/></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<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:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<div class="row ipInfo">
<div class="row">
<div class="col-md-6 hidden" >
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
<div class="col-md-6">
<select name="ipType"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<option value="${ipTypeC.itemCode}" <c:if test="${_cfg.ipType==ipTypeC.itemCode || (_cfg.ipType==null && ipTypeC.itemCode==4)}">selected</c:if>><spring:message code="${ipTypeC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="ipType"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="server_ip" /></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text"
name="destIpAddress"
value="${_cfg.destIpAddress}">
</div>
<div for="destIpAddress"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port"/></label>
<div class="col-md-6">
<input class="form-control required digits" name="port" range="[0,65535]" type="text" value="0">
</div>
<div for="port"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="direction" /></label>
<div class="col-md-6">
<select name="direction"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==1)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="direction"></div>
</div>
</div>
</div>
<div class="row hidden">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
<div class="col-md-6">
<select name="protocol"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
<option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="protocol"></div>
</div>
</div>
</div>
</div>
<div class="row hidden">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="location" /></label>
<div class="col-md-6">
<select name="location"
class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_LOCATION')}" var="locationC">
<option value="${locationC.itemCode}" <c:if test="${_cfg.location==locationC.itemCode || (_cfg.location==null && locationC.itemCode==0)}">selected</c:if>><spring:message code="${locationC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="location"></div>
</div>
</div>
</div>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
</div>
<div class="col-md-6"> </div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,442 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<script>
$(document).ready(function() {
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.groupName}"){
$("#intype").val("${cfg.groupName}");
}else if("${cfg.destIpAddress}"){
$("#intype").val("${cfg.destIpAddress}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
$("#seltype").change(function(){
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
});
//筛选功能初始化
filterActionInit();
$("#isAudit").change(function(){
page();
});
//reset
$("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){
$(this).selectpicker('val',$(this).find('option:first').val());
$(this).find("option").attr("selected",false);
$(this).find("option:first").attr("selected",true);
});
$(".Wdate").attr("value",'');
$("#description").attr("value",'');
$("#searchForm")[0].reset();
});
});
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="ip:mulitiplex:pool:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/maintenance/ipMultiplexPoolCfg/snatform?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="snat_multiplex"></spring:message>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/maintenance/ipMultiplexPoolCfg/snatlist?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
callback="page();" />
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<c:set var="state"><spring:message code='state'/></c:set>
<form:select path="isAudit" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="all_states"/></form:option>
<form:option value="0"><spring:message code="created"></spring:message></form:option>
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
<%-- <form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option> --%>
</form:select>
</div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<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="destIpAddress"><spring:message code="ip"></spring:message></form:option>
<form:option value="groupName"><spring:message code="group"></spring:message></form:option>
<form:option value="action"><spring:message code="action"></spring:message></form:option>
<form:option value="isValid"><spring:message code="is_valid"></spring:message></form:option>
</form:select>
</div>
<input id="intype" class="form-control input-medium" type="text" value="">
<div class="input-group-btn">
<form:select id="actionSelect" path="action" class="selectpicker select2 input-small" >
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${serviceList}" var="service">
<form:option value="${service.action }"><spring:message code="action_${service.actionCode }"/></form:option>
</c:forEach>
</form:select>
<form:select path="isValid" class="selectpicker select2 input-small" >
<form:option value=""><spring:message code="select"/></form:option>
<form:option value="1"><spring:message code="yes"/></form:option>
<form:option value="0"><spring:message code="no"/></form:option>
</form:select>
</div>
</div>
</div>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="ip:mulitiplex:pool:config">
<sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snatform" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snatdelete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="ip:mulitiplex:pool:confirm">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snataudit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snataudit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/maintenance/ipMultiplexPoolCfg/snataudit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</div>
<!-- /搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='letter'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='classification'/></label>
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fls}" var="fl" >
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='attribute'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${xzs}" var="xz" >
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='label'/></label>
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${lables}" var="lable" >
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="config_time"/></label>
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="edit_time"/></label>
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="audit_time"/></label>
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<sys:message content="${message}"/>
<div class="table-responsive">
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<%-- <th><spring:message code="seq"/></th> --%>
<th class="sort-column r.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
<th class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
<th><spring:message code="group"/></th>
<th><spring:message code="server_ip"/></th>
<%-- <th><spring:message code="port"/></th> --%>
<%-- <th><spring:message code="protocol"/></th>
<th><spring:message code="direction"/></th> --%>
<%-- <th><spring:message code="location"/></th>
<th><spring:message code="ip_type"/></th> --%>
<th class="sort-column r.action"><spring:message code="block_type"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
<th><spring:message code="creator"/></th>
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
<th><spring:message code="editor"/></th>
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"/></th>
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
<%-- <th><spring:message code="operation"></spring:message></th> --%>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr>
<td><input type="checkbox" class="i-checks" serviceId="${cfg.serviceId}" id="${cfg.cfgId}" value="${cfg.isAudit}"></td>
<td>${cfg.compileId}</td>
<td>
<a href="javascript:;" data-original-title="${cfg.cfgDesc}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(cfg.cfgDesc,20)}
</a>
</td>
<td>
<a href="javascript:;" data-original-title="${cfg.groupName}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(cfg.groupName,20)}
</a>
</td>
<td title="${cfg.destIpAddress }">${fns:abbr(cfg.destIpAddress, 42)}</td>
<%-- <td>${cfg.port }</td> --%>
<%-- <td>
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
<c:if test="${cfg.protocol==protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
</c:forEach>
</td> --%>
<%-- <td>
<c:forEach items="${fns:getDictList('IP_LOCATION')}" var="locationC">
<c:if test="${cfg.location eq locationC.itemCode}"><spring:message code="${locationC.itemValue }"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
</c:forEach>
</td> --%>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq cfg.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:choose>
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
<c:when test="${cfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
</c:choose>
</td>
<td>${cfg.requestName }</td>
<td >
<c:set var="classify"></c:set>
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId" varStatus="status">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId eq fn:trim(fl.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="classify" value="${fl.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="classify" value="${classify},${fl.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${classify}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(classify,20)}
</a>
</td>
<td>
<c:set var="attribute"></c:set>
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId" varStatus="status">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId eq fn:trim(xz.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="attribute" value="${xz.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="attribute" value="${attribute},${xz.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${attribute}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(attribute,20)}
</a>
</td>
<td>
<c:set var="lableInfo"></c:set>
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId" varStatus="status">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId eq fn:trim(lable.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="lableInfo" value="${lable.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="lableInfo" value="${lableInfo},${lable.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${lableInfo}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(lableInfo,20)}
</a>
</td>
<%-- <td>${cfg.areaEffectiveIds }</td> --%>
<td>
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
</td>
<td>${cfg.creatorName }</td>
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${cfg.editorName }</td>
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${cfg.auditorName }</td>
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -30,9 +30,9 @@ $(function(){
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -180,9 +180,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -116,9 +116,9 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="bgp_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -123,13 +123,13 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<c:forEach items="${serviceList }" var="serviceDict">
<c:if test="${serviceDict.functionId== cfg.functionId}">
<spring:message code="${serviceDict.serviceName }"></spring:message>
</c:if>
</c:forEach>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -48,9 +48,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="http_req_replace"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -48,9 +48,9 @@ $(function(){
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="http_res_replace"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -37,9 +37,9 @@
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="file_strategy"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">

View File

@@ -126,9 +126,9 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="dns_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -169,9 +169,9 @@
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="http_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -132,9 +132,9 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="ssl_control"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -40,15 +40,26 @@
submitHandler : function(form) {
//loading('onloading...');
var flag = true;
var subscribeId=0;
//存在隐藏的subscribeId不算进域配置
if($(".boxSolid.hidden").hasClass("subscribeId")){
subscribeId=1;
}
//代表所有业务都隐藏了,提示必须增加一种业务数据
if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
if($(".boxSolid[class~='subscribeId']").length>0){
if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
if(!$(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length) + 1){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
//代表所有业务都隐藏了,提示必须增加一种业务数据
}else{
if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
}
//代表所有区域都隐藏了,提示必须增加个区域信息
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
@@ -134,9 +145,9 @@
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<%-- <h3 class="page-title">
<spring:message code="ip_whitelist"></spring:message>
</h3>
</h3> --%>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">

View File

@@ -87,7 +87,7 @@ $(document).ready(function(){
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-2">
<div class="col-md-2 hidden">
<div class="form-group">
<label><spring:message code="protocol_type"/></label>
<c:set var="select"><spring:message code='select'/></c:set>

View File

@@ -1543,7 +1543,6 @@ pre {
clear: both; }
.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12 {
position: relative;
min-height: 1px;
/* padding-left: 15px;
padding-right: 15px; */

View File

@@ -0,0 +1,371 @@
/**
* 处理IP域值
*/
;(function($){
$.extend({
ipcommon:function(){
return {};
}
});
$.extend($.ipcommon, {
ipType:[],
ipPattern:[],
portPattern:[],
protocol:[],
direction:[]
});
})(jQuery);
$(function(){
initCommIpVal();
});
window.$.ipcommon=$.ipcommon;
/**
* ip默认选项处理
*/
var initCommIpVal=function(){
var action,regionCode,serviceType,ipPortShow,ipType,
ipPattern,portPattern,direction,protocol,regionType;
if($("input[name$='action']:checked").length>0){
regionCode=$("input[name$='action']:checked").attr("regionCode");
action=$("input[name$='action']:checked").val();
}else{
regionCode=$("input[name$='action']").attr("regionCode");
action=$("input[name$='action']").val();
}
if(regionCode){
if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType");
}else{
var _region='';
var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){
if($(this).val()==regionArr[re]){
_region=regionArr[re];
break;
}
}
});
if(_region!=''){
regionCode=_region;
}
}
}
if(regionCode){//IP域大于1个根据action获取ip属性
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");
}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端口处理
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");
}
}
//ip类型处理
$.ipcommon.ipType=$("select[name$='ipType'] option");
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).remove();
}
});
}
//ip格式处理
$.ipcommon.ipPattern=$("select[name$='ipPattern'] option");
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).remove();
}
});
}
//端口格式处理
$.ipcommon.portPattern=$("select[name$='portPattern'] option");
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).remove();
}
});
}
//方向处理
$.ipcommon.direction=$("select[name$='direction'] option");
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).remove();
}
});
}
//协议处理
$.ipcommon.protocol=$("select[name$='protocol'] option");
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).remove();
}
});
}
}
/**
* ip切换默认值处理
*/
var changeIPVal=function(obj){
var action,regionCode,serviceType,ipPortShow,ipType,
ipPattern,portPattern,direction,protocol,regionType,o;
o=$(obj);
if($("input[name$='action']:checked").length>0){
regionCode=$("input[name$='action']:checked").attr("regionCode");
action=$("input[name$='action']:checked").val();
}else{
regionCode=$("input[name$='action']").attr("regionCode");
action=$("input[name$='action']").val();
}
if(regionCode){
if(regionCode.indexOf(",")==-1){
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
$("#cfgType"+regionCode).attr("name","cfgType");
}else{
var _region='';
var regionArr=regionCode.split(',');
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
for(var re in regionArr){
if($(this).val()==regionArr[re]){
_region=regionArr[re];
break;
}
}
});
if(_region!=''){
regionCode=_region;
}
}
}
if(regionCode){//IP域大于1个根据action获取ip属性
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");
}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");
}
if(o){
//ip端口处理
if(ipPortShow){
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
o.find("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden");
o.find("input[name$='srcPort']").parents(".form-group").removeClass("hidden");
}else{
o.find("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden");
o.find("input[name$='srcPort']").parents(".form-group").addClass("hidden");
}
if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口
o.find("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden");
o.find("input[name$='destPort']").parents(".form-group").removeClass("hidden");
}else{
o.find("input[name$='destIpAddress']").parents(".form-group").addClass("hidden");
o.find("input[name$='destPort']").parents(".form-group").addClass("hidden");
}
}
//ip类型处理
if(ipType){
var arr=ipType.split(',');
var ipTypeVal=o.find("select[name$='ipType'] option:selected").attr("value");
o.find("select[name$='ipType']").empty();
$.ipcommon.ipType.each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
o.find("select[name$='ipType']").append($(this));
break;
}
}
});
o.find("select[name$='ipType']").selectpicker("refresh");
if(o.find("select[name$='ipType'] option[value='"+ipTypeVal+"']").length>0){
o.find("select[name$='ipType']").selectpicker("val",ipTypeVal);
}else{
o.find("select[name$='ipType']").selectpicker("val",4);
}
}
//ip格式处理
if(ipPattern){
arr=ipPattern.split(',');
var ipPatternVal=o.find("select[name$='ipPattern'] option:selected").attr("value");
o.find("select[name$='ipPattern']").empty();
$.ipcommon.ipPattern.each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
o.find("select[name$='ipPattern']").append($(this));
break;
}
}
});
o.find("select[name$='ipPattern']").selectpicker("refresh");
if(o.find("select[name$='ipPattern'] option[value='"+ipPatternVal+"']").length>0){
o.find("select[name$='ipPattern']").selectpicker("val",ipPatternVal);
}else{
o.find("select[name$='ipPattern']").selectpicker("val",1);
}
}
//端口格式处理
if(portPattern){
arr=portPattern.split(',');
var portPatternVal=o.find("select[name$='portPattern'] option:selected").attr("value");
o.find("select[name$='portPattern']").empty();
$.ipcommon.portPattern.each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
o.find("select[name$='portPattern']").append($(this));
break;
}
}
});
o.find("select[name$='portPattern']").selectpicker("refresh");
if(o.find("select[name$='portPattern'] option[value='"+portPatternVal+"']").length>0){
o.find("select[name$='portPattern']").selectpicker("val",portPatternVal);
}else{
o.find("select[name$='portPattern']").selectpicker("val",1);
}
}
//方向处理
if(direction){
arr=direction.split(',');
var directionVal=o.find("select[name$='direction'] option:selected").attr("value");
o.find("select[name$='direction']").empty();
$.ipcommon.direction.each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
o.find("select[name$='direction']").append($(this));
break;
}
}
});
o.find("select[name$='direction']").selectpicker("refresh");
if(o.find("select[name$='direction'] option[value='"+directionVal+"']").length>0){
o.find("select[name$='direction']").selectpicker("val",directionVal);
}else{
o.find("select[name$='direction']").selectpicker("val",0);
}
}
//协议处理
if(protocol){
arr=protocol.split(',');
var protocolVal=o.find("select[name$='protocol'] option:selected").attr("value");
o.find("select[name$='protocol']").empty();
$.ipcommon.protocol.each(function(){
var has=false;
for(var type in arr){
if($(this).val()==arr[type]){
has=true;
o.find("select[name$='protocol']").append($(this));
break;
}
}
});
o.find("select[name$='protocol']").selectpicker("refresh");
if(o.find("select[name$='protocol'] option[value='"+protocolVal+"']").length>0){
o.find("select[name$='protocol']").selectpicker("val",protocolVal);
}else{
o.find("select[name$='protocol']").selectpicker("val",0);
}
}
}
}