From 2312b410350c2688b137ca31627ce9c7e1c861d2 Mon Sep 17 00:00:00 2001 From: wangwenrui Date: Thu, 3 Jan 2019 12:50:47 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E8=BF=98=E5=8E=9F=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/WEB-INF/views/home.jsp | 2 +- src/main/webapp/WEB-INF/views/report/list.jsp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/home.jsp b/src/main/webapp/WEB-INF/views/home.jsp index 66fc8440e..68c7ac16c 100644 --- a/src/main/webapp/WEB-INF/views/home.jsp +++ b/src/main/webapp/WEB-INF/views/home.jsp @@ -193,7 +193,7 @@ function changeFrameHeight() { var paddingHeight = 11; //update for dynamicHomePage E - //iframe.contents().find(".page-content").addClass("page-content-body"); + iframe.contents().find(".page-content").addClass("page-content-body"); iframe.prop("height",clientHeight-headerHeight-barHeight-footerHeight-paddingHeight); menuHeight(); } diff --git a/src/main/webapp/WEB-INF/views/report/list.jsp b/src/main/webapp/WEB-INF/views/report/list.jsp index cac9f6098..3a7d17c53 100644 --- a/src/main/webapp/WEB-INF/views/report/list.jsp +++ b/src/main/webapp/WEB-INF/views/report/list.jsp @@ -447,7 +447,7 @@ white-space:nowrap; -
+
<%--
@@ -41,15 +43,17 @@
- + +
-
+ @@ -260,6 +264,7 @@ function changeBandwidth(unitType,beginDate,endDate){ /* 网络带宽时间维度趋势图 */ function showBandwidthChart(id,unitType,xdata,ydata,title){ var nowDate=new Date(); + Highcharts.setOptions({ global: { useUTC: false } }); var chart = Highcharts.chart(id, { chart:{ type: 'area', @@ -382,7 +387,6 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ }, */ series:ydata }); - Highcharts.setOptions({ global: { useUTC: false } }); } (function(H) { H.Chart.prototype.downloadXLS = function() { @@ -446,12 +450,12 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ }; }(Highcharts)); - function setTime(){ + /* function setTime(){ var chooseDate=new Date($('#beginDate').val()); chooseDate=chooseDate.setDate(chooseDate.getDate()+1); var modifyTime=new Date(chooseDate); $('#endDate').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds())); - } + } */ (function(H) { H.Chart.prototype.downloadCSV = function() { var rows = this.getDataRows(true); From e402a476008102263679a2469f3aeead01f232d4 Mon Sep 17 00:00:00 2001 From: tanghao Date: Thu, 3 Jan 2019 15:25:46 +0800 Subject: [PATCH 03/17] =?UTF-8?q?1.=E6=B5=81=E9=87=8F=E6=89=80=E6=9C=89?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E8=AE=BE=E7=BD=AE=E6=97=B6=E5=8C=BA=202.?= =?UTF-8?q?=E6=B5=81=E9=87=8F=E6=89=80=E6=9C=89=E7=95=8C=E9=9D=A2=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E6=94=B9=E4=B8=BA=E9=9D=A2=E7=A7=AF=E5=9B=BE?= =?UTF-8?q?=203.=E6=B5=81=E9=87=8F=E6=89=80=E6=9C=89=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9=E4=BC=98=E5=8C=96=E4=B8=8D?= =?UTF-8?q?=E4=BC=9A=E8=B6=85=E8=BF=87=E6=9C=80=E6=96=B0=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficDomainTrans.jsp | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 900278a3a..1e5fae4a9 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -65,15 +65,17 @@ $(document).ready(function(){ var xData=new Array(); var series=new Array(); var total = 0; + console.log(rs) if(rs!=null&&rs.length>0){ - xData=rs[0].statTime; + /* xData=rs[0].statTime; $(rs[0].count).each(function(i,d) { total+=d - }) + })*/ + total=rs[0].sum; series.push({ name: 'unique', - data: rs[0].count - }); + data: rs[0].result + }); }else{ series.push({ name: 'unique', @@ -98,7 +100,7 @@ function showDomainTrans(xData,series){ var domainName= $("#domainName").val(); var chart = Highcharts.chart('chart', { chart:{ -// type: 'area', + type: 'area', zoomType: 'x' }, exporting: { @@ -129,8 +131,16 @@ function showDomainTrans(xData,series){ text: domainName }, xAxis: { - type:'category', - categories: xData, + type:'datetime', + dateTimeLabelFormats: { + second: '%H:%M:%S', + minute: '%H:%M', + hour: '%H:%M', + day: '%m-%d', + week: '%m-%d', + month: '%Y-%m', + year: '%Y' + }, title: { text: 'time', align:'high', From 55243010b70997ef8783eda678b7edfaa0fa2c60 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Thu, 3 Jan 2019 15:30:14 +0800 Subject: [PATCH 04/17] =?UTF-8?q?app=20payload=E5=AF=BC=E5=85=A5L3=5Fheade?= =?UTF-8?q?r=E7=89=B9=E5=BE=81=E9=85=8D=E7=BD=AE=E6=97=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=9B=BA=E5=AE=9A=E5=B1=9E=E6=80=A7=E5=80=BC=EF=BC=9B?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=B1=9E=E6=80=A7=E6=A0=A1=E9=AA=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=9B=E5=AF=BC=E5=85=A5=E6=A8=A1=E6=9D=BF=E6=89=B9?= =?UTF-8?q?=E6=B3=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/configuration/AppFeatureIndex.java | 18 + .../java/com/nis/util/excel/ExportExcel.java | 7 +- ...ckAppFeatureComplexStringFormatThread.java | 384 +++++++++--------- .../nis/web/controller/BaseController.java | 5 + .../resources/messages/message_en.properties | 3 +- .../resources/messages/message_ru.properties | 3 +- .../messages/message_zh_CN.properties | 3 +- 7 files changed, 233 insertions(+), 190 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java b/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java index 45ef53501..897304222 100644 --- a/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java +++ b/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java @@ -133,5 +133,23 @@ public class AppFeatureIndex extends BaseCfg { public void setNumCfgList(List numCfgList) { this.numCfgList = numCfgList; } + public Integer getExprType() { + return exprType; + } + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + public Integer getMatchMethod() { + return matchMethod; + } + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + public Integer getIsHexbin() { + return isHexbin; + } + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } } diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index ad4edaaff..4976e264c 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -1038,7 +1038,12 @@ public class ExportExcel { } // APP Payload if(region.getFunctionId().equals(563)) { - commentStr=commentStr+"▶"+"L3_header:"+msgProp.getProperty("need_input")+"'headerType'"+"\n"; + commentStr=commentStr+"▶"+"L3_header:"+msgProp.getProperty("need_input")+"'headerType', "+ + msgProp.getProperty("no_need_input")+"'"+ + msgProp.getProperty("key_word")+"'、'"+ + msgProp.getProperty("match_method")+"'、'"+ + msgProp.getProperty("is_hex")+"'、'"+ + msgProp.getProperty("is_case_insenstive")+"'"+"\n"; index++; } } diff --git a/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java b/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java index 106d24e7e..8d5080f0e 100644 --- a/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java +++ b/src/main/java/com/nis/util/excel/thread/CheckAppFeatureComplexStringFormatThread.java @@ -92,21 +92,63 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable 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)) { String keyword = baseStringCfg.getCfgKeywords(); String district = baseStringCfg.getDistrict(); - if (StringUtils.isBlank(keyword)) { - errInfo.append( - String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";"); + if(!district.equals("L3_header")) {// district="L3_header"时 不校验keyword + + if (StringUtils.isBlank(keyword)) { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";"); + }else if(keyword.length() < 4 || keyword.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 (mulityKeywordsP.equals("0")) { + if (keyword.indexOf("\n") > -1) { + errInfo.append( + String.format(prop.getProperty("not_multiple"), prop.getProperty("key_word")) + ";"); + } + Matcher m = pattern.matcher(keyword); + if (m.find()) { + errInfo.append(String.format(prop.getProperty("has_invisible_char"), + prop.getProperty("key_word") + " '" + keyword + "'") + ";"); + } + } else { + boolean has = false; + Set keywordSet=Sets.newHashSet(); + + for (String key : keyword.split("\n")) { + Matcher m = pattern.matcher(key); + if (m.find()) { + has = true; + errInfo.append(String.format(prop.getProperty("has_invisible_char"), + prop.getProperty("key_word") + " '" + key + "'") + ";"); + break; + } + if(!keywordSet.contains(key)) { + keywordSet.add(key); + }else { + errInfo.append(prop.getProperty("key_word") + " '" + key + "'"+" "+prop.getProperty("repeat") + ";"); + } + } + if (!has) { + if(keyword.replaceAll("\n","").length()>1024) { + errInfo.append(String.format(prop.getProperty("most_keywords"), + prop.getProperty("key_word")) + ";"); + }else { + String reWord = keyword.replaceAll("\n", Constants.KEYWORD_EXPR); + baseStringCfg.setCfgKeywords(reWord); + } + } + } } + if (StringUtils.isNotBlank(dirtrictP)) { if (StringUtils.isBlank(district)) { if (dirtrictP.indexOf(",") == -1) { @@ -127,185 +169,149 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable -1) { - errInfo.append( - String.format(prop.getProperty("not_multiple"), prop.getProperty("key_word")) + ";"); - } - Matcher m = pattern.matcher(keyword); - if (m.find()) { - errInfo.append(String.format(prop.getProperty("has_invisible_char"), - prop.getProperty("key_word") + " '" + keyword + "'") + ";"); - } - } else { - boolean has = false; - Set keywordSet=Sets.newHashSet(); - - for (String key : keyword.split("\n")) { - Matcher m = pattern.matcher(key); - if (m.find()) { - has = true; - errInfo.append(String.format(prop.getProperty("has_invisible_char"), - prop.getProperty("key_word") + " '" + key + "'") + ";"); - break; - } - if(!keywordSet.contains(key)) { - keywordSet.add(key); - }else { - errInfo.append(prop.getProperty("key_word") + " '" + key + "'"+" "+prop.getProperty("repeat") + ";"); - } - } - if (!has) { - if(keyword.replaceAll("\n","").length()>1024) { - errInfo.append(String.format(prop.getProperty("most_keywords"), - prop.getProperty("key_word")) + ";"); - }else { - String reWord = keyword.replaceAll("\n", Constants.KEYWORD_EXPR); - baseStringCfg.setCfgKeywords(reWord); - } - } - } - Integer exprType = baseStringCfg.getExprType(); - boolean has = false; - if (exprType == null) { - if (exprTypeP.indexOf(",") == -1) { - if (mulityKeywordsP.equals("0") && exprTypeP.equals("1")) { - throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); - } - baseStringCfg.setExprType(Integer.parseInt(exprTypeP)); - } else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("0")) { - baseStringCfg.setExprType(0); - } else if (exprTypeP.indexOf("1") > -1 && mulityKeywordsP.equals("1") - && keyword.indexOf("\n") > -1) { - baseStringCfg.setExprType(1); - } else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("1") - && keyword.indexOf("\n") == -1) { - baseStringCfg.setExprType(0); - } else { - baseStringCfg.setExprType(Integer.parseInt(exprTypeP.split(",")[0])); - } - // errInfo.append(String.format(prop.getProperty("can_not_null"), - // prop.getProperty("expression_type"))+";"); - } else { - for (String exp : exprTypeP.split(",")) { - if (exp.equals(exprType.toString())) { - has = true; - break; - } - } - if (!has) { - errInfo.append( - String.format(prop.getProperty("is_incorrect"), prop.getProperty("expression_type")) - + ";"); - } - has = false; - } - exprType = baseStringCfg.getExprType(); - Integer matchMethod = baseStringCfg.getMatchMethod(); - if (matchMethod == null) { - if (matchMethodP.indexOf(",") == -1) { - if (exprTypeP.equals("1") && !matchMethodP.equals("0")) { - throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); - } - baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP)); - } else if (exprType != null && exprType.intValue() == 1) { - if (matchMethodP.indexOf("0") > -1) { - baseStringCfg.setMatchMethod(0); - } else { - throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); - } - - } else { - baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP.split(",")[0])); - } - // errInfo.append(String.format(prop.getProperty("can_not_null"), - // prop.getProperty("match_method"))+";"); - } else { - for (String exp : matchMethodP.split(",")) { - if (exp.equals(matchMethod.toString())) { - has = true; - break; - } - } - if (!has) { - errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("match_method")) - + ";"); - } - } - Integer isHex = baseStringCfg.getIsHex(); - Integer isCaseInsenstive = baseStringCfg.getIsCaseInsenstive(); - if (isHex == null || isCaseInsenstive == null) { - if (isHex == null) { - if (hexP.indexOf("0")>-1 || hexP.indexOf("2")>-1) { - baseStringCfg.setIsHex(0); - } else if (hexP.indexOf("1")>-1) { - baseStringCfg.setIsHex(1); - } else { - errInfo.append( - String.format(prop.getProperty("can_not_null"), prop.getProperty("is_hex")) + ";"); - } - } - if (isCaseInsenstive == null) { - if (hexP.indexOf("0")>-1 || hexP.indexOf("1")>-1) { - baseStringCfg.setIsCaseInsenstive(0); - } else if (hexP.indexOf("2")>-1) { - baseStringCfg.setIsCaseInsenstive(1); - } else { - errInfo.append(String.format(prop.getProperty("can_not_null"), - prop.getProperty("is_case_insenstive")) + ";"); - } - } - } else { - if (isHex.intValue() != 0 && isHex.intValue() != 1) { - errInfo.append( - String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); - } - if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) { - errInfo.append( - String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) - + ";"); - } - if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) { - errInfo.append( - String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); - } - if (hexP.equals("1") && isHex.intValue() == 0) { - errInfo.append( - String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); - } - if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) { - errInfo.append( - String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) - + ";"); - } - if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) { - errInfo.append( - String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) - + ";"); - } - // 关键字十六进制校验 - if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) { - boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches(); - if(!bl) { - errInfo.append( - prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); - } - } - } - isHex = baseStringCfg.getIsHex(); - isCaseInsenstive = baseStringCfg.getIsCaseInsenstive(); - if (isHex != null && isCaseInsenstive != null) { - if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) { - baseStringCfg.setIsHexbin(0); - } else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 0) { - baseStringCfg.setIsHexbin(1); - } else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) { - baseStringCfg.setIsHexbin(2); - } else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验 - errInfo.append(prop.getProperty("hex_case_insensitive")+ ";"); - } - } + if(!district.equals("L3_header")) {// district="L3_header"时 不校验exprType、matchMethod、isHex、isCaseInsenstive,为固定值 + Integer exprType = baseStringCfg.getExprType(); + boolean has = false; + if (exprType == null) { + if (exprTypeP.indexOf(",") == -1) { + if (mulityKeywordsP.equals("0") && exprTypeP.equals("1")) { + throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); + } + baseStringCfg.setExprType(Integer.parseInt(exprTypeP)); + } else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("0")) { + baseStringCfg.setExprType(0); + } else if (exprTypeP.indexOf("1") > -1 && mulityKeywordsP.equals("1") + && keyword.indexOf("\n") > -1) { + baseStringCfg.setExprType(1); + } else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("1") + && keyword.indexOf("\n") == -1) { + baseStringCfg.setExprType(0); + } else { + baseStringCfg.setExprType(Integer.parseInt(exprTypeP.split(",")[0])); + } + // errInfo.append(String.format(prop.getProperty("can_not_null"), + // prop.getProperty("expression_type"))+";"); + } else { + for (String exp : exprTypeP.split(",")) { + if (exp.equals(exprType.toString())) { + has = true; + break; + } + } + if (!has) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("expression_type")) + + ";"); + } + has = false; + } + exprType = baseStringCfg.getExprType(); + Integer matchMethod = baseStringCfg.getMatchMethod(); + if (matchMethod == null) { + if (matchMethodP.indexOf(",") == -1) { + if (exprTypeP.equals("1") && !matchMethodP.equals("0")) { + throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); + } + baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP)); + } else if (exprType != null && exprType.intValue() == 1) { + if (matchMethodP.indexOf("0") > -1) { + baseStringCfg.setMatchMethod(0); + } else { + throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId()); + } + + } else { + baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP.split(",")[0])); + } + // errInfo.append(String.format(prop.getProperty("can_not_null"), + // prop.getProperty("match_method"))+";"); + } else { + for (String exp : matchMethodP.split(",")) { + if (exp.equals(matchMethod.toString())) { + has = true; + break; + } + } + if (!has) { + errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("match_method")) + + ";"); + } + } + Integer isHex = baseStringCfg.getIsHex(); + Integer isCaseInsenstive = baseStringCfg.getIsCaseInsenstive(); + if (isHex == null || isCaseInsenstive == null) { + if (isHex == null) { + if (hexP.indexOf("0")>-1 || hexP.indexOf("2")>-1) { + baseStringCfg.setIsHex(0); + } else if (hexP.indexOf("1")>-1) { + baseStringCfg.setIsHex(1); + } else { + errInfo.append( + String.format(prop.getProperty("can_not_null"), prop.getProperty("is_hex")) + ";"); + } + } + if (isCaseInsenstive == null) { + if (hexP.indexOf("0")>-1 || hexP.indexOf("1")>-1) { + baseStringCfg.setIsCaseInsenstive(0); + } else if (hexP.indexOf("2")>-1) { + baseStringCfg.setIsCaseInsenstive(1); + } else { + errInfo.append(String.format(prop.getProperty("can_not_null"), + prop.getProperty("is_case_insenstive")) + ";"); + } + } + } else { + if (isHex.intValue() != 0 && isHex.intValue() != 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); + } + if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) + + ";"); + } + if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); + } + if (hexP.equals("1") && isHex.intValue() == 0) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";"); + } + if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) + + ";"); + } + if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) { + errInfo.append( + String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive")) + + ";"); + } + // 关键字十六进制校验 + if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) { + boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches(); + if(!bl) { + errInfo.append( + prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";"); + } + } + } + isHex = baseStringCfg.getIsHex(); + isCaseInsenstive = baseStringCfg.getIsCaseInsenstive(); + if (isHex != null && isCaseInsenstive != null) { + if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) { + baseStringCfg.setIsHexbin(0); + } else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 0) { + baseStringCfg.setIsHexbin(1); + } else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) { + baseStringCfg.setIsHexbin(2); + } else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验 + errInfo.append(prop.getProperty("hex_case_insensitive")+ ";"); + } + } + } // APP Payload L3_HEADER的特殊属性限制 if(baseStringCfg.getDistrict().equals("L3_header")) { String headerType = baseStringCfg.getHeaderType(); @@ -318,7 +324,13 @@ public class CheckAppFeatureComplexStringFormatThread implements Callable Date: Thu, 3 Jan 2019 16:48:11 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=AF=BC=E5=87=BApng?= =?UTF-8?q?=20pdf=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../highcharts/js/offline-exporting.js | 4 -- .../webapp/static/pages/scripts/echart.js | 44 ++++++++++++++++++- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js b/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js index 622210fc4..58f5440fb 100644 --- a/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js +++ b/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js @@ -277,13 +277,9 @@ License: www.highcharts.com/license downloadPNG: { textKey: "downloadPNG", onclick: function () { - console.log(this) - console.log(chart_main) this.legend.itemStyle.color='#000000' this.exportChartLocal() this.legend.itemStyle.color='#ffffff' - console.log('ok') - console.log(this) } }, downloadJPEG: { diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index b751f0b05..03e82deed 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -266,8 +266,23 @@ dataLabels: { enabled: true, allowOverlap: true, // 允许数据标签重叠 + color:'#000000' }, }, + xAxis: [{ + labels: { + style: { + color: '#000000' + } + } + }], + yAxis: [{ + labels: { + style: { + color: '#000000' + } + } + }] } }, buttons: { @@ -473,7 +488,7 @@ data: [pktNum,byteLen], });*/ }); - var chart = Highcharts.chart('chart_3',{ + var chart = Highcharts.chart('chart_3',{ chart: { backgroundColor: 'rgba(255, 255, 255, 0)', plotBackgroundColor:null, @@ -492,7 +507,32 @@ exporting: { allowHTML:true, filename:'App'+addDateName(), - buttons: exportingButton('#415262') + buttons: exportingButton('#415262'), + chartOptions: { + plotOptions: { + series: { + dataLabels: { + enabled: true, + color:'#000000' + } + } + }, + xAxis: [{ + categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + labels: { + style: { + color: '#000000' + } + } + }], + yAxis: [{ + labels: { + style: { + color: '#000000' + } + } + }] + } }, noData:{ style: {//设置字体颜色 From fcf064df1888827a43ecb162b3c6da5cfc3a9371 Mon Sep 17 00:00:00 2001 From: dongxiaoyan Date: Thu, 3 Jan 2019 16:48:58 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E5=88=B0=E5=BC=A0?= =?UTF-8?q?=E5=BE=AE=E6=B7=BB=E5=8A=A0=E7=89=88=E6=9C=AC=E5=88=B0=E5=85=B7?= =?UTF-8?q?=E4=BD=93=E6=8E=A5=E5=8F=A3=E7=9A=84=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/nis.properties | 184 +++++++++++++++--------------- 1 file changed, 93 insertions(+), 91 deletions(-) diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index b9afa1648..0a78ca76f 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -219,72 +219,72 @@ clusterBStartTime=1503504000725 isCommit=true ############################################################################################################################################ ############################################################################################################################################ -httpUrl=http://10.0.7.14:9999/galaxy-service/service/cfg/v1/ -maatCfg=configSources -fileUploadCfg=fileUploadSources -callbackCfg=commonSources -fileDigestCfg=fileDigestSources -configIdSources=configPzIdSources +httpUrl=http://10.0.7.14:9999/galaxy-service/service/cfg/ +maatCfg=v1/configSources +fileUploadCfg=v1/fileUploadSources +callbackCfg=v1/commonSources +fileDigestCfg=v1/fileDigestSources +configIdSources=v1/configPzIdSources #logBaseUrl=http://10.0.6.242:8080/galaxy-service/service/log/v1/ -logBaseUrl=http://10.0.7.14:9999/galaxy-service/service/log/v1/ -ntcPzReport=ntcPzReport -ntcServiceReport=ntcServiceReport -ntcTagReport=ntcTagReport -ntcAttrTypeReport=ntcAttrTypeReport -ntcLwhhReport=ntcLwhhReport -ntcSrcipDomesticReport=ntcSrcipDomesticReport -ntcDestipCountryReport=ntcDestipCountryReport -ntcEntranceReport=ntcEntranceReport -ntcIpLog=ntcIpLogs -ntcBgpLog=ntcBgpLogs -ntcP2pLog=ntcP2pLogs -ntcHttpLog=ntcHttpLogs -ntcDnsLog=ntcDnsLogs -ntcSslLog=ntcSslLogs -ntcPptpLog=ntcPptpLogs -ntcL2tpLog=ntcL2tpLogs -ntcOpenvpnLog=ntcOpenvpnLogs -ntcIpsecLog=ntcIpsecLogs -ntcSshLog=ntcSshLogs -ntcMailLog=ntcMailLogs -ntcFtpLog=ntcFtpLogs -ntcAppLog=ntcAppLogs -ntcDdosLog=ntcDdosLogs -dkBehaviorLog=ntcAppLogs -mmVoipLog=ntcVoipLogs -mmAvIpLog=mmAvIpLogs -mmAvUrlLog=mmAvUrlLogs -mmPicIpLog=mmPicIpLogs -mmPicUrlLog=mmPicUrlLogs -mmVoipIpLog=ntcVoipLogs -mmVoipAccountLog=mmVoipAccountLogs -mmSampleAudioLog=mmSampleAudioLogs -mmSampleVideoLog=mmSampleVideoLogs -mmPornAudioLevelLog=mmPornAudioLevelLogs -mmPornVideoLevelLog=mmPornVideoLevelLogs -mmSamplePicLog=mmSamplePicLogs -mmSampleVoipLog=mmSampleVoipLogs -pxyHttpLog=pxyHttpLogs -mmSpeakerRecognizationLog=mmSpeakerRecognizationLogs -mmLogoDetectionLog=mmLogoDetectionLogs -mmFaceRecognizationLog=mmFaceRecognizationLogs +logBaseUrl=http://10.0.7.14:9999/galaxy-service/service/log/ +ntcPzReport=v1/ntcPzReport +ntcServiceReport=v1/ntcServiceReport +ntcTagReport=v1/ntcTagReport +ntcAttrTypeReport=v1/ntcAttrTypeReport +ntcLwhhReport=v1/ntcLwhhReport +ntcSrcipDomesticReport=v1/ntcSrcipDomesticReport +ntcDestipCountryReport=v1/ntcDestipCountryReport +ntcEntranceReport=v1/ntcEntranceReport +ntcIpLog=v1/ntcIpLogs +ntcBgpLog=v1/ntcBgpLogs +ntcP2pLog=v1/ntcP2pLogs +ntcHttpLog=v1/ntcHttpLogs +ntcDnsLog=v1/ntcDnsLogs +ntcSslLog=v1/ntcSslLogs +ntcPptpLog=v1/ntcPptpLogs +ntcL2tpLog=v1/ntcL2tpLogs +ntcOpenvpnLog=v1/ntcOpenvpnLogs +ntcIpsecLog=v1/ntcIpsecLogs +ntcSshLog=v1/ntcSshLogs +ntcMailLog=v1/ntcMailLogs +ntcFtpLog=v1/ntcFtpLogs +ntcAppLog=v1/ntcAppLogs +ntcDdosLog=v1/ntcDdosLogs +dkBehaviorLog=v1/ntcAppLogs +mmVoipLog=v1/ntcVoipLogs +mmAvIpLog=v1/mmAvIpLogs +mmAvUrlLog=v1/mmAvUrlLogs +mmPicIpLog=v1/mmPicIpLogs +mmPicUrlLog=v1/mmPicUrlLogs +mmVoipIpLog=v1/ntcVoipLogs +mmVoipAccountLog=v1/mmVoipAccountLogs +mmSampleAudioLog=v1/mmSampleAudioLogs +mmSampleVideoLog=v1/mmSampleVideoLogs +mmPornAudioLevelLog=v1/mmPornAudioLevelLogs +mmPornVideoLevelLog=v1/mmPornVideoLevelLogs +mmSamplePicLog=v1/mmSamplePicLogs +mmSampleVoipLog=v1/mmSampleVoipLogs +pxyHttpLog=v1/pxyHttpLogs +mmSpeakerRecognizationLog=v1/mmSpeakerRecognizationLogs +mmLogoDetectionLog=v1/mmLogoDetectionLogs +mmFaceRecognizationLog=v1/mmFaceRecognizationLogs ######################################## #\u5927\u5c4f\u56fe\u8868\u5c55\u793a\u670d\u52a1\u63a5\u53e3 -dashboardUrl=http://10.0.7.14:9999/galaxy-service/service/log/v1/ -trafficIpActive=trafficIpActive -trafficProtocol=trafficProtocol -trafficApp=trafficApp -trafficOsList=trafficOsList -trafficBrowserChart=trafficBrowserChart -trafficBsList=trafficBsList -trafficSystemChart=trafficSystemChart -trafficWebsiteList=trafficWebsiteList -trafficWebTypeChart=trafficWebTypeChart -trafficPortActive=trafficPortActive -trafficTopicAndDomainChart=trafficTopicAndDomainChart -ntcTotalReport=ntcTotalReport -trafficIpActiveFiveMinute=trafficIpActiveFiveMinute -trafficIpActiveOneHour=trafficIpActiveOneHour +dashboardUrl=http://10.0.7.14:9999/galaxy-service/service/log/ +trafficIpActive=v1/trafficIpActive +trafficProtocol=v1/trafficProtocol +trafficApp=v1/trafficApp +trafficOsList=v1/trafficOsList +trafficBrowserChart=v1/trafficBrowserChart +trafficBsList=v1/trafficBsList +trafficSystemChart=v1/trafficSystemChart +trafficWebsiteList=v1/trafficWebsiteList +trafficWebTypeChart=v1/trafficWebTypeChart +trafficPortActive=v1/trafficPortActive +trafficTopicAndDomainChart=v1/trafficTopicAndDomainChart +ntcTotalReport=v1/ntcTotalReport +trafficIpActiveFiveMinute=v1/trafficIpActiveFiveMinute +trafficIpActiveOneHour=v1/trafficIpActiveOneHour client_connect_timeout=300000 client_read_timeout=300000 @@ -547,9 +547,9 @@ domain_regexp=^(?=^.{3,255}$)[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\\.[a-zA-Z0-9][-a-zA- maat_json_send_size=20000 #\u5bfc\u5165\u9a8c\u8bc1\u7684\u7ebf\u7a0b\u6570\u91cf mulity_thread_size=5 -ntcRadiusReport=ntcRadiusReport -ntcCollectVoipLog=ntcCollectVoipLogs -ntcKeywordsUrlLog=ntcKeywordsUrlLogs +ntcRadiusReport=v2/ntcRadiusReport +ntcCollectVoipLog=v1/ntcCollectVoipLogs +ntcKeywordsUrlLog=v1/ntcKeywordsUrlLogs save_and_del_thread_size=5 #mysql \u5355\u4e2asql\u5927\u5c0f\u9650\u5236,\u6839\u636emariadb\u76f8\u5173\u53c2\u6570\u914d\u7f6e max_allowed_packet=1048576 @@ -569,44 +569,46 @@ ip_reuse_call_cgi_url=http://10.4.10.32:8090/command ipNumGet=IpNumGet allIpGet=AllIpGet #\u6d41\u91cf\u7edf\u8ba1\u5e26\u5bbd\u8be6\u60c5 -trafficBandwidthTrans=trafficBandwidthTrans -trafficProtocolList=trafficProtocolList +trafficBandwidthTrans=v1/trafficBandwidthTrans +trafficProtocolList=v1/trafficProtocolList irSnatLog=irSnatLogs irDnatLog=irDnatLogs -trafficBandwidthTrans=trafficBandwidthTrans -trafficProtocolList=trafficProtocolList -trafficAppList=trafficAppList -ntcActionEntranceReport=ntcActionEntranceReport +trafficBandwidthTransv1/=trafficBandwidthTrans +trafficProtocolList=v1/trafficProtocolList +trafficAppList=v1/trafficAppList +ntcActionEntranceReport=v1/ntcActionEntranceReport redis.host=10.0.4.2:6379 redis.expire=1800 redis.timeout=10000 dns_spoofing_ip_desc=Default Spoofing IP dns_spoofing_ip_ip=1.1.1.1 -trafficBandwidthTransTwo=trafficBandwidthTransTwo -trafficBandwidthTransThree=trafficBandwidthTransThree -trafficBandwidthTransFour=trafficBandwidthTransFour -ntcCollectRadiusLog=ntcCollectRadiusLogs -ntcConnRecordLog=ntcConnRecordLogs -ntcConnRecordPercent=ntcConnRecordPercent +trafficBandwidthTransTwo=v1/trafficBandwidthTransTwo +trafficBandwidthTransThree=v1/trafficBandwidthTransThree +trafficBandwidthTransFour=v1/trafficBandwidthTransFour +ntcCollectRadiusLog=v1/ntcCollectRadiusLogs +ntcConnRecordLog=v1/ntcConnRecordLogs +ntcConnRecordPercent=v1/ntcConnRecordPercent #\u5bfc\u51fa\u6700\u5927\u6761\u6570 maxLogExportSize=2000 pxy_crtl_subscribe_id_region=PXY_CTRL_SUBSCRIBE_ID ntc_subscribe_id_region=NTC_SUBSCRIBE_ID -ntcAsnRecord=ntcAsnRecord -ntcURLReport=ntcURLReport -ntcIpRangeReport=ntcIpRangeReport -trafficWebsiteListNoTime=trafficWebsiteListNoTime -trafficTopicList=trafficTopicList -trafficDomainTrans=trafficDomainTrans +ntcAsnRecord=v1/ntcAsnRecord +ntcURLReport=v1/ntcURLReport +ntcIpRangeReport=v1/ntcIpRangeReport +trafficWebsiteListNoTime=v1/trafficWebsiteListNoTime +trafficTopicList=v1/trafficTopicList +trafficDomainTrans=v1/trafficDomainTrans #maximum number to import import_limit=10 -trafficPortActiveFiveMinute=trafficPortActiveFiveMinute -trendTotalReport=trendTotalReport +trafficPortActiveFiveMinute=v1/trafficPortActiveFiveMinute +trendTotalReport=v1/trendTotalReport #\u4e8b\u4ef6\u76d1\u6d4b/\u5c01\u5835 -ntcEventsMonitorOrBlock=ntcEventsMonitorOrBlock +ntcEventsMonitorOrBlock=v1/ntcEventsMonitorOrBlock #\u91cd\u70b9\u4fdd\u969c\u4e8b\u4ef6 -ntcEventKeyProtection=ntcEventKeyProtection +ntcEventKeyProtection=v1/ntcEventKeyProtection dashboardUrlV2=http://10.0.7.14:9999/galaxy-service/service/log/v2/ -trafficAreaStat=trafficAreaStat -logServiceTopn=logServiceTopn -blockAndDropStat=blockAndDropStat \ No newline at end of file +trafficAreaStat=v1/trafficAreaStat +logServiceTopn=v1/logServiceTopn +blockAndDropStat=v1/blockAndDropStat +#配置启停接口 +configStartStop=v2/configStartStop From d1c808d8324d8b19fb4ff469017512a596d2f5b8 Mon Sep 17 00:00:00 2001 From: tanghao Date: Thu, 3 Jan 2019 17:07:51 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8Djpg=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/static/pages/scripts/echart.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 03e82deed..07ef36dbf 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -261,6 +261,9 @@ allowHTML:true, filename:'Active-IP'+addDateName(), chartOptions: { + chart:{ + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { @@ -509,6 +512,9 @@ filename:'App'+addDateName(), buttons: exportingButton('#415262'), chartOptions: { + chart:{ + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { From 3c28bb75143d25b529b21c9a2572f971b352614c Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Thu, 3 Jan 2019 18:10:05 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/configuration/AppFeatureIndex.java | 18 ------------------ .../com/nis/web/controller/BaseController.java | 7 ------- 2 files changed, 25 deletions(-) diff --git a/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java b/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java index 897304222..45ef53501 100644 --- a/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java +++ b/src/main/java/com/nis/domain/configuration/AppFeatureIndex.java @@ -133,23 +133,5 @@ public class AppFeatureIndex extends BaseCfg { public void setNumCfgList(List numCfgList) { this.numCfgList = numCfgList; } - public Integer getExprType() { - return exprType; - } - public void setExprType(Integer exprType) { - this.exprType = exprType; - } - public Integer getMatchMethod() { - return matchMethod; - } - public void setMatchMethod(Integer matchMethod) { - this.matchMethod = matchMethod; - } - public Integer getIsHexbin() { - return isHexbin; - } - public void setIsHexbin(Integer isHexbin) { - this.isHexbin = isHexbin; - } } diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 403430b37..0cdbfecec 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -2040,7 +2040,6 @@ public class BaseController { cfg.setBehavCode(Integer.parseInt(behaviorId)); } - AppFeatureIndex appfeature = new AppFeatureIndex(); BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"}); if(regionDict!=null){ @@ -2048,13 +2047,7 @@ public class BaseController { appfeature.setCfgRegionValue(regionDict.getConfigRegionValue()); appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType())); } - if(cfg.getDistrict().equals("L3_header")) { - appfeature.setIsHexbin(1); - appfeature.setExprType(3); - appfeature.setMatchMethod(0); - } appFeatureIndexs.add(appfeature); - ind++; } ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1")); From f7795f717286fb40136240c2f3beb4cbb181716b Mon Sep 17 00:00:00 2001 From: tanghao Date: Thu, 3 Jan 2019 18:11:00 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E5=AD=97=E4=BD=93=E4=B8=8D=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E6=A0=BC=E5=BC=8F=E5=8C=96=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/ntcTotalReportDetailList.jsp | 12 ++ .../dashboard/trafficActionTransList.jsp | 12 ++ .../views/dashboard/trafficAppTypeList.jsp | 12 +- .../views/dashboard/trafficDomainTrans.jsp | 12 ++ .../views/dashboard/trafficIpActiveList.jsp | 15 ++- .../views/dashboard/trafficPortActiveList.jsp | 12 ++ .../dashboard/trafficProtocolTypeList.jsp | 14 ++- .../views/dashboard/trafficWebTypeList.jsp | 12 +- .../highcharts/js/offline-exporting.js | 2 + .../webapp/static/pages/scripts/echart.js | 111 ++++++++++++++---- 10 files changed, 188 insertions(+), 26 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp index 8d8adf230..dbebb6f06 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/ntcTotalReportDetailList.jsp @@ -190,6 +190,18 @@ }, min:0 }, + tooltip: { + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } + }, credits : {//是否有highcharts水印 enabled : false }, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index b8ba528ed..21fd191f0 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -162,6 +162,18 @@ function showActionTransChart(xData,series){ }, min:0 }, + tooltip: { + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } + }, credits:{//是否有highcharts水印 enabled:false }, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp index f35b6cc27..889254622 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficAppTypeList.jsp @@ -449,7 +449,17 @@ function protocolTypeChart(rs){ }, tooltip: { headerFormat: '{series.name}
', - pointFormat: '{point.name}: {point.percentage:.2f}%' + pointFormat: '{point.name}: {point.percentage:.2f}%', + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } }, series: [{ name: "App", diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 1e5fae4a9..8721b2515 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -158,6 +158,18 @@ function showDomainTrans(xData,series){ legend: { enabled:false }, + tooltip: { + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } + }, plotOptions: { series: { lineWidth:1, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 6247cb800..a2932c3fd 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -250,8 +250,19 @@ function showIpActiveChart(xData,series){ } }, tooltip: { - pointFormat: ':{series.name} :{point.y}
' - }, + pointFormat: ':{series.name} :{point.y}
', + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } + + }, yAxis: { title: { text: 'bytes' diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp index 3e1f1f877..ee31c6193 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficPortActiveList.jsp @@ -188,6 +188,18 @@ function showPortActiveChart(xData,series){ text: 'bytes' } }, + tooltip: { + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } + }, credits:{//是否有highcharts水印 enabled:false }, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp index 4a4ad76a8..3f2d50484 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficProtocolTypeList.jsp @@ -442,8 +442,18 @@ function protocolTypeChart(rs){ }, tooltip: { headerFormat: '{series.name}
', - pointFormat: '{point.name}: {point.percentage:.2f}%' - }, + pointFormat: '{point.name}: {point.percentage:.2f}%', + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } + }, series: [{ name: "Protocol", colorByPoint: true, diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 61b103f9a..ee8af6dfd 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -535,7 +535,17 @@ function webTypeChart(rs){ }, tooltip: { headerFormat: '{series.name}
', - pointFormat: '{point.name}: {point.percentage:.2f}%' + pointFormat: '{point.name}: {point.percentage:.2f}%', + dateTimeLabelFormats: { + millisecond: '%Y-%m-%d %H:%M:%S', + second: '%Y-%m-%d %H:%M:%S', + minute: '%Y-%m-%d %H:%M:%S', + hour: '%Y-%m-%d %H:%M:%S', + day: '%Y-%m-%d %H:%M:%S', + week: '%Y-%m-%d %H:%M:%S', + month: '%Y-%m-%d %H:%M:%S', + year: '%Y-%m-%d %H:%M:%S' + } }, series: [{ name: "Domain", diff --git a/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js b/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js index 58f5440fb..ffec23b35 100644 --- a/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js +++ b/src/main/webapp/static/global/plugins/highcharts/js/offline-exporting.js @@ -285,9 +285,11 @@ License: www.highcharts.com/license downloadJPEG: { textKey: "downloadJPEG", onclick: function () { + this.legend.itemStyle.color='#000000' this.exportChartLocal({ type: "image/jpeg" }) + this.legend.itemStyle.color='#ffffff' } }, downloadSVG: { diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 07ef36dbf..3382c3405 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -4,10 +4,66 @@ chart: { events: { beforePrint: function () { + chart_main.xAxis[0].update({ + labels:{ + style:{ + color:'#000000' + } + } + }) + chart_3.xAxis[0].update({ + labels:{ + style:{ + color:'#000000' + } + } + }) + chart_main.yAxis[0].update({ + labels:{ + style:{ + color:'#000000' + } + } + }) + chart_3.yAxis[0].update({ + labels:{ + style:{ + color:'#000000' + } + } + }) $('.highcharts-legend text').css('color','#000000'); $('.highcharts-legend text').css('fill','#000000'); }, afterPrint: function () { + chart_3.xAxis[0].update({ + labels:{ + style:{ + color:'#ffffff' + } + } + }) + chart_main.xAxis[0].update({ + labels:{ + style:{ + color:'#ffffff' + } + } + }) + chart_main.yAxis[0].update({ + labels:{ + style:{ + color:'#ffffff' + } + } + }) + chart_3.yAxis[0].update({ + labels:{ + style:{ + color:'#ffffff' + } + } + }) $('.highcharts-legend text').css('color','#ffffff'); $('.highcharts-legend text').css('fill','#ffffff'); } @@ -67,6 +123,9 @@ allowHTML:true, filename:'Protocol-Type'+addDateName(), chartOptions: { + chart:{ + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { @@ -240,7 +299,7 @@ data: [pktNum,byteLen], });*/ }); - var chart = Highcharts.chart('chart_main', { + chart_main = Highcharts.chart('chart_main', { chart: { backgroundColor: 'rgba(255, 255, 255, 0)', plotBackgroundColor:null, @@ -268,25 +327,25 @@ series: { dataLabels: { enabled: true, - allowOverlap: true, // 允许数据标签重叠 - color:'#000000' - }, - }, - xAxis: [{ - labels: { - style: { - color: '#000000' - } + color:'#000000' } - }], - yAxis: [{ - labels: { - style: { - color: '#000000' - } + } + }, + xAxis: [{ + categories: xData, + labels: { + style: { + color: '#000000' } - }] - } + } + }], + yAxis: [{ + labels: { + style: { + color: '#000000' + } + } + }] }, buttons: { contextButton: { @@ -491,7 +550,7 @@ data: [pktNum,byteLen], });*/ }); - var chart = Highcharts.chart('chart_3',{ + chart_3 = Highcharts.chart('chart_3',{ chart: { backgroundColor: 'rgba(255, 255, 255, 0)', plotBackgroundColor:null, @@ -524,7 +583,7 @@ } }, xAxis: [{ - categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + categories: xData, labels: { style: { color: '#000000' @@ -691,6 +750,9 @@ function echart_2(rs){ allowHTML:true, filename:'BS'+addDateName(), chartOptions: { + chart:{ + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { @@ -844,6 +906,9 @@ function echart_5(rs){ allowHTML:true, filename:'BS'+addDateName(), chartOptions: { + chart:{ + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { @@ -992,6 +1057,9 @@ function echart_4(rs){ allowHTML:true, filename:'Website'+addDateName(), chartOptions: { + chart:{ + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { @@ -1139,6 +1207,9 @@ function echart_6(rs){ allowHTML:true, filename:'Website'+addDateName(), chartOptions: { + chart:{ + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { From d632670e453c27aac0b24272f3e3ad431178cef6 Mon Sep 17 00:00:00 2001 From: tanghao Date: Thu, 3 Jan 2019 18:32:45 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BB=A5=E5=8F=8A=E4=BC=98=E5=8C=96=E5=AF=BC?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/dashboard/trafficDomainTrans.jsp | 5 +++- .../webapp/static/pages/scripts/echart.js | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp index 8721b2515..a114bfc78 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficDomainTrans.jsp @@ -74,7 +74,10 @@ $(document).ready(function(){ total=rs[0].sum; series.push({ name: 'unique', - data: rs[0].result + data: rs[0].result, + marker: { + enabled: false + } }); }else{ series.push({ diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 3382c3405..28e80b01f 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -26,6 +26,12 @@ } }) chart_3.yAxis[0].update({ + title: { + style: {//设置字体颜色 + color: '#000000', + fontFamily:'Microsoft YaHei' + } + }, labels:{ style:{ color:'#000000' @@ -58,6 +64,12 @@ } }) chart_3.yAxis[0].update({ + title: { + style: {//设置字体颜色 + color: '#ffffff', + fontFamily:'Microsoft YaHei' + } + }, labels:{ style:{ color:'#ffffff' @@ -591,6 +603,14 @@ } }], yAxis: [{ + title: { + text: unit, + align:'high', + style: {//设置字体颜色 + color: '#000000', + fontFamily:'Microsoft YaHei' + } + }, labels: { style: { color: '#000000' @@ -1365,6 +1385,9 @@ function echart_topic_domain(rs){ allowHTML:true, filename:'Service'+addDateName(), chartOptions: { + chart: { + backgroundColor: 'rgba(255, 255, 255, 1)' + }, plotOptions: { series: { dataLabels: { From ec7e93504c286505a90a88629a26155739bbffc5 Mon Sep 17 00:00:00 2001 From: leijun Date: Thu, 3 Jan 2019 18:44:13 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=8A=A5=E8=A1=A8Excel?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=B0=83=E6=95=B4=E4=B8=BA=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/util/excel/ExportExcel.java | 55 +++++++++++ .../nis/web/controller/BaseController.java | 18 ++++ .../controller/report/ExportController.java | 29 ++++++ .../webapp/WEB-INF/include/form/pageGroup.jsp | 8 +- src/main/webapp/WEB-INF/views/report/list.jsp | 91 +++++++++++++++++-- .../webapp/static/pages/scripts/pageLogs.js | 22 ++++- 6 files changed, 210 insertions(+), 13 deletions(-) create mode 100644 src/main/java/com/nis/web/controller/report/ExportController.java diff --git a/src/main/java/com/nis/util/excel/ExportExcel.java b/src/main/java/com/nis/util/excel/ExportExcel.java index 4976e264c..f1925e545 100644 --- a/src/main/java/com/nis/util/excel/ExportExcel.java +++ b/src/main/java/com/nis/util/excel/ExportExcel.java @@ -2616,5 +2616,60 @@ public class ExportExcel { log.debug("Export success."); */ } + + + public ExportExcel ajaxDataList(List>dataMap,String code){ + for (int i = 0; i < dataMap.size(); i++) { + Row row = this.addRow(sheets.get(code),rownums.get(code),code); + int colunm = 0; + List list=dataMap.get(i); + for (int j = 0; j < list.size(); j++) { + this.addCell(row, colunm++,list.get(j), 0,null); + } + } + return this; + } + + + public ExportExcel(String titleName,String code,String titleTime,List headerList){ + this.wb = new SXSSFWorkbook(500); + int j=0; + sheets=new HashMap<>(); + rownums=new HashMap<>(); + Sheet sheet = wb.createSheet(titleName); + if(!StringUtils.isEmpty(titleTime)){ + rownums.put(code, 1); + }else{ + rownums.put(code, 0); + } + sheets.put(code, sheet); + this.styles = createStyles(wb); + if(!StringUtils.isEmpty(titleTime)){ + //添加一行数据 + CellRangeAddress callRangeAddress = new CellRangeAddress(0,0,0,headerList.size()-1); + CellStyle style = styles.get("data"); + Row timeRow = sheet.createRow(0); + timeRow.setHeightInPoints(16); + Cell cellt = timeRow.createCell(0); + cellt.setCellValue(titleTime); + sheet.addMergedRegion(callRangeAddress); + sheet.autoSizeColumn(0); + setBorderStyle(CellStyle.BORDER_THIN,callRangeAddress,sheet,wb); + } + Integer rownum=rownums.get(code); + Row headerRow = sheet.createRow(rownum++); + headerRow.setHeightInPoints(16); + for (int i = 0; i < headerList.size(); i++) { + Cell cell = headerRow.createCell(i); + cell.setCellStyle(styles.get("header")); + cell.setCellValue(headerList.get(i)); + sheet.autoSizeColumn(i); + } + for (int i = 0; i < headerList.size(); i++) { + int colWidth = sheet.getColumnWidth(i)*2; + sheet.setColumnWidth(i, colWidth < 3000 ? 3000 : colWidth); + } + j++; + } } diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 0cdbfecec..f850b9f5f 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -2277,6 +2277,24 @@ public class BaseController { ByteArrayOutputStream out = new ByteArrayOutputStream(); ExcelCsv.writeCSVFile(response,titleList,headMap,dataList,fileName,titleTime,msgProp); } + + + public void _ajaxExport(HttpServletRequest request, HttpServletResponse response, + String code,String titleTime,List headerList, List> dataList) + throws Exception{ + Properties msgProp = getMsgProp(); + String fileName = msgProp.getProperty(code, code) + "_" + DateUtils.getDate("yyyyMMddHHmmss") + + ".xlsx"; + fileName = fileName.replaceAll(" ", "_"); + if (request.getHeader("User-Agent").toUpperCase().indexOf("MSIE") > 0) { + fileName = URLEncoder.encode(fileName, "UTF-8"); + } else { + fileName = new String(fileName.getBytes("UTF-8"), "ISO8859-1"); + } + new ExportExcel(msgProp.getProperty(code, code),code,titleTime, headerList).ajaxDataList(dataList, code).write(response, fileName).dispose(); + + } + public String initLogMap(BaseLogEntity log,String title){ Properties msgProp = getMsgProp(); String logTime=msgProp.getProperty(title,title);; diff --git a/src/main/java/com/nis/web/controller/report/ExportController.java b/src/main/java/com/nis/web/controller/report/ExportController.java new file mode 100644 index 000000000..9d1b30b51 --- /dev/null +++ b/src/main/java/com/nis/web/controller/report/ExportController.java @@ -0,0 +1,29 @@ +package com.nis.web.controller.report; + +import java.util.List; +import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang.StringEscapeUtils; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import com.nis.web.controller.BaseController; +import net.sf.json.JSONObject; + +@Controller +@RequestMapping("${adminPath}/export") +public class ExportController extends BaseController { + + @RequestMapping(value = "ajaxExport") + public void ajaxExport(String exports,HttpServletRequest request,HttpServletResponse response) throws Exception{ + JSONObject jsonObject = JSONObject.fromObject(StringEscapeUtils.unescapeHtml(exports)); + Map map=JSONObject.fromObject(jsonObject); + List> list=(List>) map.get("book"); + List heard=(List) map.get("heard"); + String titleTime=String.valueOf(map.get("titleTime")); + String titleCode=String.valueOf(map.get("titleCode")); + _ajaxExport(request,response,titleCode, titleTime, heard, list); + } + +} + diff --git a/src/main/webapp/WEB-INF/include/form/pageGroup.jsp b/src/main/webapp/WEB-INF/include/form/pageGroup.jsp index 4ae88a92c..da4255d80 100644 --- a/src/main/webapp/WEB-INF/include/form/pageGroup.jsp +++ b/src/main/webapp/WEB-INF/include/form/pageGroup.jsp @@ -1,7 +1,7 @@ <%@ page contentType="text/html;charset=UTF-8"%> <%@ include file="/WEB-INF/include/taglib.jsp"%>