1.加密隧道协议增加subscribe_id 2.增加do_log 3.compileId查询
This commit is contained in:
@@ -19,7 +19,9 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.configuration.AppPolicyCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
@@ -96,6 +98,15 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!ntc.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
||||
cfgType = ntc.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
@@ -139,9 +150,15 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
logger.error("加密隧道信息保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId();
|
||||
@@ -170,10 +187,17 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
addMessage(redirectAttributes,"audit_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("加密隧道配置下发失败:"+e.getMessage());;
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
logger.error("加密隧道配置下发失败",e);
|
||||
addMessage(redirectAttributes,"audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
||||
@@ -187,8 +211,19 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
*/
|
||||
@RequestMapping(value = {"updateValid"})
|
||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
} catch (Exception e) {
|
||||
logger.error("加密隧道协议保存失败",e);
|
||||
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
|
||||
e.printStackTrace();
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}else {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,6 +217,26 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<div for="action"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
|
||||
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||
<c:choose>
|
||||
<c:when test="${dict.itemCode eq _cfg.doLog}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||
</label>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||
</label>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 ratelimit" id="ratelimit">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
||||
@@ -226,25 +246,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<div for="ratelimit"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
|
||||
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||
<c:choose>
|
||||
<c:when test="${dict.itemCode eq _cfg.doLog}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||
</label>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||
</label>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</c:if>
|
||||
<!-- 关键字 -->
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#level").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
});
|
||||
//异步获取策略ip相关信息
|
||||
$("span[id^=open]").click(function(){
|
||||
@@ -147,7 +148,7 @@
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
|
||||
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"></spring:message></form:option>
|
||||
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="APP_SUBSCRIBE_ID"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
<title><spring:message code="encrypted_tunnel_behavior"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#cancel").on("click",function(){
|
||||
initCommIpVal();
|
||||
/* $("#cancel").on("click",function(){
|
||||
window.history.back();
|
||||
});
|
||||
}); */
|
||||
$(".action").on("change", function() {
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
$("#protocolId").val($(this).attr("protocolId"));
|
||||
@@ -181,6 +182,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<c:set var="ipCfgIndex" value="0"></c:set>
|
||||
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||
<c:if test="${region.regionType eq 2 }">
|
||||
<c:if test="${region.configServiceType eq 'app_policy' }">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
|
||||
<div class="row">
|
||||
@@ -231,6 +233,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<input type="radio" name="action"
|
||||
serviceId="${service.serviceId }"
|
||||
protocolId="${service.protocolId }"
|
||||
regionCode="${service.regionCode }"
|
||||
value="${service.action }" class="required action"
|
||||
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
||||
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||
@@ -245,6 +248,26 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<div for="action"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
|
||||
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||
<c:choose>
|
||||
<c:when test="${dict.itemCode eq _cfg.doLog}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||
</label>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
|
||||
</label>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6" id="ratelimit">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ratelimit"/></label>
|
||||
@@ -254,8 +277,49 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
<div for="ratelimit"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</c:if>
|
||||
<!-- 关键字 -->
|
||||
<c:set var="subscribeIndex" value="0"></c:set>
|
||||
<c:if test="${region.configServiceType eq 'subscribe_id' }">
|
||||
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
|
||||
<h4 class="form-section">
|
||||
<spring:message code="${region.configRegionValue}" />
|
||||
<small> <span
|
||||
class="glyphicon glyphicon-plus ${tabName}Add"
|
||||
onClick="addContent(this,'${tabName}')" title="add"></span></small>
|
||||
</h4>
|
||||
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIndex}]"></c:set>
|
||||
<c:choose>
|
||||
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
|
||||
<c:set var="isBreak" value="false" ></c:set>
|
||||
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
|
||||
<c:choose>
|
||||
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
|
||||
<div class="row boxSolid ${tabName}${status.index}">
|
||||
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||
</div>
|
||||
<c:set var="isBreak" value="true" ></c:set>
|
||||
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</c:forEach>
|
||||
<c:if test="${!isBreak}">
|
||||
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
|
||||
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||
</div>
|
||||
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
|
||||
</c:if>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
|
||||
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
|
||||
</div>
|
||||
<c:set var="subscribeIndex" value="${subscribeIndex+1 }"></c:set>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:if>
|
||||
<!-- 关键字结束 -->
|
||||
</c:if>
|
||||
<c:if test="${region.regionType eq 1 }">
|
||||
<h4 class="form-section">
|
||||
@@ -285,6 +349,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
|
||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||
|
||||
@@ -126,5 +126,60 @@
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
|
||||
<!-- keywords -->
|
||||
<c:if test="${region[0] eq 2 }">
|
||||
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
|
||||
<c:if test="${region[1] eq cfg.cfgType }">
|
||||
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='keywords' />:</label><label>
|
||||
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='expression_type' />:</label>
|
||||
<label>
|
||||
<c:choose>
|
||||
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
|
||||
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
|
||||
</c:choose>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='match_method' />:</label>
|
||||
<label>
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label><spring:message code='whether_hexbinary' />:</label>
|
||||
<label>
|
||||
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
|
||||
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
|
||||
</c:forEach>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</html>
|
||||
@@ -10,6 +10,10 @@
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
|
||||
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
|
||||
}else if("${cfg.compileId}"){
|
||||
$("#intype").val("${cfg.compileId}");
|
||||
}else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
@@ -31,6 +35,7 @@
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#level").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
});
|
||||
//异步获取策略ip相关信息
|
||||
$("span[id^=open]").click(function(){
|
||||
@@ -142,6 +147,8 @@
|
||||
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
|
||||
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="APP_SUBSCRIBE_ID"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
@@ -311,11 +318,13 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="encrypted_tunnel_behavior"/></th>
|
||||
<th><spring:message code="behaviour_type"/></th>
|
||||
<th><spring:message code="ratelimit"/></th>
|
||||
<th><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
@@ -339,6 +348,7 @@
|
||||
<span id="open${status.index}" class="" compileId="${cfg.compileId}" cfgId="${cfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
|
||||
<input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
|
||||
</td>
|
||||
<td>${cfg.compileId }</td>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td>${cfg.appName }</td>
|
||||
<td>${cfg.behavName }</td>
|
||||
@@ -350,6 +360,13 @@
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
|
||||
<c:if test="${dict.itemCode eq cfg.doLog }">
|
||||
<spring:message code="${dict.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}">
|
||||
|
||||
Reference in New Issue
Block a user