From 9cd93c1d6e671fede101b35b89c8c6ec1236a8f6 Mon Sep 17 00:00:00 2001 From: wangxin Date: Mon, 28 May 2018 17:05:35 +0800 Subject: [PATCH] =?UTF-8?q?(1)=E7=AB=AF=E5=8F=A3=E9=AA=8C=E8=AF=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8C=E7=AB=AF=E5=8F=A3=E5=BF=85=E9=A1=BB?= =?UTF-8?q?=E4=B8=BA=E6=95=B0=E5=AD=97=EF=BC=8C=E4=B8=8D=E5=86=8D=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=A4=A7=E5=B0=8F=E5=B0=8F=E4=BA=8E65535=EF=BC=8C?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E5=8A=A0=E5=85=A5=E9=99=90=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E9=9D=9E0=E6=95=B0=E5=AD=97=E4=B8=8D=E8=83=BD=E4=BB=A50?= =?UTF-8?q?=E5=BC=80=E5=A4=B4=20(2)Maat=E7=9B=B8=E5=85=B3bean=E5=8A=A0?= =?UTF-8?q?=E5=85=A5@Expose=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/domain/maat/MaatCfg.java | 111 ++++++++++++++---- .../java/com/nis/domain/maat/ToMaatBean.java | 5 + .../WEB-INF/views/cfg/whitelist/ipForm.jsp | 2 +- .../1.11.0/jquery.validate.method.js | 4 +- .../1.11.0/localization/messages_en.js | 4 +- .../1.11.0/localization/messages_ru.js | 8 +- .../1.11.0/localization/messages_zh.js | 4 +- 7 files changed, 109 insertions(+), 29 deletions(-) diff --git a/src/main/java/com/nis/domain/maat/MaatCfg.java b/src/main/java/com/nis/domain/maat/MaatCfg.java index 854709a51..a5ae31ba8 100644 --- a/src/main/java/com/nis/domain/maat/MaatCfg.java +++ b/src/main/java/com/nis/domain/maat/MaatCfg.java @@ -27,44 +27,72 @@ import com.nis.domain.configuration.NumBoundaryCfg; * @version V1.0 */ public class MaatCfg implements Serializable { - - private Integer compileId; - private Integer action; + @Expose + private Integer compileId; + @Expose + private Integer action; + @Expose @SerializedName("service") - private Integer serviceId; + private Integer serviceId; + @Expose @SerializedName("contType") - private String classify;//分类 + private String classify;//分类 + @Expose @SerializedName("attrType") - private String attribute;//性质 + private String attribute;//性质 + @Expose @SerializedName("contLabel") - private String lable;//标签 + private String lable;//标签 + @Expose private Integer taskId; + @Expose @SerializedName("guaranteeId") private Integer functionId; + @Expose @SerializedName("effectiveRange") - private String areaEffectiveIds ; - private Integer doBlackList; - private Integer doLog; - private Integer activeSys; - private Integer configPercent; - private Integer configOption; - private Date startTime; - private Date endTime; - private String userRegion; - private Integer groupNum; + private String areaEffectiveIds ; + @Expose + private Integer doBlackList; + @Expose + private Integer doLog; + @Expose + private Integer activeSys; + @Expose + private Integer configPercent; + @Expose + private Integer configOption; + @Expose + private Date startTime; + @Expose + private Date endTime; + @Expose + private String userRegion; + @Expose + private Integer groupNum; + @Expose private Integer fatherCfgId; + @Expose @SerializedName("opTime") private Date auditTime; + @Expose private List groupRelationList; - private List strRegionList; - private List ipRegionList; - private List numRegionList; + @Expose + private List strRegionList; + @Expose + private List ipRegionList; + @Expose + private List numRegionList; + @Expose private List digestRegionList; - public static class GroupCfg{ + public static class GroupCfg{ + @Expose private Integer groupId; + @Expose private Integer compileId; + @Expose private Integer isValid; + @Expose private Date opTime; public Integer getGroupId() { return groupId; @@ -93,17 +121,27 @@ public class MaatCfg implements Serializable { } public static class StringCfg{ + @Expose private Integer regionId; + @Expose private Integer groupId; + @Expose @SerializedName("tableName") private String cfgType; + @Expose private String district; + @Expose @SerializedName("keywords") private String cfgKeywords; + @Expose private Integer exprType; + @Expose private Integer matchMethod; + @Expose private Integer isHexbin; + @Expose private Integer isValid; + @Expose private Date opTime; public Integer getRegionId() { return regionId; @@ -168,22 +206,38 @@ public class MaatCfg implements Serializable { } public static class IpCfg{ + @Expose private Integer regionId; + @Expose private Integer groupId; + @Expose @SerializedName("tableName") private String cfgType; + @Expose private Integer ipType; + @Expose private String srcIp; + @Expose private String srcIpMask ; + @Expose private String srcPort ; + @Expose private String srcPortMask ; + @Expose private String dstIp ; + @Expose private String dstIpMask ; + @Expose private String dstPort ; + @Expose private String dstPortMask ; + @Expose private Integer direction ; + @Expose private Integer protocol ; + @Expose private Integer isValid; + @Expose private Date opTime; public Integer getRegionId() { return regionId; @@ -283,13 +337,20 @@ public class MaatCfg implements Serializable { } } public static class NumBoundaryCfg{ + @Expose private Integer regionId; + @Expose private Integer groupId; + @Expose @SerializedName("tableName") private String cfgType; + @Expose private Integer lowBoundary; + @Expose private Integer upBoundary; + @Expose private Integer isValid; + @Expose private Date opTime; public Integer getRegionId() { return regionId; @@ -334,14 +395,22 @@ public class MaatCfg implements Serializable { this.opTime = opTime; } }public static class DigestCfg{ + @Expose private Integer regionId; + @Expose private Integer groupId; + @Expose @SerializedName("tableName") private String cfgType; + @Expose private Integer rawLen; + @Expose private String digest; + @Expose private Integer cfdsLevel; + @Expose private Integer isValid; + @Expose private Date opTime; public Integer getRegionId() { return regionId; diff --git a/src/main/java/com/nis/domain/maat/ToMaatBean.java b/src/main/java/com/nis/domain/maat/ToMaatBean.java index 9bbc2866e..5427a936a 100644 --- a/src/main/java/com/nis/domain/maat/ToMaatBean.java +++ b/src/main/java/com/nis/domain/maat/ToMaatBean.java @@ -13,6 +13,7 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; +import com.google.gson.annotations.Expose; import com.google.gson.annotations.SerializedName; /** @@ -33,11 +34,15 @@ public class ToMaatBean implements Serializable{ * * @since 1.0.0 */ + @Expose private String version; + @Expose @SerializedName("operator") private String creatorName; + @Expose @SerializedName("opTime") private Date auditTime; + @Expose private List configCompileList; public String getVersion() { diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index e4bc8b87e..7d6753711 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -82,7 +82,7 @@ $(function(){
-
+
diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index 63bea7a50..c1964fc7f 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -272,14 +272,14 @@ jQuery.validator.addMethod("portCheck",function(value, element) { typeInt=$(element).parents(".row").find("select[name$='portPattern']").val(); } if(typeInt==1){//port 0~65535 - if(this.optional(element)||(/^([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$1 >=0))){ + if(this.optional(element)||(/^(0|[1-9]+)$/.test(value))){ return true; }else{ $.validator.messages.portCheck=$.validator.messages.portRange return false; } }else if(typeInt==2){// port -mask 0~65535/0~65535 - if(this.optional(element)||(/^([0-9]+)\/([0-9]+)$/.test(value) && (RegExp.$1 <=65535 && RegExp.$2 <=65535))){ + if(this.optional(element)||(/^(0|[1-9]+)\/(0|[1-9]{1,5})$/.test(value) && RegExp.$2 <=65535)){ return true; }else{ $.validator.messages.portCheck=$.validator.messages.portMaskRange diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js index d1ba7fd1a..24ec9175d 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_en.js @@ -29,7 +29,7 @@ ipRange1:"start IP should smaller than end IP", portCheck:"Please enter a correct port", notStartZero:"Please enter a valid Integer", - portRange:"Port must between 0 and 65535", - portMaskRange:"Port and mask must between 0 and 65535.The right pattern is \"port/mask\"." + portRange:"Please enter a valid Integer", + portMaskRange:"Port must be a valid Integer and mask must between 0 and 65535.The correct pattern is \"port/mask\"." }); }(jQuery)); diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js index 0ceb23591..078b8fd0f 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_ru.js @@ -22,6 +22,12 @@ max: $.validator.format("Пожалуйста, введите число, меньшее или равное {0}."), min: $.validator.format("Пожалуйста, введите число, большее или равное {0}."), ipCheck: $.validator.format(" Пожалуйста, введите  правильный  IP - адрес."), - portCheck: $.validator.format(" Пожалуйста, введите  правильный  порт.") + ipMask:"Please enter a correct IP/mask", + ipMaskRange:"IP mask must between 0 and 32", + ipRange:"Wrong IP format or start IP and end IP in two subnet", + ipRange1:"start IP should smaller than end IP", + portCheck: " Пожалуйста, введите  правильный  порт.", + portRange:"Please enter a valid Integer", + portMaskRange:"Port must be a valid Integer and mask must between 0 and 65535.The correct pattern is \"port/mask\"." }); }(jQuery)); \ No newline at end of file diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js index a5c1f7ba5..b66801cb6 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/localization/messages_zh.js @@ -30,7 +30,7 @@ ipMaskRange:"掩码范围0到32", ipRange:"IP范围格式错误或者起始IP与结束IP不在同一网段", ipRange1:"起始IP值应小于结束IP值", - portRange:"端口范围0 到 65535", - portMaskRange:"端口和掩码均为0-65535,格式为\"端口/掩码\"" + portRange:"端口必须为整数,非0数字不能以0开头", + portMaskRange:"端口必须为整数,掩码范围0-65535,非0数字不能以0开头。格式为\"端口/掩码\"", }); }(jQuery));