diff --git a/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java index d9b25ddc3..20bd6bf07 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckComplexStringFormatThread.java @@ -90,6 +90,14 @@ public class CheckComplexStringFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); ComplexkeywordCfg baseStringCfg = new ComplexkeywordCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); + // 配置描述、关键字长度限制 + if(baseStringCfg.getCfgDesc().length() > 128) { + errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); + } + if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){ + errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";"); + } + if (regionDict.getRegionType().equals(3)) { if (regionDict.getFunctionId().equals(7)) { Long dnsStrategyId = baseStringCfg.getDnsStrategyId(); diff --git a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java index 8b70610c6..5d849ba57 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckIpFormatThread.java @@ -103,6 +103,11 @@ public class CheckIpFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); IpPortCfg baseIpCfg = new IpPortCfg(); BeanUtils.copyProperties(list.get(i), baseIpCfg); + // 配置描述长度限制 + if(baseIpCfg.getCfgDesc().length() > 128) { + errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); + } + // 特殊字段验证 // packet ip ratelimit if (serviceDict!=null&&serviceDict.getFunctionId().intValue() == 5 && serviceDict.getAction().intValue() == 64) { diff --git a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java index 8bfa9a4dd..df3afa7b7 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckStringFormatThread.java @@ -88,6 +88,14 @@ public class CheckStringFormatThread implements Callable{ StringBuffer errInfo = new StringBuffer(); BaseStringCfg baseStringCfg = new BaseStringCfg(); BeanUtils.copyProperties(list.get(i), baseStringCfg); + // 配置描述、关键字长度限制 + if(baseStringCfg.getCfgDesc().length() > 128) { + errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";"); + } + if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){ + errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";"); + } + if (regionDict.getRegionType().equals(2)) { if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) { String userRegion1 = baseStringCfg.getUserRegion1(); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 85bcc5382..4ac9e3449 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1429,4 +1429,7 @@ letter_num=LETTER config_num=CONFIG monitor_num=MONITOR control_num=CONTROL -contains_non_hex_char=Contains non-hexadecimal characters \ No newline at end of file +contains_non_hex_char=Contains non-hexadecimal characters +max_length=Maximum Length +min_length=Minimum Length +length_error=Length Error \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 6bcc59afd..88876c992 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1433,4 +1433,7 @@ letter_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041f\u config_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0439 monitor_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 control_num=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f -contains_non_hex_char=Contains non-hexadecimal characters \ No newline at end of file +contains_non_hex_char=Contains non-hexadecimal characters +max_length=Maximum Length +min_length=Minimum Length +length_error=Length Error \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index a66fb7f33..aa202ad5f 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1429,4 +1429,7 @@ letter_num=\u6765\u51fd\u4ef6\u6570 config_num=\u914d\u7f6e\u603b\u6570 monitor_num=\u76d1\u6d4b\u6570\u91cf control_num=\u7ba1\u63a7\u6570\u91cf -contains_non_hex_char=\u5305\u542b\u975e\u5341\u516d\u8fdb\u5236\u5b57\u7b26 \ No newline at end of file +contains_non_hex_char=\u5305\u542b\u975e\u5341\u516d\u8fdb\u5236\u5b57\u7b26 +max_length=\u6700\u5927\u957F\u5EA6 +min_length=\u6700\u5C0F\u957F\u5EA6 +length_error=\u957F\u5EA6\u9519\u8BEF \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index a5c7c933e..026f57216 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -121,9 +121,36 @@ $(document).ready(function() { var action = ""; } var reportType = $("[name=reportType]").find('[value=' + "${bean.reportType}" + ']').text() + "_"; - var reportTime = "${bean.reportTime}"; - return cfgName + action + reportType + reportTime; + //var reportTime = "${bean.reportTime}"; + return cfgName + action + reportType + getStringFormatDate(); } + + function getStringFormatDate() { + var date = new Date(); + var year = date.getFullYear(); + var month = date.getMonth() + 1; + var strDate = date.getDate(); + var hours = date.getHours(); + var minutes = date.getMinutes(); + var seconds = date.getSeconds(); + if (month >= 1 && month <= 9) { + month = "0" + month; + } + if (strDate >= 0 && strDate <= 9) { + strDate = "0" + strDate; + } + if (hours >= 1 && hours <= 9) { + hours = "0" + hours; + } + if (minutes >= 1 && minutes <= 9) { + minutes = "0" + minutes; + } + if (seconds >= 1 && seconds <= 9) { + seconds = "0" + seconds; + } + var currentdate = year+""+ month+""+strDate+""+ hours+""+ minutes+""+seconds; + return currentdate; + } var reportDate=0; function changeReportType(reportType) {