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);
|
|
|
|
|
|
})
|
|
|
|
|
|
$("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-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");
|
|
|
|
|
|
switchIpInfo(obj.find("select[name$='ipType']"),"ipType");
|
|
|
|
|
|
obj.find("select[name$='ipType']").on("change",function(){
|
|
|
|
|
|
switchIpInfo($(this),"ipType");
|
|
|
|
|
|
});
|
|
|
|
|
|
obj.find("select[name$='ipPattern']").on("change",function(){
|
|
|
|
|
|
switchIpInfo($(this),"ipPattern");
|
|
|
|
|
|
});
|
|
|
|
|
|
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");
|
2018-05-30 14:37:35 +08:00
|
|
|
|
/*$("#areaIsp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","true");
|
|
|
|
|
|
});*/
|
2018-05-29 18:31:43 +08:00
|
|
|
|
$("#areaIsp").addClass("hidden");
|
|
|
|
|
|
if($("#areaIp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
2018-05-30 14:37:35 +08:00
|
|
|
|
/*$("#areaIp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
});*/
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}else{
|
|
|
|
|
|
$("#areaIsp").removeClass("hidden");
|
2018-05-30 14:37:35 +08:00
|
|
|
|
/*$("#areaIp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).attr("disabled","true");
|
|
|
|
|
|
});*/
|
2018-05-29 18:31:43 +08:00
|
|
|
|
$("#areaIp").addClass("hidden");
|
|
|
|
|
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIsp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
2018-05-30 14:37:35 +08:00
|
|
|
|
/*$("#areaIsp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
|
|
|
|
|
$(this).removeAttr("disabled");
|
|
|
|
|
|
});*/
|
2018-05-29 18:31:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$("#areaIsp").addClass("hidden");
|
|
|
|
|
|
$("#areaIp").addClass("hidden");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
$("input[name='isAreaEffective']").on('change',function(){
|
|
|
|
|
|
var val=$(this).val();
|
|
|
|
|
|
if(val==1){
|
|
|
|
|
|
$(".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();
|
|
|
|
|
|
}
|
|
|
|
|
|
}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();
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$(".areaType").find("[value='1']").prop("checked",true);
|
|
|
|
|
|
$("#areaIsp").removeClass("hidden");
|
|
|
|
|
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
|
|
|
|
|
$("#areaIsp").find(".glyphicon-plus").click();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}else{
|
|
|
|
|
|
$(".areaType").addClass("hidden");
|
|
|
|
|
|
$("#areaIp").addClass("hidden");
|
|
|
|
|
|
$("#areaIsp").addClass("hidden");
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
areaControlInit();
|
2018-04-11 13:45:04 +08:00
|
|
|
|
});
|
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-05-25 15:16:05 +08:00
|
|
|
|
//ipType、ipPattern、portPattern选项变化时调用此方法,添加默认值
|
|
|
|
|
|
var switchIpInfo=function(obj,type){
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//删除区域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-04-09 11:03:22 +08:00
|
|
|
|
}
|