ip_type all时,只有ip非空时,切换默认值
证书模块文件校验 ip掩码验证,非掩码范围增加掩码范围提示 国际化sourse和dest修改为client和server 国际化俄文提交
This commit is contained in:
@@ -49,12 +49,14 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
boolean isSampleFileUpload = request.getRequestURI().toLowerCase().contains(Constants.SAMPLE_UPLOAD_URL_KEYWORD);
|
||||
//摘要文件URI
|
||||
boolean isDigestFileUpload = request.getRequestURI().toLowerCase().contains(Constants.DIGEST_UPLOAD_URL_KEYWORD);
|
||||
FileUpload fileUpload = this.prepareFileUpload(encoding,isSampleFileUpload,isDigestFileUpload);
|
||||
//证书文件URI
|
||||
boolean isCertFileUpload = request.getRequestURI().toLowerCase().contains(Constants.CERT_UPLOAD_URL_KEYWORD);
|
||||
FileUpload fileUpload = this.prepareFileUpload(encoding,isSampleFileUpload,isDigestFileUpload,isCertFileUpload);
|
||||
long fileUploadTotalSize=0l;
|
||||
Properties languageProp=getMsgProp();
|
||||
MultipartParsingResult multipartParsingResult=null;
|
||||
try {
|
||||
if(isSampleFileUpload || isDigestFileUpload){
|
||||
if(isSampleFileUpload || isDigestFileUpload || isCertFileUpload){
|
||||
/*****************预先获取上传文件的总的大小************/
|
||||
FileUpload fileUploadTotal = fileUpload;
|
||||
ServletRequestContext ctx = new ServletRequestContext(request);
|
||||
@@ -110,6 +112,8 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
String errorInfo="";
|
||||
String fileTypes="";
|
||||
long fileMaxSize=0l;
|
||||
String privateFileTypes="";
|
||||
long privateFileMaxSize=0l;
|
||||
if(functionId.equals(52)){ //digest
|
||||
fileTypes=Constants.DIGEST_FILE_TYPE;
|
||||
fileMaxSize=Constants.DIGEST_SINGLE_FILE_MAX_SIZE;
|
||||
@@ -134,6 +138,11 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
}else if(functionId.equals(632)){ //人脸识别
|
||||
fileTypes=Constants.FACE_FILE_TYPE;
|
||||
fileMaxSize=Constants.FACE_SINGLE_FILE_MAX_SIZE;
|
||||
}else if(functionId.equals(570)){ //证书管理
|
||||
fileTypes=Constants.PUBLIC_FILE_TYPE;
|
||||
fileMaxSize=Constants.PUBLIC_SINGLE_FILE_MAX_SIZE;
|
||||
privateFileTypes=Constants.PRIVATE_FILE_TYPE;
|
||||
privateFileMaxSize=Constants.PRIVATE_SINGLE_FILE_MAX_SIZE;
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
@@ -143,13 +152,26 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
|
||||
for (String fileName : multipartFile.keySet()) {
|
||||
MultipartFile file= multipartFile.getFirst(fileName);
|
||||
//文件类型错误
|
||||
if(fileTypes.indexOf(","+FileUtils.getSuffix(file.getOriginalFilename().toLowerCase(), false)+",") == -1){
|
||||
throw new MultiPartNewException(errorInfo,file.getOriginalFilename(),fileTypes.substring(0,fileTypes.length()-1).substring(1),prop,null);
|
||||
}
|
||||
if(file.getSize() > fileMaxSize){
|
||||
throw new MultiPartNewException(errorInfo, file.getOriginalFilename(), file.getSize(), fileMaxSize,prop, null);
|
||||
//私钥文件校验
|
||||
if(!StringUtil.isEmpty(fileName) && fileName.toLowerCase().equals("privatekeyfilei")){
|
||||
//文件类型错误
|
||||
if(privateFileTypes.indexOf(","+FileUtils.getSuffix(file.getOriginalFilename().toLowerCase(), false)+",") == -1){
|
||||
throw new MultiPartNewException(errorInfo,file.getOriginalFilename(),privateFileTypes.substring(0,privateFileTypes.length()-1).substring(1),prop,null);
|
||||
}
|
||||
if(file.getSize() > privateFileMaxSize){
|
||||
throw new MultiPartNewException(errorInfo, file.getOriginalFilename(), file.getSize(), privateFileMaxSize,prop, null);
|
||||
}
|
||||
//其他文件校验
|
||||
}else{
|
||||
//文件类型错误
|
||||
if(fileTypes.indexOf(","+FileUtils.getSuffix(file.getOriginalFilename().toLowerCase(), false)+",") == -1){
|
||||
throw new MultiPartNewException(errorInfo,file.getOriginalFilename(),fileTypes.substring(0,fileTypes.length()-1).substring(1),prop,null);
|
||||
}
|
||||
if(file.getSize() > fileMaxSize){
|
||||
throw new MultiPartNewException(errorInfo, file.getOriginalFilename(), file.getSize(), fileMaxSize,prop, null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -158,7 +180,7 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
* @param isSampleFileUpload
|
||||
* @return
|
||||
*/
|
||||
protected FileUpload prepareFileUpload(String encoding,boolean isSampleFileUpload,boolean isDigestFileUpload) {
|
||||
protected FileUpload prepareFileUpload(String encoding,boolean isSampleFileUpload,boolean isDigestFileUpload,boolean isCertFileUpload) {
|
||||
FileUpload fileUpload = getFileUpload();
|
||||
FileUpload actualFileUpload = fileUpload;
|
||||
if (encoding != null && !encoding.equals(fileUpload.getHeaderEncoding())) {
|
||||
@@ -168,6 +190,8 @@ public class MultipartFileIntercepter extends CommonsMultipartResolver{
|
||||
actualFileUpload.setSizeMax(Constants.SAMPLE_TOTAL_FILE_MAX_SIZE);
|
||||
}else if(isDigestFileUpload){
|
||||
actualFileUpload.setSizeMax(Constants.DIGEST_TOTAL_FILE_MAX_SIZE);
|
||||
}else if(isCertFileUpload){
|
||||
actualFileUpload.setSizeMax(Constants.CERT_TOTAL_FILE_MAX_SIZE);
|
||||
}else{
|
||||
actualFileUpload.setSizeMax(fileUpload.getSizeMax());
|
||||
}
|
||||
|
||||
@@ -514,6 +514,10 @@ public final class Constants {
|
||||
* 摘要文件URL关键字
|
||||
*/
|
||||
public static final String DIGEST_UPLOAD_URL_KEYWORD = Configurations.getStringProperty("digest_upload_url_keyword","fileTransfer");
|
||||
/**
|
||||
* 证书文件URL关键字
|
||||
*/
|
||||
public static final String CERT_UPLOAD_URL_KEYWORD = Configurations.getStringProperty("cert_upload_url_keyword","/intercept/strateagy");
|
||||
/**
|
||||
* 样例文件限制总文件大小
|
||||
*/
|
||||
@@ -578,6 +582,14 @@ public final class Constants {
|
||||
* 摘要文件支持文件类型
|
||||
*/
|
||||
public static final String DIGEST_FILE_TYPE = Configurations.getStringProperty("digest_file_type","");
|
||||
/**
|
||||
* 公钥文件支持文件类型
|
||||
*/
|
||||
public static final String PUBLIC_FILE_TYPE = Configurations.getStringProperty("public_file_type","");
|
||||
/**
|
||||
* 私钥文件支持文件类型
|
||||
*/
|
||||
public static final String PRIVATE_FILE_TYPE = Configurations.getStringProperty("private_file_type","");
|
||||
/**
|
||||
* 摘要文件限制单个文件大小
|
||||
*/
|
||||
@@ -586,7 +598,19 @@ public final class Constants {
|
||||
* 摘要文件限制总文件大小
|
||||
*/
|
||||
public static final long DIGEST_TOTAL_FILE_MAX_SIZE = Configurations.getLongProperty("digest_total_file_max_size",52428800l);//50M
|
||||
/**
|
||||
* 证书文件限制总文件大小
|
||||
*/
|
||||
public static final long CERT_TOTAL_FILE_MAX_SIZE = Configurations.getLongProperty("cert_total_file_max_size",52428800l);//50M
|
||||
|
||||
/**
|
||||
* 公钥文件限制单个文件大小
|
||||
*/
|
||||
public static final long PUBLIC_SINGLE_FILE_MAX_SIZE = Configurations.getLongProperty("public_single_file_max_size",10485760l);//10M
|
||||
/**
|
||||
* 私钥文件限制单个文件大小
|
||||
*/
|
||||
public static final long PRIVATE_SINGLE_FILE_MAX_SIZE = Configurations.getLongProperty("private_single_file_max_size",10485760l);//10M
|
||||
//YSP文件特征配置相关参数,用于调用外部程序生成特征文件时使用
|
||||
public static final String AV_FILE_PATH = Configurations.getStringProperty("av_file_path", "/home/ysp/");
|
||||
public static final String AV_SAMPLE_AUDIO_REGION = Configurations.getStringProperty("av_sample_audio_region", "av_sample_audio");
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -374,6 +374,7 @@ replace_substitute_key=substitute
|
||||
#\u6837\u4F8B\u6587\u4EF6\u4E0A\u4F20\u7684uri\u5173\u952E\u8BCD
|
||||
sample_upload_url_keyword=/av
|
||||
digest_upload_url_keyword=/filetransfer
|
||||
cert_upload_url_keyword=/intercept/strateagy
|
||||
|
||||
#sample File Size 12M 12582912
|
||||
sample_total_file_max_size=12582912
|
||||
@@ -413,9 +414,19 @@ digest_file_type=,txt,doc,img,docx,pptx,xlsx,xls,ppt,
|
||||
digest_single_file_max_size=10485760
|
||||
#digest File Size 12M 12582912\uFF08total\uFF09
|
||||
digest_total_file_max_size=12582912
|
||||
#cert File Size 12M 12582912\uFF08total\uFF09
|
||||
cert_total_file_max_size=12582912
|
||||
#public File Types
|
||||
public_file_type=,cer,crt,pem,p12,
|
||||
#public File Size 10M 10485760\uFF08single\uFF09
|
||||
public_single_file_max_size=10485760
|
||||
#private File Types
|
||||
private_file_type=,cer,crt,pem,p12,
|
||||
#private File Size 10M 10485760\uFF08single\uFF09
|
||||
private_single_file_max_size=10485760
|
||||
#YSP\u6587\u4EF6\u4FDD\u5B58\u8DEF\u5F84
|
||||
#av_file_path=/home/ysp/
|
||||
av_file_path=D\:\\ysp\\
|
||||
av_file_path=/home/ysp/
|
||||
#av_file_path=D\:\\ysp\\
|
||||
#YSP\u6587\u4EF6\u7279\u5F81\u7C7B\u578B
|
||||
av_sample_audio_region=av_sample_audio
|
||||
av_sample_video_region=av_sample_video
|
||||
@@ -426,43 +437,43 @@ mm_logo_detection_region=MM_LOGO_DETECTION
|
||||
mm_face_recognization_region=MM_FACE_RECOGNIZATION
|
||||
|
||||
#\u6837\u4F8B\u6587\u4EF6\u751F\u6210\u7A0B\u5E8F
|
||||
#audio_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
#video_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
#picture_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
#speaker_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
#logo_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
#face_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
#audio_sample_proc_param_is_quotation=true
|
||||
#video_sample_proc_param_is_quotation=true
|
||||
#picture_sample_proc_param_is_quotation=true
|
||||
audio_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
video_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
picture_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
speaker_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
logo_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
face_sample_create_proc=java -jar /home/sampleTest.jar
|
||||
audio_sample_proc_param_is_quotation=true
|
||||
video_sample_proc_param_is_quotation=true
|
||||
picture_sample_proc_param_is_quotation=true
|
||||
speaker_sample_proc_param_is_quotation=true
|
||||
logo_sample_proc_param_is_quotation=true
|
||||
face_sample_proc_param_is_quotation=true
|
||||
audio_sample_proc_param_is_translation=false
|
||||
video_sample_proc_param_is_translation=false
|
||||
picture_sample_proc_param_is_translation=false
|
||||
speaker_sample_proc_param_is_translation=false
|
||||
logo_sample_proc_param_is_translation=false
|
||||
face_sample_proc_param_is_translation=false
|
||||
#\u672C\u5730\u6D4B\u8BD5
|
||||
#audio_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
#video_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
#picture_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
#speaker_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
#logo_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
#face_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
#audio_sample_proc_param_is_quotation=false
|
||||
#video_sample_proc_param_is_quotation=false
|
||||
#picture_sample_proc_param_is_quotation=false
|
||||
#speaker_sample_proc_param_is_quotation=false
|
||||
#logo_sample_proc_param_is_quotation=false
|
||||
#face_sample_proc_param_is_quotation=false
|
||||
#audio_sample_proc_param_is_translation=false
|
||||
#video_sample_proc_param_is_translation=false
|
||||
#picture_sample_proc_param_is_translation=false
|
||||
#audio_sample_proc_param_is_translation=true
|
||||
#video_sample_proc_param_is_translation=true
|
||||
#picture_sample_proc_param_is_translation=true
|
||||
#speaker_sample_proc_param_is_translation=true
|
||||
#logo_sample_proc_param_is_translation=true
|
||||
#face_sample_proc_param_is_translation=true
|
||||
#\u672C\u5730\u6D4B\u8BD5
|
||||
audio_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
video_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
picture_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
speaker_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
logo_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
face_sample_create_proc=java -jar D\:\\sampleTest.jar
|
||||
audio_sample_proc_param_is_quotation=false
|
||||
video_sample_proc_param_is_quotation=false
|
||||
picture_sample_proc_param_is_quotation=false
|
||||
speaker_sample_proc_param_is_quotation=false
|
||||
logo_sample_proc_param_is_quotation=false
|
||||
face_sample_proc_param_is_quotation=false
|
||||
audio_sample_proc_param_is_translation=true
|
||||
video_sample_proc_param_is_translation=true
|
||||
picture_sample_proc_param_is_translation=true
|
||||
speaker_sample_proc_param_is_translation=true
|
||||
logo_sample_proc_param_is_translation=true
|
||||
face_sample_proc_param_is_translation=true
|
||||
#http\u81EA\u5B9A\u4E49\u57DF\u76F8\u5173\u53C2\u6570
|
||||
http_header_user_region_key=HTTP_HEADER
|
||||
http_header_dict_module=HTTP_HEADER_DISTRICT
|
||||
@@ -503,5 +514,5 @@ app_spec_service_code_max_val=310000
|
||||
app_spec_service_code_min_val=300001
|
||||
groupReuseSources=groupReuseSources
|
||||
log_time_range=3600000
|
||||
log_time_start=2018-07-01 00:00:00
|
||||
log_time_end=2018-08-01 00:00:00
|
||||
log_time_start=2018-08-01 00:00:00
|
||||
log_time_end=2018-10-01 00:00:00
|
||||
@@ -259,7 +259,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
|
||||
if(ipv4_ip_subnet_regexp.test(value)){
|
||||
return true;
|
||||
}else{
|
||||
$.validator.messages.ipCheck=$.validator.messages.ipMask;
|
||||
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
|
||||
return false;
|
||||
}
|
||||
}else if(RegExp.$5&&RegExp.$5>32){
|
||||
@@ -379,7 +379,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
|
||||
if(ipv4_ip_subnet_regexp.test(value)){
|
||||
return true;
|
||||
}else{
|
||||
$.validator.messages.ipCheck=$.validator.messages.ipMask;
|
||||
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
|
||||
return false;
|
||||
}
|
||||
}else if(RegExp.$5&&RegExp.$5>32){
|
||||
@@ -550,7 +550,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) {
|
||||
if(ipv4_ip_subnet_regexp.test(value)){
|
||||
return true;
|
||||
}else{
|
||||
$.validator.messages.ipCheck=$.validator.messages.ipMask;
|
||||
$.validator.messages.ipCheck=$.validator.messages.ipMaskRange;
|
||||
return false;
|
||||
}
|
||||
}else if(RegExp.$5&&RegExp.$5>32){
|
||||
|
||||
@@ -30,11 +30,11 @@
|
||||
ipv6MaskPart:"Mask must be 128",
|
||||
//ipMaskRange:"IP mask must between 0 and 32",
|
||||
ipMaskRange:"IP mask must between 16 and 32",
|
||||
srcIpNotEqDestIp:"Source IP ",
|
||||
destIpNotEqDestIp:" and destination IP ",
|
||||
srcIpNotEqDestIp:"Client IP ",
|
||||
destIpNotEqDestIp:" and Server IP ",
|
||||
IpNotEqDestIp:" can't be the same",
|
||||
srcIpIsNotValue:"Source IP can't be ",
|
||||
destIpIsNotValue:"Destination IP can't be ",
|
||||
srcIpIsNotValue:"Client IP can't be ",
|
||||
destIpIsNotValue:"Server IP can't be ",
|
||||
ipRange:"Wrong IP format or start IP and end IP in two subnet",
|
||||
ipRange1:"start IP should smaller than end IP",
|
||||
portCheck:"Please enter a correct port",
|
||||
|
||||
@@ -899,6 +899,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(srcIp).val(srcIpV4Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(srcIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV6Default) > -1){ //是ipV4的默认值其中一个
|
||||
if(ipPattern==1){
|
||||
$(srcIp).val(srcIpV4Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(srcIp).val(srcIpV4Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(srcIp).val(srcIpV4Default[2]);
|
||||
}else{
|
||||
$(srcIp).val(srcIpV4Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$(destIp).val()){
|
||||
if(ipPattern==1){
|
||||
@@ -910,6 +925,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(destIp).val(destIpV4Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(destIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV6Default) > -1){
|
||||
if(ipPattern==1){
|
||||
$(destIp).val(destIpV4Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(destIp).val(destIpV4Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(destIp).val(destIpV4Default[2]);
|
||||
}else{
|
||||
$(destIp).val(destIpV4Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(6==ipType){
|
||||
@@ -923,6 +953,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(srcIp).val(srcIpV6Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(srcIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV6Default) > -1){ //是ipV6的默认值其中一个
|
||||
if(ipPattern==1){
|
||||
$(srcIp).val(srcIpV6Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(srcIp).val(srcIpV6Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(srcIp).val(srcIpV6Default[2]);
|
||||
}else{
|
||||
$(srcIp).val(srcIpV6Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$(destIp).val()){
|
||||
if(ipPattern==1){
|
||||
@@ -934,6 +979,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(destIp).val(srcIpV6Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(destIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV6Default) > -1){ //是ipV6的默认值其中一个
|
||||
if(ipPattern==1){
|
||||
$(destIp).val(destIpV6Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(destIp).val(destIpV6Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(destIp).val(destIpV6Default[2]);
|
||||
}else{
|
||||
$(destIp).val(srcIpV6Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(46==ipType){
|
||||
@@ -947,6 +1007,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(srcIp).val(srcIpV4Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(srcIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV6Default) > -1){
|
||||
if(ipPattern==1){
|
||||
$(srcIp).val(srcIpV4Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(srcIp).val(srcIpV4Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(srcIp).val(srcIpV4Default[2]);
|
||||
}else {
|
||||
$(srcIp).val(srcIpV4Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$(destIp).val()){
|
||||
if(ipPattern==1){
|
||||
@@ -958,6 +1033,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(destIp).val(destIpV6Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(destIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV6Default) > -1){
|
||||
if(ipPattern==1){
|
||||
$(destIp).val(destIpV6Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(destIp).val(destIpV6Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(destIp).val(destIpV6Default[2]);
|
||||
}else{
|
||||
$(destIp).val(destIpV6Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(64==ipType){
|
||||
@@ -971,6 +1061,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(srcIp).val(srcIpV6Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(srcIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(srcIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(srcIp).val(),destIpV6Default) > -1){
|
||||
if(ipPattern==1){
|
||||
$(srcIp).val(srcIpV6Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(srcIp).val(srcIpV6Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(srcIp).val(srcIpV6Default[2]);
|
||||
}else{
|
||||
$(srcIp).val(srcIpV6Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!$(destIp).val()){
|
||||
if(ipPattern==1){
|
||||
@@ -982,6 +1087,21 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(destIp).val(srcIpV4Default[2]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(destIp).val(),srcIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV4Default) > -1
|
||||
|| $.inArray($(destIp).val(),srcIpV6Default) > -1
|
||||
|| $.inArray($(destIp).val(),destIpV6Default) > -1){
|
||||
if(ipPattern==1){
|
||||
$(destIp).val(destIpV4Default[0]);
|
||||
}else if(ipPattern==2){
|
||||
$(destIp).val(destIpV4Default[1]);
|
||||
}else if(ipPattern==3){
|
||||
$(destIp).val(destIpV4Default[2]);
|
||||
}else{
|
||||
$(destIp).val(destIpV4Default[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(10==ipType){
|
||||
@@ -1017,6 +1137,16 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(srcPort).val(portDefault[0]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(srcPort).val(),portDefault) > -1){ //是ipV4的默认值其中一个
|
||||
if(portPattern==1){
|
||||
$(srcPort).val(portDefault[0]);
|
||||
}else if(portPattern==2){
|
||||
$(srcPort).val(portDefault[1]);
|
||||
}else{
|
||||
$(srcPort).val(portDefault[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//设置目的端口默认值
|
||||
if(!$(destPort).val()){
|
||||
@@ -1027,6 +1157,16 @@ var switchIpInfo=function(obj){
|
||||
}else{
|
||||
$(destPort).val(portDefault[0]);
|
||||
}
|
||||
}else{
|
||||
if($.inArray($(destPort).val(),portDefault) > -1){ //是port的默认值其中一个
|
||||
if(portPattern==1){
|
||||
$(destPort).val(portDefault[0]);
|
||||
}else if(portPattern==2){
|
||||
$(destPort).val(portDefault[1]);
|
||||
}else{
|
||||
$(destPort).val(portDefault[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var areaControlInit=function(){
|
||||
|
||||
Reference in New Issue
Block a user