2018-04-11 13:45:04 +08:00
|
|
|
|
$(function(){
|
|
|
|
|
|
//全选及取消
|
|
|
|
|
|
$("#checkAll").change(function(){
|
|
|
|
|
|
if($("#checkAll").prop("checked")){
|
|
|
|
|
|
$("input.i-checks").prop("checked",true);
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$("input.i-checks").prop("checked",false);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2018-05-25 18:25:42 +08:00
|
|
|
|
|
|
|
|
|
|
$("select[name$='ipType']").each(function(){
|
|
|
|
|
|
switchIpInfo(this);
|
|
|
|
|
|
})
|
2018-06-11 13:59:42 +08:00
|
|
|
|
$("select[name$='exprType']").each(function(){
|
|
|
|
|
|
switchIpInfo(this);
|
|
|
|
|
|
})
|
2018-05-25 18:25:42 +08:00
|
|
|
|
$("select[name$='ipType']").on("change",function(){
|
|
|
|
|
|
switchIpInfo(this);
|
|
|
|
|
|
});
|
|
|
|
|
|
$("select[name$='ipPattern']").on("change",function(){
|
|
|
|
|
|
switchIpInfo(this);
|
|
|
|
|
|
});
|
|
|
|
|
|
$("select[name$='portPattern']").on("change",function(){
|
|
|
|
|
|
switchIpInfo(this);
|
|
|
|
|
|
});
|
2018-06-22 15:59:47 +08:00
|
|
|
|
switchAction($("input[name='action']:checked").val());
|
|
|
|
|
|
//DNS REJECT 时选择dnsStrategyId
|
|
|
|
|
|
$("input[name='action']").on('change',function(){
|
|
|
|
|
|
var action=$(this).val();
|
|
|
|
|
|
switchAction(action);
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
$(".glyphicon-plus").on("click",function(){
|
|
|
|
|
|
var obj=$(this).parents(".form-section").next(".container-fluid").clone();
|
|
|
|
|
|
var len=$(this).parents("div").find(".container-fluid:visible").size();
|
|
|
|
|
|
if($(this).parent().parent().parent().attr("id")=="areaIp"){
|
|
|
|
|
|
obj.find("[id^='_areaCfg']").each(function(){
|
|
|
|
|
|
var name=$(this).attr("id").replace("_areaCfg.","");
|
|
|
|
|
|
$(this).removeAttr("id");
|
|
|
|
|
|
$(this).attr("name","areaCfg["+len+"]."+name);
|
|
|
|
|
|
$(this).parents(".form-group").find("div[for^='_areaCfg']").attr("for","areaCfg["+len+"]."+name);
|
|
|
|
|
|
$(this).selectpicker("refresh");
|
|
|
|
|
|
});
|
|
|
|
|
|
obj.removeClass("hidden");
|
2018-05-30 15:00:19 +08:00
|
|
|
|
switchIpInfo(obj.find("select[name$='ipType']"));
|
2018-05-29 18:31:43 +08:00
|
|
|
|
obj.find("select[name$='ipType']").on("change",function(){
|
2018-05-30 15:00:19 +08:00
|
|
|
|
switchIpInfo($(this));
|
2018-05-29 18:31:43 +08:00
|
|
|
|
});
|
|
|
|
|
|
obj.find("select[name$='ipPattern']").on("change",function(){
|
2018-05-30 15:00:19 +08:00
|
|
|
|
switchIpInfo($(this));
|
2018-05-29 18:31:43 +08:00
|
|
|
|
});
|
|
|
|
|
|
obj.appendTo("#areaIp");
|
|
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
if(!$(this).hasClass("hidden")) $(this).remove();
|
|
|
|
|
|
});
|
2018-05-30 14:37:35 +08:00
|
|
|
|
if(len==0){
|
|
|
|
|
|
$("#areaIp").find(".container-fluid:visible").eq(0).find("span[title=remove]").addClass("hidden");
|
|
|
|
|
|
}
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}else if($(this).parent().parent().parent().attr("id")=="areaIsp"){
|
|
|
|
|
|
obj.find("[name^='areaCode']").each(function(){
|
|
|
|
|
|
$(this).attr("name","areaIsp["+len+"].area");
|
|
|
|
|
|
$(this).parents(".form-group").find("div[for^='areaCode']").attr("for","areaIsp["+len+"].area");
|
|
|
|
|
|
$(this).selectpicker("refresh");
|
|
|
|
|
|
});
|
|
|
|
|
|
obj.find("[name^='ispCode']").each(function(){
|
|
|
|
|
|
$(this).attr("name","areaIsp["+len+"].isp");
|
|
|
|
|
|
$(this).selectpicker("refresh");
|
|
|
|
|
|
});
|
|
|
|
|
|
obj.removeClass("hidden");
|
|
|
|
|
|
obj.appendTo("#areaIsp");
|
|
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
if(!$(this).hasClass("hidden")) $(this).remove();
|
|
|
|
|
|
});
|
2018-05-30 14:37:35 +08:00
|
|
|
|
if(len==0){
|
|
|
|
|
|
$("#areaIsp").find(".container-fluid:visible").eq(0).find("span[title=remove]").addClass("hidden");
|
|
|
|
|
|
}
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$("input[name='areaType']").on('change',function(){
|
|
|
|
|
|
var val=$(this).val();
|
|
|
|
|
|
if($(this).is(":visible")){
|
|
|
|
|
|
if(val==0){
|
|
|
|
|
|
$("#areaIp").removeClass("hidden");
|
|
|
|
|
|
$("#areaIsp").addClass("hidden");
|
|
|
|
|
|
if($("#areaIp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
2018-05-30 17:10:39 +08:00
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
$(this).removeClass("disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
$("#areaIsp").removeClass("hidden");
|
|
|
|
|
|
$("#areaIp").addClass("hidden");
|
|
|
|
|
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIsp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
2018-05-30 17:10:39 +08:00
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
$(this).removeClass("disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$("#areaIsp").addClass("hidden");
|
|
|
|
|
|
$("#areaIp").addClass("hidden");
|
2018-05-30 17:10:39 +08:00
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
2018-05-31 09:17:09 +08:00
|
|
|
|
$(this).attr("disabled","disabled");
|
2018-05-30 17:10:39 +08:00
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$("input[name='isAreaEffective']").on('change',function(){
|
|
|
|
|
|
var val=$(this).val();
|
|
|
|
|
|
if(val==1){
|
2018-05-30 17:10:39 +08:00
|
|
|
|
$(".areaType").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
$(this).removeClass("disabled");
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
$(".areaType").removeClass("hidden");
|
|
|
|
|
|
if($("input[name='areaType']:checked").val()==1){//areaISP
|
|
|
|
|
|
$("#areaIsp").removeClass("hidden");
|
|
|
|
|
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIsp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
2018-05-30 17:10:39 +08:00
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
$(this).removeClass("disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}else if($("input[name='areaType']:checked").val()==0){//areaIp
|
|
|
|
|
|
$("#areaIp").removeClass("hidden");
|
|
|
|
|
|
if($("#areaIp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
2018-05-30 17:10:39 +08:00
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
$(this).removeClass("disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
$(".areaType").find("[value='1']").prop("checked",true);
|
|
|
|
|
|
$("#areaIsp").removeClass("hidden");
|
|
|
|
|
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIsp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
2018-05-30 17:10:39 +08:00
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
$(this).removeClass("disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}
|
2018-05-30 17:10:39 +08:00
|
|
|
|
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
$(".areaType").addClass("hidden");
|
|
|
|
|
|
$("#areaIp").addClass("hidden");
|
|
|
|
|
|
$("#areaIsp").addClass("hidden");
|
2018-05-30 17:10:39 +08:00
|
|
|
|
|
|
|
|
|
|
$(".areaType").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
});
|
2018-05-31 09:17:09 +08:00
|
|
|
|
$("#areaIsp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
2018-05-30 17:10:39 +08:00
|
|
|
|
});
|
2018-05-31 09:17:09 +08:00
|
|
|
|
$("#areaIp").find(".container-fluid").each(function(){
|
|
|
|
|
|
$(this).find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
})
|
2018-05-30 17:10:39 +08:00
|
|
|
|
});
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
areaControlInit();
|
2018-06-01 16:55:49 +08:00
|
|
|
|
/*=====关键字与表达式处理 开始=====*/
|
|
|
|
|
|
var tagsInputSettings="#tags";
|
|
|
|
|
|
$("input[name$='cfgKeywords']").each(function(){
|
|
|
|
|
|
var tagsId = $(this).attr("id");
|
2018-06-04 15:36:00 +08:00
|
|
|
|
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
2018-06-01 16:55:49 +08:00
|
|
|
|
var isTags = $(this).hasClass("tags");//有tags样式的关键字输入框才需处理
|
|
|
|
|
|
if(typeof(tagsId)!=='undefined' && tagsId.indexOf("tags_")!=-1 && isTags){
|
2018-06-11 13:59:42 +08:00
|
|
|
|
if($("input:radio[name='"+objNamePrefix+"exprType']").val()==1){
|
|
|
|
|
|
$("select[name='"+objNamePrefix+"matchMethod']").find("option[value!=0]").attr("disabled",true);
|
|
|
|
|
|
}
|
2018-06-01 16:55:49 +08:00
|
|
|
|
//表单中如果有关键字内容可能输入多个关键字的情况,根据输入关键字个数确定表达式选中情况,不允许手动选中
|
2018-06-04 15:36:00 +08:00
|
|
|
|
$("input:radio[name='"+objNamePrefix+"exprType']").attr("disabled",true);
|
2018-06-01 16:55:49 +08:00
|
|
|
|
tagsInputSettings = tagsInputSettings+",#"+tagsId;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
$(tagsInputSettings).tagsInput({
|
2018-06-23 17:29:14 +08:00
|
|
|
|
width:$(tagsInputSettings).find(".form-control").width(),
|
2018-06-01 16:55:49 +08:00
|
|
|
|
defaultText:'please input keywords',
|
2018-06-06 14:54:14 +08:00
|
|
|
|
'delimiter':'***and***',//特殊字符串分隔与表达式的多关键词
|
2018-06-01 16:55:49 +08:00
|
|
|
|
onAddTag:function(tag,size){
|
|
|
|
|
|
//var keywordValue = "";
|
2018-06-04 15:36:00 +08:00
|
|
|
|
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
2018-06-01 16:55:49 +08:00
|
|
|
|
/*$("span[class='tag']").each(function(){
|
|
|
|
|
|
keywordValue = keywordValue+"***iie***"+$(this).find("span").text().trim();
|
|
|
|
|
|
});
|
|
|
|
|
|
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
|
|
|
|
|
|
exprTypeChecked(objNamePrefix,size);
|
|
|
|
|
|
},
|
|
|
|
|
|
onRemoveTag:function(tag,size){
|
|
|
|
|
|
//var keywordValue = "";
|
2018-06-04 15:36:00 +08:00
|
|
|
|
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
2018-06-01 16:55:49 +08:00
|
|
|
|
/*$("span[class='tag']").each(function(){
|
|
|
|
|
|
keywordValue = keywordValue+"***iie***"+$(this).find("span").text().trim();
|
|
|
|
|
|
});
|
|
|
|
|
|
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
|
|
|
|
|
|
exprTypeChecked(objNamePrefix,size);
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$(".tagsinput").popover({
|
|
|
|
|
|
animation:true,
|
|
|
|
|
|
container:'body',
|
|
|
|
|
|
placement:'right',
|
|
|
|
|
|
html:true,
|
|
|
|
|
|
trigger:"hover",
|
|
|
|
|
|
title:"",
|
|
|
|
|
|
content:function(){
|
2018-06-06 09:57:26 +08:00
|
|
|
|
var content = $("#tagsinputTip").text();
|
2018-06-01 16:55:49 +08:00
|
|
|
|
return content;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
/*=====关键字与表达式处理 结束=====*/
|
2018-06-05 20:35:37 +08:00
|
|
|
|
/*$("input[name$='cfgKeywords']").each(function(){
|
|
|
|
|
|
if($(this).hasClass("tags")){
|
|
|
|
|
|
if($(this).val()==''){
|
|
|
|
|
|
$(this).parents(".form-group").find(
|
|
|
|
|
|
"div[for='"
|
|
|
|
|
|
+ $(this).attr("name")
|
|
|
|
|
|
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
|
|
|
|
|
|
flag = false;
|
|
|
|
|
|
return;
|
2018-06-05 17:52:26 +08:00
|
|
|
|
}
|
2018-06-05 20:35:37 +08:00
|
|
|
|
}
|
|
|
|
|
|
})*/
|
|
|
|
|
|
|
2018-06-06 14:54:14 +08:00
|
|
|
|
//处理增强字符串配置的匹配区域
|
|
|
|
|
|
$(".district").each(function(){
|
|
|
|
|
|
if($(this).siblings(".otherValue").val()!=''){
|
|
|
|
|
|
if($(this).val()!=$(this).siblings(".otherValue").val()){
|
|
|
|
|
|
$(this).find("option[value=others]").attr("selected","selected");
|
|
|
|
|
|
$(this).siblings(".otherValue").prop("type","text");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
2018-06-11 13:59:42 +08:00
|
|
|
|
$("input[name$='exprType']").on("change",function(){
|
|
|
|
|
|
setDefaultMatchMethod(this);
|
|
|
|
|
|
});
|
|
|
|
|
|
$("input[name$='exprType']:checked").each(function(){
|
|
|
|
|
|
setDefaultMatchMethod(this);
|
|
|
|
|
|
});
|
2018-06-27 15:13:08 +08:00
|
|
|
|
/*
|
|
|
|
|
|
*配置展示日志总数,审核通过才会调用接口查询日志总量
|
|
|
|
|
|
必须放在是否审核一列之后
|
|
|
|
|
|
并且是否审核一列的span标签需配置data-audit="xxxx"属性
|
|
|
|
|
|
xxxx可用值为created,approved,unapproved,cancel
|
|
|
|
|
|
td需要配置属性有,functionId,compileId,action
|
|
|
|
|
|
*/
|
|
|
|
|
|
$("td[compileId]").each(function(){
|
|
|
|
|
|
var audit=$(this).prev().find("span").data("audit");
|
|
|
|
|
|
if(audit == "approved"){
|
|
|
|
|
|
var data={};
|
|
|
|
|
|
data.date=new Date();
|
|
|
|
|
|
data.compileId=$(this).attr("compileId");
|
|
|
|
|
|
data.action=$(this).attr("action");
|
|
|
|
|
|
data.functionId=$(this).attr("functionId");
|
|
|
|
|
|
data.audit=$(this).attr("audit");
|
|
|
|
|
|
data.obj=$(this)
|
2018-06-29 15:02:17 +08:00
|
|
|
|
GetLogTotal(data);
|
2018-06-27 15:13:08 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
$(this).html("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
2018-04-11 13:45:04 +08:00
|
|
|
|
});
|
2018-06-11 13:59:42 +08:00
|
|
|
|
//与表达式时,只允许为子串匹配
|
|
|
|
|
|
var setDefaultMatchMethod=function (obj){
|
|
|
|
|
|
var exprType = $(obj).val();
|
|
|
|
|
|
if(exprType == 1){
|
|
|
|
|
|
$(obj).parents(".row").parent(".row").find("select[name$='matchMethod']").find("option").removeAttr("selected");
|
|
|
|
|
|
$(obj).parents(".row").parent(".row").find("select[name$='matchMethod']").find("option[value=0]").attr("selected","selected");
|
|
|
|
|
|
$(obj).parents(".row").parent(".row").find("select[name$='matchMethod']").find("option[value!=0]").attr("disabled",true);
|
|
|
|
|
|
$(obj).parents(".row").parent(".row").find("select[name$='matchMethod']").selectpicker("refresh");
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$(obj).parents(".row").parent(".row").find("select[name$='matchMethod']").find("option").removeAttr("disabled");
|
|
|
|
|
|
$(obj).parents(".row").parent(".row").find("select[name$='matchMethod']").selectpicker("refresh");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-04-09 11:03:22 +08:00
|
|
|
|
var switchIpType=function(obj){
|
|
|
|
|
|
var type=$(obj).val();
|
|
|
|
|
|
var row=$(obj).parents('.row');
|
2018-05-22 18:59:19 +08:00
|
|
|
|
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']");
|
2018-04-09 11:26:14 +08:00
|
|
|
|
var srcPort=row.siblings().find("input[name$='srcPort']");
|
2018-05-22 18:59:19 +08:00
|
|
|
|
var dstPort=row.siblings().find("input[name$='destPort']");
|
2018-04-09 11:03:22 +08:00
|
|
|
|
if(4==type){
|
|
|
|
|
|
if(!$(srcIp).val()){
|
|
|
|
|
|
$(srcIp).val("0.0.0.0");
|
|
|
|
|
|
}else if($(srcIp).val()=="::"){
|
|
|
|
|
|
$(srcIp).val("0.0.0.0");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!$(dstIp).val()){
|
|
|
|
|
|
$(dstIp).val("0.0.0.0");
|
|
|
|
|
|
}else if($(dstIp).val()=="::"){
|
|
|
|
|
|
$(dstIp).val("0.0.0.0");
|
|
|
|
|
|
}
|
2018-04-09 11:26:14 +08:00
|
|
|
|
if(!$(srcPort).val()){
|
|
|
|
|
|
$(srcPort).val("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!$(dstPort).val()){
|
|
|
|
|
|
$(dstPort).val("0");
|
|
|
|
|
|
}
|
2018-04-09 11:03:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
if(6==type){
|
|
|
|
|
|
if(!$(srcIp).val()){
|
|
|
|
|
|
$(srcIp).val("::");
|
|
|
|
|
|
}else if($(srcIp).val()=="0.0.0.0"){
|
|
|
|
|
|
$(srcIp).val("::");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!$(dstIp).val()){
|
|
|
|
|
|
$(dstIp).val("::");
|
|
|
|
|
|
}else if($(dstIp).val()=="0.0.0.0"){
|
|
|
|
|
|
$(dstIp).val("::");
|
|
|
|
|
|
}
|
2018-04-11 13:45:04 +08:00
|
|
|
|
if(!$(srcPort).val()){
|
|
|
|
|
|
$(srcPort).val("0");
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!$(dstPort).val()){
|
|
|
|
|
|
$(dstPort).val("0");
|
|
|
|
|
|
}
|
2018-04-09 11:03:22 +08:00
|
|
|
|
}
|
2018-04-09 16:38:45 +08:00
|
|
|
|
}
|
2018-06-22 15:59:47 +08:00
|
|
|
|
var switchAction=function(action){
|
|
|
|
|
|
if(action == 16){ //reject
|
|
|
|
|
|
$(".policy").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
$(this).removeClass("hidden");
|
|
|
|
|
|
$(this).removeClass("disabled");
|
|
|
|
|
|
})
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$(".policy").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","disabled");
|
|
|
|
|
|
$(this).addClass("hidden");
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-05-25 15:16:05 +08:00
|
|
|
|
//ipType、ipPattern、portPattern选项变化时调用此方法,添加默认值
|
2018-05-30 15:00:19 +08:00
|
|
|
|
var switchIpInfo=function(obj){
|
2018-05-25 15:16:05 +08:00
|
|
|
|
var ipType="";
|
|
|
|
|
|
var ipPattern="";
|
|
|
|
|
|
var portPattern="";
|
|
|
|
|
|
|
2018-05-29 18:31:43 +08:00
|
|
|
|
var row=$(obj).parents('.row').parent('.row');
|
2018-05-25 16:33:33 +08:00
|
|
|
|
ipType=row.find("select[name$='ipType']").val();
|
|
|
|
|
|
ipPattern=row.find("select[name$='ipPattern']").val();
|
|
|
|
|
|
portPattern=row.find("select[name$='portPattern']").val();
|
|
|
|
|
|
var srcIp=row.find("input[name$='srcIpAddress']");
|
|
|
|
|
|
var destIp=row.find("input[name$='destIpAddress']");
|
|
|
|
|
|
var srcPort=row.find("input[name$='srcPort']");
|
|
|
|
|
|
var destPort=row.find("input[name$='destPort']");
|
2018-05-25 15:16:05 +08:00
|
|
|
|
|
|
|
|
|
|
var ipV4Default=new Array();
|
|
|
|
|
|
ipV4Default[0]="0.0.0.0/8"; //subnet
|
|
|
|
|
|
ipV4Default[1]="0.0.0.0-1.1.1.1";//ip_range
|
|
|
|
|
|
ipV4Default[2]="0.0.0.0"; //ip
|
|
|
|
|
|
|
|
|
|
|
|
var ipV6Default=new Array();
|
|
|
|
|
|
ipV6Default[0]="::/64"; //subnet
|
|
|
|
|
|
ipV6Default[1]="::-::";//ip_range
|
|
|
|
|
|
ipV6Default[2]="::"; //ip
|
|
|
|
|
|
|
|
|
|
|
|
var portDefault=new Array();
|
|
|
|
|
|
portDefault[0]="0";//port
|
|
|
|
|
|
portDefault[1]="0/0";//port_mask
|
|
|
|
|
|
|
|
|
|
|
|
//IPv4设置默认值
|
|
|
|
|
|
if(4==ipType){
|
|
|
|
|
|
if(!$(srcIp).val()){
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(srcIp).val(ipV4Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(srcIp).val(ipV4Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(srcIp).val(ipV4Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if($.inArray($(srcIp).val(),ipV4Default) > -1 || $.inArray($(srcIp).val(),ipV6Default) > -1){ //是ipV4的默认值其中一个
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(srcIp).val(ipV4Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(srcIp).val(ipV4Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(srcIp).val(ipV4Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!$(destIp).val()){
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(destIp).val(ipV4Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(destIp).val(ipV4Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(destIp).val(ipV4Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if($.inArray($(destIp).val(),ipV4Default) > -1 || $.inArray($(destIp).val(),ipV6Default) > -1){ //是ipV4的默认值其中一个
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(destIp).val(ipV4Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(destIp).val(ipV4Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(destIp).val(ipV4Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(6==ipType){
|
|
|
|
|
|
if(!$(srcIp).val()){
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(srcIp).val(ipV6Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(srcIp).val(ipV6Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(srcIp).val(ipV6Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if($.inArray($(srcIp).val(),ipV4Default) > -1 || $.inArray($(srcIp).val(),ipV6Default) > -1){ //是ipV6的默认值其中一个
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(srcIp).val(ipV6Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(srcIp).val(ipV6Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(srcIp).val(ipV6Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if(!$(destIp).val()){
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(destIp).val(ipV6Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(destIp).val(ipV6Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(destIp).val(ipV6Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if($.inArray($(destIp).val(),ipV4Default) > -1 || $.inArray($(destIp).val(),ipV6Default) > -1){ //是ipV6的默认值其中一个
|
|
|
|
|
|
if(ipPattern==1){
|
|
|
|
|
|
$(destIp).val(ipV6Default[0]);
|
|
|
|
|
|
}else if(ipPattern==2){
|
|
|
|
|
|
$(destIp).val(ipV6Default[1]);
|
|
|
|
|
|
}else if(ipPattern==3){
|
|
|
|
|
|
$(destIp).val(ipV6Default[2]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//设置源端口默认值
|
|
|
|
|
|
if(!$(srcPort).val()){
|
|
|
|
|
|
if(portPattern==1){
|
|
|
|
|
|
$(srcPort).val(portDefault[0]);
|
|
|
|
|
|
}else if(portPattern==2){
|
|
|
|
|
|
$(srcPort).val(portDefault[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if($.inArray($(srcPort).val(),portDefault) > -1){ //是ipV4的默认值其中一个
|
|
|
|
|
|
if(portPattern==1){
|
|
|
|
|
|
$(srcPort).val(portDefault[0]);
|
|
|
|
|
|
}else if(portPattern==2){
|
|
|
|
|
|
$(srcPort).val(portDefault[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//设置目的端口默认值
|
|
|
|
|
|
if(!$(destPort).val()){
|
|
|
|
|
|
if(portPattern==1){
|
|
|
|
|
|
$(destPort).val(portDefault[0]);
|
|
|
|
|
|
}else if(portPattern==2){
|
|
|
|
|
|
$(destPort).val(portDefault[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
if($.inArray($(destPort).val(),portDefault) > -1){ //是port的默认值其中一个
|
|
|
|
|
|
if(portPattern==1){
|
|
|
|
|
|
$(destPort).val(portDefault[0]);
|
|
|
|
|
|
}else if(portPattern==2){
|
|
|
|
|
|
$(destPort).val(portDefault[1]);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-04-09 16:38:45 +08:00
|
|
|
|
var areaControlInit=function(){
|
|
|
|
|
|
if($("input[name='isAreaEffective']:checked").val()==1){
|
|
|
|
|
|
$(".areaType").removeClass("hidden");
|
|
|
|
|
|
if($("input[name='areaEffectiveIds']").val()){
|
|
|
|
|
|
$(".areaType").find("[value='1']").prop("checked",true);
|
|
|
|
|
|
$("#areaIsp").removeClass("hidden");
|
|
|
|
|
|
$("#areaIp").addClass("hidden");
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$(".areaType").find("[value='0']").prop("checked",true);
|
|
|
|
|
|
$("#areaIp").removeClass("hidden");
|
|
|
|
|
|
$("#areaIsp").addClass("hidden");
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$("input[name='areaEffectiveIds']").val("");
|
2018-05-29 18:31:43 +08:00
|
|
|
|
$("input[name='isAreaEffective']").eq(1).prop("checked",true);
|
2018-04-09 16:38:45 +08:00
|
|
|
|
}
|
2018-04-11 14:30:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
//查询
|
|
|
|
|
|
var page=function(n,s){
|
|
|
|
|
|
$("#intype").attr("name",$("#seltype").val());
|
|
|
|
|
|
$("#pageNo").val(n);
|
|
|
|
|
|
$("#pageSize").val(s);
|
|
|
|
|
|
$("#searchForm").submit();
|
|
|
|
|
|
return false;
|
2018-05-21 19:40:04 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//show more 添加更多属性
|
|
|
|
|
|
var more=function(obj){
|
|
|
|
|
|
var clickTimes=$(obj).data("click-times");
|
|
|
|
|
|
if(clickTimes==0){
|
|
|
|
|
|
$(".port").removeClass("hidden").removeClass("disabled");
|
|
|
|
|
|
$(obj).data("click-times",clickTimes+1);
|
|
|
|
|
|
}
|
|
|
|
|
|
if(clickTimes==1){
|
2018-05-25 16:33:33 +08:00
|
|
|
|
$(".destPort").removeClass("hidden").removeClass("disabled");
|
|
|
|
|
|
$(obj).data("click-times",clickTimes+1);
|
|
|
|
|
|
}
|
|
|
|
|
|
if(clickTimes==2){
|
2018-05-21 19:40:04 +08:00
|
|
|
|
$(".protocol").removeClass("hidden").removeClass("disabled");
|
|
|
|
|
|
$(obj).data("click-times",clickTimes+1);
|
|
|
|
|
|
}
|
|
|
|
|
|
var rows=$(obj).parent(".row").siblings(".row:hidden");
|
|
|
|
|
|
if(rows.size()==0){
|
|
|
|
|
|
$(obj).addClass("hidden");
|
|
|
|
|
|
}
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2018-06-05 20:35:37 +08:00
|
|
|
|
var viewAreaInfo=function(path,areaEffectiveIds,compileId){
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
|
type:'post',
|
|
|
|
|
|
url:path+'/ntc/av/area/ajaxAreaEffictiveInfo',
|
|
|
|
|
|
data:{"areaEffectiveIds":areaEffectiveIds,"compileId":compileId},
|
|
|
|
|
|
dataType:'json',
|
|
|
|
|
|
async:false,
|
|
|
|
|
|
success:function(data,textStatus){
|
|
|
|
|
|
if(textStatus=="success"){
|
|
|
|
|
|
var html = "";
|
|
|
|
|
|
var title="";
|
|
|
|
|
|
if(data.areaIsps.length > 0){
|
|
|
|
|
|
title=$.validator.messages.area+" "+$.validator.messages.isp;
|
|
|
|
|
|
html+="<table class='table table-striped table-bordered table-condensed' style='margin-left: 10px; width: 96%;'>";
|
|
|
|
|
|
html+="<thead>";
|
2018-06-06 09:44:24 +08:00
|
|
|
|
html+="<th style='width:50%;padding-right:0px'>"+$.validator.messages.area+"</th>" +
|
|
|
|
|
|
"<th style='width:50%;padding-right:0px'>"+$.validator.messages.isp+"</th>";
|
2018-06-05 20:35:37 +08:00
|
|
|
|
html+="</thead>";
|
|
|
|
|
|
html+="<tbody>";
|
|
|
|
|
|
for(i=0;i<data.areaIsps.length;i++){
|
|
|
|
|
|
html+="<tr>";
|
|
|
|
|
|
html+="<td>"+data.areaIsps[i].areaName;
|
|
|
|
|
|
html+="</td>";
|
|
|
|
|
|
html+="<td>"+data.areaIsps[i].ispName;
|
|
|
|
|
|
html+="</td>";
|
|
|
|
|
|
html+="</tr>";
|
|
|
|
|
|
}
|
|
|
|
|
|
html+="</tbody>";
|
|
|
|
|
|
html+="</table>";
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.areaIps.length > 0){
|
|
|
|
|
|
title=$.validator.messages.area+" ip";
|
|
|
|
|
|
html+="<table class='table table-striped table-bordered table-condensed' style='margin-left: 10px; width: 96%;'>";
|
|
|
|
|
|
html+="<thead>";
|
2018-06-06 09:44:24 +08:00
|
|
|
|
html+="<th style='width:20%;padding-right:0px'>"+$.validator.messages.ip_type+"</th>" +
|
|
|
|
|
|
"<th style='width:20%;padding-right:0px'>"+$.validator.messages.ip_pattern+"</th>" +
|
|
|
|
|
|
"<th style='width:60%;padding-right:0px'>"+$.validator.messages.client_ip+"</th>";
|
2018-06-05 20:35:37 +08:00
|
|
|
|
html+="</thead>";
|
|
|
|
|
|
html+="<tbody>";
|
|
|
|
|
|
for(i=0;i<data.areaIps.length;i++){
|
|
|
|
|
|
html+="<tr>";
|
|
|
|
|
|
html+="<td>";
|
|
|
|
|
|
if(data.areaIps[i].ipType==4){
|
|
|
|
|
|
html+=$.validator.messages.ipv4;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.areaIps[i].ipType==6){
|
|
|
|
|
|
html+=$.validator.messages.ipv6;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.areaIps[i].ipType==46){
|
|
|
|
|
|
html+=$.validator.messages.over4;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.areaIps[i].ipType==64){
|
|
|
|
|
|
html+=$.validator.messages.over6;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.areaIps[i].ipType==10){
|
|
|
|
|
|
html+=$.validator.messages.all;
|
|
|
|
|
|
}
|
|
|
|
|
|
html+="</td>";
|
|
|
|
|
|
html+="<td>";
|
|
|
|
|
|
if(data.areaIps[i].ipPattern==1){
|
|
|
|
|
|
html+=$.validator.messages.ip_subnet;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.areaIps[i].ipPattern==2){
|
|
|
|
|
|
html+=$.validator.messages.ip_range;
|
|
|
|
|
|
}
|
|
|
|
|
|
if(data.areaIps[i].ipPattern==3){
|
|
|
|
|
|
html+="IP";
|
|
|
|
|
|
}
|
|
|
|
|
|
html+="</td>";
|
|
|
|
|
|
html+="<td>"+data.areaIps[i].srcIpAddress;
|
|
|
|
|
|
html+="</td>";
|
|
|
|
|
|
html+="</tr>";
|
|
|
|
|
|
}
|
|
|
|
|
|
html+="</tbody>";
|
|
|
|
|
|
html+="</table>";
|
|
|
|
|
|
}
|
|
|
|
|
|
top.$.jBox(html,{width: $(document).width()*0.4,height: 400,title:title, buttons:false});
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2018-06-12 11:24:19 +08:00
|
|
|
|
|
2018-06-29 15:02:17 +08:00
|
|
|
|
var GetLogTotal=function(data){
|
|
|
|
|
|
var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/nis")+4);
|
2018-06-14 10:16:19 +08:00
|
|
|
|
var timeStamp=0;
|
|
|
|
|
|
if(data.date){
|
|
|
|
|
|
timeStamp=data.date.valueOf();
|
|
|
|
|
|
}else{
|
|
|
|
|
|
timeStamp=(new Date()).valueOf();
|
|
|
|
|
|
}
|
2018-06-14 17:49:58 +08:00
|
|
|
|
var totalTr=$(data.obj);
|
|
|
|
|
|
var timeout=$.validator.messages.timeout;
|
|
|
|
|
|
var request=$.ajax({
|
2018-06-12 11:24:19 +08:00
|
|
|
|
type:'post',
|
2018-06-14 17:49:58 +08:00
|
|
|
|
timeout:1000,//超时时间设置,查询接口时间过长超时
|
2018-06-29 15:02:17 +08:00
|
|
|
|
url:pathName+'/logs/ajaxGetLogTotal',
|
2018-06-14 10:16:19 +08:00
|
|
|
|
data:{"endTime":timeStamp,"action":data.action,"functionId":data.functionId,"compileId":data.compileId},
|
2018-06-12 11:24:19 +08:00
|
|
|
|
dataType:'json',
|
2018-06-14 10:16:19 +08:00
|
|
|
|
async:true,
|
2018-06-12 11:24:19 +08:00
|
|
|
|
success:function(data,textStatus){//处理返回结果
|
2018-06-14 10:16:19 +08:00
|
|
|
|
if(textStatus=="success"){
|
2018-06-14 17:49:58 +08:00
|
|
|
|
totalTr.html(data.sum);
|
2018-06-14 10:16:19 +08:00
|
|
|
|
}
|
2018-06-12 11:24:19 +08:00
|
|
|
|
},
|
|
|
|
|
|
complete:function(XMLHttpRequest,status){//超时设置
|
|
|
|
|
|
if(status=="timeout"){
|
2018-06-14 17:49:58 +08:00
|
|
|
|
totalTr.html(timeout);
|
2018-06-12 11:24:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2018-06-14 17:49:58 +08:00
|
|
|
|
|
2018-05-29 18:31:43 +08:00
|
|
|
|
//删除区域IP
|
|
|
|
|
|
function delAreaIp(obj){
|
|
|
|
|
|
var thisObj=$(obj);
|
|
|
|
|
|
thisObj.parents(".container-fluid").remove();
|
|
|
|
|
|
var len=$("#areaIp").find(".container-fluid:visible").size();
|
|
|
|
|
|
//调整角标
|
|
|
|
|
|
if(len>0){
|
|
|
|
|
|
len--;
|
|
|
|
|
|
$("#areaIp").find(".container-fluid:visible").each(function(){
|
|
|
|
|
|
$(this).find("[name^='areaCfg']").each(function(){
|
|
|
|
|
|
var name=$(this).attr("name");
|
|
|
|
|
|
name=name.substring(name.lastIndexOf(".")+1,name.length);
|
|
|
|
|
|
$(this).attr("name","areaCfg["+len+"]."+name);
|
|
|
|
|
|
$(this).parents(".form-group").find("div[for^='areaCfg']").attr("for","areaCfg["+len+"]."+name);
|
|
|
|
|
|
});
|
|
|
|
|
|
len--;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
//删除区域ISP
|
|
|
|
|
|
function delAreaIsp(obj){
|
|
|
|
|
|
var thisObj=$(obj);
|
|
|
|
|
|
thisObj.parents(".container-fluid").remove();
|
|
|
|
|
|
var len=$("#areaIsp").find(".container-fluid:visible").size();
|
|
|
|
|
|
if(len>0){
|
|
|
|
|
|
len--;
|
|
|
|
|
|
$("#areaIsp").find(".container-fluid:visible").each(function(){
|
|
|
|
|
|
$(this).find("[name^='areaIsp']").each(function(){
|
|
|
|
|
|
var name=$(this).attr("name");
|
|
|
|
|
|
name=name.substring(name.lastIndexOf(".")+1,name.length);
|
|
|
|
|
|
$(this).attr("name","areaIsp["+len+"]."+name);
|
|
|
|
|
|
$(this).parents(".form-group").find("div[for^='areaIsp']").attr("for","areaIsp["+len+"]."+name);
|
|
|
|
|
|
});
|
|
|
|
|
|
len--;
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
2018-06-01 09:51:18 +08:00
|
|
|
|
}
|
|
|
|
|
|
//切换配置列表中显示子配置的选项卡样式
|
|
|
|
|
|
function switchSubCfgTabInfo(flag,index){
|
|
|
|
|
|
$("div[name='subCfg"+index+"']").hide();
|
|
|
|
|
|
$("div[id='"+flag+"Info"+index+"']").show();
|
|
|
|
|
|
$("div[name='tabTitle"+index+"']").removeClass("badge-info");
|
|
|
|
|
|
$("div[id='"+flag+"Title"+index+"']").addClass("badge-info");
|
|
|
|
|
|
$("i[name='tabFlag"+index+"']").addClass("fa-angle-double-up");
|
|
|
|
|
|
$("i[name='tabFlag"+index+"']").removeClass("fa-angle-double-down");
|
|
|
|
|
|
$("i[id='"+flag+index+"']").addClass("fa-angle-double-down");
|
|
|
|
|
|
$("i[id='"+flag+index+"']").removeClass("fa-angle-double-up");
|
2018-06-01 16:55:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
function isLicit(str,regStr) {//判断是否为合格字符 //s 包括空格回车等特殊字符
|
|
|
|
|
|
regStr = App.isEmpty(regStr)?"^[_0-9a-zA-Z\u4e00-\u9fa5\.@&]*$":regStr;
|
|
|
|
|
|
var re = new RegExp(regStr);
|
|
|
|
|
|
//var re = "^[_0-9a-zA-Z\.@]*$";
|
|
|
|
|
|
return re.test(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
function exprTypeChecked(objNamePrefix,size){
|
|
|
|
|
|
if(size>1) {
|
2018-06-04 15:36:00 +08:00
|
|
|
|
$("input:radio[name='"+objNamePrefix+"exprType'][value=1]").prop("checked",true); //选中是
|
2018-06-11 13:59:42 +08:00
|
|
|
|
$("select[name='"+objNamePrefix+"matchMethod']").find("option").removeAttr("selected",false);
|
|
|
|
|
|
$("select[name='"+objNamePrefix+"matchMethod']").find("option[value=0]").attr("selected",true);
|
|
|
|
|
|
$("select[name='"+objNamePrefix+"matchMethod']").find("option[value!=0]").attr("disabled",true);
|
|
|
|
|
|
$("select[name='"+objNamePrefix+"matchMethod']").selectpicker("refresh");
|
2018-06-01 16:55:49 +08:00
|
|
|
|
}else {
|
2018-06-04 15:36:00 +08:00
|
|
|
|
$("input:radio[name='"+objNamePrefix+"exprType'][value=0]").prop("checked",true); //选中否
|
2018-06-11 13:59:42 +08:00
|
|
|
|
$("select[name='"+objNamePrefix+"matchMethod']").find("option").removeAttr("disabled");
|
|
|
|
|
|
$("select[name='"+objNamePrefix+"matchMethod']").selectpicker("refresh");
|
2018-06-01 16:55:49 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function validateDataIsLicit(){
|
|
|
|
|
|
var fdfz = $.trim($("#tags_1").val()).replace(/,/g,"");
|
|
|
|
|
|
return isLicit(fdfz);
|
2018-06-05 17:52:26 +08:00
|
|
|
|
}
|