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

This commit is contained in:
duandongmei
2018-06-22 10:05:10 +08:00
20 changed files with 938 additions and 365 deletions

View File

@@ -65,6 +65,25 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
@Expose
@SerializedName("protocolId")
protected Integer protocolId ;
/**
* 限速比例
*/
protected Integer ratelimit ;
/**
* ratelimit
* @return ratelimit
*/
public Integer getRatelimit() {
return ratelimit;
}
/**
* @param ratelimit the ratelimit to set
*/
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
/**
* ipType
* @return ipType

View File

@@ -17,7 +17,7 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
private static final long serialVersionUID = -1133644323636425766L;
private Integer specServiceId; //spec_service_id 协议ID int N 主键,初始化
//private Integer specServiceCode; //协议编码 int N 暂定,以后可扩展 1000微信 , 1001QQ
private Integer specServiceCode; //协议编码 int N 暂定,以后可扩展 1000微信 , 1001QQ
private String specServiceName; //spec_service_name 协议名称 varchar(64) N
private String specServiceDesc; //spec_service_desc 协议描述 varchar2(64) N
private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效
@@ -36,6 +36,12 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
public void setSpecServiceId(Integer specServiceId) {
this.specServiceId = specServiceId;
}
public Integer getSpecServiceCode() {
return specServiceCode;
}
public void setSpecServiceCode(Integer specServiceCode) {
this.specServiceCode = specServiceCode;
}
public String getSpecServiceName() {
return specServiceName;
}

View File

@@ -26,26 +26,21 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
@Expose
private Integer ipType; //ip地址类型 ipV4=4 ipV6=6
@Expose
private String srcIp; //src_ip 源IP地址 varchar(64) N 缺省0.0.0.0值表示任意
@Expose
private String srcIpMask; //src_ip_mask 源地址掩码 varchar(64) N IPV4:255.255.255.255表示无掩码即精确IP匹配0.0.0.0值表示任意;
//IPV6FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF表示无掩码::两个半角冒号表示任意。非0掩码值必须是2的指数幂下同。
@Expose
private String srcPort; //src_port 源端口 varchar(6) N 0表示任意值
@Expose
private String srcPortMask; //src_port_mask 源端口掩码 varchar(6) N 65535表示无掩码即精确端口匹配0表示任意
@Expose
private String dstIp; //dst_ip 目的IP地址 varchar(64) N 缺省0.0.0.0值表示任意
@Expose
private String dstIpMask; //dst_ip_mask 目的地址掩码 varchar(64) N 同源ip地址掩码
@Expose
private String dstPort; //dst_port 目的端口 varchar(6) N 目的端口,0表示任意值
@Expose
private String dstPortMask; //dst_port_mask 目的端口掩码 varchar(6) N 同源端口掩码
@Expose
private Integer direction;; //direction 方向 int N 0双向1单向默认缺省为双向。
@Expose
private Integer protocol; //protocol 协议 int N 6表示tcp,17表示udp0表示任意
@Expose
private Integer ipPattern; //ip格式
@Expose
private String srcIpAddress; //源客户端IP地址
@Expose
private String destIpAddress; //目的服务器IP地址
@Expose
private Integer portPattern; //端口格式
@Expose
private String srcPort; //源(客户端)端口
@Expose
private String destPort;//目的(服务器)端口
private Integer isValid; //is_valid 有效标识 int N 0无效1有效
private Integer isAudit; //is_audit 是否审核 int N 0未审核1审核通过2审核未通过3取消审核通过即删除
@@ -90,19 +85,13 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
this.ipType = ipType;
}
@ExcelField(title="client_ip",align=2,sort=30,fieldType=String.class)
public String getSrcIp() {
return srcIp;
public String getSrcIpAddress() {
return srcIpAddress;
}
public void setSrcIp(String srcIp) {
this.srcIp = srcIp;
}
@ExcelField(title="client_address_mask",align=2,sort=40,fieldType=String.class)
public String getSrcIpMask() {
return srcIpMask;
}
public void setSrcIpMask(String srcIpMask) {
this.srcIpMask = srcIpMask;
public void setSrcIpAddress(String srcIpAddress) {
this.srcIpAddress = srcIpAddress;
}
@ExcelField(title="client_port",align=2,sort=50,fieldType=String.class)
public String getSrcPort() {
return srcPort;
@@ -110,40 +99,34 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
public void setSrcPort(String srcPort) {
this.srcPort = srcPort;
}
@ExcelField(title="client_port_mask",align=2,sort=60,fieldType=String.class)
public String getSrcPortMask() {
return srcPortMask;
}
public void setSrcPortMask(String srcPortMask) {
this.srcPortMask = srcPortMask;
}
@ExcelField(title="server_ip",align=2,sort=70,fieldType=String.class)
public String getDstIp() {
return dstIp;
public String getDestIpAddress() {
return destIpAddress;
}
public void setDstIp(String dstIp) {
this.dstIp = dstIp;
}
@ExcelField(title="server_address_mask",align=2,sort=80,fieldType=String.class)
public String getDstIpMask() {
return dstIpMask;
}
public void setDstIpMask(String dstIpMask) {
this.dstIpMask = dstIpMask;
public void setDestIpAddress(String destIpAddress) {
this.destIpAddress = destIpAddress;
}
@ExcelField(title="server_port",align=2,sort=90,fieldType=String.class)
public String getDstPort() {
return dstPort;
public String getDestPort() {
return destPort;
}
public void setDstPort(String dstPort) {
this.dstPort = dstPort;
public void setDestPort(String destPort) {
this.destPort = destPort;
}
@ExcelField(title="server_port_mask",align=2,sort=100,fieldType=String.class)
public String getDstPortMask() {
return dstPortMask;
@ExcelField(title="ip_pattern",align=2,sort=21,fieldType=Integer.class)
public Integer getIpPattern() {
return ipPattern;
}
public void setDstPortMask(String dstPortMask) {
this.dstPortMask = dstPortMask;
public void setIpPattern(Integer ipPattern) {
this.ipPattern = ipPattern;
}
@ExcelField(title="port_pattern",align=2,sort=40,fieldType=Integer.class)
public Integer getPortPattern() {
return portPattern;
}
public void setPortPattern(Integer portPattern) {
this.portPattern = portPattern;
}
@ExcelField(title="direction",align=2,sort=110)
public Integer getDirection() {
@@ -209,9 +192,6 @@ public class SpecificServiceHostCfg extends BaseEntity<SpecificServiceHostCfg>{
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public Date getBeginDate() {
return beginDate;
}

View File

@@ -0,0 +1,131 @@
package com.nis.web.controller.configuration.proxy;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
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.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.HttpUrlCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseController;
/**
* IP相关配置控制类
* @author dell
*
*/
@Controller
@RequestMapping("${adminPath}/proxy/intercept")
public class InterceptController extends BaseController{
@RequestMapping(value = {"/ip/list"})
@RequiresPermissions(value={"intercept:ip:config","intercept:ip:audit"},logical=Logical.OR)
public String ipList(Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
cfg.setTableName(IpPortCfg.getTablename());
Page<BaseIpCfg> searchPage=new Page<BaseIpCfg>(request,response,"r");
Page<BaseIpCfg> page = ipCfgService.findPage(searchPage, cfg);
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/proxy/ipList";
}
@RequestMapping(value = {"/ip/form"})
@RequiresPermissions(value={"intercept:ip:config"})
public String ipForm(Model model,String ids,BaseIpCfg entity) {
if(StringUtils.isNotBlank(ids)){
entity = ipCfgService.getIpCfgById(IpPortCfg.getTablename(),Long.parseLong(ids));
}
if(entity.getCfgId()!=null){
List<BaseIpCfg> areaCfg=ipCfgService.getListByComileId(AreaIpCfg.getTablename(), String.valueOf(entity.getCompileId()));
model.addAttribute("areaCfgs", areaCfg);
model.addAttribute("_cfg", entity);
initUpdateFormCondition(model,entity);
}else{
IpPortCfg cfg=new IpPortCfg();
cfg.initDefaultValueImpl();
cfg.setFunctionId(entity.getFunctionId());
cfg.setProtocolId(entity.getProtocolId());
model.addAttribute("_cfg", cfg);
initFormCondition(model,entity);
}
return "/cfg/proxy/ipForm";
}
@RequestMapping(value = {"/ip/saveOrUpdate"})
public String saveOrUpdateIp(RedirectAttributes model, IpPortCfg cfg) {
Date date=new Date();
cfg.setTableName(IpPortCfg.getTablename());
logger.info("saveOrUpdateIp loaded");
try{
cfg.setIsValid(Constants.VALID_NO);
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
if(cfg.getCfgId()==null){//新增
cfg.setCreatorId(cfg.getCurrentUser().getId());
cfg.setCreateTime(date);
ipCfgService.addIpCfg(cfg);
}else{//修改
cfg.setEditorId(cfg.getCurrentUser().getId());
cfg.setEditTime(new Date());
ipCfgService.updateIpCfg(cfg);
}
addMessage(model,"save_success");
}catch(Exception e){
logger.error("保存失败",e);
addMessage(model,"save_failed");
}
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
}
@RequestMapping(value = {"/ip/delete"})
@RequiresPermissions("iplist:config")
public String deleteIp(String ids,String compileIds,Integer functionId,RedirectAttributes model) {
try{
ipCfgService.deleteIp(ids,compileIds,functionId.intValue());
addMessage(model,"delete_success");
}catch(Exception e){
logger.error("删除失败", e);
addMessage(model,"delete_failed");
}
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
}
@RequestMapping(value = {"/ip/audit"})
// @RequiresPermissions("intercept:ip:audit")
public String auditIp(String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) {
try{
for(String id:ids.split(",")){
Long.parseLong(id);
}
List<BaseIpCfg> beans=ipCfgService.getListByCfgId(IpPortCfg.getTablename(),ids);
Date date=new Date();
for(BaseIpCfg bean:beans){
bean.setTableName(IpPortCfg.getTablename());
bean.setAuditorId(bean.getCurrentUser().getId());
bean.setAuditTime(date);
bean.setIsAudit(cfg.getIsAudit());
bean.setIsValid(cfg.getIsValid());
ipCfgService.audit(bean);
}
addMessage(redirectAttributes,"audit_success");
}catch(MaatConvertException e){
logger.error("审核失败", e);
addMessage(redirectAttributes, e.getMessage());
}catch(Exception e){
logger.error("审核失败", e);
addMessage(redirectAttributes, "audit_failed");
}
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
}
}

