欺骗ip配置(未走maat)

This commit is contained in:
chenjinsong
2018-03-22 14:41:10 +08:00
parent 6e373f513b
commit 659dc9fc2c
14 changed files with 1333 additions and 120 deletions

View File

@@ -1,29 +1,35 @@
/**
*@Title: DnsIpConfig.java
*@Package com.nis.domain.restful
*@Description TODO
*@Description 欺骗IP实体类
*@author dell
*@date 2018年2月5日 下午2:57:17
*@version 版本号
*/
package com.nis.domain.configuration;
import java.util.Date;
import com.nis.domain.BaseEntity;
import com.nis.domain.SysUser;
/**
* @ClassName: DnsIpConfig.java
* @Description: TODO
* @author (dell)
* @date 2018年2月5日 下午2:57:17
* @version V1.0
*/
public class DnsIpCfg extends BaseCfg<DnsIpCfg> {
public class DnsIpCfg extends BaseEntity<DnsIpCfg> {
/**
* @Fields serialVersionUID:TODO用一句话描述这个变量表示什么
*
* @since 1.0.0
*/
private static final long serialVersionUID = -4476190616323264876L;
/**
* 配置ID
*/
private Long cfgId;
/**
* 配置描述
*/
private String cfgDesc;
/**
* ip类型
*/
@@ -69,171 +75,257 @@ public class DnsIpCfg extends BaseCfg<DnsIpCfg> {
*/
private Integer protocol ;
/**
* ipType
* @return ipType
*/
* 有效标识
*/
private Integer isValid;
/**
* 是否审核
*/
private Integer isAudit;
/**
* 创建人
*/
private SysUser creator;
/**
* 创建时间
*/
private Date createTime;
/**
* 最后修改人
*/
private SysUser editor;
/**
* 最后修改时间
*/
private Date editTime;
/**
* 审核人
*/
private SysUser auditor;
/**
* 审核时间
*/
private Date auditTime;
/**
* 来函
*/
private RequestInfo request;
/**
* 欺骗id
*/
private Integer fakeId;
/**
* 分类
*/
private String classify;
/**
* 性质
*/
private String attribute;
/**
* 标签
*/
private String lable;
public Long getCfgId() {
return cfgId;
}
public void setCfgId(Long cfgId) {
this.cfgId = cfgId;
}
public String getCfgDesc() {
return cfgDesc;
}
public void setCfgDesc(String cfgDesc) {
this.cfgDesc = cfgDesc;
}
public Integer getIpType() {
return ipType;
}
/**
* @param ipType the ipType to set
*/
public void setIpType(Integer ipType) {
this.ipType = ipType;
}
/**
* srcIp
* @return srcIp
*/
public String getSrcIp() {
return srcIp;
}
/**
* @param srcIp the srcIp to set
*/
public void setSrcIp(String srcIp) {
this.srcIp = srcIp;
}
/**
* srcIpMask
* @return srcIpMask
*/
public String getSrcIpMask() {
return srcIpMask;
return srcIpMask;
}
/**
* @param srcIpMask the srcIpMask to set
*/
public void setSrcIpMask(String srcIpMask) {
this.srcIpMask = srcIpMask;
}
/**
* srcPort
* @return srcPort
*/
public String getSrcPort() {
return srcPort;
}
/**
* @param srcPort the srcPort to set
*/
public void setSrcPort(String srcPort) {
this.srcPort = srcPort;
}
/**
* srcPortMask
* @return srcPortMask
*/
public String getSrcPortMask() {
return srcPortMask;
}
/**
* @param srcPortMask the srcPortMask to set
*/
public void setSrcPortMask(String srcPortMask) {
this.srcPortMask = srcPortMask;
}
/**
* dstIp
* @return dstIp
*/
public String getDstIp() {
return dstIp;
}
/**
* @param dstIp the dstIp to set
*/
public void setDstIp(String dstIp) {
this.dstIp = dstIp;
}
/**
* dstIpMask
* @return dstIpMask
*/
public String getDstIpMask() {
return dstIpMask;
}
/**
* @param dstIpMask the dstIpMask to set
*/
public void setDstIpMask(String dstIpMask) {
this.dstIpMask = dstIpMask;
}
/**
* dstPort
* @return dstPort
*/
public String getDstPort() {
return dstPort;
}
/**
* @param dstPort the dstPort to set
*/
public void setDstPort(String dstPort) {
this.dstPort = dstPort;
}
/**
* dstPortMask
* @return dstPortMask
*/
public String getDstPortMask() {
return dstPortMask;
}
/**
* @param dstPortMask the dstPortMask to set
*/
public void setDstPortMask(String dstPortMask) {
this.dstPortMask = dstPortMask;
}
/**
* direction
* @return direction
*/
public Integer getDirection() {
return direction;
}
/**
* @param direction the direction to set
*/
public void setDirection(Integer direction) {
this.direction = direction;
}
/**
* protocol
* @return protocol
*/
public Integer getProtocol() {
return protocol;
}
/**
* @param protocol the protocol to set
*/
public void setProtocol(Integer protocol) {
this.protocol = protocol;
}
/* (non-Javadoc)
* @see com.nis.domain.configuration.BaseCfg#initDefaultValue()
*/
@Override
public void initDefaultValue() {
// TODO Auto-generated method stub
super.initDefaultValue();
this.srcIp ="0.0.0.0";
this.srcPortMask = "65535" ;
this.dstIp = "0.0.0.0" ;
this.dstPortMask = "65535";
this.direction = 0;
public Integer getIsValid() {
return isValid;
}
public void setIsValid(Integer isValid) {
this.isValid = isValid;
}
public Integer getIsAudit() {
return isAudit;
}
public void setIsAudit(Integer isAudit) {
this.isAudit = isAudit;
}
public SysUser getCreator() {
return creator;
}
public void setCreator(SysUser creator) {
this.creator = creator;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public SysUser getEditor() {
return editor;
}
public void setEditor(SysUser editor) {
this.editor = editor;
}
public Date getEditTime() {
return editTime;
}
public void setEditTime(Date editTime) {
this.editTime = editTime;
}
public SysUser getAuditor() {
return auditor;
}
public void setAuditor(SysUser auditor) {
this.auditor = auditor;
}
public Date getAuditTime() {
return auditTime;
}
public void setAuditTime(Date auditTime) {
this.auditTime = auditTime;
}
public RequestInfo getRequest() {
return request;
}
public void setRequest(RequestInfo request) {
this.request = request;
}
public Integer getFakeId() {
return fakeId;
}
public void setFakeId(Integer fakeId) {
this.fakeId = fakeId;
}
public String getClassify() {
return classify;
}
public void setClassify(String classify) {
this.classify = classify;
}
public String getAttribute() {
return attribute;
}
public void setAttribute(String attribute) {
this.attribute = attribute;
}
public String getLable() {
return lable;
}
public void setLable(String lable) {
this.lable = lable;
}
private Date searchCreateTimeStart;
private Date searchCreateTimeEnd;
private Date searchEditTimeStart;
private Date searchEditTimeEnd;
private Date searchAuditTimeStart;
private Date searchAuditTimeEnd;
public Date getSearchCreateTimeStart() {
return searchCreateTimeStart;
}
public void setSearchCreateTimeStart(Date searchCreateTimeStart) {
this.searchCreateTimeStart = searchCreateTimeStart;
}
public Date getSearchCreateTimeEnd() {
return searchCreateTimeEnd;
}
public void setSearchCreateTimeEnd(Date searchCreateTimeEnd) {
this.searchCreateTimeEnd = searchCreateTimeEnd;
}
public Date getSearchEditTimeStart() {
return searchEditTimeStart;
}
public void setSearchEditTimeStart(Date searchEditTimeStart) {
this.searchEditTimeStart = searchEditTimeStart;
}
public Date getSearchEditTimeEnd() {
return searchEditTimeEnd;
}
public void setSearchEditTimeEnd(Date searchEditTimeEnd) {
this.searchEditTimeEnd = searchEditTimeEnd;
}
public Date getSearchAuditTimeStart() {
return searchAuditTimeStart;
}
public void setSearchAuditTimeStart(Date searchAuditTimeStart) {
this.searchAuditTimeStart = searchAuditTimeStart;
}
public Date getSearchAuditTimeEnd() {
return searchAuditTimeEnd;
}
public void setSearchAuditTimeEnd(Date searchAuditTimeEnd) {
this.searchAuditTimeEnd = searchAuditTimeEnd;
}
}

View File

@@ -31,6 +31,7 @@ import com.nis.web.service.configuration.AppCfgService;
import com.nis.web.service.configuration.ComplexStringCfgService;
import com.nis.web.service.configuration.FtpCfgService;
import com.nis.web.service.configuration.IpCfgService;
import com.nis.web.service.configuration.DnsIpCfgService;
import com.nis.web.service.configuration.MailCfgService;
import com.nis.web.service.configuration.MediaCfgService;
import com.nis.web.service.configuration.NumCfgService;
@@ -74,6 +75,9 @@ public class BaseController {
@Autowired
protected IpCfgService ipCfgService;
@Autowired
protected DnsIpCfgService dnsIpCfgService;
@Autowired
protected WebCfgService webCfgService;

View File

@@ -0,0 +1,98 @@
package com.nis.web.controller.configuration;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.cxf.common.util.StringUtils;
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.basics.ServiceDictInfo;
import com.nis.domain.configuration.DnsIpCfg;
import com.nis.domain.configuration.RequestInfo;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/cfg/dnsIp")
public class DnsIpCfgController extends BaseController {
@ModelAttribute
public DnsIpCfg get(Long cfgId) {
if (!StringUtil.isEmpty(cfgId)){
return dnsIpCfgService.get(cfgId);
}else{
return new DnsIpCfg();
}
}
@RequestMapping("list")
public String list(Model model, HttpServletRequest request, HttpServletResponse response, DnsIpCfg dnsIpCfg) {
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, 30), dnsIpCfg);
model.addAttribute("page", page);
addRequestAndServiceDictToModel(model);
return "/cfg/dnsIpCfgList";
}
@RequestMapping("form")
public String form(Model model, DnsIpCfg dnsIpCfg) {
addRequestAndServiceDictToModel(model);
return "/cfg/dnsIpCfgForm";
}
@RequestMapping("save")
public String save(Model model, DnsIpCfg dnsIpCfg, RedirectAttributes redirectAttributes) {
Date now = new Date();
if (dnsIpCfg.getCfgId() == null) {//新增
dnsIpCfg.setFakeId(0);
dnsIpCfg.setIsValid(1);
dnsIpCfg.setCreateTime(now);
dnsIpCfg.setCreator(UserUtils.getUser());
} else {//修改
dnsIpCfg.setEditor(UserUtils.getUser());
dnsIpCfg.setEditTime(now);
}
dnsIpCfgService.save(dnsIpCfg);
addMessage(redirectAttributes, "保存成功");
return "redirect:" + adminPath + "/cfg/dnsIp/list";
}
@RequestMapping("delete")
public String delete(Model model, String cfgIds, RedirectAttributes redirectAttributes) {
if (!StringUtils.isEmpty(cfgIds)) {
try {
dnsIpCfgService.delete(cfgIds);
addMessage(redirectAttributes, "删除成功");
} catch (Exception e) {
e.printStackTrace();
addMessage(redirectAttributes, "删除失败");
}
} else {
addMessage(redirectAttributes, "删除失败");
}
return "redirect:" + adminPath + "/cfg/dnsIp/list";
}
private void addRequestAndServiceDictToModel(Model model) {
List<RequestInfo> requestInfos = requestInfoService.getAllRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls = serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs = serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables = serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
}
}

View File

@@ -0,0 +1,10 @@
package com.nis.web.dao.configuration;
import com.nis.domain.configuration.DnsIpCfg;
import com.nis.web.dao.CrudDao;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface DnsIpCfgDao extends CrudDao<DnsIpCfg> {
}

View File

@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.nis.web.dao.configuration.DnsIpCfgDao">
<resultMap id="dnsIpCfgMap" type="com.nis.domain.configuration.DnsIpCfg">
<id column="cfg_id" property="cfgId"/>
<result column="cfg_desc" property="cfgDesc"/>
<result column="ip_type" property="ipType"/>
<result column="src_ip" property="srcIp"/>
<result column="src_ip_mask" property="srcIpMask"/>
<result column="src_port" property="srcPort"/>
<result column="src_port_mask" property="srcPortMask"/>
<result column="dst_ip" property="dstIp"/>
<result column="dst_ip_mask" property="dstIpMask"/>
<result column="dst_port" property="dstPort"/>
<result column="dst_port_mask" property="dstPortMask"/>
<result column="direction" property="direction"/>
<result column="protocol" property="protocol"/>
<result column="is_valid" property="isValid"/>
<result column="is_audit" property="isAudit"/>
<result column="creator_id" property="creator.id"/>
<result column="create_time" property="createTime"/>
<result column="editor_id" property="editor.id"/>
<result column="edit_time" property="editTime"/>
<result column="auditor_id" property="auditor.id"/>
<result column="audit_time" property="auditTime"/>
<result column="request_id" property="request.id"/>
<result column="fake_id" property="fakeId"/>
<result column="classify" property="classify"/>
<result column="attribute" property="attribute"/>
<result column="label" property="label"/>
</resultMap>
<sql id="columns">
dic.CFG_ID, dic.CFG_DESC, dic.IP_TYPE, dic.SRC_IP, dic.SRC_IP_MASK, dic.SRC_PORT,
dic.SRC_PORT_MASK, dic.DST_IP, dic.DST_IP_MASK, dic.DST_PORT, dic.DST_PORT_MASK,
dic.DIRECTION, dic.PROTOCOL, dic.IS_VALID, dic.IS_AUDIT, dic.CREATOR_ID,
dic.CREATE_TIME, dic.EDITOR_ID, dic.EDIT_TIME, dic.AUDITOR_ID, dic.AUDIT_TIME,
dic.REQUEST_ID, dic.FAKE_ID, dic.CLASSIFY, dic.ATTRIBUTE, dic.LABLE
</sql>
<select id="findList" resultMap="dnsIpCfgMap">
select
<include refid="columns"></include>,
c.name as "creator.name",
e.name as "editor.name",
a.name as "auditor.name",
ri.request_title as "request.requestTitle"
from dns_ip_cfg dic
left join sys_user c on dic.creator_id=c.id
left join sys_user e on dic.creator_id=e.id
left join sys_user a on dic.creator_id=a.id
left join request_info ri on dic.request_id=ri.id
where dic.is_valid=1
<if test="searchCreateTimeStart != null">
and dic.create_time &gt;= #{searchCreateTimeStart}
</if>
<if test="searchCreateTimeEnd != null">
and dic.create_time &lt;= #{searchCreateTimeEnd}
</if>
<if test="searchEditTimeStart != null">
and dic.create_time &gt;= #{searchEditTimeStart}
</if>
<if test="searchEditTimeEnd != null">
and dic.create_time &lt;= #{searchEditTimeEnd}
</if>
<if test="searchAuditTimeStart != null">
and dic.create_time &gt;= #{searchAuditTimeStart}
</if>
<if test="searchAuditTimeEnd != null">
and dic.create_time &lt;= #{searchAuditTimeEnd}
</if>
<if test="isAudit != null">
and dic.is_audit = #{isAudit}
</if>
<if test="request != null and request.id != null">
and dic.request_id = #{request.id}
</if>
<if test="classify != null and classify != ''">
and concat(",", dic.classify, ",") like concat("%,", #{classify}, ",%")
</if>
<if test="attribute != null and attribute != ''">
and concat(",", dic.attribute, ",") like concat("%,", #{attribute}, ",%")
</if>
<if test="lable != null and lable != ''">
and concat(",", dic.lable, ",") like concat("%,", #{lable}, ",%")
</if>
</select>
<select id="get" resultMap="dnsIpCfgMap">
select
<include refid="columns"></include>,
c.name as "creator.name",
e.name as "editor.name",
a.name as "auditor.name",
ri.request_title as "request.requestTitle"
from dns_ip_cfg dic
left join sys_user c on dic.creator_id=c.id
left join sys_user e on dic.creator_id=e.id
left join sys_user a on dic.creator_id=a.id
left join request_info ri on dic.request_id=ri.id
where dic.cfg_id=#{id}
</select>
<insert id="insert">
insert into dns_ip_cfg (
cfg_desc, 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, request_id, fake_id, classify, attribute, lable
) values (
#{cfgDesc}, #{ipType}, #{srcIp}, #{srcIpMask}, #{srcPort}, #{srcPortMask},
#{dstIp}, #{dstIpMask}, #{dstPort}, #{dstPortMask}, #{direction}, #{protocol},
#{isValid}, #{isAudit}, #{creator.id}, #{createTime}, #{request.id}, #{fakeId},
#{classify}, #{attribute}, #{lable}
)
</insert>
<update id="update">
update
dns_ip_cfg
set
cfg_desc=#{cfgDesc}, ip_type=#{ipType}, src_ip=#{srcIp}, src_ip_mask=#{srcIpMask},
src_port=#{srcPort}, src_port_mask=#{srcPortMask}, dst_ip=#{dstIp},
dst_ip_mask=#{dstIpMask}, dst_port=#{dstPort}, dst_port_mask=#{dstPortMask},
direction=#{direction}, protocol=#{protocol}, request_id=#{request.id},
fake_id=#{fakeId}, classify=#{classify}, attribute=#{attribute}, lable=#{lable},
editor_id=#{editor.id}, edit_time=#{editTime}
where cfg_id=#{cfgId}
</update>
<update id="delete">
update
dns_ip_cfg
set
is_valid=0
where cfg_id=#{cfgId}
</update>
</mapper>

View File

@@ -0,0 +1,31 @@
package com.nis.web.service.configuration;
import org.springframework.stereotype.Service;
import com.nis.domain.configuration.DnsIpCfg;
import com.nis.web.dao.configuration.DnsIpCfgDao;
import com.nis.web.service.CrudService;
@Service
public class DnsIpCfgService extends CrudService<DnsIpCfgDao, DnsIpCfg>{
@Override
public void save(DnsIpCfg dnsIpCfg) {
if (dnsIpCfg.getCfgId() == null) {
dao.insert(dnsIpCfg);
} else {
dao.update(dnsIpCfg);
}
//TODO 下发流程
}
public void delete(String cfgIds) {
String[] cfgIdsArr = cfgIds.split(",");
for (String cfgId : cfgIdsArr) {
DnsIpCfg d = new DnsIpCfg();
d.setCfgId(Long.valueOf(cfgId));
dao.delete(d);
}
//TODO 下发流程
}
}

View File

@@ -175,6 +175,7 @@ one_more=please choose at least one !
#==========message end=====================
#==========yewuliexingguanli begin=====================
all=all
act=action
block=block
monitor=monitor

View File

@@ -175,6 +175,7 @@ one_more=please choose at least one !
#==========message end=====================
#==========yewuliexingguanli begin=====================
all=all
act=action
block=block
monitor=monitor

View File

@@ -174,6 +174,7 @@ one_more=\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u6570\u636e!
#==========message end=====================
#==========yewuliexingguanli begin=====================
all=\u5168\u90E8
act=\u52a8\u4f5c
block=\u963b\u65ad
monitor=\u76d1\u6d4b

View File

@@ -0,0 +1,473 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<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"/>
<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>
</c:when>
<c:when test="${cookie.Language.value eq 'en'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:when>
<c:when test="${cookie.Language.value eq 'ru_RU'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-ru_RU.min.js"></script>
</c:when>
<c:otherwise>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:otherwise>
</c:choose>
<script type="text/javascript">
$(function(){
$("#submitBtn").on("click",function(){
$("#inputFrom").attr("action","${ctx}/cfg/dnsIp/save");
$("#inputFrom").submit();
});
$("#cancel").on("click",function(){
window.history.back();
});
$("select[name='ipType']").on("change",function(){
var type=$(this).val();
if(4==type){
if(!$("input[name='srcIpMask']").val()){
$("input[name='srcIpMask']").val("255.255.255.255");
}else if($("input[name='srcIpMask']").val()=="FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"){
$("input[name='srcIpMask']").val("255.255.255.255");
}
if(!$("input[name='dstIpMask']").val()){
$("input[name='dstIpMask']").val("255.255.255.255");
}else if($("input[name='dstIpMask']").val()=="FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"){
$("input[name='dstIpMask']").val("255.255.255.255");
}
if(!$("input[name='srcIp']").val()){
$("input[name='srcIp']").val("0.0.0.0");
}else if($("input[name='srcIp']").val()=="::"){
$("input[name='srcIp']").val("0.0.0.0");
}
if(!$("input[name='dstIp']").val()){
$("input[name='dstIp']").val("0.0.0.0");
}else if($("input[name='dstIp']").val()=="::"){
$("input[name='dstIp']").val("0.0.0.0");
}
}
if(6==type){
if(!$("input[name='srcIpMask']").val()){
$("input[name='srcIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}else if($("input[name='srcIpMask']").val()=="255.255.255.255"){
$("input[name='srcIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}
if(!$("input[name='dstIpMask']").val()){
$("input[name='dstIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}else if($("input[name='dstIpMask']").val()=="255.255.255.255"){
$("input[name='dstIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}
if(!$("input[name='srcIp']").val()){
$("input[name='srcIp']").val("::");
}else if($("input[name='srcIp']").val()=="0.0.0.0"){
$("input[name='srcIp']").val("::");
}
if(!$("input[name='dstIp']").val()){
$("input[name='dstIp']").val("::");
}else if($("input[name='dstIp']").val()=="0.0.0.0"){
$("input[name='dstIp']").val("::");
}
}
});
$("#inputFrom").validate({
rules: {
cfgDesc: {
required: true,
},
ipType: {
required: true,
},
srcIp: {
required: true,
checkIp: true
},
srcIpMask: {
required: true,
},
srcPort: {
required: true,
max: 65535,
min: 0
},
srcPortMask: {
required: true,
},
dstIp: {
required: true,
checkIp: true
},
dstIpMask: {
required: true,
},
dstPort: {
required: true,
max: 65535,
min: 0
},
dstPortMask: {
required: true,
},
direction: {
required: true,
},
protocol: {
required: true,
},
requestId: {
required: true,
}
},
messages: {
cfgDesc: {
required: '<spring:message code="required"/>',
},
ipType: {
required: '<spring:message code="required"/>',
},
srcIp: {
required: '<spring:message code="required"/>',
},
srcIpMask: {
required: '<spring:message code="required"/>',
},
srcPort: {
required: '<spring:message code="required"/>',
max: '范围0-65535!',
min: '范围0-65535!'
},
srcPortMask: {
required: '<spring:message code="required"/>',
},
dstIp: {
required: '<spring:message code="required"/>',
},
dstIpMask: {
required: '<spring:message code="required"/>',
},
dstPort: {
required: '<spring:message code="required"/>',
max: '范围0-65535!',
min: '范围0-65535!'
},
dstPortMask: {
required: '<spring:message code="required"/>',
},
direction: {
required: '<spring:message code="required"/>',
},
protocol: {
required: '<spring:message code="required"/>',
},
requestId: {
required: '<spring:message code="required"/>',
}
},
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",
});
$.validator.addMethod(
"checkIp",
function(value, element, params) {
var checkIp;
if ($("[name=ipType]").val() == 4) {
checkIp = /((25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))/;
} else {
checkIp = /\S+/;
}
return this.optional(element) || (checkIp.test(value) && (RegExp.$1 < 256 && RegExp.$2 < 256 && RegExp.$3 < 256 && RegExp.$4 < 256));
},
"请输入正确的IP!"
);
});
</script>
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<spring:message code="dns_ipdnsIpCfg"></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 dnsIpCfg.cfgId}"><spring:message code="add"></spring:message></c:if>
<c:if test="${not empty dnsIpCfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="inputFrom" method="post" class="form-horizontal">
<input name="cfgId" value="${dnsIpCfg.cfgId }" type="hidden"/>
<div class="form-body">
<div class="row">
<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="config_describe"/></label>
<div class="col-md-6">
<input class="form-control" type="text" id="cfgDesc" name="cfgDesc" value="${dnsIpCfg.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="ip_type"/></label>
<div class="col-md-6">
<select name="ipType" class="selectpicker show-tick form-control" title=<spring:message code="select"/>>
<option value="4" <c:if test="${dnsIpCfg.ipType==4}">selected</c:if> >V4</option>
<option value="6" <c:if test="${dnsIpCfg.ipType==6}">selected</c:if>>V6</option>
</select>
</div>
<div for="ipType"></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="client_ip"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="srcIp" value="${dnsIpCfg.srcIp}">
</div>
<div for="srcIp"></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="client_address_mask"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="srcIpMask" value="${dnsIpCfg.srcIpMask}">
</div>
<div for="srcIpMask"></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="client_port"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="srcPort" value="${dnsIpCfg.srcPort}">
</div>
<div for="srcPort"></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="client_port_mask"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="srcPortMask" value="${dnsIpCfg.srcPortMask}">
</div>
<div for="srcPortMask"></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_ip"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="dstIp" value="${dnsIpCfg.dstIp}">
</div>
<div for="dstIp"></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_address_mask"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="dstIpMask" value="${dnsIpCfg.dstIpMask}">
</div>
<div for="dstIpMask"></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" type="text" name="dstPort" value="${dnsIpCfg.dstPort}">
</div>
<div for="dstPort"></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_port_mask"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="dstPortMask" value="${dnsIpCfg.dstPortMask}">
</div>
<div for="dstPortMask"></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="direction"/></label>
<div class="col-md-6">
<select name="direction" class="selectpicker show-tick form-control" title=<spring:message code="select"/>>
<option value="0" <c:if test="${dnsIpCfg.direction==0}">selected</c:if>><spring:message code="twoway"/></option>
<option value="1" <c:if test="${dnsIpCfg.direction==1}">selected</c:if>><spring:message code="oneway"/></option>
</select>
</div>
<div for="direction"></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="protocol"/></label>
<div class="col-md-6">
<select name="protocol" class="selectpicker show-tick form-control" title=<spring:message code="select"/>>
<option value="6" <c:if test="${dnsIpCfg.protocol==6}">selected</c:if>>TCP</option>
<option value="17" <c:if test="${dnsIpCfg.protocol==17}">selected</c:if>>UDP</option>
<option value="0" <c:if test="${dnsIpCfg.protocol==0}">selected</c:if>><spring:message code="arbitrary"/></option>
</select>
</div>
<div for="protocol"></div>
</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="letter"/></label>
<div class="col-md-6">
<select name="request.id" title=<spring:message code="select"/> data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control">
<c:forEach items="${requestInfos}" var="requestInfo">
<option value="${requestInfo.id}"
<c:if test="${requestInfo.isValid==0 or requestInfo.isAudit==3}">disabled="disabled"</c:if>
<c:if test="${requestInfo.id==dnsIpCfg.request.id}">selected</c:if>>${requestInfo.requestTitle}</option>
</c:forEach>
</select>
</div>
<div for="request.id"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="type"/></label>
<div class="col-md-6">
<select name="classify" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${fls}" var="fl">
<c:choose>
<c:when test="${dnsIpCfg.classify==null or dnsIpCfg.classify==''}">
<option value="${fl.serviceDictId}">${fl.itemValue}</option>
</c:when>
<c:when test="${fn:contains(dnsIpCfg.classify,',')}">
<option value="${fl.serviceDictId}"
<c:forEach items="${fn:split(dnsIpCfg.classify,',')}" var="_classify">
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
</c:forEach>
>${fl.itemValue}</option>
</c:when>
<c:otherwise>
<option value="${fl.serviceDictId}"
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fn:trim(fl.serviceDictId) eq _classify}">selected</c:if>
>${fl.itemValue}</option>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</div>
</div>
<!--/span-->
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="attribute"/></label>
<div class="col-md-6">
<select name="attribute" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${xzs}" var="xz">
<c:choose>
<c:when test="${dnsIpCfg.attribute==null or dnsIpCfg.attribute==''}">
<option value="${xz.serviceDictId}">${xz.itemValue}</option>
</c:when>
<c:otherwise>
<c:forEach items="${fn:split(dnsIpCfg.attribute,',')}" var="_attribute">
<option value="${xz.serviceDictId}"
<c:if test="${xz.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fn:trim(xz.serviceDictId) eq _attribute}">selected</c:if>
>${xz.itemValue}</option>
</c:forEach>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="label"/></label>
<div class="col-md-6">
<select name="lable" multiple class="selectpicker form-control" title=<spring:message code="select"/>>
<c:forEach items="${lables}" var="lable">
<c:choose>
<c:when test="${dnsIpCfg.lable==null or dnsIpCfg.lable==''}">
<option value="${lable.serviceDictId}">${lable.itemValue}</option>
</c:when>
<c:otherwise>
<c:forEach items="${fn:split(dnsIpCfg.lable,',')}" var="_lable">
<option value="${lable.serviceDictId}"
<c:if test="${lable.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fn:trim(lable.serviceDictId) eq _lable}">selected</c:if>
>${lable.itemValue}</option>
</c:forEach>
</c:otherwise>
</c:choose>
</c:forEach>
</select>
</div>
</div>
</div>
</div>
</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">
<input id="submitBtn" type="submit" class="btn btn-circle blue" value=<spring:message code="submit"></spring:message>>
<button id="cancel" type="button" class="btn btn-circle grey-salsa btn-outline" onclick="history.go(-1)"><spring:message code="cancel"></spring:message></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,358 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<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"/>
<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>
</c:when>
<c:when test="${cookie.Language.value eq 'en'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:when>
<c:when test="${cookie.Language.value eq 'ru_RU'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-ru_RU.min.js"></script>
</c:when>
<c:otherwise>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:otherwise>
</c:choose>
<script>
$(document).ready(function() {
//筛选功能初始化
filterActionInit();
//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();
});
$("#checkAll").click(function() {
var checkFlag = $(this).prop("checked");
$(".child-checks").prop("checked", checkFlag);
});
});
//查询
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").attr("action", "${ctx}/cfg/dnsIp/list");
$("#searchForm").submit();
return false;
}
function edit() {
var checkboxes = $(".child-checks:checked");
if (checkboxes.length == 0) {
alertx("请选择一条配置");
} else if (checkboxes.length > 1) {
alertx("只能选择一条配置");
} else {
window.location.href = "${ctx}/cfg/dnsIp/form?cfgId=" + checkboxes.attr("id");
}
}
function delCfg() {
var checkboxes = $(".child-checks:checked");
if (checkboxes.length == 0) {
alertx("请选择一条配置");
} else {
var ids;
checkboxes.each(function(){
ids = ids + $(this).attr("id") + ",";
});
confirmx("<spring:message code='confirm_message'/>", "${ctx}/cfg/dnsIp/delete?cfgIds=" + ids);
}
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="javascript:window.location='${ctx}/cfg/dnsIp/list'"><spring:message code="refresh"></spring:message></button>
<shiro:hasPermission name="system:service:view">
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/cfg/dnsIp/form'"><spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="dns_ip_cfg"></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" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="dnsIpCfg" method="post" class="form-search">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${dnsIpCfg.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"></spring:message><spring:message code="state"></spring:message></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">
<c:set var="request_number"><spring:message code='request_number'/></c:set>
<form:select path="request.id" class="selectpicker select2 input-small" title="${request_number}" data-live-search="true" data-live-search-placeholder="search">
<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 class="pull-left">
<c:set var="flI18n"><spring:message code='type'/></c:set>
<form:select path="classify" class="selectpicker select2 input-small" title="${flI18n}" data-live-search="true" data-live-search-placeholder="search">
<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 class="pull-left">
<c:set var="attributeI18n"><spring:message code='attribute'/></c:set>
<form:select path="attribute" class="selectpicker select2 input-small" title="${attributeI18n}" data-live-search="true" data-live-search-placeholder="search">
<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 class="pull-left">
<c:set var="labelI18n"><spring:message code='label'/></c:set>
<form:select path="lable" class="selectpicker select2 input-small" title="${labelI18n}" data-live-search="true" data-live-search-placeholder="search">
<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 class="pull-left">
<button type="button" class="btn btn-default" id="filter-btn"> 筛选 <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-left">
<button type="button" class="btn btn-default" onclick="return page();"> <i class="fa fa-search"></i></button>
</div>
<div class="pull-left">
<button type="button" class="btn btn-default resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/></button>
</div>
<div class="pull-right">
<%-- <button type="button" class="btn btn-default" onclick="edit()">
<i class="fa fa-edit"></i> <spring:message code="edit"/>
</button> --%>
<button class="btn btn-default" onclick="delCfg()" data-toggle="tooltip" data-placement="top">
<i class="fa fa-trash"> <spring:message code="delete"/></i>
</button>
<%-- <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><a href="javascript:void(0)" onclick="pass()">通过</a></li>
<li><a href="javascript:void(0)" onclick="noPass()">不通过</a></li>
<li><a href="javascript:void(0)" onclick="cancelPass()">取消通过</a></li>
</ul>
</div> --%>
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title="自定义列字段" 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-6">
<div class="pull-left">
<label><spring:message code="config_time"/></label>
</div>
<div class="pull-left">
<input name="searchCreateTimeStart" type="text" readonly="readonly" maxlength="20" class="form-control input-medium Wdate"
value="<fmt:formatDate value='${dnsIpCfg.searchCreateTimeStart}' pattern='yyyy-MM-dd HH:mm:ss'/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
<div class="pull-left">
<label>-</label>
</div>
<div class="pull-left">
<input name="searchCreateTimeEnd" type="text" readonly="readonly" maxlength="20" class="form-control input-medium Wdate"
value="<fmt:formatDate value="${dnsIpCfg.searchCreateTimeEnd}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-6">
<div class="pull-left">
<label><spring:message code="edit_time"/></label>
</div>
<div class="pull-left">
<input name="searchEditTimeStart" type="text" readonly="readonly" maxlength="20" class="form-control input-medium Wdate"
value="<fmt:formatDate value="${dnsIpCfg.searchEditTimeStart}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
<div class="pull-left">
<label>-</label>
</div>
<div class="pull-left">
<input name="searchEditTimeEnd" type="text" readonly="readonly" maxlength="20" class="form-control input-medium Wdate"
value="<fmt:formatDate value="${dnsIpCfg.searchEditTimeEnd}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-6">
<div class="pull-left">
<label><spring:message code="audit_time"/></label>
</div>
<div class="pull-left">
<input name="searchAuditTimeStart" type="text" readonly="readonly" maxlength="20" class="form-control input-medium Wdate"
value="<fmt:formatDate value="${dnsIpCfg.searchAuditTimeStart}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
<div class="pull-left">
<label>-</label>
</div>
<div class="pull-left">
<input name="searchAuditTimeEnd" type="text" readonly="readonly" maxlength="20" class="form-control input-medium Wdate"
value="<fmt:formatDate value="${dnsIpCfg.searchAuditTimeEnd}" 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">
<table 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="config_describe"/></th>
<th>ip<spring:message code="type"/></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="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>
<th><spring:message code="auditor"/></th>
<th><spring:message code="audit_time"/></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="creator"/></th>
<th><spring:message code="config_time"/></th>
<%-- <th><spring:message code="editor"/></th>
<th><spring:message code="edit_time"/></th> --%>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="dnsIpCfg" varStatus="status" step="1">
<td><input type="checkbox" class="i-checks child-checks" id="${dnsIpCfg.cfgId}" value="${dnsIpCfg.isAudit}"></td>
<td>${dnsIpCfg.cfgDesc }</td>
<td>V${dnsIpCfg.ipType }</td>
<td>${dnsIpCfg.srcIp }</td>
<td>${dnsIpCfg.srcIpMask }</td>
<td>${dnsIpCfg.srcPort }</td>
<td>${dnsIpCfg.srcPortMask }</td>
<td>${dnsIpCfg.dstIp }</td>
<td>${dnsIpCfg.dstIpMask }</td>
<td>${dnsIpCfg.dstPort }</td>
<td>${dnsIpCfg.dstPortMask }</td>
<td>
<c:if test="${dnsIpCfg.direction==0}"><spring:message code="twoway"/></c:if>
<c:if test="${dnsIpCfg.direction==1}"><spring:message code="oneway"/></c:if>
</td>
<td>
<c:if test="${dnsIpCfg.protocol==6}"><spring:message code="TCP"/></c:if>
<c:if test="${dnsIpCfg.protocol==17}"><spring:message code="UDP"/></c:if>
<c:if test="${dnsIpCfg.protocol==0}"><spring:message code="arbitrary"/></c:if>
</td>
<%-- <td>
<c:choose>
<c:when test="${dnsIpCfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
<c:when test="${dnsIpCfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
<c:when test="${dnsIpCfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
<c:when test="${dnsIpCfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
</c:choose>
</td>
<td>${dnsIpCfg.auditor.name }</td>
<td><fmt:formatDate value="${dnsIpCfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td> --%>
<td>${dnsIpCfg.request.requestTitle }</td>
<td>
<c:forEach items="${fn:split(dnsIpCfg.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>
${classifyName[status]}
</td>
<td>
<c:forEach items="${fn:split(dnsIpCfg.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(dnsIpCfg.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>${dnsIpCfg.creator.name }</td>
<td><fmt:formatDate value="${dnsIpCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<%-- <td>${dnsIpCfg.editor.name }</td>
<td><fmt:formatDate value="${dnsIpCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td> --%>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page" style="margin-top:40px">${page}</div>
</div>
</div>
</div>
</div>
<style>
.input-medium {
width: 200px !important;
}
.Wdate {
border: #c2cad8 1px solid;
height: 26px;
}
.dropdown-menu {
min-width: 50px;
}
</style>
</body>
</html>

View File

@@ -100,6 +100,7 @@ $(function(){
},
dstIp: {
required: true,
checkIp: true
},
dstIpMask: {
required: true,

View File

@@ -170,8 +170,7 @@
'<div class="table-item">' +
'<span class="child-label col-md-3"><font color="red">*</font>'+'<spring:message code="table_type"/>'+':</span> ' +
'<span> ' +
'<select class="child-required2 selectpicker select2" name="tableType" onchange="autoServiceId()"> ' +
'<option value="">'+'<spring:message code="select"/>'+'</option>' +
'<select class="child-required2 selectpicker select2" name="tableType" onchange="autoServiceId()" title="<spring:message code="select"/>"> ' +
'<option value="1">IP</option>' +
'<option value="2">'+'<spring:message code="string"/>'+'</option>' +
'<option value="3">'+'<spring:message code="number"/>'+'</option>' +
@@ -224,7 +223,10 @@
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i><spring:message code="add"/></div>
<i class="fa fa-gift"></i>
<c:if test="${empty systemServiceInfo.id }"><spring:message code="add"/></c:if>
<c:if test="${not empty systemServiceInfo.id }"><spring:message code="edit"/></c:if>
</div>
</div>
<div class="portlet-body form">
@@ -245,8 +247,8 @@
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="act"/>:</label>
<div class="col-md-4">
<form:select id="action" path="action" class="required form-control selectpicker select2" onchange="autoServiceId()">
<form:option value=""><spring:message code="select"/></form:option>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select id="action" path="action" class="required form-control selectpicker select2" onchange="autoServiceId()" title="${select }">
<form:option value="1"><spring:message code="block"/></form:option>
<form:option value="2"><spring:message code="monitor"/></form:option>
<form:option value="5"><spring:message code="block_white_list"/></form:option>
@@ -260,8 +262,7 @@
<div class="form-group">
<label class="col-md-3 control-label"><font color="red">*</font><spring:message code="type"/>:</label>
<div class="col-md-4">
<form:select id="serviceType" path="serviceType" class="required form-control selectpicker select2" onchange="changeType(now, this)">
<form:option value=""><spring:message code="select"/></form:option>
<form:select id="serviceType" path="serviceType" class="required form-control selectpicker select2" onchange="changeType(now, this)" title="${select }">
<form:option value="1"><spring:message code="single_domain"/></form:option>
<form:option value="2"><spring:message code="multi_domain"/></form:option>
<form:option value="3"><spring:message code="special_service"/></form:option>
@@ -291,7 +292,6 @@
<span class="child-label col-md-3"><font color="red">*</font><spring:message code="table_type"/>:</span>
<span>
<select class="child-required2 selectpicker select2" name="tableType">
<option value=""><spring:message code="select"/></option>
<option value="1" <c:if test="${serviceConfigInfo.tableType eq 1}">selected="selected"</c:if>>IP</option>
<option value="2" <c:if test="${serviceConfigInfo.tableType eq 2}">selected="selected"</c:if>><spring:message code="string"/></option>
<option value="3" <c:if test="${serviceConfigInfo.tableType eq 3}">selected="selected"</c:if>><spring:message code="number"/></option>

View File

@@ -8,6 +8,10 @@
<body>
<script>
$(document).ready(function() {
top.window.scrollTo(0, 0);
})
function page(n,s){
if(n) $("#pageNo").val(n);
if(s) $("#pageSize").val(s);
@@ -53,7 +57,7 @@ function deleteService(id) {
<div class="col-md-12">
<div class="pull-left">
<form:select path="action" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="act"/></form:option>
<form:option value=""><spring:message code="all"/><spring:message code="act"/></form:option>
<form:option value="1"><spring:message code="block"/></form:option>
<form:option value="2"><spring:message code="monitor"/></form:option>
<form:option value="5"><spring:message code="block_white_list"/></form:option>
@@ -64,7 +68,7 @@ function deleteService(id) {
</div>
<div class="pull-left">
<form:select path="serviceType" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="type"/></form:option>
<form:option value=""><spring:message code="all"/><spring:message code='type'/></form:option>
<form:option value="1"><spring:message code="single_domain"/></form:option>
<form:option value="2"><spring:message code="multi_domain"/></form:option>
<form:option value="3"><spring:message code="special_service"/></form:option>
@@ -78,7 +82,7 @@ function deleteService(id) {
</div>
<div class="pull-left">
<button type="submit" onclick="return page();" class="btn btn-default">
<i class="fa fa-edit"></i> <spring:message code="search"></spring:message>
<i class="fa fa-search"></i>
</button>
</div>
</div>
@@ -130,7 +134,7 @@ function deleteService(id) {
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
<div class="page" style="margin-top:40px">${page}</div>
</div>
</div>
</div>