国际化

更改:
intercept_intensity
新增:
default_value=Default Value
intercept=Intercept
修改部分导出提示信息
This commit is contained in:
duandongmei
2018-11-01 19:38:53 +08:00
parent 43fbee90a0
commit 7808f09f1c
4 changed files with 1118 additions and 1057 deletions

View File

@@ -144,14 +144,15 @@ public class ExportExcel {
}
}
public String[] validRegionFieldAndSetComment(String headerStr,String commentStr,FunctionRegionDict region,FunctionServiceDict service,Properties msgProp){
String defaultValue="";
int index=0;
String[] titleInfo=new String[3];
//p2p_hash_type
if("p2p_hash_type".equals(headerStr)){
commentStr="";
List<SysDataDictionaryItem> ratelimit=DictUtils.getDictList("P2P_HASH_TYPE");
if(ratelimit !=null && ratelimit.size()>0){
for (SysDataDictionaryItem sysDataDictionaryItem : ratelimit) {
List<SysDataDictionaryItem> p2pHashType=DictUtils.getDictList("P2P_HASH_TYPE");
if(p2pHashType !=null && p2pHashType.size()>0){
for (SysDataDictionaryItem sysDataDictionaryItem : p2pHashType) {
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+sysDataDictionaryItem.getItemValue()+"\n";
index++;
@@ -167,20 +168,25 @@ public class ExportExcel {
//p2p_ip_config_type
if("p2p_ip_config_type".equals(headerStr)){
commentStr="";
List<SysDataDictionaryItem> ratelimit=DictUtils.getDictList("P2P_IP_TYPE");
if(ratelimit !=null && ratelimit.size()>0){
for (SysDataDictionaryItem sysDataDictionaryItem : ratelimit) {
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+sysDataDictionaryItem.getItemValue()+"\n";
index++;
}else{
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+"\n";
index++;
}
List<SysDataDictionaryItem> p2pIpType=DictUtils.getDictList("P2P_IP_TYPE");
if(p2pIpType !=null && p2pIpType.size()>0){
for (SysDataDictionaryItem sysDataDictionaryItem : p2pIpType) {
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+"\n";
index++;
}
defaultValue=p2pIpType.get(0).getItemCode()+""+msgProp.getProperty(p2pIpType.get(0).getItemValue(),p2pIpType.get(0).getItemValue())+"";
}
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
index++;
index++;
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
index++;
if(!StringUtil.isEmpty(defaultValue)){
//2、默认值说明
commentStr=commentStr+""+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
index++;
}
}
//ratelimit
if("ratelimit".equals(headerStr)){
@@ -188,39 +194,51 @@ public class ExportExcel {
List<SysDataDictionaryItem> ratelimit=DictUtils.getDictList("RATE_LIMIT");
if(ratelimit !=null && ratelimit.size()>0){
for (SysDataDictionaryItem sysDataDictionaryItem : ratelimit) {
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"\n";
commentStr=commentStr+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+"\n";
index++;
}else{
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"\n";
index++;
}
}
defaultValue=ratelimit.get(0).getItemCode();
}
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
index++;
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
index++;
if(!StringUtil.isEmpty(defaultValue)){
//2、默认值说明
commentStr=commentStr+""+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
index++;
index++;
}
}
//replace_zone
//intercept replace replace_zone
if("replace_zone".equals(headerStr)){
commentStr="";
List<SysDataDictionaryItem> interceptReplaceZone=DictUtils.getDictList("INTERCEPT_REPLACE_ZONE");
if(interceptReplaceZone !=null && interceptReplaceZone.size()>0){
for (SysDataDictionaryItem sysDataDictionaryItem : interceptReplaceZone) {
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+sysDataDictionaryItem.getItemValue()+"\n";
index++;
}else{
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+"\n";
index++;
}
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+"\n";
index++;
}
defaultValue=interceptReplaceZone.get(0).getItemCode()+""+msgProp.getProperty(interceptReplaceZone.get(0).getItemValue(),interceptReplaceZone.get(0).getItemValue())+"";
}
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
index++;
index++;
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
index++;
if(!StringUtil.isEmpty(defaultValue)){
//2、默认值说明
commentStr=commentStr+""+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
index++;
index++;
}
}
if("asn_no".equals(headerStr)){
commentStr=msgProp.getProperty("input_integer")+":\n"+commentStr;
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
index++;
//2、数值类型
commentStr=commentStr+""+msgProp.getProperty("input_integer")+"\n";
index++;
}
if("policy_name".equals(headerStr)){
@@ -232,6 +250,7 @@ public class ExportExcel {
List<DnsResStrategy> resStrategys=dnsResStrategyDao.findList(null, 1,1);
commentStr=commentStr+"0"+""+msgProp.getProperty("no_strategy")+"\n";
index++;
defaultValue="0"+""+msgProp.getProperty("no_strategy")+"";
if(!StringUtil.isEmpty(resStrategys)){
for (DnsResStrategy dnsResStrategy : resStrategys) {
commentStr=commentStr+dnsResStrategy.getCfgId()+""+dnsResStrategy.getCfgDesc()+"\n";
@@ -245,8 +264,41 @@ public class ExportExcel {
}else{
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
index++;
index++;
commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
index++;
if(!StringUtil.isEmpty(defaultValue)){
//2、默认值说明
commentStr=commentStr+""+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
index++;
}
}
}
if("antiddos_protocol".equals(headerStr)) {
commentStr="";
List<SysDataDictionaryItem> antiddosProtocol=DictUtils.getDictList("ANTIDDOS_PROTOCOL");
if(antiddosProtocol !=null && antiddosProtocol.size()>0){
for (SysDataDictionaryItem sysDataDictionaryItem : antiddosProtocol) {
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+sysDataDictionaryItem.getItemValue()+"\n";
index++;
}else{
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+""+msgProp.getProperty(sysDataDictionaryItem.getItemValue())+"\n";
index++;
}
}
}
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
index++;
}
if("bps_threadshold".equals(headerStr)){
commentStr=msgProp.getProperty("input_integer")+":\n"+commentStr;
index++;
}
if("pps_threadshold".equals(headerStr)){
commentStr=msgProp.getProperty("input_integer")+":\n"+commentStr;
index++;
}
if(region.getRegionType().equals(1)){//IP配置
//ip配置需要导入的信息srcIp srcPort destIp destPort Protocol Direction
//确定需要导入的srcIp srcPort destIp destPort信息