View File

@@ -147,9 +147,9 @@ public class SpecificServiceCfgController extends BaseController {
@RequiresPermissions(value= {"specific:service:add","specific:service:edit"},logical=Logical.OR)
@RequestMapping(value="saveOrUpdate")
public String saveOrUpdate(SpecificServiceCfg specificServiceCfg, Model model,
RedirectAttributes redirectAttributes,Integer oldId) {
RedirectAttributes redirectAttributes) {
try {
specificServiceCfgService.saveOrUpdate(specificServiceCfg,oldId);
specificServiceCfgService.saveOrUpdate(specificServiceCfg);
addMessage(redirectAttributes, "save_success");
} catch (Exception e) {
e.printStackTrace();
@@ -181,14 +181,16 @@ public class SpecificServiceCfgController extends BaseController {
/**
* 父节点选择树形结构
* @param extId
* @param extId排除节点id
* @param isShowHide
* @param isLeafShow:叶子节点是否显示
* @param response
* @return
*/
@ResponseBody
@RequestMapping(value = "treeData")
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response){
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide,
@RequestParam(required=false)boolean isLeafShow,HttpServletResponse response){
List<Map<String, Object>> mapList = Lists.newArrayList();
Map<String, Object> map2 = Maps.newHashMap();
map2.put("id", 0);
@@ -200,7 +202,8 @@ public class SpecificServiceCfgController extends BaseController {
for (int i=0; i<list.size(); i++){
SpecificServiceCfg specificServiceCfg = list.get(i);
if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){
if(specificServiceCfg.getIsValid().equals(0)||specificServiceCfg.getIsLeaf().equals(1)){
if(specificServiceCfg.getIsValid().equals(0)||
(!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))){
continue;
}
Map<String, Object> map = Maps.newHashMap();

View File

@@ -34,6 +34,7 @@
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
</resultMap>
@@ -48,7 +49,7 @@
DIRECTION,PROTOCOL,PROTOCOL_ID,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT
</sql>
<sql id="BaseIpCfg_Column_List_with_id_alias" >
<choose>
@@ -58,7 +59,7 @@
${page.alias}.DIRECTION as direction,${page.alias}.PROTOCOL as protocol,${page.alias}.PROTOCOL_ID as protocolId,${page.alias}.ACTION as action,${page.alias}.IS_VALID as isValid,${page.alias}.IS_AUDIT as isAudit,
${page.alias}.CREATOR_ID as creatorId,${page.alias}.CREATE_TIME AS createTime,${page.alias}.EDITOR_ID as editorId,${page.alias}.EDIT_TIME AS editTime,${page.alias}.AUDITOR_ID as auditorId,${page.alias}.AUDIT_TIME AS auditTime,
${page.alias}.SERVICE_ID as serviceId,${page.alias}.REQUEST_ID AS requestId,${page.alias}.COMPILE_ID AS compileId,${page.alias}.IS_AREA_EFFECTIVE as isAreaEffective,${page.alias}.classify,
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId
${page.alias}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId,${page.alias}.RATELIMIT AS ratelimit
</when>
<otherwise>
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc,r.CFG_REGION_CODE as cfgRegionCode,r.CFG_TYPE as cfgType, r.IP_TYPE as ipType,
@@ -66,7 +67,7 @@
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID as functionId,r.RATELIMIT AS ratelimit
</otherwise>
</choose>
</sql>
@@ -80,7 +81,7 @@
AUDITOR_ID,AUDIT_TIME,SERVICE_ID,
REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,
CLASSIFY,ATTRIBUTE,LABLE,
AREA_EFFECTIVE_IDS,FUNCTION_ID
AREA_EFFECTIVE_IDS,FUNCTION_ID,RATELIMIT
</sql>
<sql id="BaseIpCfg_Value_List" >
#{cfgDesc,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},#{cfgType,jdbcType=VARCHAR},
@@ -92,7 +93,7 @@
#{auditorId,jdbcType=INTEGER},#{auditTime,jdbcType=TIMESTAMP},#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{functionId,jdbcType=INTEGER}
#{areaEffectiveIds,jdbcType=VARCHAR}, #{functionId,jdbcType=INTEGER}, #{ratelimit,jdbcType=INTEGER}
</sql>
<select id="getById" resultMap="BaseIpMap" parameterType="java.lang.Long" >
SELECT
@@ -259,6 +260,9 @@
<if test="functionId != null">
AND ${page.alias}.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
<if test="ratelimit != null">
AND ${page.alias}.RATELIMIT=#{ratelimit,jdbcType=INTEGER}
</if>
</when>
<otherwise>
<if test="cfgId != null">
@@ -360,6 +364,9 @@
<if test="functionId != null">
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
<if test="ratelimit != null">
AND r.RATELIMIT=#{ratelimit,jdbcType=INTEGER}
</if>
</otherwise>
</choose>
<!-- 数据范围过滤 -->
@@ -506,6 +513,9 @@
<if test="functionId != null">
FUNCTION_ID=#{functionId,jdbcType=INTEGER}
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER}
</if>
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}

View File

@@ -4,6 +4,7 @@
<resultMap id="CFGResultMap" type="com.nis.domain.specific.SpecificServiceCfg" >
<id column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="spec_service_code" property="specServiceCode" jdbcType="INTEGER" />
<result column="spec_service_name" property="specServiceName" jdbcType="VARCHAR" />
<result column="spec_service_desc" property="specServiceDesc" jdbcType="VARCHAR" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
@@ -18,6 +19,7 @@
<sql id="specificServiceCfgColumns">
s.spec_service_id AS specServiceId,
s.spec_service_code AS specServiceCode,
s.spec_service_name AS specServiceName,
s.spec_service_desc AS specServiceDesc,
s.is_valid AS isValid,
@@ -62,6 +64,9 @@
<if test="specServiceId != null">
AND s2.spec_service_id like '%${specServiceId}%'
</if>
<if test="specServiceCode != null">
AND spec_service_code = #{specServiceCode}
</if>
<if test="specServiceName != null and specServiceName != '' ">
AND s2.spec_service_name like '%${specServiceName}%'
</if>
@@ -93,7 +98,10 @@
<select id="findAllSpecificServiceCfg" resultMap="CFGResultMap" >
SELECT * from specific_service_cfg where is_valid = 1
<if test="specificServiceCfg.specServiceId != null">
AND spec_service_id like '%${specificServiceCfg.specServiceId}%'
AND spec_service_id =#{specificServiceCfg.specServiceId}
</if>
<if test="specificServiceCfg.specServiceCode != null">
AND spec_service_id =#{specificServiceCfg.specServiceCode}
</if>
<if test="specificServiceCfg.specServiceName != null and specificServiceCfg.specServiceName != '' ">
AND spec_service_name like '%${specificServiceCfg.specServiceName}%'
@@ -122,22 +130,22 @@
<!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceCfg" useGeneratedKeys="true">
insert into specific_service_cfg (spec_service_id,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id)
values(#{specServiceId},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId})
insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id)
values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId})
</insert>
<!-- 修改 -->
<update id="update" parameterType="com.nis.domain.specific.SpecificServiceCfg">
UPDATE specific_service_cfg s SET
s.spec_service_id = #{specificServiceCfg.specServiceId},
s.spec_service_name = #{specificServiceCfg.specServiceName},
s.spec_service_desc = #{specificServiceCfg.specServiceDesc},
s.is_valid = #{specificServiceCfg.isValid},
s.op_time = #{specificServiceCfg.opTime},
s.parent_id = #{specificServiceCfg.parent.specServiceId},
s.is_leaf = #{specificServiceCfg.isLeaf},
s.group_id = #{specificServiceCfg.groupId}
WHERE s.spec_service_id = #{oldId}
s.spec_service_code = #{specServiceCode},
s.spec_service_name = #{specServiceName},
s.spec_service_desc = #{specServiceDesc},
s.is_valid = #{isValid},
s.op_time = #{opTime},
s.parent_id = #{parent.specServiceId},
s.is_leaf = #{isLeaf},
s.group_id = #{groupId}
WHERE s.spec_service_id = #{specServiceId}
</update>
<!-- 删除 -->

View File

@@ -7,16 +7,14 @@
<id column="host_id" property="hostId" jdbcType="INTEGER" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
<result column="src_ip" property="srcIp" jdbcType="VARCHAR" />
<result column="src_ip_mask" property="srcIpMask" jdbcType="VARCHAR" />
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
<result column="src_port_mask" property="srcPortMask" jdbcType="VARCHAR" />
<result column="dst_ip" property="dstIp" jdbcType="VARCHAR" />
<result column="dst_ip_mask" property="dstIpMask" jdbcType="VARCHAR" />
<result column="dst_port" property="dstPort" jdbcType="VARCHAR" />
<result column="dst_port_mask" property="dstPortMask" jdbcType="VARCHAR" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="ip_pattern" property="ipPattern" jdbcType="INTEGER" />
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
@@ -39,17 +37,8 @@
<sql id="specificServiceHostCfgColumns">
s.host_id AS hostId,
s.spec_service_id AS specServiceId,
s.ip_type AS ipType,
s.src_ip AS srcIp,
s.src_ip_mask AS srcIpMask,
s.src_port AS srcPort,
s.src_port_mask AS srcPortMask,
s.dst_ip AS dstIp,
s.dst_ip_mask AS dstIpMask,
s.dst_port AS dstPort,
s.dst_port_mask AS dstPortMask,
s.direction AS direction,
s.protocol AS protocol,
s.ip_type,s.src_ip_address,s.ip_pattern,s.port_pattern,s.src_port
,s.protocol,s.direction,s.dest_ip_address,s.dest_port,
s.is_valid AS isValid,
s.is_audit AS isAudit,
s.creator_id AS "creator.id",
@@ -81,11 +70,11 @@ select * from specific_service_host_cfg where is_valid = 1
<if test="ipType !=null" >
AND ip_type = #{ipType}
</if>
<if test="srcIp !=null and srcIp !='' " >
AND src_ip = #{srcIp}
<if test="srcIpAddress !=null and srcIpAddress !='' " >
AND src_ip_address = #{srcIpAddress}
</if>
<if test="dstIp !=null and dstIp !='' " >
AND dst_ip = #{dstIp}
<if test="destIpAddress !=null and destIpAddress !='' " >
AND dest_ip_address = #{destIpAddress}
</if>
<if test="protocol !=null" >
AND protocol = #{protocol}
@@ -131,24 +120,40 @@ from specific_service_host_cfg s where s.spec_service_id = #{specServiceId}
<!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
insert into specific_service_host_cfg (spec_service_id,ip_type,src_ip,src_ip_mask,src_port,src_port_mask,dst_ip,dst_ip_mask,dst_port,dst_port_mask,direction,protocol,is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time)
values(#{specServiceId},#{ipType},#{srcIp},#{srcIpMask},#{srcPort},#{srcPortMask},#{dstIp},#{dstIpMask},#{dstPort},#{dstPortMask},#{direction},#{protocol},#{isValid},#{isAudit},#{creator.id},#{createTime},#{editor.id},#{editTime},#{auditor.id},#{auditTime})
insert into specific_service_host_cfg (spec_service_id,ip_type,
src_ip_address,
ip_pattern,
port_pattern,
src_port,
protocol,
direction,
dest_port,
dest_ip_address,
is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time)
values(#{specServiceId},#{ipType,jdbcType=INTEGER},
#{srcIpAddress,jdbcType=VARCHAR},
#{ipPattern,jdbcType=INTEGER},
#{portPattern,jdbcType=INTEGER},
#{srcPort,jdbcType=VARCHAR},
#{protocol,jdbcType=INTEGER},
#{direction,jdbcType=INTEGER},
#{destPort,jdbcType=VARCHAR},
#{destIpAddress,jdbcType=VARCHAR},
#{isValid},#{isAudit},#{creator.id},#{createTime},#{editor.id},#{editTime},#{auditor.id},#{auditTime})
</insert>
<!-- 修改 -->
<update id="update" parameterType="com.nis.domain.specific.SpecificServiceHostCfg">
update specific_service_host_cfg s set
s.spec_service_id = #{specServiceId},
s.ip_type = #{ipType},
s.src_ip = #{srcIp},
s.src_ip_mask = #{srcIpMask},
s.src_port = #{srcPort},
s.src_port_mask = #{srcPortMask},
s.dst_ip = #{dstIp},
s.dst_ip_mask = #{dstIpMask},
s.dst_port = #{dstPort},
s.dst_port_mask = #{dstPortMask},
s.direction = #{direction},
s.protocol = #{protocol},
s.IP_TYPE = #{ipType,jdbcType=INTEGER},
s.IP_PATTERN=#{ipPattern,jdbcType=INTEGER},
s.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR},
s.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR},
s.PORT_PATTERN=#{portPattern,jdbcType=INTEGER},
s.SRC_PORT=#{srcPort,jdbcType=VARCHAR},
s.DEST_PORT=#{destPort,jdbcType=VARCHAR},
s.direction = #{direction,jdbcType=INTEGER},
s.protocol = #{protocol,jdbcType=INTEGER},
s.is_valid = #{isValid},
s.is_audit = #{isAudit},
s.creator_id = #{creator.id},

View File

@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -13,6 +14,7 @@ import com.nis.domain.Page;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.main.ConvertTool;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.specific.SpecificServiceCfgDao;
import com.nis.web.service.BaseService;
@@ -65,9 +67,10 @@ public class SpecificServiceCfgService extends BaseService{
* @throws Exception
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdate(SpecificServiceCfg specificServiceCfg, Integer oldId) throws Exception {
public void saveOrUpdate(SpecificServiceCfg specificServiceCfg) throws Exception {
if(specificServiceCfg.getGroupId()==null || specificServiceCfg.getGroupId()==0){
specificServiceCfg.setGroupId(new ConvertTool().getGroupId());
Integer groupId = ConfigServiceUtil.getId(2, 1).get(0);
specificServiceCfg.setGroupId(groupId);
}
//新增协议分组
ConfigGroupInfo group = specificServiceCfgDao.getConfigGroupInfoByGroupId(specificServiceCfg.getGroupId());
@@ -79,26 +82,28 @@ public class SpecificServiceCfgService extends BaseService{
group.setGroupType(1);
specificServiceCfgDao.insertConfigGroupInfo(group);
}
if(oldId==null){//新增
if(specificServiceCfg.getSpecServiceId()==null){//新增
if(specificServiceCfg.getIsLeaf()==null){
if(specificServiceCfg.getParent().getSpecServiceId().equals(0)){
specificServiceCfg.setIsLeaf(0);
}else{
specificServiceCfg.setIsLeaf(1);
}
}
specificServiceCfg.setIsValid(1);
specificServiceCfg.setOpTime(new Date());
specificServiceCfgDao.insert(specificServiceCfg);
}else{//修改
specificServiceCfg.setOpTime(new Date());
//修改id则将其子类的parent_id一并修改
if(oldId!=specificServiceCfg.getSpecServiceId()){
//找出所有子类
List<SpecificServiceCfg> list = specificServiceCfgDao.getChildrenById(oldId);
SpecificServiceCfg se =new SpecificServiceCfg();
se.setSpecServiceId(specificServiceCfg.getSpecServiceId());
for(SpecificServiceCfg ss:list){
if(ss!=null){
ss.setParent(se);
specificServiceCfgDao.update(ss,ss.getSpecServiceId());
}
if(specificServiceCfg.getIsLeaf()==null){
if(specificServiceCfg.getParent().getSpecServiceId().equals(0)){
specificServiceCfg.setIsLeaf(0);
}else{
specificServiceCfg.setIsLeaf(1);
}
}
specificServiceCfgDao.update(specificServiceCfg,oldId);
specificServiceCfg.setOpTime(new Date());
specificServiceCfgDao.update(specificServiceCfg);
}
}
/**

View File

@@ -59,34 +59,44 @@ public class SpecificServiceHostCfgService extends BaseService{
public void saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg) {
SysUser user = UserUtils.getUser();
String defaultIp = "0.0.0.0"; //缺省0.0.0.0值表示任意
String defaultIpMask = "";
if(specificServiceHostCfg.getIpType().equals(4)){
defaultIpMask = "255.255.255.255"; //255.255.255.255表示无掩码
if(specificServiceHostCfg.getIpPattern()==1){
defaultIp = "0.0.0.0/32"; //0.0.0.0表示任意
}else if(specificServiceHostCfg.getIpPattern()==2){
defaultIp = "0.0.0.0-0.0.0.0";
}else{
defaultIp = "0.0.0.0";
}
}
if(specificServiceHostCfg.getIpType().equals(6)){
defaultIpMask = "FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"; //FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF表示无掩码
if(specificServiceHostCfg.getIpPattern()==1){
defaultIp = "::/64";
}else if(specificServiceHostCfg.getIpPattern()==2){
defaultIp = "::-::";
}else{
defaultIp = "::";
}
}
String defaultPort = "0"; //0表示任意
if(specificServiceHostCfg.getPortPattern().equals(1)){
defaultPort = "0";
}else{
defaultPort = "0/0";
}
String defaultPortMask = "65535"; //65535表示无掩码
//ip地址默认 缺省0.0.0.0值表示任意
if(StringUtil.isBlank(specificServiceHostCfg.getSrcIp())){
specificServiceHostCfg.setSrcIp(defaultIp);
if(StringUtil.isBlank(specificServiceHostCfg.getSrcIpAddress())){
specificServiceHostCfg.setSrcIpAddress(defaultIp);
}
if(StringUtil.isBlank(specificServiceHostCfg.getDstIp())){
specificServiceHostCfg.setDstIp(defaultIp);
}
//ip掩码默认
if(StringUtil.isBlank(specificServiceHostCfg.getSrcIpMask())){
specificServiceHostCfg.setSrcIpMask(defaultIpMask);
}
if(StringUtil.isBlank(specificServiceHostCfg.getDstIpMask())){
specificServiceHostCfg.setDstIpMask(defaultIpMask);
if(StringUtil.isBlank(specificServiceHostCfg.getDestIpAddress())){
specificServiceHostCfg.setDestIpAddress(defaultIp);
}
//端口掩码默认
if(StringUtil.isBlank(specificServiceHostCfg.getSrcPortMask())){
specificServiceHostCfg.setSrcPortMask(defaultPortMask);
if(StringUtil.isBlank(specificServiceHostCfg.getSrcPort())){
specificServiceHostCfg.setSrcPort(defaultPort);
}
if(StringUtil.isBlank(specificServiceHostCfg.getDstPortMask())){
specificServiceHostCfg.setDstPortMask(defaultPortMask);
if(StringUtil.isBlank(specificServiceHostCfg.getDestPort())){
specificServiceHostCfg.setDestPort(defaultPort);
}
//方向缺省
if(specificServiceHostCfg.getDirection()==null){
@@ -181,7 +191,7 @@ public class SpecificServiceHostCfgService extends BaseService{
}
//源IP
if(!StringUtil.isEmpty(specificServiceHostCfg.getSrcIp())&&!BasicProvingUtil.isIpOrIpMask(specificServiceHostCfg.getSrcIp(), specificServiceHostCfg.getIpType())){
/*if(!StringUtil.isEmpty(specificServiceHostCfg.getSrcIp())&&!BasicProvingUtil.isIpOrIpMask(specificServiceHostCfg.getSrcIp(), specificServiceHostCfg.getIpType())){
logger.info(msgProp.getProperty("the_line_of").replace("rowNum", (i+3)+"")+ msgProp.getProperty("val_src_ip"));
// throw new RuntimeException(msgProp.getProperty("the_line_of").replace("rowNum", (i+3)+"")+ msgProp.getProperty("val_src_ip"));
importErrorInfo=new ImportErrorInfo(i+3+"",msgProp.getProperty("client_ip"),msgProp.getProperty("the_line_of").replace("rowNum", (i+3)+"")+ msgProp.getProperty("val_src_ip"));
@@ -293,7 +303,7 @@ public class SpecificServiceHostCfgService extends BaseService{
//方向缺省
if(specificServiceHostCfg.getDirection()==null){
specificServiceHostCfg.setDirection(0);
}
}*/
Date date = new Date();
specificServiceHostCfg.setIsValid(1);
specificServiceHostCfg.setCreator(user);

View File

@@ -32,8 +32,10 @@ $(function(){
}
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
if('${fn:length(serviceList)}'>1){
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
}
$("#ipCfgFrom").validate({
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
@@ -70,9 +72,19 @@ $(function(){
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="cfgType" name="cfgType" value="${_cfg.cfgType}">
<input type="hidden" id="cfgRegionCode" name="cfgRegionCode" value="${_cfg.cfgRegionCode}">
<c:if test="${fn:length(serviceList)==1}">
<c:forEach items="${serviceList}" var="service">
<input type="hidden" name="action" value="${service.action }">
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
<input type="hidden" id="protocolId" name="protocolId" value="${service.protocolId}">
</c:forEach>
</c:if>
<c:if test="${fn:length(serviceList)>1}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
</c:if>
<!-- 配置域类型 -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
@@ -110,7 +122,11 @@ $(function(){
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>>
<spring:message code="${service.actionCode }" />
<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>

View File

@@ -14,11 +14,6 @@
data.obj=$(this)
GetLogTotal('${ctx}',data);
});
//$("#loadingModal").modal("show");
//setTimeout(function(){
// $("#loadingModal").modal("hide");
//},1000);
//$("#loadingModal").modal({backdrop:'static',keybord:false});
//搜索框提示语初始化
if("${cfg.srcIpAddress}"){
$("#intype").val("${cfg.srcIpAddress}");

View File

@@ -0,0 +1,171 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="ip_intercept"></spring:message></title>
<script type="text/javascript">
$(function(){
if($("input[name='action']:checked").val()==0x20||$("input[name='action']:checked").val()==0x60){
$("#cfgRegionCode").val($("#cfgRegionCodeCallback").val());
$("#cfgType").val($("#cfgTypeCallback").val());
}else{
$("#cfgRegionCode").val($("#cfgRegionCodeMaat").val());
$("#cfgType").val($("#cfgTypeMaat").val());
}
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
if($(this).val()==0x20||$(this).val()==0x60){
$("#cfgRegionCode").val($("#cfgRegionCodeCallback").val());
$("#cfgType").val($("#cfgTypeCallback").val());
$("input[name='isAreaEffective']").each(function(){
if($(this).val()==0){
$(this).click();
}
})
}else{
$("#cfgRegionCode").val($("#cfgRegionCodeMaat").val());
$("#cfgType").val($("#cfgTypeMaat").val());
}
});
if('${fn:length(serviceList)}'>1){
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
}
$("#ipCfgFrom").validate({
errorPlacement: function(error,element){
$(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="ip_intercept"></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="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="ipCfgFrom" action="${ctx}/proxy/intercept/ip/saveOrUpdate" method="post" class="form-horizontal">
<div class="form-body row">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="cfgType" name="cfgType" value="${_cfg.cfgType}">
<input type="hidden" id="cfgRegionCode" name="cfgRegionCode" value="${_cfg.cfgRegionCode}">
<c:if test="${fn:length(serviceList)==1}">
<c:forEach items="${serviceList}" var="service">
<input type="hidden" name="action" value="${service.action }">
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
<input type="hidden" id="protocolId" name="protocolId" value="${service.protocolId}">
</c:forEach>
</c:if>
<c:if test="${fn:length(serviceList)>1}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
</c:if>
<!-- 配置域类型 -->
<c:forEach items="${regionList}" var="region">
<c:if test="${_cfg.functionId eq region.functionId}">
<c:if test="${region.isMaat==1}"><!-- is maat -->
<input type="hidden" id="cfgTypeMaat" value="${region.configRegionValue}">
<input type="hidden" id="cfgRegionCodeMaat" value="${region.configRegionCode}">
</c:if>
<c:if test="${region.isMaat==0}">
<input type="hidden" id="cfgTypeCallback" value="${region.configRegionValue}">
<input type="hidden" id="cfgRegionCodeCallback" value="${region.configRegionCode}">
</c:if>
</c:if>
</c:forEach>
<div class="form-body">
<!-- desc and action -->
<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:if test="${fn:length(serviceList)>1}">
<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 }"
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>
</c:if>
</div>
<!-- desc and action -->
<c:forEach items="${fns:getDictList('SPECIAL_FUNCTION_ID')}" var="sfi">
<c:if test="${sfi.itemCode==_cfg.functionId}">
<c:set var="specialProtocol" value="${sfi.itemValue}"/>
</c:if>
</c:forEach>
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<%@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,336 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="ip_intercept"></spring:message></title>
<script>
$(document).ready(function() {
$("td[compileId]").each(function(){
var data={};
data.date=new Date();
data.compileId=$(this).attr("compileId");
data.action=$(this).attr("action");
data.functionId=$(this).attr("functionId");
data.obj=$(this)
GetLogTotal('${ctx}',data);
});
//搜索框提示语初始化
if("${cfg.srcIpAddress}"){
$("#intype").val("${cfg.srcIpAddress}");
} else if("${cfg.destIpAddress}"){
$("#intype").val("${cfg.destIpAddress}");
} else if("${cfg.srcPort}"){
$("#intype").val("${cfg.srcPort}");
} else if("${cfg.destPort}"){
$("#intype").val("${cfg.destPort}");
} else if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
} 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",'');
$("#searchForm")[0].reset();
});
});
var edit=function(url){
var cked = $('tbody tr td input.i-checks:checkbox:checked');
if(cked.val()==1){
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
return;
}
if(cked.length==1){
window.location = url+"&compileId="+cked.attr("id");
}else{
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
return;
}
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="iplist:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/proxy/intercept/ip/form?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="ip_intercept"></spring:message>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="row">
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/intercept/ip/list" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<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">
<form:select path="isAudit" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="all_states"/></form:option>
<c:forEach items="${fns:getDictList('SPEC_AUDIT')}" var="auditC">
<form:option value="${auditC.itemCode}"><spring:message code="${auditC.itemValue}"></spring:message></form:option>
</c:forEach>
</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="srcIpAddress"><spring:message code="client_ip"></spring:message></form:option>
<form:option value="destIpAddress"><spring:message code="server_ip"></spring:message></form:option>
<form:option value="srcPort"><spring:message code="client_port"></spring:message></form:option>
<form:option value="destPort"><spring:message code="server_port"></spring:message></form:option>
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
</form:select>
</div>
<input id="intype" class="form-control input-medium" type="text" value="">
</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="iplist:config">
<sys:delRow url="${ctx}/proxy/intercept/ip/form?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/proxy/intercept/ip/delete?functionId=${cfg.functionId}" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="iplist:config">
<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}/proxy/intercept/ip/audit?isAudit=1&isValid=1&functionId=${cfg.functionId}" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/proxy/intercept/ip/audit?isAudit=2&isValid=0&functionId=${cfg.functionId}" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/proxy/intercept/ip/audit?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-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>
<div class="table-responsive">
<sys:message content="${message}"/>
<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><spring:message code="config_describe"/></th>
<th>ip<spring:message code="type"/></th>
<th><spring:message code="client_ip"/></th>
<th><spring:message code="client_port"/></th>
<th><spring:message code="server_ip"/></th>
<th><spring:message code="server_port"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="direction"/></th>
<th><spring:message code="protocol"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="type"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></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 pId="${status.index}">
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" compileId="${cfg.compileId}" value="${cfg.isAudit}"></td>
<%-- <td>${status.index+1 }</td> --%>
<td>${cfg.cfgDesc }</td>
<td><c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipType">
<c:if test="${ipType.itemCode==cfg.ipType}">${ipType.itemValue}</c:if>
</c:forEach></td>
<td>${cfg.srcIpAddress }</td>
<td>${cfg.srcPort }</td>
<td>${cfg.destIpAddress }</td>
<td>${cfg.destPort }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="serviceC">
<c:if test="${cfg.action eq serviceC.itemCode}"><spring:message code="${serviceC.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('PROTOCOL')}" var="protocolC">
<c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isAreaEffective==1}">
<a href="javascript:viewAreaInfo('${ctx }','${cfg.areaEffectiveIds }','${cfg.compileId }')" >
<spring:message code="yes"/>
</a>
</c:if>
</td>
<td>${cfg.requestName }</td>
<td>
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId">
<c:forEach items="${fls}" var="fl">
<c:if test="${fn:trim(fl.serviceDictId) eq classifyId}">
${fl.itemValue},
</c:if>
</c:forEach>
</c:forEach>
</td>
<td>
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId">
<c:forEach items="${xzs}" var="xz">
<c:if test="${fn:trim(xz.serviceDictId) eq attributeId}">${xz.itemValue},</c:if>
</c:forEach>
</c:forEach>
</td>
<td>
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId">
<c:forEach items="${lables}" var="lable">
<c:if test="${fn:trim(lable.serviceDictId) eq lableId}">${lable.itemValue},</c:if>
</c:forEach>
</c:forEach>
</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>
<c:forEach items="${fns:getDictList('SPEC_AUDIT')}" var="auditC">
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'created'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:if>
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'approved'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:if>
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'unapproved'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:if>
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'cancel'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:if>
</c:forEach>
</td>
<td functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}"><div class="loading-total"></div></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>
</body>
</html>

View File

@@ -216,7 +216,11 @@ $(function(){
<c:if test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action" serviceId="${service.serviceId }" value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action}">checked</c:if>>
<spring:message code="${service.actionCode }"/>
<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>

View File

@@ -2,14 +2,12 @@
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="${ctxStatic}/pages/css/dictInfo.css" />
<script type="text/javascript" src="${ctxStatic}/pages/scripts/specificServiceForm/specificServiceFormCfg.js"></script>
<title></title>
<script type="text/javascript">
var validateForm;
$(document).ready(function() {
//校验叶子节点有下级不得更改为叶子节点
jQuery.validator.addMethod("leafChange",function(value,element){
/* jQuery.validator.addMethod("leafChange",function(value,element){
var flagLeafChange=false;
$.ajax({
type:'post',
@@ -21,11 +19,11 @@
}
});
return flagLeafChange;
},"<spring:message code='leafChange'/>");
},"<spring:message code='leafChange'/>"); */
$("#name").focus();
validateForm = $("#inputForm").validate({
rules:{
/* rules:{
specServiceId:{
remote:'${ctx}/specific/specificServiceCfg/isIdRepeat?oldId=${specificServiceCfg.specServiceId}'
}
@@ -34,7 +32,7 @@
specServiceId:{
remote:'<spring:message code="repeat"/>'
}
},
}, */
submitHandler: function(form){
if(!validateForm.form()) {
@@ -93,7 +91,7 @@
<!-- BEGIN FORM-->
<form:form id="inputForm" modelAttribute="specificServiceCfg" action="${ctx}/specific/specificServiceCfg/saveOrUpdate" method="post" class="form-horizontal">
<input name="oldId" type="hidden" value="${specificServiceCfg.specServiceId}"/>
<input name="specServiceId" type="hidden" value="${specificServiceCfg.specServiceId}"/>
<form:hidden path="isValid" class="form-control"/>
<sys:message content="${message}"/>
<div class="form-group">
@@ -101,13 +99,13 @@
<div class="col-md-4">
<c:set var="fatherName"><spring:message code="root_node"/></c:set>
<sys:treeselect id="specificServiceCfg" name="parent.specServiceId" value="${specificServiceCfg.parent.specServiceId}" labelName="parent.specServiceName" labelValue="${specificServiceCfg.parent.specServiceId eq '0'?fatherName:fns:getBySpecServiceId(specificServiceCfg.parent.specServiceId).specServiceName}"
title="菜单" url="/specific/specificServiceCfg/treeData" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/>
title="" url="/specific/specificServiceCfg/treeData?isLeafShow=false" extId="${specificServiceCfg.specServiceId}" cssClass="required form-control"/>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="protocol_id"/>:</label>
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="protocol_code"/>:</label>
<div class="col-md-4">
<input id="specServiceId" name="specServiceId" maxlength="50" range="[0,2147483647]" class="form-control required digits" value="${specificServiceCfg.specServiceId}"/>
<input id="specServiceCode" name="specServiceCode" maxlength="50" range="[0,2147483647]" class="form-control required digits" value="${specificServiceCfg.specServiceCode}"/>
</div>
</div>
<div class="form-group">
@@ -122,7 +120,7 @@
<form:input path="groupId" htmlEscape="false" maxlength="50" range="[0,2147483647]" class="form-control digits" placeholder="0"/>
</div>
</div>
<div class="form-group">
<%-- <div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="is_leaf"/>:</label>
<div class="col-md-4">
<form:select path="isLeaf" class="form-control leafChange">
@@ -131,7 +129,7 @@
</c:forEach>
</form:select>
</div>
</div>
</div> --%>
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code="protocol_desc"/>:</label>
<div class="col-md-4">

View File

@@ -160,12 +160,12 @@
<div class="input-group">
<div class="input-group-btn">
<select id="seltype" class="selectpicker select2 input-middle" >
<option value="specServiceId"><spring:message code="protocol_id"/></option>
<option value="specServiceCode"><spring:message code="protocol_code"/></option>
<option value="specServiceName"><spring:message code="protocol_name"/></option>
<option value="groupId"><spring:message code="group_id"/></option>
</select>
</div>
<input id="intype" class="form-control input-medium" placeholder="<spring:message code='input_protocol_id'/>" type="text" onchange="casec()" maxlength="60">
<input id="intype" class="form-control input-medium" placeholder="<spring:message code='input_protocol_code'/>" type="text" onchange="casec()" maxlength="60">
</div>
@@ -252,7 +252,7 @@
<tr>
<th><input type="checkbox" class="ckboxs" id="selAll" onclick="selectAll()"></th>
<!-- <th>序号</th> -->
<th><spring:message code="protocol_id"/></th>
<th><spring:message code="protocol_code"/></th>
<th><spring:message code="protocol_name"/></th>
<th><spring:message code="protocol_desc"/></th>
<th><spring:message code="group_id"/></th>
@@ -265,7 +265,7 @@
<tr id="${specificServiceCfg.specServiceId}" pId="${specificServiceCfg.parent.specServiceId ne 0?specificServiceCfg.parent.specServiceId:0}">
<td><input type="checkbox" class="ckbox" name="check" value="${specificServiceCfg.specServiceId}"></td>
<%-- <td>${specificServiceCfg.showSequence}</td> --%>
<td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/specific/specificServiceCfg/form?specServiceId=${specificServiceCfg.specServiceId}&doAction=0">${specificServiceCfg.specServiceId}</a></td>
<td nowrap><i class="icon-icon-tablet"></i><a href="${ctx}/specific/specificServiceCfg/form?specServiceId=${specificServiceCfg.specServiceId}&doAction=0">${specificServiceCfg.specServiceCode}</a></td>
<td title="${specificServiceCfg.specServiceName}">${specificServiceCfg.specServiceName}</td>
<td title="${specificServiceCfg.specServiceDesc}">${fns:abbr(specificServiceCfg.specServiceDesc,15)}</td>
<td>${specificServiceCfg.groupId }</td>

View File

@@ -2,8 +2,7 @@
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<link rel="stylesheet" type="text/css"
href="${ctxStatic}/pages/css/dictInfo.css" />
<script type="text/javascript">
var validateForm;
function selectP(){
@@ -88,7 +87,6 @@ function selectP(){
<h3 class="page-title">
<spring:message code="agreement_ip_configuration" />
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
@@ -99,13 +97,10 @@ function selectP(){
</div>
<div class="tools"></div>
</div>
<div class="portlet-body form">
<div class="form-body">
<!-- BEGIN FORM-->
<form:form id="inputForm" modelAttribute="specificServiceHostCfg" action="${ctx}/specific/specificServiceHostCfg/saveOrUpdate" method="post" class="form-horizontal" >
<div class="form-body row">
<form:hidden path="hostId" class="form-control" />
<sys:message content="${message}" />
<div class="row">
@@ -113,15 +108,14 @@ function selectP(){
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code='protocol_name' />:</label>
<c:set var="spec_service_id"><spring:message code='select' /></c:set>
<form:select path="specServiceId" class="selectpicker select2 col-md-6" title="${spec_service_id}" data-live-search="true" data-live-search-placeholder="search" onchange="selectP()">
<c:forEach items="${listSpecService}" var="specService" >
<form:option value="${specService.specServiceId}">${specService.specServiceName}</form:option>
</c:forEach>
</form:select>
<!-- <label class="col-md-3 control-label dfdf" > </label>
<div class="col-md-6 dfdf">
<label class="error">不能为空!</label>
</div> -->
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
labelValue="${empty specificServiceHostCfg.specServiceId?spec_service_id:fns:getBySpecServiceId(specificServiceHostCfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false" extId=""
cssClass="form-control required"/>
</div>
</div>
</div>
@@ -129,9 +123,9 @@ function selectP(){
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code='direction' />:</label>
<div class="col-md-6">
<form:select path="direction" class="select2 form-control" >
<form:select path="direction" class="select2 form-control required" >
<form:option value=""><spring:message code='select' /></form:option>
<c:forEach items="${fns:getDictList('SPEC_DIRECTION')}" var="dict">
<c:forEach items="${fns:getDictList('DIRECTION')}" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}' /></form:option>
</c:forEach>
</form:select>
@@ -147,7 +141,7 @@ function selectP(){
<div class="col-md-6">
<form:select path="protocol" class="select2 form-control required" >
<form:option value=""><spring:message code='select' /></form:option>
<c:forEach items="${fns:getDictList('SPEC_PROTOCOL')}" var="dict">
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}' /></form:option>
</c:forEach>
</form:select>
@@ -159,8 +153,7 @@ function selectP(){
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code='ip_type' />:</label>
<div class="col-md-6">
<form:select path="ipType" class="select2 form-control required" >
<%-- <form:option value=""><spring:message code='select' /></form:option> --%>
<c:forEach items="${fns:getDictList('SPEC_IP_TYPE')}" var="dict">
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="dict">
<form:option value="${dict.itemCode}"><spring:message code='${dict.itemValue}' /></form:option>
</c:forEach>
</form:select>
@@ -171,22 +164,26 @@ function selectP(){
</div>
</div>
</div>
<c:set var="arbitraryValue"><spring:message code='arbitrary'/> : 0.0.0.0</c:set>
<c:set var="arbitraryPort"><spring:message code='arbitrary'/> : 0</c:set>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code='client_ip' />:</label>
<div class="col-md-6">
<form:input path="srcIp" htmlEscape="false" maxlength="50" class="form-control ipCheck" placeholder="${arbitraryValue}"/>
</div>
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="ip_pattern" /></label>
<div class="col-md-6">
<form:select path="ipPattern"
class="select2 form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
<option value="${ipPatternC.itemCode}" ><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code='server_ip' />:</label>
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code='server_ip' />:</label>
<div class="col-md-6">
<form:input path="dstIp" htmlEscape="false" maxlength="50" class="form-control ipCheck" placeholder="${arbitraryValue}"/>
<form:input class="form-control required ipCheck" type="text" path="destIpAddress" />
</div>
</div>
</div>
@@ -195,120 +192,29 @@ function selectP(){
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code='client_address_mask' />:</label>
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="port_pattern" /></label>
<div class="col-md-6">
<form:input path="srcIpMask" htmlEscape="false" maxlength="50" class="form-control ipMask" placeholder="${arbitraryValue}"/>
<form:select path="portPattern"
class="select2 form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
<option value="${portPatternC.itemCode}" ><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code='server_address_mask' />:</label>
<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">
<form:input path="dstIpMask" htmlEscape="false" maxlength="50" class="form-control ipMask" placeholder="${arbitraryValue}"/>
<form:input class="form-control required portCheck" type="text"
path="destPort" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code='client_port' />:</label>
<div class="col-md-6">
<form:input path="srcPort" htmlEscape="false" maxlength="50" range="[0,65535]" class="form-control required digits notStartZero" placeholder="${arbitraryPort}"/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code='server_port' />:</label>
<div class="col-md-6">
<form:input path="dstPort" htmlEscape="false" maxlength="50" range="[0,65535]" class="form-control required digits notStartZero" placeholder="${arbitraryPort}"/>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code='client_port_mask' />:</label>
<div class="col-md-6">
<form:input path="srcPortMask" htmlEscape="false" maxlength="50" range="[0,65535]" class="form-control digits notStartZero" placeholder="${arbitraryPort}"/>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><spring:message code='server_port_mask' />:</label>
<div class="col-md-6">
<form:input path="dstPortMask" htmlEscape="false" maxlength="50" range="[0,65535]" class="form-control digits notStartZero" placeholder="${arbitraryPort}"/>
</div>
</div>
</div>
</div>
<%-- <div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font>创建人员:</label>
<div class="col-md-6">
<form:input path="creator.id" htmlEscape="false" maxlength="50" class="form-control" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font>配置时间:</label>
<div class="col-md-6">
<form:input path="createTime" htmlEscape="false" maxlength="50" class="form-control" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font>修改人员:</label>
<div class="col-md-6">
<form:input path="editor.id" htmlEscape="false" maxlength="50" class="form-control" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font>修改时间:</label>
<div class="col-md-6">
<form:input path="editTime" htmlEscape="false" maxlength="50" class="form-control" />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font>审核人员:</label>
<div class="col-md-6">
<form:input path="auditor.id" htmlEscape="false" maxlength="50" class="form-control" />
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font>审核时间:</label>
<div class="col-md-6">
<form:input path="auditTime" htmlEscape="false" maxlength="50" class="form-control" />
</div>
</div>
</div>
</div> --%>
<div class="form-actions">
<div class="row">
<div class="col-md-offset-3 col-md-9">
@@ -317,16 +223,13 @@ function selectP(){
</div>
</div>
</div>
</div>
</form:form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -224,9 +224,9 @@
onClick="javascript:window.location='${ctx}/specific/specificServiceHostCfg/form'">
<i class="fa fa-plus"></i>
<spring:message code="add"/></button>
<button type="button" class="btn btn-primary green" data-toggle="modal" data-target="#exampleModal" onClick="toImport();">
<%-- <button type="button" class="btn btn-primary green" data-toggle="modal" data-target="#exampleModal" onClick="toImport();">
<i class="fa fa-upload"></i>
<spring:message code="import"/></button>
<spring:message code="import"/></button> --%>
</button>
</shiro:hasPermission>
</div>
@@ -256,11 +256,12 @@
<div class="col-md-12">
<div class="pull-left">
<c:set var="spec_service_id"><spring:message code="protocol_name"/></c:set>
<form:select path="specServiceId" class="selectpicker select2 input-small" title="${spec_service_id}" data-live-search="true" data-live-search-placeholder="search" onchange="page()">
<c:forEach items="${listSpecService}" var="specService" >
<form:option value="${specService.specServiceId}">${specService.specServiceName}</form:option>
</c:forEach>
</form:select>
<sys:treeselect id="specServiceId" name="specServiceId" value="${specificServiceCfg.parent.specServiceId}"
labelName="parent.specServiceName"
labelValue="${empty specificServiceHostCfg.specServiceId?spec_service_id:fns:getBySpecServiceId(specificServiceHostCfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false" extId=""
cssClass="form-control input-small"/>
</div>
<div class="pull-left" style="margin-right:0px;">
<form:select path="protocol" class="selectpicker select2 input-small" >
@@ -270,21 +271,9 @@
</c:forEach>
</form:select>
</div>
<%-- <div class="pull-left" style="margin-right:0px;">
<form:select path="ipType" class="selectpicker select2 input-small" >
<form:option value=""><spring:message code="ip_type"/></form:option>
<c:forEach items="${fns:getDictList('SPEC_IP_TYPE')}" var="dict">
<form:option value="${dict.itemCode}"><spring:message code="${dict.itemValue}"/></form:option>
</c:forEach>
</form:select>
</div> --%>
<div class="pull-left">
<c:set var = "condition_srcIp"><spring:message code="client_ip" /></c:set>
<form:input path="srcIp" placeholder="${condition_srcIp}" class="form-control input-small"/>
</div>
<div class="pull-left">
<c:set var = "condition_dstIp"><spring:message code="server_ip" /></c:set>
<form:input path="dstIp" placeholder="${condition_dstIp}" class="form-control input-small"/>
<form:input path="destIpAddress" placeholder="${condition_dstIp}" class="form-control input-small"/>
</div>
<div class="pull-left">
@@ -393,14 +382,9 @@
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th><spring:message code="protocol_name" /></th>
<th><spring:message code="client_ip" /></th>
<th><spring:message code="client_address_mask" /></th>
<th><spring:message code="client_port" /></th>
<th><spring:message code="client_port_mask" /></th>
<th><spring:message code="ip_type" /></th>
<th><spring:message code="server_ip" /></th>
<th><spring:message code="server_address_mask" /></th>
<th><spring:message code="server_port" /></th>
<th><spring:message code="server_port_mask" /></th>
<th><spring:message code="direction" /></th>
<th><spring:message code="protocol" /></th>
<%-- <th><spring:message code="is_audit" /></th> --%>
@@ -417,17 +401,15 @@
<tr>
<td><input type="checkbox" class="i-checks" name="check" id="${specificServiceHostCfg.hostId}" value="${specificServiceHostCfg.hostId}"></td>
<td>${fns:getBySpecServiceId(specificServiceHostCfg.specServiceId).specServiceName }</td>
<td title="${specificServiceHostCfg.srcIp}">${fns:abbr(specificServiceHostCfg.srcIp,15)}</td>
<td title="${specificServiceHostCfg.srcIpMask}">${fns:abbr(specificServiceHostCfg.srcIpMask,15) }</td>
<td>${specificServiceHostCfg.srcPort}</td>
<td>${specificServiceHostCfg.srcPortMask}</td>
<td title="${specificServiceHostCfg.dstIp}">${fns:abbr(specificServiceHostCfg.dstIp,15) }</td>
<td title="${specificServiceHostCfg.dstIpMask}">${fns:abbr(specificServiceHostCfg.dstIpMask,15) }</td>
<td>${specificServiceHostCfg.dstPort }</td>
<td>${specificServiceHostCfg.dstPortMask }</td>
<td><spring:message code='${fns:getDictLabel("SPEC_DIRECTION",specificServiceHostCfg.direction,"0")}' /></td>
<td><spring:message code='${fns:getDictLabel("SPEC_PROTOCOL",specificServiceHostCfg.protocol,"0")}' /></td>
<!--<td><spring:message code='${fns:getDictLabel("SPEC_AUDIT",specificServiceHostCfg.isAudit,"0")}' /></td> -->
<td>
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipType">
<c:if test="${ipType.itemCode eq specificServiceHostCfg.ipType}">${ipType.itemValue}</c:if>
</c:forEach>
</td>
<td>${specificServiceHostCfg.destIpAddress }</td>
<td>${specificServiceHostCfg.destPort }</td>
<td><spring:message code='${fns:getDictLabel("DIRECTION",specificServiceHostCfg.direction,"0")}' /></td>
<td><spring:message code='${fns:getDictLabel("PROTOCOL",specificServiceHostCfg.protocol,"0")}' /></td>
<td>${fns:getUserById(specificServiceHostCfg.creator.id).name}</td>
<td><fmt:formatDate value="${specificServiceHostCfg.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${fns:getUserById(specificServiceHostCfg.editor.id==null?0:specificServiceHostCfg.editor.id).name}</td>

View File

@@ -170,13 +170,7 @@ jQuery.validator.addMethod("notStartZero",function(value, element) {
jQuery.validator.addMethod("ipCheck",function(value, element) {
if(value.length==0||value.trim().length==0){return true;}
var typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val();
if(!typeInt){
typeInt=$(element).parents(".row").parent(".row").find("select[name$='ipType']").val();
}
var ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val();
if(!ipPattern){
ipPattern=$(element).parents(".row").parent(".row").find("select[name$='ipPattern']").val();
}
if(typeInt==4){
if(ipPattern){
if(ipPattern==1){//ip/掩码格式
@@ -292,9 +286,6 @@ jQuery.validator.addMethod("ipMask",function(value, element) {
jQuery.validator.addMethod("portCheck",function(value, element) {
if(value.length==0||value.trim().length==0){return true;}
var typeInt=$(element).parents(".row").parent(".row").find("select[name$='portPattern']").val();
if(!typeInt){
typeInt=$(element).parents(".row").parent(".row").find("select[name$='portPattern']").val();
}
if(typeInt==1){//port 0~65535
if(this.optional(element)||(/^(0|[1-9][0-9]{0,4})$/.test(value)&& RegExp.$1 <=65535)){
return true;