拦截内置compile_id=0配置;
拦截内置配置不允许删除、不允许取消。只允许修日志参数,拦截动作,以及动作参数等信息,其他信息策略编辑界面置灰,不能修改。
This commit is contained in:
@@ -196,6 +196,8 @@
|
||||
<!-- 判断是否批量操作 -->
|
||||
<when test="batchValidValue != null and batchValidValue != ''">
|
||||
AND a.IS_VALID in (${batchValidValue})
|
||||
<!-- 批量操作不针对compie_id=0的拦截配置 -->
|
||||
AND a.compile_id != 0
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="isValid != null">
|
||||
|
||||
6
src/main/resources/sql/20190604/intercept-built-in.sql
Normal file
6
src/main/resources/sql/20190604/intercept-built-in.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
INSERT INTO `cfg_index_info`
|
||||
(`cfg_desc`, `action`, `is_valid`, `is_audit`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `auditor_id`, `audit_time`, `service_id`, `request_id`, `compile_id`, `is_area_effective`, `classify`, `attribute`, `lable`, `area_effective_ids`, `function_id`, `dns_strategy_id`, `do_log`, `user_region1`, `user_region2`, `user_region3`, `user_region4`, `user_region5`, `office_id`, `cancel_request_id`, `source_compile_id`, `do_blacklist`, `common_group_ids`)
|
||||
VALUES ('default intercept policy', 128, 0, 0, 6, now(), NULL, NULL, NULL, NULL, 521, 0, 0, 0, '0', '0', '0', '', 200, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, '');
|
||||
INSERT INTO `http_url_cfg`
|
||||
(`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`, `function_id`, `cfg_region_code`, `cfg_type`, `ratelimit`, `user_region1`, `user_region2`, `user_region3`, `user_region4`, `user_region5`)
|
||||
VALUES ('default intercept policy', '20190946.com', 128, 0, 0, 6, now(), NULL, NULL, NULL, NULL, 521, 0, 0, 0, '0', '0', '0', 0, 1, 2, '', 200, 2, 'PXY_INTERCEPT_DOMAIN', NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
@@ -1,11 +0,0 @@
|
||||
#修改日志检索->国家代理->HTTP(S)阻断 url
|
||||
UPDATE `sys_menu` SET `href`='/log/pxy/httpBlockLists?searchAction=16' WHERE code='http_block' and href='/log/pxy/httpBlockList?searchAction=16' and permission= '';
|
||||
#修改日志检索->国家代理->HTTP(S)监测 url
|
||||
UPDATE `sys_menu` SET `href`='/log/pxy/httpMonitLists?searchAction=1' WHERE code='http_monit' and href='/log/pxy/httpMonitogs' and permission= '';
|
||||
|
||||
#实时报表->国家代理菜单和它下面的子菜单都置为失效
|
||||
UPDATE `sys_menu` SET `del_flag`='0' WHERE href ='/report/list?cfgName=http_block';
|
||||
UPDATE `sys_menu` SET `del_flag`='0' WHERE href ='/report/list?cfgName=http_redirect';
|
||||
UPDATE `sys_menu` SET `del_flag`='0' WHERE href ='/report/list?cfgName=http_replace';
|
||||
UPDATE `sys_menu` SET `del_flag`='0' WHERE href ='/report/list?cfgName=http_monit';
|
||||
UPDATE `sys_menu` SET `del_flag`='0' WHERE `code`='Proxy' and parent_id='780';
|
||||
@@ -168,6 +168,19 @@ function del(url){
|
||||
});
|
||||
}
|
||||
|
||||
/***拦截内置配置不允许删除***/
|
||||
var builtInCompile=false;
|
||||
$(checkboxes).filter(":checked").each(function(){
|
||||
var compileId = $(this).attr("compileId");
|
||||
if(compileId == 0){
|
||||
builtInCompile=true;
|
||||
}
|
||||
});
|
||||
|
||||
if(builtInCompile){
|
||||
top.$.jBox.tip('<spring:message code="intercept_built_in"/>');
|
||||
canDel=false;
|
||||
}
|
||||
if(canDel){
|
||||
doAll(checkboxes,url);
|
||||
}
|
||||
@@ -298,7 +311,20 @@ function noPassOpt(url){
|
||||
top.$.jBox.tip("<spring:message code='has_prohibit_nopass'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}else{
|
||||
doAll(checkboxes,url);
|
||||
/***拦截内置配置不允许删除***/
|
||||
var builtInCompile=false;
|
||||
$(checkboxes).filter(":checked").each(function(){
|
||||
var compileId = $(this).attr("compileId");
|
||||
if(compileId == 0){
|
||||
builtInCompile=true;
|
||||
}
|
||||
});
|
||||
|
||||
if(builtInCompile){
|
||||
top.$.jBox.tip('<spring:message code="intercept_built_in"/>');
|
||||
}else{
|
||||
doAll(checkboxes,url);
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
@@ -344,7 +370,7 @@ function cancelPassOpt(url){
|
||||
|
||||
if($(checkboxes).filter(":checked").length>0){
|
||||
if(validateAllPass(checkboxes)){
|
||||
|
||||
var builtInCompile=false;
|
||||
var addrPoolIds = [],canCancel = true;
|
||||
var compileIds = [];
|
||||
var serviceId = 0;
|
||||
@@ -367,6 +393,9 @@ function cancelPassOpt(url){
|
||||
if(typeof serviceId != "undefined" && serviceIdJudge && typeof compileId != "undefined"){
|
||||
compileIds.push(compileId);
|
||||
}
|
||||
if(compileId == 0){
|
||||
builtInCompile=true;
|
||||
}
|
||||
});
|
||||
// 地址池管理 (被策略引用的地址池不可取消)
|
||||
if(addrPoolIds.length > 0){
|
||||
@@ -399,7 +428,13 @@ function cancelPassOpt(url){
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/***拦截内置配置不允许删除***/
|
||||
if(builtInCompile){
|
||||
top.$.jBox.tip('<spring:message code="intercept_built_in"/>');
|
||||
canCancel=false;
|
||||
}
|
||||
if(canCancel){
|
||||
doAll(checkboxes,url);
|
||||
}
|
||||
|
||||
@@ -96,9 +96,9 @@ legend{padding:.5em;border:0;width:auto;font-family: "Open Sans", sans-serif;col
|
||||
$(this).attr("checked",true);
|
||||
}); */
|
||||
|
||||
|
||||
var compileId=$("input[name=compileId]").val();
|
||||
//代表所有业务都隐藏了,提示必须增加一种业务数据
|
||||
if($(".boxSolid").length ==$(".boxSolid.hidden").length){
|
||||
if(($(".boxSolid").length ==$(".boxSolid.hidden").length) && compileId!=0){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}else{
|
||||
@@ -189,6 +189,13 @@ legend{padding:.5em;border:0;width:auto;font-family: "Open Sans", sans-serif;col
|
||||
/* $("span[title='add']").on("click", function() {
|
||||
$(".ipPort0").removeClass("hidden");
|
||||
}); */
|
||||
//0号内置配置不允许修改内容
|
||||
if("${_cfg.compileId}" == 0){
|
||||
$(".glyphicon-plus").remove();
|
||||
$(".glyphicon-remove").remove();
|
||||
$("input[name='cfgDesc']").attr("readonly",true);
|
||||
$(".boxSolid").addClass("hidden");
|
||||
}
|
||||
});
|
||||
|
||||
//限流方式
|
||||
@@ -1229,12 +1236,19 @@ legend{padding:.5em;border:0;width:auto;font-family: "Open Sans", sans-serif;col
|
||||
</c:if>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<br>
|
||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
||||
<br>
|
||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
|
||||
<br>
|
||||
<%@include file="/WEB-INF/include/form/scheduleNew.jsp"%>
|
||||
<c:if test="${_cfg.compileId == 0}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="${_cfg.isAreaEffective }">
|
||||
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId }">
|
||||
</c:if>
|
||||
<c:if test="${_cfg.compileId != 0}">
|
||||
<br>
|
||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
|
||||
<br>
|
||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
|
||||
<br>
|
||||
<%@include file="/WEB-INF/include/form/scheduleNew.jsp"%>
|
||||
</c:if>
|
||||
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
@@ -511,8 +511,8 @@
|
||||
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td>
|
||||
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
|
||||
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
|
||||
<span <c:if test="${indexCfg.compileId == 0}"> class="hidden"</c:if> id="open${status.index}" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
|
||||
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}" compileId="${indexCfg.compileId}">
|
||||
</td>
|
||||
<td>${indexCfg.compileId }</td>
|
||||
<td>
|
||||
|
||||
Reference in New Issue
Block a user