恢复被覆盖的ip common处理
This commit is contained in:
@@ -1,4 +1,15 @@
|
|||||||
$(function(){
|
$(function(){
|
||||||
|
//扩展jquery,增加全局函数
|
||||||
|
$.ipcommon=function(){
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
$.extend($.ipcommon, {
|
||||||
|
ipType:[],
|
||||||
|
ipPattern:[],
|
||||||
|
portPattern:[],
|
||||||
|
protocol:[],
|
||||||
|
direction:[]
|
||||||
|
});
|
||||||
$("select[name$='isHexbin']").each(function(){
|
$("select[name$='isHexbin']").each(function(){
|
||||||
setIsHexBin(this);
|
setIsHexBin(this);
|
||||||
});
|
});
|
||||||
@@ -1389,12 +1400,14 @@ var setHexCaseSenstive=function(){
|
|||||||
* ip默认选项处理
|
* ip默认选项处理
|
||||||
*/
|
*/
|
||||||
var initCommIpVal=function(){
|
var initCommIpVal=function(){
|
||||||
var regionCode,serviceType,ipPortShow,ipType,
|
var action,regionCode,serviceType,ipPortShow,ipType,
|
||||||
ipPattern,portPattern,direction,protocol,regionType;
|
ipPattern,portPattern,direction,protocol,regionType;
|
||||||
if($("input[name$='action']:checked").length>0){
|
if($("input[name$='action']:checked").length>0){
|
||||||
regionCode=$("input[name$='action']:checked").attr("regionCode");
|
regionCode=$("input[name$='action']:checked").attr("regionCode");
|
||||||
|
action=$("input[name$='action']:checked").val();
|
||||||
}else{
|
}else{
|
||||||
regionCode=$("input[name$='action']").attr("regionCode");
|
regionCode=$("input[name$='action']").attr("regionCode");
|
||||||
|
action=$("input[name$='action']").val();
|
||||||
}
|
}
|
||||||
if(regionCode){
|
if(regionCode){
|
||||||
if(regionCode.indexOf(",")==-1){
|
if(regionCode.indexOf(",")==-1){
|
||||||
@@ -1453,6 +1466,7 @@ var initCommIpVal=function(){
|
|||||||
//ip类型处理
|
//ip类型处理
|
||||||
if(ipType){
|
if(ipType){
|
||||||
var arr=ipType.split(',');
|
var arr=ipType.split(',');
|
||||||
|
$.ipcommon.ipType=$("select[name$='ipType'] option");
|
||||||
$("select[name$='ipType'] option").each(function(){
|
$("select[name$='ipType'] option").each(function(){
|
||||||
var has=false;
|
var has=false;
|
||||||
for(var type in arr){
|
for(var type in arr){
|
||||||
@@ -1465,13 +1479,16 @@ var initCommIpVal=function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!has){
|
if(!has){
|
||||||
$(this).attr("disabled",true);
|
$(this).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
$.ipcommon.ipType=[];
|
||||||
}
|
}
|
||||||
//ip格式处理
|
//ip格式处理
|
||||||
if(ipPattern){
|
if(ipPattern){
|
||||||
arr=ipPattern.split(',');
|
arr=ipPattern.split(',');
|
||||||
|
$.ipcommon.ipPattern=$("select[name$='ipPattern'] option");
|
||||||
$("select[name$='ipPattern'] option").each(function(){
|
$("select[name$='ipPattern'] option").each(function(){
|
||||||
var has=false;
|
var has=false;
|
||||||
for(var type in arr){
|
for(var type in arr){
|
||||||
@@ -1484,13 +1501,16 @@ var initCommIpVal=function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!has){
|
if(!has){
|
||||||
$(this).attr("disabled",true);
|
$(this).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
$.ipcommon.ipPattern=[];
|
||||||
}
|
}
|
||||||
//端口格式处理
|
//端口格式处理
|
||||||
if(portPattern){
|
if(portPattern){
|
||||||
arr=portPattern.split(',');
|
arr=portPattern.split(',');
|
||||||
|
$.ipcommon.portPattern=$("select[name$='portPattern'] option");
|
||||||
$("select[name$='portPattern'] option").each(function(){
|
$("select[name$='portPattern'] option").each(function(){
|
||||||
var has=false;
|
var has=false;
|
||||||
for(var type in arr){
|
for(var type in arr){
|
||||||
@@ -1503,13 +1523,16 @@ var initCommIpVal=function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!has){
|
if(!has){
|
||||||
$(this).attr("disabled",true);
|
$(this).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
$.ipcommon.portPattern=[];
|
||||||
}
|
}
|
||||||
//方向处理
|
//方向处理
|
||||||
if(direction){
|
if(direction){
|
||||||
arr=direction.split(',');
|
arr=direction.split(',');
|
||||||
|
$.ipcommon.direction=$("select[name$='direction'] option");
|
||||||
$("select[name$='direction'] option").each(function(){
|
$("select[name$='direction'] option").each(function(){
|
||||||
var has=false;
|
var has=false;
|
||||||
for(var type in arr){
|
for(var type in arr){
|
||||||
@@ -1522,13 +1545,16 @@ var initCommIpVal=function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!has){
|
if(!has){
|
||||||
$(this).attr("disabled",true);
|
$(this).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
$.ipcommon.direction=[];
|
||||||
}
|
}
|
||||||
//协议处理
|
//协议处理
|
||||||
if(protocol){
|
if(protocol){
|
||||||
arr=protocol.split(',');
|
arr=protocol.split(',');
|
||||||
|
$.ipcommon.protocol=$("select[name$='protocol'] option");
|
||||||
$("select[name$='protocol'] option").each(function(){
|
$("select[name$='protocol'] option").each(function(){
|
||||||
var has=false;
|
var has=false;
|
||||||
for(var type in arr){
|
for(var type in arr){
|
||||||
@@ -1541,8 +1567,10 @@ var initCommIpVal=function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!has){
|
if(!has){
|
||||||
$(this).attr("disabled",true);
|
$(this).remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}else{
|
||||||
|
$.ipcommon.protocol=[];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user