IP拦截提交
This commit is contained in:
@@ -0,0 +1,131 @@
|
|||||||
|
package com.nis.web.controller.configuration.proxy;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.Logical;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.ui.Model;
|
||||||
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.configuration.AreaIpCfg;
|
||||||
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.HttpUrlCfg;
|
||||||
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IP相关配置控制类
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@Controller
|
||||||
|
@RequestMapping("${adminPath}/proxy/intercept")
|
||||||
|
public class InterceptController extends BaseController{
|
||||||
|
@RequestMapping(value = {"/ip/list"})
|
||||||
|
@RequiresPermissions(value={"intercept:ip:config","intercept:ip:audit"},logical=Logical.OR)
|
||||||
|
public String ipList(Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||||
|
cfg.setTableName(IpPortCfg.getTablename());
|
||||||
|
Page<BaseIpCfg> searchPage=new Page<BaseIpCfg>(request,response,"r");
|
||||||
|
Page<BaseIpCfg> page = ipCfgService.findPage(searchPage, cfg);
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
initPageCondition(model,cfg);
|
||||||
|
return "/cfg/proxy/ipList";
|
||||||
|
}
|
||||||
|
@RequestMapping(value = {"/ip/form"})
|
||||||
|
@RequiresPermissions(value={"intercept:ip:config"})
|
||||||
|
public String ipForm(Model model,String ids,BaseIpCfg entity) {
|
||||||
|
if(StringUtils.isNotBlank(ids)){
|
||||||
|
entity = ipCfgService.getIpCfgById(IpPortCfg.getTablename(),Long.parseLong(ids));
|
||||||
|
}
|
||||||
|
if(entity.getCfgId()!=null){
|
||||||
|
List<BaseIpCfg> areaCfg=ipCfgService.getListByComileId(AreaIpCfg.getTablename(), String.valueOf(entity.getCompileId()));
|
||||||
|
model.addAttribute("areaCfgs", areaCfg);
|
||||||
|
model.addAttribute("_cfg", entity);
|
||||||
|
initUpdateFormCondition(model,entity);
|
||||||
|
}else{
|
||||||
|
IpPortCfg cfg=new IpPortCfg();
|
||||||
|
cfg.initDefaultValueImpl();
|
||||||
|
cfg.setFunctionId(entity.getFunctionId());
|
||||||
|
cfg.setProtocolId(entity.getProtocolId());
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
initFormCondition(model,entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
return "/cfg/proxy/ipForm";
|
||||||
|
}
|
||||||
|
@RequestMapping(value = {"/ip/saveOrUpdate"})
|
||||||
|
public String saveOrUpdateIp(RedirectAttributes model, IpPortCfg cfg) {
|
||||||
|
Date date=new Date();
|
||||||
|
cfg.setTableName(IpPortCfg.getTablename());
|
||||||
|
logger.info("saveOrUpdateIp loaded");
|
||||||
|
try{
|
||||||
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
if(cfg.getCfgId()==null){//新增
|
||||||
|
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
ipCfgService.addIpCfg(cfg);
|
||||||
|
}else{//修改
|
||||||
|
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||||
|
cfg.setEditTime(new Date());
|
||||||
|
ipCfgService.updateIpCfg(cfg);
|
||||||
|
}
|
||||||
|
addMessage(model,"save_success");
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("保存失败",e);
|
||||||
|
addMessage(model,"save_failed");
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
@RequestMapping(value = {"/ip/delete"})
|
||||||
|
@RequiresPermissions("iplist:config")
|
||||||
|
public String deleteIp(String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
||||||
|
try{
|
||||||
|
ipCfgService.deleteIp(ids,compileIds,functionId.intValue());
|
||||||
|
addMessage(model,"delete_success");
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("删除失败", e);
|
||||||
|
addMessage(model,"delete_failed");
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
||||||
|
}
|
||||||
|
@RequestMapping(value = {"/ip/audit"})
|
||||||
|
// @RequiresPermissions("intercept:ip:audit")
|
||||||
|
public String auditIp(String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) {
|
||||||
|
try{
|
||||||
|
for(String id:ids.split(",")){
|
||||||
|
Long.parseLong(id);
|
||||||
|
}
|
||||||
|
List<BaseIpCfg> beans=ipCfgService.getListByCfgId(IpPortCfg.getTablename(),ids);
|
||||||
|
Date date=new Date();
|
||||||
|
for(BaseIpCfg bean:beans){
|
||||||
|
bean.setTableName(IpPortCfg.getTablename());
|
||||||
|
bean.setAuditorId(bean.getCurrentUser().getId());
|
||||||
|
bean.setAuditTime(date);
|
||||||
|
bean.setIsAudit(cfg.getIsAudit());
|
||||||
|
bean.setIsValid(cfg.getIsValid());
|
||||||
|
ipCfgService.audit(bean);
|
||||||
|
}
|
||||||
|
addMessage(redirectAttributes,"audit_success");
|
||||||
|
}catch(MaatConvertException e){
|
||||||
|
logger.error("审核失败", e);
|
||||||
|
addMessage(redirectAttributes, e.getMessage());
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("审核失败", e);
|
||||||
|
addMessage(redirectAttributes, "audit_failed");
|
||||||
|
}
|
||||||
|
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,8 +32,10 @@ $(function(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
if('${fn:length(serviceList)}'>1){
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
|
}
|
||||||
$("#ipCfgFrom").validate({
|
$("#ipCfgFrom").validate({
|
||||||
errorPlacement: function(error,element){
|
errorPlacement: function(error,element){
|
||||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||||
@@ -70,9 +72,19 @@ $(function(){
|
|||||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
|
||||||
<input type="hidden" id="cfgType" name="cfgType" value="${_cfg.cfgType}">
|
<input type="hidden" id="cfgType" name="cfgType" value="${_cfg.cfgType}">
|
||||||
<input type="hidden" id="cfgRegionCode" name="cfgRegionCode" value="${_cfg.cfgRegionCode}">
|
<input type="hidden" id="cfgRegionCode" name="cfgRegionCode" value="${_cfg.cfgRegionCode}">
|
||||||
|
<c:if test="${fn:length(serviceList)==1}">
|
||||||
|
<c:forEach items="${serviceList}" var="service">
|
||||||
|
<input type="hidden" name="action" value="${service.action }">
|
||||||
|
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||||||
|
<input type="hidden" id="protocolId" name="protocolId" value="${service.protocolId}">
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${fn:length(serviceList)>1}">
|
||||||
|
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||||
|
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
|
||||||
|
</c:if>
|
||||||
<!-- 配置域类型 -->
|
<!-- 配置域类型 -->
|
||||||
<c:forEach items="${regionList}" var="region">
|
<c:forEach items="${regionList}" var="region">
|
||||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||||
@@ -110,7 +122,11 @@ $(function(){
|
|||||||
protocolId="${service.protocolId }"
|
protocolId="${service.protocolId }"
|
||||||
value="${service.action }" class="required action"
|
value="${service.action }" class="required action"
|
||||||
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
||||||
<spring:message code="${service.actionCode }" />
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq service.action }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
</c:if>
|
</c:if>
|
||||||
</label>
|
</label>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
@@ -14,11 +14,6 @@
|
|||||||
data.obj=$(this)
|
data.obj=$(this)
|
||||||
GetLogTotal('${ctx}',data);
|
GetLogTotal('${ctx}',data);
|
||||||
});
|
});
|
||||||
//$("#loadingModal").modal("show");
|
|
||||||
//setTimeout(function(){
|
|
||||||
// $("#loadingModal").modal("hide");
|
|
||||||
//},1000);
|
|
||||||
//$("#loadingModal").modal({backdrop:'static',keybord:false});
|
|
||||||
//搜索框提示语初始化
|
//搜索框提示语初始化
|
||||||
if("${cfg.srcIpAddress}"){
|
if("${cfg.srcIpAddress}"){
|
||||||
$("#intype").val("${cfg.srcIpAddress}");
|
$("#intype").val("${cfg.srcIpAddress}");
|
||||||
|
|||||||
171
src/main/webapp/WEB-INF/views/cfg/proxy/ipForm.jsp
Normal file
171
src/main/webapp/WEB-INF/views/cfg/proxy/ipForm.jsp
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="ip_intercept"></spring:message></title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function(){
|
||||||
|
if($("input[name='action']:checked").val()==0x20||$("input[name='action']:checked").val()==0x60){
|
||||||
|
$("#cfgRegionCode").val($("#cfgRegionCodeCallback").val());
|
||||||
|
$("#cfgType").val($("#cfgTypeCallback").val());
|
||||||
|
}else{
|
||||||
|
$("#cfgRegionCode").val($("#cfgRegionCodeMaat").val());
|
||||||
|
$("#cfgType").val($("#cfgTypeMaat").val());
|
||||||
|
}
|
||||||
|
$("#cancel").on("click",function(){
|
||||||
|
window.history.back();
|
||||||
|
});
|
||||||
|
$(".action").on("change", function() {
|
||||||
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
|
if($(this).val()==0x20||$(this).val()==0x60){
|
||||||
|
$("#cfgRegionCode").val($("#cfgRegionCodeCallback").val());
|
||||||
|
$("#cfgType").val($("#cfgTypeCallback").val());
|
||||||
|
$("input[name='isAreaEffective']").each(function(){
|
||||||
|
if($(this).val()==0){
|
||||||
|
$(this).click();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
$("#cfgRegionCode").val($("#cfgRegionCodeMaat").val());
|
||||||
|
$("#cfgType").val($("#cfgTypeMaat").val());
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
if('${fn:length(serviceList)}'>1){
|
||||||
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
|
}
|
||||||
|
$("#ipCfgFrom").validate({
|
||||||
|
errorPlacement: function(error,element){
|
||||||
|
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||||
|
},
|
||||||
|
submitHandler: function(form){
|
||||||
|
|
||||||
|
//loading('onloading...');
|
||||||
|
form.submit();
|
||||||
|
},
|
||||||
|
errorContainer: "#messageBox",
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="page-content">
|
||||||
|
<h3 class="page-title">
|
||||||
|
<spring:message code="ip_intercept"></spring:message>
|
||||||
|
</h3>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet box blue">
|
||||||
|
<div class="portlet-title">
|
||||||
|
<div class="caption">
|
||||||
|
<i class="fa fa-gift"></i>
|
||||||
|
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
|
||||||
|
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-body form">
|
||||||
|
<!-- BEGIN FORM-->
|
||||||
|
<form id="ipCfgFrom" action="${ctx}/proxy/intercept/ip/saveOrUpdate" method="post" class="form-horizontal">
|
||||||
|
<div class="form-body row">
|
||||||
|
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||||
|
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||||
|
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||||
|
<input type="hidden" id="cfgType" name="cfgType" value="${_cfg.cfgType}">
|
||||||
|
<input type="hidden" id="cfgRegionCode" name="cfgRegionCode" value="${_cfg.cfgRegionCode}">
|
||||||
|
<c:if test="${fn:length(serviceList)==1}">
|
||||||
|
<c:forEach items="${serviceList}" var="service">
|
||||||
|
<input type="hidden" name="action" value="${service.action }">
|
||||||
|
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||||||
|
<input type="hidden" id="protocolId" name="protocolId" value="${service.protocolId}">
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${fn:length(serviceList)>1}">
|
||||||
|
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||||
|
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
|
||||||
|
</c:if>
|
||||||
|
<!-- 配置域类型 -->
|
||||||
|
<c:forEach items="${regionList}" var="region">
|
||||||
|
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||||
|
<c:if test="${region.isMaat==1}"><!-- is maat -->
|
||||||
|
<input type="hidden" id="cfgTypeMaat" value="${region.configRegionValue}">
|
||||||
|
<input type="hidden" id="cfgRegionCodeMaat" value="${region.configRegionCode}">
|
||||||
|
</c:if>
|
||||||
|
<c:if test="${region.isMaat==0}">
|
||||||
|
<input type="hidden" id="cfgTypeCallback" value="${region.configRegionValue}">
|
||||||
|
<input type="hidden" id="cfgRegionCodeCallback" value="${region.configRegionCode}">
|
||||||
|
</c:if>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<div class="form-body">
|
||||||
|
<!-- desc and action -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<c:if test="${fn:length(serviceList)>1}">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-md-3"><spring:message code="action"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<c:forEach items="${serviceList}" var="service"
|
||||||
|
varStatus="satus">
|
||||||
|
<label class="radio-inline"> <c:if
|
||||||
|
test="${_cfg.functionId eq service.functionId}">
|
||||||
|
<input type="radio" name="action"
|
||||||
|
serviceId="${service.serviceId }"
|
||||||
|
protocolId="${service.protocolId }"
|
||||||
|
value="${service.action }" class="required action"
|
||||||
|
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq service.action }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
</label>
|
||||||
|
</c:forEach>
|
||||||
|
</div>
|
||||||
|
<div for="action"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
</div>
|
||||||
|
<!-- desc and action -->
|
||||||
|
<c:forEach items="${fns:getDictList('SPECIAL_FUNCTION_ID')}" var="sfi">
|
||||||
|
<c:if test="${sfi.itemCode==_cfg.functionId}">
|
||||||
|
<c:set var="specialProtocol" value="${sfi.itemValue}"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
|
||||||
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
|
||||||
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||||
|
</div>
|
||||||
|
<div class="form-actions">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-offset-3 col-md-8">
|
||||||
|
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||||
|
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
<!-- END FORM-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
336
src/main/webapp/WEB-INF/views/cfg/proxy/ipList.jsp
Normal file
336
src/main/webapp/WEB-INF/views/cfg/proxy/ipList.jsp
Normal file
@@ -0,0 +1,336 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="ip_intercept"></spring:message></title>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$("td[compileId]").each(function(){
|
||||||
|
var data={};
|
||||||
|
data.date=new Date();
|
||||||
|
data.compileId=$(this).attr("compileId");
|
||||||
|
data.action=$(this).attr("action");
|
||||||
|
data.functionId=$(this).attr("functionId");
|
||||||
|
data.obj=$(this)
|
||||||
|
GetLogTotal('${ctx}',data);
|
||||||
|
});
|
||||||
|
//搜索框提示语初始化
|
||||||
|
if("${cfg.srcIpAddress}"){
|
||||||
|
$("#intype").val("${cfg.srcIpAddress}");
|
||||||
|
} else if("${cfg.destIpAddress}"){
|
||||||
|
$("#intype").val("${cfg.destIpAddress}");
|
||||||
|
} else if("${cfg.srcPort}"){
|
||||||
|
$("#intype").val("${cfg.srcPort}");
|
||||||
|
} else if("${cfg.destPort}"){
|
||||||
|
$("#intype").val("${cfg.destPort}");
|
||||||
|
} else if("${cfg.cfgDesc}"){
|
||||||
|
$("#intype").val("${cfg.cfgDesc}");
|
||||||
|
} else{
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||||
|
}
|
||||||
|
$("#seltype").change(function(){
|
||||||
|
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||||
|
});
|
||||||
|
//筛选功能初始化
|
||||||
|
filterActionInit();
|
||||||
|
$("#isAudit").change(function(){
|
||||||
|
page();
|
||||||
|
});
|
||||||
|
//reset
|
||||||
|
$("#resetBtn").on("click",function(){
|
||||||
|
$("select.selectpicker").each(function(){
|
||||||
|
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||||
|
$(this).find("option").attr("selected",false);
|
||||||
|
$(this).find("option:first").attr("selected",true);
|
||||||
|
});
|
||||||
|
$(".Wdate").attr("value",'');
|
||||||
|
$("#searchForm")[0].reset();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
var edit=function(url){
|
||||||
|
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||||
|
if(cked.val()==1){
|
||||||
|
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(cked.length==1){
|
||||||
|
window.location = url+"&compileId="+cked.attr("id");
|
||||||
|
}else{
|
||||||
|
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="theme-panel hidden-xs hidden-sm">
|
||||||
|
<shiro:hasPermission name="iplist:config">
|
||||||
|
<button type="button" class="btn btn-primary"
|
||||||
|
onClick="javascript:window.location='${ctx}/proxy/intercept/ip/form?functionId=${cfg.functionId}'">
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="add"></spring:message></button>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
</div>
|
||||||
|
<h3 class="page-title">
|
||||||
|
<spring:message code="ip_intercept"></spring:message>
|
||||||
|
<small><spring:message code="date_list"/></small>
|
||||||
|
</h3>
|
||||||
|
<h5 class="page-header"></h5>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="portlet">
|
||||||
|
<div class="portlet-body">
|
||||||
|
<div class="row" >
|
||||||
|
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/proxy/intercept/ip/list" method="post" class="form-search">
|
||||||
|
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
||||||
|
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||||
|
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||||
|
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||||
|
callback="page();" />
|
||||||
|
<!-- 筛选按钮展开状态-->
|
||||||
|
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||||
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="pull-left">
|
||||||
|
<form:select path="isAudit" class="selectpicker select2 input-small">
|
||||||
|
<form:option value=""><spring:message code="all_states"/></form:option>
|
||||||
|
<c:forEach items="${fns:getDictList('SPEC_AUDIT')}" var="auditC">
|
||||||
|
<form:option value="${auditC.itemCode}"><spring:message code="${auditC.itemValue}"></spring:message></form:option>
|
||||||
|
</c:forEach>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
|
||||||
|
<div class="input-group">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
|
||||||
|
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||||
|
<form:option value="srcIpAddress"><spring:message code="client_ip"></spring:message></form:option>
|
||||||
|
<form:option value="destIpAddress"><spring:message code="server_ip"></spring:message></form:option>
|
||||||
|
<form:option value="srcPort"><spring:message code="client_port"></spring:message></form:option>
|
||||||
|
<form:option value="destPort"><spring:message code="server_port"></spring:message></form:option>
|
||||||
|
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||||
|
</form:select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||||
|
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
|
||||||
|
</div>
|
||||||
|
<div class="pull-right">
|
||||||
|
<shiro:hasPermission name="iplist:config">
|
||||||
|
<sys:delRow url="${ctx}/proxy/intercept/ip/form?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||||
|
<sys:delRow url="${ctx}/proxy/intercept/ip/delete?functionId=${cfg.functionId}" id="contentTable" label="delete"></sys:delRow>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
<shiro:hasPermission name="iplist:config">
|
||||||
|
<div class="btn-group">
|
||||||
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
|
||||||
|
<i class="fa fa-angle-down"></i>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu pull-right">
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/intercept/ip/audit?isAudit=1&isValid=1&functionId=${cfg.functionId}" id="contentTable" label="approved"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/intercept/ip/audit?isAudit=2&isValid=0&functionId=${cfg.functionId}" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/proxy/intercept/ip/audit?isAudit=3&isValid=0&functionId=${cfg.functionId}" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</shiro:hasPermission>
|
||||||
|
|
||||||
|
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||||
|
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||||
|
<i class="icon-wrench"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 搜索内容与操作按钮栏 -->
|
||||||
|
|
||||||
|
<!-- 筛选搜索内容栏默认隐藏-->
|
||||||
|
<div class="col-md-12 filter-action-select-panle hide" >
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label><spring:message code="config_time"/>:</label>
|
||||||
|
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||||
|
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-2">
|
||||||
|
<div class="form-group">
|
||||||
|
<label> </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">
|
||||||
|
<sys:message content="${message}"/>
|
||||||
|
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
|
<%-- <th><spring:message code="seq"/></th> --%>
|
||||||
|
<th><spring:message code="config_describe"/></th>
|
||||||
|
<th>ip<spring:message code="type"/></th>
|
||||||
|
<th><spring:message code="client_ip"/></th>
|
||||||
|
<th><spring:message code="client_port"/></th>
|
||||||
|
<th><spring:message code="server_ip"/></th>
|
||||||
|
<th><spring:message code="server_port"/></th>
|
||||||
|
<th><spring:message code="block_type"/></th>
|
||||||
|
<th><spring:message code="direction"/></th>
|
||||||
|
<th><spring:message code="protocol"/></th>
|
||||||
|
<th><spring:message code="whether_area_block"/></th>
|
||||||
|
<th><spring:message code="letter"/></th>
|
||||||
|
<th><spring:message code="type"/></th>
|
||||||
|
<th><spring:message code="attribute"/></th>
|
||||||
|
<th><spring:message code="label"/></th>
|
||||||
|
<th><spring:message code="valid_identifier"/></th>
|
||||||
|
<th><spring:message code="is_audit"/></th>
|
||||||
|
<th><spring:message code="log_total"/></th>
|
||||||
|
<th><spring:message code="creator"/></th>
|
||||||
|
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||||
|
<th><spring:message code="editor"/></th>
|
||||||
|
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||||
|
<th><spring:message code="auditor"/></th>
|
||||||
|
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||||
|
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||||
|
<tr pId="${status.index}">
|
||||||
|
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" compileId="${cfg.compileId}" value="${cfg.isAudit}"></td>
|
||||||
|
<%-- <td>${status.index+1 }</td> --%>
|
||||||
|
<td>${cfg.cfgDesc }</td>
|
||||||
|
<td><c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipType">
|
||||||
|
<c:if test="${ipType.itemCode==cfg.ipType}">${ipType.itemValue}</c:if>
|
||||||
|
</c:forEach></td>
|
||||||
|
<td>${cfg.srcIpAddress }</td>
|
||||||
|
<td>${cfg.srcPort }</td>
|
||||||
|
<td>${cfg.destIpAddress }</td>
|
||||||
|
<td>${cfg.destPort }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION')}" var="serviceC">
|
||||||
|
<c:if test="${cfg.action eq serviceC.itemCode}"><spring:message code="${serviceC.itemValue }"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||||
|
<c:if test="${cfg.direction eq directionC.itemCode}"><spring:message code="${directionC.itemValue }"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||||
|
<c:if test="${cfg.protocol eq protocolC.itemCode}"><spring:message code="${protocolC.itemValue }"/></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||||
|
<c:if test="${cfg.isAreaEffective==1}">
|
||||||
|
<a href="javascript:viewAreaInfo('${ctx }','${cfg.areaEffectiveIds }','${cfg.compileId }')" >
|
||||||
|
<spring:message code="yes"/>
|
||||||
|
</a>
|
||||||
|
</c:if>
|
||||||
|
</td>
|
||||||
|
<td>${cfg.requestName }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId">
|
||||||
|
<c:forEach items="${fls}" var="fl">
|
||||||
|
<c:if test="${fn:trim(fl.serviceDictId) eq classifyId}">
|
||||||
|
${fl.itemValue},
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId">
|
||||||
|
<c:forEach items="${xzs}" var="xz">
|
||||||
|
<c:if test="${fn:trim(xz.serviceDictId) eq attributeId}">${xz.itemValue},</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId">
|
||||||
|
<c:forEach items="${lables}" var="lable">
|
||||||
|
<c:if test="${fn:trim(lable.serviceDictId) eq lableId}">${lable.itemValue},</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<%-- <td>${cfg.areaEffectiveIds }</td> --%>
|
||||||
|
<td>
|
||||||
|
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||||
|
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||||
|
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('SPEC_AUDIT')}" var="auditC">
|
||||||
|
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'created'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:if>
|
||||||
|
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'approved'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:if>
|
||||||
|
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'unapproved'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:if>
|
||||||
|
<c:if test="${cfg.isAudit eq auditC.itemCode and auditC.itemValue eq 'cancel'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}"><div class="loading-total"></div></td>
|
||||||
|
<td>${cfg.creatorName }</td>
|
||||||
|
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
<td>${cfg.editorName }</td>
|
||||||
|
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
<td>${cfg.auditorName }</td>
|
||||||
|
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="page">${page}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -216,7 +216,11 @@ $(function(){
|
|||||||
<c:if test="${_cfg.functionId eq service.functionId}">
|
<c:if test="${_cfg.functionId eq service.functionId}">
|
||||||
<input type="radio" name="action" serviceId="${service.serviceId }" value="${service.action }" class="required action"
|
<input type="radio" name="action" serviceId="${service.serviceId }" value="${service.action }" class="required action"
|
||||||
<c:if test="${_cfg.action==service.action}">checked</c:if>>
|
<c:if test="${_cfg.action==service.action}">checked</c:if>>
|
||||||
<spring:message code="${service.actionCode }"/>
|
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||||
|
<c:if test="${dict.itemCode eq service.action }">
|
||||||
|
<spring:message code="${dict.itemValue }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
</c:if>
|
</c:if>
|
||||||
</label>
|
</label>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
Reference in New Issue
Block a user