diff --git a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml index 74fa98ff2..505c6b20a 100644 --- a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml @@ -196,6 +196,8 @@ AND a.IS_VALID in (${batchValidValue}) + + AND a.compile_id != 0 diff --git a/src/main/resources/sql/20190604/intercept-built-in.sql b/src/main/resources/sql/20190604/intercept-built-in.sql new file mode 100644 index 000000000..5506a7cd6 --- /dev/null +++ b/src/main/resources/sql/20190604/intercept-built-in.sql @@ -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); diff --git a/src/main/resources/sql/20190610/update_sys_menu.sql b/src/main/resources/sql/20190610/update_sys_menu.sql deleted file mode 100644 index 3cc66595c..000000000 --- a/src/main/resources/sql/20190610/update_sys_menu.sql +++ /dev/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'; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 4365d9202..71db369ff 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -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(''); + canDel=false; + } if(canDel){ doAll(checkboxes,url); } @@ -298,7 +311,20 @@ function noPassOpt(url){ top.$.jBox.tip("", ""); 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(''); + }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(''); + canCancel=false; + } if(canCancel){ doAll(checkboxes,url); } diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp index d722663f2..0d22af983 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptForm.jsp @@ -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("", ""); 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 - - <%@include file="/WEB-INF/include/form/areaInfo.jsp"%> - - <%@include file="/WEB-INF/include/form/basicInfo.jsp"%> - - <%@include file="/WEB-INF/include/form/scheduleNew.jsp"%> + + + + + + + <%@include file="/WEB-INF/include/form/areaInfo.jsp"%> + + <%@include file="/WEB-INF/include/form/basicInfo.jsp"%> + + <%@include file="/WEB-INF/include/form/scheduleNew.jsp"%> + + diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp index a4bd9bb5c..86a8fa3b3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptList.jsp @@ -511,8 +511,8 @@ - ▷ ▼ - + class="hidden" id="open${status.index}" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ ▼ + ${indexCfg.compileId }