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}