(1)IP白名单调整字段
(2)域名白名单配增删改查提交 (3)common.js调整switchIp
This commit is contained in:
@@ -123,5 +123,12 @@ public class BaseStringCfg extends BaseCfg<BaseStringCfg> {
|
||||
public void setCfgKeywordsShowName(String cfgKeywordsShowName) {
|
||||
this.cfgKeywordsShowName = cfgKeywordsShowName;
|
||||
}
|
||||
/**
|
||||
* cfgKeywords
|
||||
* @return cfgKeywords
|
||||
*/
|
||||
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package com.nis.domain.configuration;
|
||||
* @version V1.0
|
||||
*/
|
||||
public class DnsDomainCfg extends ComplexkeywordCfg {
|
||||
private static final String tableName="dns_domain_cfg";
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -36,4 +37,14 @@ public class DnsDomainCfg extends ComplexkeywordCfg {
|
||||
this.isHexbin=0;
|
||||
this.district="QNAME";
|
||||
}
|
||||
|
||||
/**
|
||||
* tablename
|
||||
* @return tablename
|
||||
*/
|
||||
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ package com.nis.domain.configuration;
|
||||
* @version V1.0
|
||||
*/
|
||||
public class HttpUrlCfg extends BaseStringCfg {
|
||||
private static final String tableName="http_url_cfg";
|
||||
/**
|
||||
* @Fields serialVersionUID:TODO(用一句话描述这个变量表示什么)
|
||||
*
|
||||
@@ -33,5 +34,13 @@ public class HttpUrlCfg extends BaseStringCfg {
|
||||
this.exprType=0;
|
||||
this.matchMethod=0;
|
||||
}
|
||||
/**
|
||||
* tablename
|
||||
* @return tablename
|
||||
*/
|
||||
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -36,8 +36,6 @@ public class IpPortCfg extends BaseIpCfg {
|
||||
}
|
||||
public void initDefaultValueImpl(){
|
||||
initDefaultValue();
|
||||
this.portPattern=1;
|
||||
this.port="0/0";
|
||||
}
|
||||
/**
|
||||
* 此表固定写0
|
||||
|
||||
@@ -17,10 +17,14 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.DnsDomainCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.main.ConvertTool;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
|
||||
/**
|
||||
* 白名单
|
||||
@@ -33,8 +37,7 @@ public class WhiteListController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"ipList"})
|
||||
@RequiresPermissions(value={"whitelist:config","whitelist:audit"},logical=Logical.OR)
|
||||
public String ipList(Model model,String cfgName,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
model.addAttribute("cfgName", cfgName);
|
||||
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);
|
||||
@@ -42,6 +45,16 @@ public class WhiteListController extends BaseController{
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/whitelist/ipList";
|
||||
}
|
||||
@RequestMapping(value = {"domainList"})
|
||||
@RequiresPermissions(value={"whitelist:config","whitelist:audit"},logical=Logical.OR)
|
||||
public String domainList(Model model,@ModelAttribute("cfg")HttpUrlCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||
Page<BaseStringCfg> searchPage=new Page<BaseStringCfg>(request,response,"r");
|
||||
Page<BaseStringCfg> page = stringCfgService.findPage(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/whitelist/domainList";
|
||||
}
|
||||
@RequestMapping(value = {"ipForm"})
|
||||
@RequiresPermissions(value={"whitelist:config"})
|
||||
public String ipForm(Model model,String ids,BaseIpCfg entity) {
|
||||
@@ -60,7 +73,24 @@ public class WhiteListController extends BaseController{
|
||||
|
||||
return "/cfg/whitelist/ipForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"domainForm"})
|
||||
@RequiresPermissions(value={"whitelist:config"})
|
||||
public String domainForm(Model model,String ids,BaseStringCfg entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = stringCfgService.getStringCfgById(HttpUrlCfg.getTablename(),Long.parseLong(ids));
|
||||
}
|
||||
initFormCondition(model,entity);
|
||||
if(entity.getCfgId()!=null){
|
||||
model.addAttribute("_cfg", entity);
|
||||
}else{
|
||||
HttpUrlCfg cfg=new HttpUrlCfg();
|
||||
cfg.initDefaultValue();
|
||||
cfg.setFunctionId(entity.getFunctionId());
|
||||
model.addAttribute("_cfg", cfg);
|
||||
}
|
||||
|
||||
return "/cfg/whitelist/domainForm";
|
||||
}
|
||||
@RequestMapping(value = {"saveOrUpdateIp"})
|
||||
public String saveOrUpdateIp(Model model, IpPortCfg cfg) {
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
@@ -89,7 +119,34 @@ public class WhiteListController extends BaseController{
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ipList?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"saveOrUpdateDomain"})
|
||||
public String saveOrUpdateDomain(Model model, HttpUrlCfg cfg) {
|
||||
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||
logger.info("saveOrUpdateIp loaded");
|
||||
try{
|
||||
if(cfg.getCompileId()==null){
|
||||
int compileId=0;
|
||||
cfg.setCompileId(compileId);
|
||||
}
|
||||
Date date=new Date();
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
if(cfg.getCfgId()==null){//新增
|
||||
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
cfg.setCreateTime(date);
|
||||
stringCfgService.addStringCfg((BaseStringCfg)cfg,null);
|
||||
}else{//修改
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
stringCfgService.updateStringCfg((BaseStringCfg)cfg,null,null,null);
|
||||
}
|
||||
addMessage(model,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败",e);
|
||||
addMessage(model,"save_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domainList?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"deleteIp"})
|
||||
@RequiresPermissions("whitelist:config")
|
||||
@@ -118,6 +175,33 @@ public class WhiteListController extends BaseController{
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ipList?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"deleteDomain"})
|
||||
@RequiresPermissions("whitelist:config")
|
||||
public String deleteDomain(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model) {
|
||||
try{
|
||||
List<BaseStringCfg> cfgs=new ArrayList<BaseStringCfg>();
|
||||
Date date =new Date();
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
for(String idStr:ids.split(",")){
|
||||
if(StringUtils.isNotBlank(idStr)){
|
||||
BaseStringCfg cfg=new BaseStringCfg();
|
||||
cfg.setCfgId(Long.parseLong(idStr));
|
||||
cfg.setTableName(HttpUrlCfg.getTablename());
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(date);
|
||||
cfg.setIsValid(Constants.VALID_DEL);
|
||||
cfgs.add(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
stringCfgService.deleteBatch(cfgs, StringCfgDao.class);
|
||||
addMessage(model,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domainList?functionId="+functionId;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* getCompileId(获取编译ID)
|
||||
|
||||
@@ -29,33 +29,7 @@
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
<resultMap id="BaseStringMapWithUser" type="com.nis.domain.configuration.BaseStringCfg" >
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<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="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
|
||||
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<resultMap id="BaseStringMapWithUser" type="com.nis.domain.configuration.BaseStringCfg" extends="BaseStringMap">
|
||||
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
|
||||
<result column="auditor_name" property="auditorName" jdbcType="VARCHAR" />
|
||||
<result column="editor_name" property="editorName" jdbcType="VARCHAR" />
|
||||
@@ -65,7 +39,7 @@
|
||||
CFG_ID, CFG_DESC, CFG_KEYWORDS,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,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN
|
||||
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,FUNCTION_ID
|
||||
</sql>
|
||||
<!-- <sql id="BaseStringCfg_Column_List_with_id_alias" >
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.CFG_KEYWORDS as cfgKeywords, r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
|
||||
@@ -80,14 +54,14 @@
|
||||
${page.alias}.CFG_ID as cfgId, ${page.alias}.CFG_DESC as cfgDesc, ${page.alias}.CFG_KEYWORDS as cfgKeywords,${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}.ATTRIBUTE AS attribute,${page.alias}.LABLE AS lable,${page.alias}.AREA_EFFECTIVE_IDS AS areaEffectiveIds,${page.alias}.FUNCTION_ID AS functionId
|
||||
</when>
|
||||
<otherwise>
|
||||
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.CFG_KEYWORDS as cfgKeywords, 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.EXPR_TYPE as exprType,r.MATCH_METHOD as matchMethod,r.IS_HEXBIN as isHexbin,
|
||||
r.AREA_EFFECTIVE_IDS AS areaEffectiveIds
|
||||
r.AREA_EFFECTIVE_IDS AS areaEffectiveIds,r.FUNCTION_ID AS functionId
|
||||
</otherwise>
|
||||
</choose>
|
||||
</sql>
|
||||
@@ -95,7 +69,7 @@
|
||||
CFG_DESC, CFG_KEYWORDS, 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,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,AREA_EFFECTIVE_IDS
|
||||
ATTRIBUTE,LABLE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,AREA_EFFECTIVE_IDS,FUNCTION_ID
|
||||
</sql>
|
||||
<sql id="BaseStringCfg_Value_List" >
|
||||
#{cfgDesc,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
|
||||
@@ -105,7 +79,7 @@
|
||||
#{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR}
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},#{functionId,jdbcType=INTEGER}
|
||||
</sql>
|
||||
<select id="getById" resultMap="BaseStringMap" parameterType="java.lang.Long" >
|
||||
SELECT
|
||||
@@ -145,9 +119,6 @@
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
left join request_info ri on r.request_id=ri.id
|
||||
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_leaf=0
|
||||
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=2 and sdia.is_leaf=0
|
||||
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=3 and sdil.is_leaf=0
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
@@ -226,6 +197,9 @@
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
||||
AND ${page.alias}.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND ${page.alias}.FUNCTION_ID =#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="cfgId != null">
|
||||
@@ -300,6 +274,9 @@
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID =#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</trim>
|
||||
@@ -417,6 +394,9 @@
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
function_id = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
where cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||
|
||||
@@ -130,6 +130,9 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
public ComplexkeywordCfg getStringCfgById(ComplexkeywordCfg cfg){
|
||||
return complexStringCfgDao.getById(cfg.getTableName(),cfg.getCfgId());
|
||||
}
|
||||
public ComplexkeywordCfg getStringCfgById(String tableName,long id){
|
||||
return complexStringCfgDao.getById(tableName,id);
|
||||
}
|
||||
public Integer getIsValid(ComplexkeywordCfg cfg){
|
||||
return complexStringCfgDao.getIsValid(cfg);
|
||||
}
|
||||
|
||||
@@ -127,6 +127,9 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
public BaseStringCfg getStringCfgById(BaseStringCfg baseStringCfg){
|
||||
return stringCfgDao.getById(baseStringCfg.getTableName(), baseStringCfg.getCfgId());
|
||||
}
|
||||
public BaseStringCfg getStringCfgById(String tableName, long id){
|
||||
return stringCfgDao.getById(tableName, id);
|
||||
}
|
||||
public Integer getIsValid(BaseStringCfg baseStringCfg){
|
||||
return stringCfgDao.getIsValid(baseStringCfg);
|
||||
}
|
||||
|
||||
161
src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp
Normal file
161
src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp
Normal file
@@ -0,0 +1,161 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
switchIpType($("select[name$='ipType']"));
|
||||
areaControlInit();
|
||||
$("input[name='isAreaEffective']").on('change',function(){
|
||||
var val=$(this).val();
|
||||
if(val==1){
|
||||
$(".areaType").removeClass("hidden");
|
||||
if($("input[name='areaType']:checked").val()==1){//areaISP
|
||||
$("#areaIsp").removeClass("hidden");
|
||||
}else if($("input[name='areaType']:checked").val()==0){//areaIp
|
||||
$("#areaIp").removeClass("hidden");
|
||||
}
|
||||
}else{
|
||||
$(".areaType").addClass("hidden");
|
||||
$("#areaIp").addClass("hidden");
|
||||
$("#areaIsp").addClass("hidden");
|
||||
}
|
||||
});
|
||||
$("input[name='areaType']").on('change',function(){
|
||||
var val=$(this).val();
|
||||
if($(this).is(":visible")){
|
||||
if(val==0){
|
||||
$("#areaIp").removeClass("hidden");
|
||||
$("#areaIsp").addClass("hidden");
|
||||
}else{
|
||||
$("#areaIsp").removeClass("hidden");
|
||||
$("#areaIp").addClass("hidden");
|
||||
}
|
||||
}else{
|
||||
$("#areaIsp").addClass("hidden");
|
||||
$("#areaIp").addClass("hidden");
|
||||
}
|
||||
});
|
||||
$(".action").on("change",function(){
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
});
|
||||
$("#cfgFrom").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",
|
||||
});
|
||||
$("select[name$='ipType']").on("change",function(){
|
||||
switchIpType($(this));
|
||||
});
|
||||
$("#cancel").on("click",function(){
|
||||
window.history.back();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="${cfgName}"></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 class="tools">
|
||||
<a href="javascript:;" class="collapse" data-original-title="" title=""> </a>
|
||||
<a href="#portlet-config" data-toggle="modal" class="config" data-original-title="" title=""> </a>
|
||||
<a href="javascript:;" class="reload" data-original-title="" title=""> </a>
|
||||
<a href="javascript:;" class="remove" data-original-title="" title=""> </a>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/ntc/whitelist/saveOrUpdateDomain" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="exprType" value="0">
|
||||
<input type="hidden" name="matchMethod" value="0">
|
||||
<input type="hidden" name="isHexbin" value="0">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="isAreaEffective" value="0">
|
||||
<input type="hidden" name=requestId value="0">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<div class="form-body">
|
||||
<h3 class="form-section"><spring:message code="block_config"/></h3>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
<div for="cfgDesc"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="key_word"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="cfgKeywords" value="${_cfg.cfgKeywords}">
|
||||
</div>
|
||||
<div for="cfgKeywords"></div>
|
||||
</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="action"/></label>
|
||||
<div class="col-md-6">
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<label class="radio-inline">
|
||||
<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:if>
|
||||
</label>
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div for="action"></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">
|
||||
<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>
|
||||
259
src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp
Normal file
259
src/main/webapp/WEB-INF/views/cfg/whitelist/domainList.jsp
Normal file
@@ -0,0 +1,259 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgKeywords}"){
|
||||
$("#intype").val("${cfg.cfgKeywords}");
|
||||
} 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);
|
||||
});
|
||||
$("#cfgKeywords").attr("value",'');
|
||||
$(".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">
|
||||
<%-- <button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/string/list?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="refresh"></spring:message></button> --%>
|
||||
<shiro:hasPermission name="whitelist:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/ntc/whitelist/domainForm?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="${cfgName}"></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}/ntc/whitelist/domainList" method="post" class="form-search">
|
||||
<input id="functionId" name="functionId" type="hidden" value="${audit}"/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<form:select path="isAudit" class="selectpicker select2 input-small">
|
||||
<form:option value=""><spring:message code="all_states"/></form:option>
|
||||
<form:option value="0"><spring:message code="created"></spring:message></form:option>
|
||||
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
|
||||
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
|
||||
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
|
||||
<div class="pull-left">
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="cfgKeywords"><spring:message code="key_word"></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="whitelist:config">
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/domainForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/deleteDomain?isValid=-1&functionId=${cfg.functionId}" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
<!-- <button type="button" class="btn btn-default">
|
||||
<i class="fa fa-download"></i> 导出</button> -->
|
||||
<c:if test="${audit==1}">
|
||||
<shiro:hasPermission name="cfg:string:audit">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li><sys:delRow url="${ctx}/ntc/whitelist/auditDomain?isAudit=1&isValid=1" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/whitelist/auditDomain?isAudit=2&isValid=0" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/whitelist/auditDomain?isAudit=3&isValid=0" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
</c:if>
|
||||
<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> </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> </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> </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">
|
||||
<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><spring:message code="key_word"/></th>
|
||||
<th><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" value="${cfg.isAudit}"></td>
|
||||
<%-- <td>${status.index+1 }</td> --%>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td>${cfg.cfgKeywords }</td>
|
||||
<td>
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<c:if test="${cfg.action eq service.action}"><spring:message code="${service.actionCode}"/></c:if>
|
||||
</c:forEach>
|
||||
</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:choose>
|
||||
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${cfg.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>
|
||||
@@ -117,10 +117,81 @@ $(function(){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ip">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipPattern" class="selectpicker show-tick form-control required">
|
||||
<option value="1" <c:if test="${_cfg.ipPattern==1}">selected</c:if> ><spring:message code="subnet"/></option>
|
||||
<option value="2" <c:if test="${_cfg.ipPattern==2}">selected</c:if>><spring:message code="ip_range"/></option>
|
||||
<option value="3" <c:if test="${_cfg.ipPattern==3}">selected</c:if>><spring:message code="ip"/></option>
|
||||
</select>
|
||||
<!-- <input class="form-control" type="text" value="${_cfg.ipType}">-->
|
||||
</div>
|
||||
<div for="ipPattern"></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="port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="portPattern" class="selectpicker show-tick form-control required">
|
||||
<option value="1" <c:if test="${_cfg.portPattern==1}">selected</c:if> ><spring:message code="port"/></option>
|
||||
<option value="2" <c:if test="${_cfg.portPattern==2}">selected</c:if>><spring:message code="port_range"/></option>
|
||||
</select>
|
||||
</div>
|
||||
<div for="portPattern"></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 required" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
||||
</div>
|
||||
<div for="srcIpAddress"></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"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="srcPort" value="${_cfg.srcPort}">
|
||||
</div>
|
||||
<div for="srcPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hidden disabled port">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
|
||||
</div>
|
||||
<div for="destIpAddress"></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"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="destPort" value="${_cfg.destPort}">
|
||||
</div>
|
||||
<div for="destPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<button type="button" class="btn btn-red-hollow center-block" onClick="more(this);" data-click-times="0"><spring:message code="show_more"/></button>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="action"/></label>
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="action"/></label>
|
||||
<div class="col-md-6">
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<label class="radio-inline">
|
||||
@@ -136,56 +207,6 @@ $(function(){
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ip">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipPattern" class="selectpicker show-tick form-control required">
|
||||
<option value="1" <c:if test="${_cfg.ipPattern==1}">selected</c:if> ><spring:message code="subnet"/></option>
|
||||
<option value="2" <c:if test="${_cfg.ipPattern==2}">selected</c:if>><spring:message code="ip_range"/></option>
|
||||
</select>
|
||||
<!-- <input class="form-control" type="text" value="${_cfg.ipType}">-->
|
||||
</div>
|
||||
<div for="ipPattern"></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_address"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="ipAddress" value="${_cfg.ipAddress}">
|
||||
</div>
|
||||
<div for="ipAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row hidden disabled port">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="portPattern" class="selectpicker show-tick form-control required">
|
||||
<option value="1" <c:if test="${_cfg.portPattern==1}">selected</c:if> ><spring:message code="subnet"/></option>
|
||||
<option value="2" <c:if test="${_cfg.portPattern==2}">selected</c:if>><spring:message code="port_range"/></option>
|
||||
</select>
|
||||
</div>
|
||||
<div for="portPattern"></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="port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="port" value="${_cfg.port}">
|
||||
</div>
|
||||
<div for="port"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<button type="button" class="btn btn-red-hollow center-block" onClick="more(this);" data-click-times="0"><spring:message code="show_more"/></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
|
||||
@@ -6,10 +6,14 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.ipAddress}"){
|
||||
$("#intype").val("${cfg.ipAddress}");
|
||||
} else if("${cfg.port}"){
|
||||
$("#intype").val("${cfg.port}");
|
||||
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{
|
||||
@@ -96,8 +100,10 @@
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="ipAddress"><spring:message code="ip_address"></spring:message></form:option>
|
||||
<form:option value="port"><spring:message code="port"></spring:message></form:option>
|
||||
<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>
|
||||
|
||||
@@ -203,8 +209,10 @@
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th><spring:message code="config_describe"/></th>
|
||||
<th>ip<spring:message code="type"/></th>
|
||||
<th><spring:message code="ip"/></th>
|
||||
<th><spring:message code="port"/></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="valid_identifier"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
@@ -224,8 +232,10 @@
|
||||
<%-- <td>${status.index+1 }</td> --%>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td>V${cfg.ipType }</td>
|
||||
<td>${cfg.ipAddress }</td>
|
||||
<td>${cfg.port }</td>
|
||||
<td>${cfg.srcIpAddress }</td>
|
||||
<td>${cfg.srcPort }</td>
|
||||
<td>${cfg.destIpAddress }</td>
|
||||
<td>${cfg.destPort }</td>
|
||||
<td>
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<c:if test="${cfg.action eq service.action}"><spring:message code="${service.actionCode }"/></c:if>
|
||||
|
||||
@@ -11,25 +11,13 @@ $(function(){
|
||||
var switchIpType=function(obj){
|
||||
var type=$(obj).val();
|
||||
var row=$(obj).parents('.row');
|
||||
var srcIpMask=row.siblings().find("input[name$='srcIpMask']");
|
||||
var dstIpMask=row.siblings().find("input[name$='dstIpMask']");
|
||||
var srcIp=row.siblings().find("input[name$='srcIp']");
|
||||
var dstIp=row.siblings().find("input[name$='dstIp']");
|
||||
var ipPattern=row.siblings().find("input[name$='ipPattern']");
|
||||
var portPattern=row.siblings().find("input[name$='portPattern']");
|
||||
var srcIp=row.siblings().find("input[name$='srcIpAddress']");
|
||||
var dstIp=row.siblings().find("input[name$='destIpAddress']");
|
||||
var srcPort=row.siblings().find("input[name$='srcPort']");
|
||||
var srcPortMask=row.siblings().find("input[name$='srcPortMask']");
|
||||
var dstPort=row.siblings().find("input[name$='dstPort']");
|
||||
var dstPortMask=row.siblings().find("input[name$='dstPortMask']");
|
||||
var dstPort=row.siblings().find("input[name$='destPort']");
|
||||
if(4==type){
|
||||
if(!$(srcIpMask).val()){
|
||||
$(srcIpMask).val("255.255.255.255");
|
||||
}else if($(srcIpMask).val()=="FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"){
|
||||
$(srcIpMask).val("255.255.255.255");
|
||||
}
|
||||
if(!$(dstIpMask).val()){
|
||||
$(dstIpMask).val("255.255.255.255");
|
||||
}else if($(dstIpMask).val()=="FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"){
|
||||
$(dstIpMask).val("255.255.255.255");
|
||||
}
|
||||
if(!$(srcIp).val()){
|
||||
$(srcIp).val("0.0.0.0");
|
||||
}else if($(srcIp).val()=="::"){
|
||||
@@ -46,24 +34,8 @@ var switchIpType=function(obj){
|
||||
if(!$(dstPort).val()){
|
||||
$(dstPort).val("0");
|
||||
}
|
||||
if(!$(srcPortMask).val()){
|
||||
$(srcPortMask).val("65535");
|
||||
}
|
||||
if(!$(dstPortMask).val()){
|
||||
$(dstPortMask).val("65535");
|
||||
}
|
||||
}
|
||||
if(6==type){
|
||||
if(!$(srcIpMask).val()){
|
||||
$(srcIpMask).val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}else if($(srcIpMask).val()=="255.255.255.255"){
|
||||
$(srcIpMask).val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
if(!$(dstIpMask).val()){
|
||||
$(dstIpMask).val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}else if($(dstIpMask).val()=="255.255.255.255"){
|
||||
$(dstIpMask).val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
|
||||
}
|
||||
if(!$(srcIp).val()){
|
||||
$(srcIp).val("::");
|
||||
}else if($(srcIp).val()=="0.0.0.0"){
|
||||
@@ -80,12 +52,6 @@ var switchIpType=function(obj){
|
||||
if(!$(dstPort).val()){
|
||||
$(dstPort).val("0");
|
||||
}
|
||||
if(!$(srcPortMask).val()){
|
||||
$(srcPortMask).val("65535");
|
||||
}
|
||||
if(!$(dstPortMask).val()){
|
||||
$(dstPortMask).val("65535");
|
||||
}
|
||||
}
|
||||
}
|
||||
var areaControlInit=function(){
|
||||
|
||||
Reference in New Issue
Block a user