From fe2c7df204ceb51a5dd62cc00bf84d626d2de8e7 Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 25 Jul 2018 12:41:54 +0800 Subject: [PATCH 1/3] =?UTF-8?q?(1)app=E7=AD=96=E7=95=A5=E4=BF=AE=E6=94=B9d?= =?UTF-8?q?ao.xml=EF=BC=8Cupdate=E6=93=8D=E4=BD=9C=E9=99=A4=E4=BA=86creato?= =?UTF-8?q?rId=EF=BC=8CcreatorTime,editorId,editTime,auditor,aduitTime?= =?UTF-8?q?=E4=B9=8B=E5=A4=96=EF=BC=8C=E5=8E=BB=E6=8E=89if=20null=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD=20(2)app=E7=AD=96=E7=95=A5=EF=BC=8C=E5=9F=BA?= =?UTF-8?q?=E7=A1=80=E5=8D=8F=E8=AE=AE=E9=A1=B5=E9=9D=A2ratelimit=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E6=8F=90=E4=BA=A4=E8=A1=A8=E5=8D=95=E6=97=B6=E5=A6=82?= =?UTF-8?q?=E6=9E=9Catction=E4=B8=8D=E4=B8=BA=E9=99=90=E9=80=9F=EF=BC=8C?= =?UTF-8?q?=E7=BD=AE=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nis/web/dao/configuration/AppCfgDao.xml | 106 +++++++++--------- .../views/cfg/app/appPolicyCfgForm.jsp | 5 + .../WEB-INF/views/cfg/basicprotocol/form.jsp | 3 + 3 files changed, 61 insertions(+), 53 deletions(-) diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index a2ace008d..3ffaeea66 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -1180,96 +1180,96 @@ update app_policy_cfg - + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, - - + APP_CODE = #{appCode,jdbcType=INTEGER}, - - + BEHAV_CODE = #{behavCode,jdbcType=INTEGER}, - - + SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER}, - - + action = #{action,jdbcType=INTEGER}, - - + is_valid = #{isValid,jdbcType=INTEGER}, - - + is_audit = #{isAudit,jdbcType=INTEGER}, - + creator_id = #{creatorId,jdbcType=INTEGER}, - + create_time = #{createTime,jdbcType=TIMESTAMP}, - + editor_id = #{editorId,jdbcType=INTEGER}, edit_time = #{editTime,jdbcType=TIMESTAMP}, - + --> auditor_id = #{auditorId,jdbcType=INTEGER}, - - + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, - + service_id = #{serviceId,jdbcType=INTEGER}, - - + request_id = #{requestId,jdbcType=INTEGER}, - - + compile_id = #{compileId,jdbcType=INTEGER}, - - + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, - - + classify = #{classify,jdbcType=VARCHAR}, - - + attribute = #{attribute,jdbcType=VARCHAR}, - - + lable = #{lable,jdbcType=VARCHAR}, - - + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, - - + function_id = #{functionId,jdbcType=INTEGER}, - - + RATELIMIT=#{ratelimit,jdbcType=INTEGER}, - - + CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}, - - + CFG_TYPE =#{cfgType,jdbcType=VARCHAR}, - - + USER_REGION1 =#{userRegion1,jdbcType=VARCHAR}, - - + USER_REGION2 =#{userRegion2,jdbcType=VARCHAR}, - - + USER_REGION1 =#{userRegion3,jdbcType=VARCHAR}, - - + USER_REGION1 =#{userRegion4,jdbcType=VARCHAR}, - - + USER_REGION1 =#{userRegion5,jdbcType=VARCHAR}, - + where cfg_id = #{cfgId,jdbcType=BIGINT} diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp index 3c94b1b52..508dfad05 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -53,6 +53,9 @@ $(function(){ if($("[name='behavCode']")&&$("[name='behavCode']").val()!=""){ $("input[name$='exprType']").val(1); } + if($("input[name='ratelimit']").is(":hidden")){ + $("input[name='ratelimit']").val(""); + } /* $("#appCode").val($("#specServiceIdId").val()); */ loading('onloading...'); form.submit(); @@ -190,12 +193,14 @@ var delContent = function(contentClassName, addBtnClassName) {
+
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp index fd73af01d..2c9ea71f2 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp @@ -53,6 +53,9 @@ $(function(){ if($("[name='behavCode']")&&$("[name='behavCode']").val()!=""){ $("input[name$='exprType']").val(1); } + if($("input[name='ratelimit']").is(":hidden")){ + $("input[name='ratelimit']").val(""); + } /* $("#appCode").val($("#specServiceIdId").val()); */ loading('onloading...'); form.submit(); From 36b274fa4d141399abd3f3da4b9f5aa3b85d17b0 Mon Sep 17 00:00:00 2001 From: wangxin Date: Wed, 25 Jul 2018 12:42:18 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4dao.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 3ffaeea66..6b1f5d881 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -1213,7 +1213,7 @@ edit_time = #{editTime,jdbcType=TIMESTAMP}, - --> + auditor_id = #{auditorId,jdbcType=INTEGER}, From 6398c30af0ef0d58a63bb4307529083d520a8a95 Mon Sep 17 00:00:00 2001 From: zhanghongqing Date: Wed, 25 Jul 2018 13:00:36 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97ddos?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/log/ntc/DdosLogController.java | 18 +++++++++++++++++- .../messages/message_zh_CN.properties | 4 ++-- .../webapp/WEB-INF/views/log/ntc/ddosList.jsp | 4 ++-- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java index 7a7ae5c8c..273d30052 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java @@ -1,6 +1,8 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.sql.Timestamp; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -16,7 +18,12 @@ import org.springframework.web.bind.annotation.RequestMapping; import com.google.gson.Gson; import com.google.gson.GsonBuilder; +import com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonParseException; import com.google.gson.reflect.TypeToken; +import com.google.protobuf.DescriptorProtos.FieldDescriptorProto.Type; import com.nis.domain.Page; import com.nis.domain.PageLog; import com.nis.domain.log.NtcDdosLog; @@ -24,6 +31,7 @@ import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.sun.jna.platform.win32.OaIdl.DATE; @Controller @RequestMapping(value = "${adminPath}/log/ntc/ntcDdosLogs") @@ -54,7 +62,15 @@ public class DdosLogController extends BaseController{ url = Constants.LOG_BASE_URL+Constants.NTC_DDOS_LOG; String jsonString = HttpClientUtil.getMsg(url,params,request); - Gson gson = new GsonBuilder().create(); + GsonBuilder builder = new GsonBuilder(); + builder.registerTypeAdapter(Date.class, new JsonDeserializer() { + + public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT, + JsonDeserializationContext context) throws JsonParseException { + return new Date(json.getAsJsonPrimitive().getAsLong()); + } + }); + Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create(); //gson泛型支持 LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 57f3906d1..a5f2338d1 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -681,8 +681,8 @@ direct=\u4F20\u8F93\u65B9\u5411 stream_type=\u6D41\u7C7B\u578B clj_ip=\u5904\u7406\u673AIP nest_addr_list=\u5D4C\u5957\u5730\u5740\u5217\u8868 -server_locate=\u670D\u52A1\u7AEF\u5730\u5740\u5B9A\u4F4D\u4FE1\u606F -client_locate=\u5BA2\u6237\u7AEF\u5730\u5740\u5B9A\u4F4D\u4FE1\u606F +server_locate=\u670D\u52A1\u7AEF\u5730\u5740 +client_locate=\u5BA2\u6237\u7AEF\u5730\u5740 user_region=\u7528\u6237\u81EA\u5B9A\u4E49 version=\u7248\u672C\u53F7 encrypt_mode=\u52A0\u5BC6\u65B9\u5F0F diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp index 581b6b9bd..ae11f7438 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp @@ -235,8 +235,8 @@ $(document).ready(function(){ ${log.userRegion} ${log.attackType} - ${log.attackStartTime} - ${log.lastAttackTime} + + ${log.attackMaxPps} ${log.attackMaxBps} ${log.attackTotalPkt}