业务配置导出首行增加标题和时间范围
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -64,6 +64,7 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* 特定协议相关配置控制类
|
||||
*
|
||||
* @author zhangwei
|
||||
*
|
||||
*/
|
||||
@@ -72,48 +73,58 @@ import com.nis.web.security.UserUtils;
|
||||
public class AppFeatureCfgController extends BaseController {
|
||||
/**
|
||||
* app协议复杂特征配置列表
|
||||
*
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"multiFeatureCfgList"})
|
||||
public String multiFeatureCfgList(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppFeatureIndex> searchPage=new Page<AppFeatureIndex>(request,response,"r");
|
||||
@RequestMapping(value = { "multiFeatureCfgList" })
|
||||
public String multiFeatureCfgList(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
Page<AppFeatureIndex> searchPage = new Page<AppFeatureIndex>(request, response, "r");
|
||||
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg);
|
||||
for(AppFeatureIndex entity:page.getList()){
|
||||
for (AppFeatureIndex entity : page.getList()) {
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
entity.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/app/appMultiFeatureCfgList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置表单
|
||||
*
|
||||
* @param model
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"multiFeatureCfgForm"})
|
||||
public String multiFeatureCfgForm(Model model,String ids,AppFeatureIndex entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
@RequestMapping(value = { "multiFeatureCfgForm" })
|
||||
public String multiFeatureCfgForm(Model model, String ids, AppFeatureIndex entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(ids));
|
||||
entity.setIpPortList(appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
||||
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
||||
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
||||
entity.setNumCfgList(appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
entity.setIpPortList(
|
||||
appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
||||
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(),
|
||||
entity.getFunctionId(), null));
|
||||
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(),
|
||||
entity.getFunctionId(), null));
|
||||
entity.setNumCfgList(
|
||||
appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(), null));
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/app/appMultiFeatureCfgForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置新增修改
|
||||
*
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
@@ -121,29 +132,32 @@ public class AppFeatureCfgController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"saveAppMultiFeatureCfg"})
|
||||
public String saveAppMultiFeatureCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
AppFeatureIndex entity,RedirectAttributes redirectAttributes) {
|
||||
@RequestMapping(value = { "saveAppMultiFeatureCfg" })
|
||||
public String saveAppMultiFeatureCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
AppFeatureIndex entity, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(specificService!=null){
|
||||
SpecificServiceCfg specificService = specificServiceCfgService
|
||||
.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if (specificService != null) {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity);
|
||||
addMessage(redirectAttributes,"success", "save_success");
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+entity.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置审核
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
@@ -151,19 +165,14 @@ public class AppFeatureCfgController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"auditAppFeatureCfg"})
|
||||
public String auditAppFeatureCfg(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
@RequestMapping(value = { "auditAppFeatureCfg" })
|
||||
public String auditAppFeatureCfg(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg, Integer isValid,
|
||||
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
AppFeatureIndex entity = new AppFeatureIndex();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
for (String id : idArray) {
|
||||
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
@@ -171,247 +180,264 @@ public class AppFeatureCfgController extends BaseController {
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
appMultiFeatureCfgService.auditAppFeatureCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
logger.error("app 特征配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("app 特征配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
} else {
|
||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
Page<AppPolicyCfg> auditPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
|
||||
try {
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return multiFeatureCfgList(model, cfg, request, response);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+functionId;
|
||||
|
||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 特征配置删除
|
||||
*
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"updateAppFeatureCfgValid"})
|
||||
public String updateAppFeatureCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+functionId;
|
||||
@RequestMapping(value = { "updateAppFeatureCfgValid" })
|
||||
public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询特征子配置
|
||||
*
|
||||
* @param model
|
||||
* @param cfgId
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"ajaxAppFeatureList"})
|
||||
public String ajaxAppFeatureList(Model model,Long cfgId,Integer compileId,Integer functionId,Integer index) {
|
||||
List<AppIpCfg> ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId,functionId);
|
||||
@RequestMapping(value = { "ajaxAppFeatureList" })
|
||||
public String ajaxAppFeatureList(Model model, Long cfgId, Integer compileId, Integer functionId, Integer index) {
|
||||
List<AppIpCfg> ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId, functionId);
|
||||
AppFeatureIndex cfg = appMultiFeatureCfgService.getAppFeatureIndex(cfgId);
|
||||
List<Map<String,Object>> tabList = new ArrayList();
|
||||
List<Map<String, Object>> tabList = new ArrayList();
|
||||
String[] cfgRegionValue = cfg.getCfgRegionValue().split(",");
|
||||
String[] cfgRegionType = cfg.getCfgRegionType().split(",");
|
||||
String[] cfgRegionCode = cfg.getCfgRegionCode1().split(",");
|
||||
if(cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length==cfgRegionCode.length){
|
||||
for(int i=0;i<cfgRegionValue.length;i++){
|
||||
Map<String,Object> map = new HashMap();
|
||||
if (cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length == cfgRegionCode.length) {
|
||||
for (int i = 0; i < cfgRegionValue.length; i++) {
|
||||
Map<String, Object> map = new HashMap();
|
||||
map.put("regionType", cfgRegionType[i]);
|
||||
map.put("regionValue", cfgRegionValue[i]);
|
||||
if("1".equals(cfgRegionType[i])){
|
||||
if ("1".equals(cfgRegionType[i])) {
|
||||
map.put("ipRangeList", ipRangeList);
|
||||
}
|
||||
if("2".equals(cfgRegionType[i])){
|
||||
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
||||
if ("2".equals(cfgRegionType[i])) {
|
||||
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,
|
||||
functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||
map.put("strList", strList);
|
||||
}
|
||||
if("3".equals(cfgRegionType[i])){
|
||||
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService.getAppComplexFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
||||
if ("3".equals(cfgRegionType[i])) {
|
||||
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService
|
||||
.getAppComplexFeatureCfg(compileId, functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||
map.put("complexList", complexList);
|
||||
}
|
||||
if("4".equals(cfgRegionType[i])){
|
||||
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
||||
if ("4".equals(cfgRegionType[i])) {
|
||||
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId, functionId,
|
||||
Integer.valueOf(cfgRegionCode[i]));
|
||||
map.put("numCfgList", numCfgList);
|
||||
}
|
||||
tabList.add(map);
|
||||
}
|
||||
}else{
|
||||
Map<String,Object> map = new HashMap();
|
||||
} else {
|
||||
Map<String, Object> map = new HashMap();
|
||||
map.put("regionType", "0");
|
||||
map.put("regionValue", "query config detail error");
|
||||
tabList.add(map);
|
||||
}
|
||||
|
||||
/*if(ipRangeList!=null){
|
||||
String cfgType = null;
|
||||
for(AppIpCfg ip:ipRangeList){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(strList!=null){
|
||||
String cfgType = null;
|
||||
for(AppStringFeatureCfg cfg:strList){
|
||||
if(!cfg.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",cfg.getCfgType()});
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(complexList!=null){
|
||||
String cfgType = null;
|
||||
for(AppComplexFeatureCfg cfg:complexList){
|
||||
if(!cfg.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"3",cfg.getCfgType()});
|
||||
cfgType = cfg.getCfgType();0.
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
/*
|
||||
* if(ipRangeList!=null){ String cfgType = null; for(AppIpCfg
|
||||
* ip:ipRangeList){ if(!ip.getCfgType().equals(cfgType)){
|
||||
* tabList.add(new String[]{"1",ip.getCfgType()}); cfgType =
|
||||
* ip.getCfgType(); } } } if(strList!=null){ String cfgType = null;
|
||||
* for(AppStringFeatureCfg cfg:strList){
|
||||
* if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new
|
||||
* String[]{"2",cfg.getCfgType()}); cfgType = cfg.getCfgType(); } } }
|
||||
* if(complexList!=null){ String cfgType = null;
|
||||
* for(AppComplexFeatureCfg cfg:complexList){
|
||||
* if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new
|
||||
* String[]{"3",cfg.getCfgType()}); cfgType = cfg.getCfgType();0.
|
||||
*
|
||||
* } } }
|
||||
*/
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/app/appSubFeatureList";
|
||||
}
|
||||
|
||||
//appfeature配置导出
|
||||
|
||||
// appfeature配置导出
|
||||
@RequestMapping(value = "exportFeature")
|
||||
public void exportFeature(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")AppFeatureIndex entity,String ids,RedirectAttributes redirectAttributes){
|
||||
public void exportFeature(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") AppFeatureIndex entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<AppFeatureIndex> ipLists=new ArrayList<AppFeatureIndex>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=appMultiFeatureCfgService.findAppByFeatureIndexList(ids);
|
||||
}else{
|
||||
Page<AppFeatureIndex> pageInfo=new Page<AppFeatureIndex>(request, response,"r");
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<AppFeatureIndex> ipLists = new ArrayList<AppFeatureIndex>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = appMultiFeatureCfgService.findAppByFeatureIndexList(ids);
|
||||
} else {
|
||||
Page<AppFeatureIndex> pageInfo = new Page<AppFeatureIndex>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
for(AppFeatureIndex feature:ipLists){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId());
|
||||
feature.setAppName(app.getSpecServiceName());
|
||||
|
||||
for (AppFeatureIndex feature : ipLists) {
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId());
|
||||
feature.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
String cfgIndexInfoNoExport = ",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String appComplexNoExport = ",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class);
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<AppComplexFeatureCfg> keywordList = new ArrayList<AppComplexFeatureCfg>();
|
||||
List<AppStringFeatureCfg> strList = new ArrayList<AppStringFeatureCfg>();
|
||||
for (AppFeatureIndex cfg : ipLists) {
|
||||
Map<String, List> maps = appMultiFeatureCfgService.exportFeature(cfg);
|
||||
if (entity.getFunctionId() != 567) {
|
||||
keywordList.addAll(maps.get("APP_KEYWORDS"));
|
||||
} else {
|
||||
strList.addAll(maps.get("APP_DK_GL"));
|
||||
}
|
||||
String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String appComplexNoExport=",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class);
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<AppComplexFeatureCfg> keywordList=new ArrayList<AppComplexFeatureCfg>();
|
||||
List<AppStringFeatureCfg> strList=new ArrayList<AppStringFeatureCfg>();
|
||||
for (AppFeatureIndex cfg : ipLists) {
|
||||
Map<String, List> maps=appMultiFeatureCfgService.exportFeature(cfg);
|
||||
if(entity.getFunctionId()!=567){
|
||||
keywordList.addAll(maps.get("APP_KEYWORDS"));
|
||||
}else{
|
||||
strList.addAll(maps.get("APP_DK_GL"));
|
||||
}
|
||||
ipList.addAll(maps.get("APP_IP_RANGE"));
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
if(entity.getFunctionId()!=564 && entity.getFunctionId()!=567 ){
|
||||
keywordList=replaceKeyList(keywordList);
|
||||
titleList.add("APP_IP_RANGE");
|
||||
classMap.put("APP_IP_RANGE", IpPortCfg.class);
|
||||
noExportMap.put("APP_IP_RANGE",ipPortInfoNoExport);
|
||||
dataMap.put("APP_IP_RANGE", ipList);
|
||||
}
|
||||
if(entity.getFunctionId()==563){
|
||||
titleList.add("APP_PAYLOAD");
|
||||
classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_PAYLOAD",appComplexNoExport);
|
||||
dataMap.put("APP_PAYLOAD", keywordList);
|
||||
}else if(entity.getFunctionId()==565){
|
||||
titleList.add("APP_HTTP");
|
||||
classMap.put("APP_HTTP", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_HTTP",appComplexNoExport);
|
||||
dataMap.put("APP_HTTP", keywordList);
|
||||
}else if(entity.getFunctionId()==566){
|
||||
titleList.add("APP_SSL");
|
||||
classMap.put("APP_SSL", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_SSL",appComplexNoExport);
|
||||
dataMap.put("APP_SSL", keywordList);
|
||||
}else if(entity.getFunctionId()==564){
|
||||
keywordList=replaceKeyList(keywordList);
|
||||
titleList.add("APP_DNS");
|
||||
classMap.put("APP_DNS", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_DNS",appComplexNoExport);
|
||||
dataMap.put("APP_DNS", keywordList);
|
||||
}else if(entity.getFunctionId()==567){
|
||||
strList=replaceFeatureList(strList);
|
||||
appComplexNoExport=appComplexNoExport+"district,";
|
||||
titleList.add("APP_DK");
|
||||
classMap.put("APP_DK", AppStringFeatureCfg.class);
|
||||
noExportMap.put("APP_DK",appComplexNoExport);
|
||||
dataMap.put("APP_DK", strList);
|
||||
}
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
ipList.addAll(maps.get("APP_IP_RANGE"));
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
if (entity.getFunctionId() != 564 && entity.getFunctionId() != 567) {
|
||||
keywordList = replaceKeyList(keywordList);
|
||||
titleList.add("APP_IP_RANGE");
|
||||
classMap.put("APP_IP_RANGE", IpPortCfg.class);
|
||||
noExportMap.put("APP_IP_RANGE", ipPortInfoNoExport);
|
||||
dataMap.put("APP_IP_RANGE", ipList);
|
||||
}
|
||||
if (entity.getFunctionId() == 563) {
|
||||
titleList.add("APP_PAYLOAD");
|
||||
classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_PAYLOAD", appComplexNoExport);
|
||||
dataMap.put("APP_PAYLOAD", keywordList);
|
||||
} else if (entity.getFunctionId() == 565) {
|
||||
titleList.add("APP_HTTP");
|
||||
classMap.put("APP_HTTP", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_HTTP", appComplexNoExport);
|
||||
dataMap.put("APP_HTTP", keywordList);
|
||||
} else if (entity.getFunctionId() == 566) {
|
||||
titleList.add("APP_SSL");
|
||||
classMap.put("APP_SSL", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_SSL", appComplexNoExport);
|
||||
dataMap.put("APP_SSL", keywordList);
|
||||
} else if (entity.getFunctionId() == 564) {
|
||||
keywordList = replaceKeyList(keywordList);
|
||||
titleList.add("APP_DNS");
|
||||
classMap.put("APP_DNS", AppComplexFeatureCfg.class);
|
||||
noExportMap.put("APP_DNS", appComplexNoExport);
|
||||
dataMap.put("APP_DNS", keywordList);
|
||||
} else if (entity.getFunctionId() == 567) {
|
||||
strList = replaceFeatureList(strList);
|
||||
appComplexNoExport = appComplexNoExport + "district,";
|
||||
titleList.add("APP_DK");
|
||||
classMap.put("APP_DK", AppStringFeatureCfg.class);
|
||||
noExportMap.put("APP_DK", appComplexNoExport);
|
||||
dataMap.put("APP_DK", strList);
|
||||
}
|
||||
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Appfeature export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
logger.error("Appfeature export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
public static List<AppComplexFeatureCfg> replaceKeyList(List<AppComplexFeatureCfg> list){
|
||||
|
||||
public static List<AppComplexFeatureCfg> replaceKeyList(List<AppComplexFeatureCfg> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
AppComplexFeatureCfg base=(AppComplexFeatureCfg)list.get(i);
|
||||
AppComplexFeatureCfg base = (AppComplexFeatureCfg) list.get(i);
|
||||
base.setIsHex(base.getIsHexbin());
|
||||
base.setIsCaseInsenstive(base.getIsHexbin());
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
|
||||
}
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " "));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public static List<AppStringFeatureCfg> replaceFeatureList(List<AppStringFeatureCfg> list){
|
||||
|
||||
public static List<AppStringFeatureCfg> replaceFeatureList(List<AppStringFeatureCfg> list) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
AppStringFeatureCfg base=(AppStringFeatureCfg)list.get(i);
|
||||
AppStringFeatureCfg base = (AppStringFeatureCfg) list.get(i);
|
||||
base.setIsHex(base.getIsHexbin());
|
||||
base.setIsCaseInsenstive(base.getIsHexbin());
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
|
||||
}
|
||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " "));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* 基础协议控制类
|
||||
*
|
||||
* @author wx
|
||||
*
|
||||
*/
|
||||
@@ -43,52 +44,57 @@ import com.nis.web.security.UserUtils;
|
||||
public class BasicProtocolController extends BaseController {
|
||||
/**
|
||||
* app策略列表
|
||||
*
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"list"})
|
||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
@RequestMapping(value = { "list" })
|
||||
public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(app!=null) {
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app =
|
||||
// specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(app!=null) {
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/basicprotocol/list";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询APP策略IP子配置
|
||||
*
|
||||
* @param model
|
||||
* @param cfgId
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"ajaxIpList"})
|
||||
public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId,compileId);
|
||||
@RequestMapping(value = { "ajaxIpList" })
|
||||
public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getIpPortList()!=null){
|
||||
if (cfg.getIpPortList() != null) {
|
||||
String cfgType = null;
|
||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!ntc.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
||||
for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) {
|
||||
if (!ntc.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", ntc.getCfgType() });
|
||||
cfgType = ntc.getCfgType();
|
||||
}
|
||||
}
|
||||
@@ -98,27 +104,31 @@ public class BasicProtocolController extends BaseController {
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/basicprotocol/basicProtocolSubList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置表单
|
||||
*
|
||||
* @param model
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"form"})
|
||||
@RequiresPermissions(value={"basicprotocol:config"})
|
||||
public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null);
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
@RequestMapping(value = { "form" })
|
||||
@RequiresPermissions(value = { "basicprotocol:config" })
|
||||
public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null);
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/basicprotocol/form";
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置新增修改
|
||||
*
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
@@ -126,34 +136,37 @@ public class BasicProtocolController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"save"})
|
||||
@RequiresPermissions(value={"basicprotocol:config"})
|
||||
public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
AppPolicyCfg entity,RedirectAttributes redirectAttributes) {
|
||||
@RequestMapping(value = { "save" })
|
||||
@RequiresPermissions(value = { "basicprotocol:config" })
|
||||
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(specificService!=null){
|
||||
SpecificServiceCfg specificService = specificServiceCfgService
|
||||
.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if (specificService != null) {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("基础协议信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
// addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
logger.error("基础协议信息保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
// addMessage(redirectAttributes,e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else if (e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+entity.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置审核
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
@@ -161,21 +174,16 @@ public class BasicProtocolController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"audit"})
|
||||
@RequiresPermissions(value={"basicprotocol:confirm"})
|
||||
public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
@RequestMapping(value = { "audit" })
|
||||
@RequiresPermissions(value = { "basicprotocol:confirm" })
|
||||
public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid,
|
||||
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
AppPolicyCfg entity = new AppPolicyCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null);
|
||||
for (String id : idArray) {
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
@@ -183,138 +191,167 @@ public class BasicProtocolController extends BaseController {
|
||||
entity.setFunctionId(functionId);
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
appCfgService.auditAppPolicyCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
if (e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("app策略配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
logger.info("app策略配置下发失败:" + e.getMessage());
|
||||
;
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
e.printStackTrace();
|
||||
logger.error("app策略配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
logger.error("app策略配置下发失败", e);
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
} else {
|
||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
Page<AppPolicyCfg> auditPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return policyCfgList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置删除
|
||||
*
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"updateValid"})
|
||||
@RequiresPermissions(value={"basicprotocol:config"})
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
@RequestMapping(value = { "updateValid" })
|
||||
@RequiresPermissions(value = { "basicprotocol:config" })
|
||||
public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("基础协议信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
logger.error("基础协议信息保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else if (e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||
} else {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "exportIpAddr")
|
||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")AppPolicyCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
List<AppPolicyCfg> ipLists=new ArrayList<AppPolicyCfg>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=appCfgService.findAppByPolicyList(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
for(AppPolicyCfg policy:ipLists){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
|
||||
if(app!=null) {
|
||||
policy.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport=",encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String subscribeInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
||||
for (AppPolicyCfg cfg : ipLists) {
|
||||
AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
}
|
||||
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("ip addr export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "exportIpAddr")
|
||||
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") AppPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<AppPolicyCfg> ipLists = new ArrayList<AppPolicyCfg>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = appCfgService.findAppByPolicyList(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<AppPolicyCfg> pageInfo = new Page<AppPolicyCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
for (AppPolicyCfg policy : ipLists) {
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
|
||||
if (app != null) {
|
||||
policy.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String subscribeInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
for (AppPolicyCfg cfg : ipLists) {
|
||||
AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
}
|
||||
subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("ip addr export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* 加密隧道行为控制类
|
||||
*
|
||||
* @author wx
|
||||
*
|
||||
*/
|
||||
@@ -45,103 +46,117 @@ import com.nis.web.security.UserUtils;
|
||||
public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
/**
|
||||
* app策略列表
|
||||
*
|
||||
* @param model
|
||||
* @param cfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"list"})
|
||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
@RequestMapping(value = { "list" })
|
||||
public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(app!=null) {
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
// }
|
||||
// //查找社交应用的所有有效二级特定服务
|
||||
// SpecificServiceCfg second=new SpecificServiceCfg();
|
||||
// for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
||||
// second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// second.setIsValid(Constants.VALID_YES);
|
||||
// second.setIsLeaf(1);
|
||||
// List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
// //遍历,找到匹配项后将行为设置进去
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// if(entity.getBehavCode()==null) continue;
|
||||
// for(SpecificServiceCfg secondCfg:secondList) {
|
||||
// if(secondCfg.getSpecServiceCode()==null) continue;
|
||||
// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) {
|
||||
// entity.setBehavName(secondCfg.getSpecServiceName());
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// SpecificServiceCfg app =
|
||||
// specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
// if(app!=null) {
|
||||
// entity.setAppName(app.getSpecServiceName());
|
||||
// }
|
||||
// }
|
||||
// //查找社交应用的所有有效二级特定服务
|
||||
// SpecificServiceCfg second=new SpecificServiceCfg();
|
||||
// for(SysDataDictionaryItem
|
||||
// dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue()))
|
||||
// {
|
||||
// second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// second.setIsValid(Constants.VALID_YES);
|
||||
// second.setIsLeaf(1);
|
||||
// List<SpecificServiceCfg>
|
||||
// secondList=specificServiceCfgService.findAllSpecificServiceCfg(second,
|
||||
// null);
|
||||
// //遍历,找到匹配项后将行为设置进去
|
||||
// for(AppPolicyCfg entity:page.getList()){
|
||||
// if(entity.getBehavCode()==null) continue;
|
||||
// for(SpecificServiceCfg secondCfg:secondList) {
|
||||
// if(secondCfg.getSpecServiceCode()==null) continue;
|
||||
// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue())
|
||||
// {
|
||||
// entity.setBehavName(secondCfg.getSpecServiceName());
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/encryptedtunnelbehav/list";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询APP策略IP子配置
|
||||
*
|
||||
* @param model
|
||||
* @param cfgId
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"ajaxIpList"})
|
||||
public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId,compileId);
|
||||
@RequestMapping(value = { "ajaxIpList" })
|
||||
public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getIpPortList()!=null){
|
||||
if (cfg.getIpPortList() != null) {
|
||||
String cfgType = null;
|
||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!ntc.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
||||
for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) {
|
||||
if (!ntc.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", ntc.getCfgType() });
|
||||
cfgType = ntc.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/encryptedtunnelbehav/encrypedTunnelSubList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置表单
|
||||
*
|
||||
* @param model
|
||||
* @param ids
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"form"})
|
||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
||||
public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null);
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
@RequestMapping(value = { "form" })
|
||||
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
||||
public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null);
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/encryptedtunnelbehav/form";
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置新增修改
|
||||
*
|
||||
* @param model
|
||||
* @param request
|
||||
* @param response
|
||||
@@ -149,33 +164,36 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"save"})
|
||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
||||
public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
AppPolicyCfg entity,RedirectAttributes redirectAttributes) {
|
||||
@RequestMapping(value = { "save" })
|
||||
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
||||
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if(specificService!=null){
|
||||
SpecificServiceCfg specificService = specificServiceCfgService
|
||||
.getBySpecServiceId(entity.getSpecServiceId());
|
||||
if (specificService != null) {
|
||||
entity.setAppCode(specificService.getSpecServiceCode());
|
||||
}
|
||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("加密隧道信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
logger.error("加密隧道信息保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else if (e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置审核
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
@@ -183,21 +201,16 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"audit"})
|
||||
@RequiresPermissions(value={"encryptedtunnelbehav:confirm"})
|
||||
public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
@RequestMapping(value = { "audit" })
|
||||
@RequiresPermissions(value = { "encryptedtunnelbehav:confirm" })
|
||||
public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid,
|
||||
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
AppPolicyCfg entity = new AppPolicyCfg();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null);
|
||||
for (String id : idArray) {
|
||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
@@ -205,157 +218,187 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
entity.setFunctionId(functionId);
|
||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
|
||||
try {
|
||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
appCfgService.auditAppPolicyCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
if (e instanceof MaatConvertException) {
|
||||
e.printStackTrace();
|
||||
logger.info("加密隧道配置下发失败:"+e.getMessage());;
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
logger.info("加密隧道配置下发失败:" + e.getMessage());
|
||||
;
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
e.printStackTrace();
|
||||
logger.error("加密隧道配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
logger.error("加密隧道配置下发失败", e);
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
||||
|
||||
} else {
|
||||
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
Page<AppPolicyCfg> auditPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return policyCfgList(model, cfg, request, response);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
||||
|
||||
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 策略配置删除
|
||||
*
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"updateValid"})
|
||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
@RequestMapping(value = { "updateValid" })
|
||||
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
||||
public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
||||
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
||||
} catch (Exception e) {
|
||||
logger.error("加密隧道协议保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
logger.error("加密隧道协议保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else if (e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
//ip配置导出
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "exportIpAddr")
|
||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")AppPolicyCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") AppPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<AppPolicyCfg> ipLists=new ArrayList<AppPolicyCfg>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=appCfgService.findAppByPolicyList(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<AppPolicyCfg> ipLists = new ArrayList<AppPolicyCfg>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = appCfgService.findAppByPolicyList(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<AppPolicyCfg> pageInfo = new Page<AppPolicyCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
for (AppPolicyCfg policy : ipLists) {
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
|
||||
if (app != null) {
|
||||
policy.setBehaviorName(app.getSpecServiceName());
|
||||
}
|
||||
for(AppPolicyCfg policy:ipLists){
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
|
||||
if(app!=null) {
|
||||
policy.setBehaviorName(app.getSpecServiceName());
|
||||
}
|
||||
}
|
||||
// 查找社交应用的所有有效二级特定服务
|
||||
SpecificServiceCfg second = new SpecificServiceCfg();
|
||||
for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
if (Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
||||
second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||
break;
|
||||
}
|
||||
//查找社交应用的所有有效二级特定服务
|
||||
SpecificServiceCfg second=new SpecificServiceCfg();
|
||||
for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
||||
second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||
}
|
||||
second.setIsValid(Constants.VALID_YES);
|
||||
second.setIsLeaf(1);
|
||||
List<SpecificServiceCfg> secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
// 遍历,找到匹配项后将行为设置进去
|
||||
for (AppPolicyCfg policy : ipLists) {
|
||||
if (policy.getBehavCode() == null)
|
||||
continue;
|
||||
for (SpecificServiceCfg secondCfg : secondList) {
|
||||
if (secondCfg.getSpecServiceCode() == null)
|
||||
continue;
|
||||
if (secondCfg.getSpecServiceCode().intValue() == policy.getBehavCode().intValue()) {
|
||||
policy.setBehavName(secondCfg.getSpecServiceName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
second.setIsValid(Constants.VALID_YES);
|
||||
second.setIsLeaf(1);
|
||||
List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
//遍历,找到匹配项后将行为设置进去
|
||||
for(AppPolicyCfg policy:ipLists){
|
||||
if(policy.getBehavCode()==null) continue;
|
||||
for(SpecificServiceCfg secondCfg:secondList) {
|
||||
if(secondCfg.getSpecServiceCode()==null) continue;
|
||||
if(secondCfg.getSpecServiceCode().intValue()==policy.getBehavCode().intValue()) {
|
||||
policy.setBehavName(secondCfg.getSpecServiceName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport=",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String subscribeInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
||||
for (AppPolicyCfg cfg : ipLists) {
|
||||
AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
}
|
||||
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String subscribeInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
for (AppPolicyCfg cfg : ipLists) {
|
||||
AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
}
|
||||
subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("TunnelBehavior export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
logger.error("TunnelBehavior export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -42,211 +42,231 @@ import com.nis.web.service.configuration.DnsIpCfgService;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/dnsIp")
|
||||
public class DnsIpCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")DnsIpCfg entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response,"r"), entity);
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsIpCfg entity, RedirectAttributes redirectAttributes) {
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, "r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/dnsIpCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
||||
public String form(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")DnsIpCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model, cfg);
|
||||
}else{
|
||||
initFormCondition(model,cfg);
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
/*//获取所有响应策略信息
|
||||
List<DnsResStrategy> resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
||||
model.addAttribute("dnsResStrategys", resStrategys);*/
|
||||
//查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
/*
|
||||
* //获取所有响应策略信息 List<DnsResStrategy>
|
||||
* resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
||||
* model.addAttribute("dnsResStrategys", resStrategys);
|
||||
*/
|
||||
// 查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/dnsIpCfgForm";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化一条dns fakeip配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"initSpoofingIp"})
|
||||
public String initSpoofingIp(){
|
||||
Properties msg=getMsgProp();
|
||||
@RequestMapping(value = { "initSpoofingIp" })
|
||||
public String initSpoofingIp() {
|
||||
Properties msg = getMsgProp();
|
||||
try {
|
||||
DnsIpCfg entity=new DnsIpCfg();
|
||||
DnsIpCfg entity = new DnsIpCfg();
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
entity.setDnsStrategyId(0);
|
||||
List<DnsIpCfg> list=dnsIpCfgService.findDnsIpCfg(entity);
|
||||
if(StringUtil.isEmpty(list)) {
|
||||
List<DnsIpCfg> list = dnsIpCfgService.findDnsIpCfg(entity);
|
||||
if (StringUtil.isEmpty(list)) {
|
||||
dnsIpCfgService.saveAndAudit();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("初始化Spoofing ip失败",e);
|
||||
logger.error("初始化Spoofing ip失败", e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
if (e instanceof MaatConvertException) {
|
||||
return msg.getProperty("request_service_failed");
|
||||
}else {
|
||||
} else {
|
||||
return msg.getProperty("save_failed");
|
||||
}
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsIpCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
dnsIpCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
||||
public String delete(Integer isAudit,Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
dnsIpCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:confirm"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")DnsIpCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:confirm" })
|
||||
public String audit(Model model, @ModelAttribute("cfg") DnsIpCfg cfg, Integer isValid, Integer isAudit, String ids,
|
||||
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
dnsIpCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
dnsIpCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<DnsIpCfg> searchPage=new Page<DnsIpCfg>(request,response,"r");
|
||||
Page<DnsIpCfg> auditPage=new Page<DnsIpCfg>(request,response,"r");
|
||||
|
||||
} else {
|
||||
Page<DnsIpCfg> searchPage = new Page<DnsIpCfg>(request, response, "r");
|
||||
Page<DnsIpCfg> auditPage = new Page<DnsIpCfg>(request, response, "r");
|
||||
|
||||
try {
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response,cfg, redirectAttributes);
|
||||
|
||||
return list(model, request, response, cfg, redirectAttributes);
|
||||
}
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DNS阻断无策略时检验
|
||||
*
|
||||
* @param entity
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/dnsNoStrategyCheck"})
|
||||
public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response){
|
||||
@RequestMapping(value = { "/dnsNoStrategyCheck" })
|
||||
public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
List<DnsIpCfg> list = dnsIpCfgService.findDnsIpCfg(entity);
|
||||
if(list.size() > 0){
|
||||
if (list.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//dnsIp配置导出
|
||||
@RequestMapping(value = "exportDnsIp")
|
||||
public void exportDns(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
List<DnsIpCfg> ipLists=new ArrayList<DnsIpCfg>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=dnsIpCfgService.findByPage(ids);
|
||||
}else{
|
||||
Page<DnsIpCfg> pageInfo=new Page<DnsIpCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
if(StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())){
|
||||
Properties msgProp = getMsgProp();
|
||||
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
||||
String cfgIndexInfoNoExport=",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("DnsIp export failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
// dnsIp配置导出
|
||||
@RequestMapping(value = "exportDnsIp")
|
||||
public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<DnsIpCfg> ipLists = new ArrayList<DnsIpCfg>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = dnsIpCfgService.findByPage(ids);
|
||||
} else {
|
||||
Page<DnsIpCfg> pageInfo = new Page<DnsIpCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
if (StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())) {
|
||||
Properties msgProp = getMsgProp();
|
||||
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
||||
String cfgIndexInfoNoExport = ",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("DnsIp export failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,189 +33,206 @@ import com.nis.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* dns响应策略
|
||||
*
|
||||
* @author ddm
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/maintenance/dnsResStrategy")
|
||||
public class DnsResStrategyController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
||||
public String from(Model model,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String ids,
|
||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(cfg == null){
|
||||
cfg=new DnsResStrategy();
|
||||
public class DnsResStrategyController extends BaseController {
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||
if (cfg == null) {
|
||||
cfg = new DnsResStrategy();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids),-1);
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids), -1);
|
||||
initFormCondition(model, cfg);
|
||||
model.addAttribute("isAdd", false);
|
||||
}else{
|
||||
/*//不存在响应策略为0的配置,则新策略时,cfgId默认为0
|
||||
DnsResStrategy dns0=dnsResStrategyService.getDnsResStrategy(0l,null);
|
||||
if(dns0 == null){
|
||||
cfg.setCfgId(0l);
|
||||
cfg.setCfgDesc("无策略");
|
||||
}*/
|
||||
} else {
|
||||
/*
|
||||
* //不存在响应策略为0的配置,则新策略时,cfgId默认为0 DnsResStrategy
|
||||
* dns0=dnsResStrategyService.getDnsResStrategy(0l,null); if(dns0 ==
|
||||
* null){ cfg.setCfgId(0l); cfg.setCfgDesc("无策略"); }
|
||||
*/
|
||||
initFormCondition(model, cfg);
|
||||
model.addAttribute("isAdd", true);
|
||||
}
|
||||
|
||||
//查询policyGroup列表,供响应策略选择
|
||||
// List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
||||
|
||||
// 查询policyGroup列表,供响应策略选择
|
||||
// List<PolicyGroupInfo>
|
||||
// policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/maintenance/dnsResStrategy/form";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
|
||||
dnsResStrategyService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response
|
||||
,@ModelAttribute("cfg")DnsResStrategy entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
//查询时left join policyGroup
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response,"r"), entity);
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsResStrategy entity, RedirectAttributes redirectAttributes) {
|
||||
// 查询时left join policyGroup
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response, "r"),
|
||||
entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/maintenance/dnsResStrategy/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId
|
||||
,Model model,HttpServletRequest request
|
||||
,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
dnsResStrategyService.delete(isAudit,isValid,ids,functionId);
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId;
|
||||
|
||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:confirm"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")DnsResStrategy cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:confirm" })
|
||||
public String audit(Model model, @ModelAttribute("cfg") DnsResStrategy cfg, Integer isValid, Integer isAudit,
|
||||
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
dnsResStrategyService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
dnsResStrategyService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<DnsResStrategy> searchPage=new Page<DnsResStrategy>(request,response,"r");
|
||||
Page<DnsResStrategy> auditPage=new Page<DnsResStrategy>(request,response,"r");
|
||||
|
||||
} else {
|
||||
Page<DnsResStrategy> searchPage = new Page<DnsResStrategy>(request, response, "r");
|
||||
Page<DnsResStrategy> auditPage = new Page<DnsResStrategy>(request, response, "r");
|
||||
|
||||
try {
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response, cfg,redirectAttributes);
|
||||
|
||||
return list(model, request, response, cfg, redirectAttributes);
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/validCfgId")
|
||||
public boolean validCfgId(Long cfgId) {
|
||||
DnsResStrategy dns=dnsResStrategyService.getDnsResStrategy(cfgId,null);
|
||||
if(dns == null ){
|
||||
DnsResStrategy dns = dnsResStrategyService.getDnsResStrategy(cfgId, null);
|
||||
if (dns == null) {
|
||||
return false;
|
||||
}else{
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//dns配置导出
|
||||
|
||||
// dns配置导出
|
||||
@RequestMapping(value = "exportDns")
|
||||
public void exportDns(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsResStrategy entity,String ids,RedirectAttributes redirectAttributes){
|
||||
public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsResStrategy entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<DnsResStrategy> ipLists=new ArrayList<DnsResStrategy>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=dnsResStrategyService.findByPage(ids);
|
||||
}else{
|
||||
Page<DnsResStrategy> pageInfo=new Page<DnsResStrategy>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<DnsResStrategy> ipLists = new ArrayList<DnsResStrategy>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = dnsResStrategyService.findByPage(ids);
|
||||
} else {
|
||||
Page<DnsResStrategy> pageInfo = new Page<DnsResStrategy>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
ipLists.get(i).setMiTtlmax(
|
||||
String.valueOf(ipLists.get(i).getMinTtl()) + "-" + String.valueOf(ipLists.get(i).getMaxTtl()));
|
||||
ipLists.get(i).setDnsId(String.valueOf(ipLists.get(i).getCfgId()));
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
||||
String cfgIndexInfoNoExport = ",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:policy_name-";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
if (entity.gethColumns().contains("policy_name")) {
|
||||
cfgIndexInfoNoExport = ",config_describe," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
ipLists.get(i).setMiTtlmax(String.valueOf(ipLists.get(i).getMinTtl())+"-"+String.valueOf(ipLists.get(i).getMaxTtl()));
|
||||
ipLists.get(i).setDnsId( String.valueOf(ipLists.get(i).getCfgId()));
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
||||
String cfgIndexInfoNoExport=",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(),ipLists);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Dns export failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
logger.error("Dns export failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,213 +34,200 @@ import com.nis.web.service.basics.SysDictInfoService;
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/maintenance/ipMultiplexPoolCfg")
|
||||
public class IpMultiplexPoolCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String from(Model model,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String ids,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
if(cfg == null){
|
||||
cfg=new IpMultiplexPoolCfg();
|
||||
public class IpMultiplexPoolCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||
if (cfg == null) {
|
||||
cfg = new IpMultiplexPoolCfg();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids), null);
|
||||
initFormCondition(model, cfg);
|
||||
}else{
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
|
||||
//查询ip复用地址池配置的policyGroup列表
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(3);
|
||||
|
||||
// 查询ip复用地址池配置的policyGroup列表
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.getHasAreaPolicyGroups(3);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/maintenance/ipMultiplexPool/form";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
try{
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, @ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||
try {
|
||||
// 设置省份信息
|
||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
||||
|
||||
|
||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
||||
//查询时left join policyGroup
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg entity) {
|
||||
// 查询时left join policyGroup
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService
|
||||
.findPage(new Page<IpMultiplexPoolCfg>(request, response, "r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/maintenance/ipMultiplexPool/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
||||
,HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||
RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipMultiplexPoolCfgService.delete(isAudit, isValid, ids, functionId);
|
||||
}
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"error", "delete_failed");
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
||||
public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:confirm" })
|
||||
public String audit(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
ipMultiplexPoolCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("IP复用地址池配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.info("IP复用地址池配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("IP复用地址池配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.info("IP复用地址池配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/validCfgId")
|
||||
public boolean validCfgId(Long cfgId) {
|
||||
IpMultiplexPoolCfg dns=ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId,null);
|
||||
if(dns == null ){
|
||||
IpMultiplexPoolCfg dns = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId, null);
|
||||
if (dns == null) {
|
||||
return false;
|
||||
}else{
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/*@RequestMapping(value = {"/snatlist"})
|
||||
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
||||
//查询时left join policyGroup
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initFormCondition(model,entity);
|
||||
return "/cfg/maintenance/ipMultiplexPool/snatlist";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snatform"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String snatfrom(Model model,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String ids,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
if(cfg == null){
|
||||
cfg=new IpMultiplexPoolCfg();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
}else{
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
|
||||
//查询ip复用地址池配置的policyGroup列表
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/maintenance/ipMultiplexPool/snatform";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snatsaveOrUpdate"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String snatsaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
try{
|
||||
// 设置省份信息
|
||||
if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
||||
}
|
||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snataudit"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
||||
public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
try {
|
||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("SNAT地址池管理配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"/snatdelete"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String snatdelete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
||||
,HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
}
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* @RequestMapping(value = {"/snatlist"}) public String snatlist(Model
|
||||
* model,HttpServletRequest request,HttpServletResponse
|
||||
* response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ //查询时left join
|
||||
* policyGroup Page<IpMultiplexPoolCfg> page =
|
||||
* ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request,
|
||||
* response,"r"), entity); model.addAttribute("page", page);
|
||||
* initFormCondition(model,entity); return
|
||||
* "/cfg/maintenance/ipMultiplexPool/snatlist"; }
|
||||
*
|
||||
* @RequestMapping(value = {"/snatform"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||
* snatfrom(Model model, HttpServletRequest request, HttpServletResponse
|
||||
* response, String ids,
|
||||
*
|
||||
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ if(cfg == null){ cfg=new
|
||||
* IpMultiplexPoolCfg(); } if(!StringUtil.isEmpty(ids)){ cfg =
|
||||
* ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||
* initUpdateFormCondition(model, cfg); }else{ initFormCondition(model,
|
||||
* cfg); }
|
||||
*
|
||||
* //查询ip复用地址池配置的policyGroup列表 List<PolicyGroupInfo>
|
||||
* policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
||||
* model.addAttribute("policyGroups", policyGroups);
|
||||
* model.addAttribute("_cfg", cfg); return
|
||||
* "/cfg/maintenance/ipMultiplexPool/snatform"; }
|
||||
*
|
||||
* @RequestMapping(value = {"/snatsaveOrUpdate"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||
* snatsaveOrUpdate(Model model,HttpServletRequest
|
||||
* request,HttpServletResponse response,RedirectAttributes
|
||||
* redirectAttributes,
|
||||
*
|
||||
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ try{ // 设置省份信息
|
||||
* if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
||||
* groupAreaService.setAreaCodeByGroupId(cfg); }
|
||||
* ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
*
|
||||
* addMessage(redirectAttributes,"success","save_success"); }catch(Exception
|
||||
* e){ e.printStackTrace(); if(e instanceof MaatConvertException) {
|
||||
* addMessage(redirectAttributes,"error", "request_service_failed"); }else {
|
||||
* addMessage(redirectAttributes,"error", "save_failed"); } }
|
||||
*
|
||||
* return "redirect:" + adminPath
|
||||
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId
|
||||
* (); }
|
||||
*
|
||||
* @RequestMapping(value = {"/snataudit"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) public String
|
||||
* snataudit(Integer isAudit,Integer isValid,String ids,Integer
|
||||
* functionId,RedirectAttributes redirectAttributes) {
|
||||
* if(!StringUtil.isEmpty(ids)){ String[] idArray = ids.split(","); Date
|
||||
* auditTime=new Date(); for(String id :idArray){ try {
|
||||
* ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
* } catch (Exception e) { e.printStackTrace();
|
||||
* logger.error("SNAT地址池管理配置下发失败:"+e.getMessage()); if(e instanceof
|
||||
* MaatConvertException) { addMessage(redirectAttributes,"error",
|
||||
* "request_service_failed"); }else { addMessage(redirectAttributes,"error",
|
||||
* "audit_failed"); } } }
|
||||
*
|
||||
* } return "redirect:" + adminPath
|
||||
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; }
|
||||
*
|
||||
* @RequestMapping(value = {"/snatdelete"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||
* snatdelete(Integer isAudit,Integer isValid,String ids,Integer
|
||||
* functionId,Model model,RedirectAttributes redirectAttributes
|
||||
* ,HttpServletRequest request,HttpServletResponse response){ try{
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
* ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId); }
|
||||
* addMessage(redirectAttributes,"success","delete_success");
|
||||
* }catch(Exception e){ logger.error(e);
|
||||
* addMessage(redirectAttributes,"error","delete_failed"); } return
|
||||
* "redirect:" + adminPath
|
||||
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; }
|
||||
*/
|
||||
|
||||
/**
|
||||
* 校验IP是否已存在
|
||||
*
|
||||
* @param cfg
|
||||
* @param redirectAttributes
|
||||
* @param request
|
||||
@@ -248,97 +235,143 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/checkIp"})
|
||||
public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response){
|
||||
@RequestMapping(value = { "/checkIp" })
|
||||
public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response) {
|
||||
// 修改
|
||||
if(!StringUtil.isEmpty(cfg.getCfgId())){
|
||||
if (!StringUtil.isEmpty(cfg.getCfgId())) {
|
||||
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
||||
if(poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())){
|
||||
if (poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cfg.setCfgId(null);
|
||||
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
||||
if(poolCfg != null){
|
||||
if (poolCfg != null) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//snat配置导出
|
||||
@RequestMapping(value = "exportSnat")
|
||||
public void exportSnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo=new Page<IpMultiplexPoolCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
page.setList(ipMultiplexPoolCfgService.getIsp(page.getList()));
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport=",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("snat export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
|
||||
// snat配置导出
|
||||
@RequestMapping(value = "exportSnat")
|
||||
public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||
* , entity.getFunctionId(), ids); }else{
|
||||
*/
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
page.setList(ipMultiplexPoolCfgService.getIsp(page.getList()));
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport = ",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
snatNoExport = ",config_time" + snatNoExport;
|
||||
}
|
||||
|
||||
//dnat配置导出
|
||||
@RequestMapping(value = "exportDnat")
|
||||
public void exportDnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo=new Page<IpMultiplexPoolCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport=",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("dnat export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
snatNoExport = ",edit_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
snatNoExport = ",audit_time" + snatNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("snat export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
// dnat配置导出
|
||||
@RequestMapping(value = "exportDnat")
|
||||
public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||
* , entity.getFunctionId(), ids); }else{
|
||||
*/
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport = ",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
snatNoExport = ",config_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
snatNoExport = ",edit_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
snatNoExport = ",audit_time" + snatNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("dnat export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,165 +39,189 @@ import com.nis.web.security.UserUtils;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/manipulation/ddos")
|
||||
public class DdosCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DdosIpCfg entity){
|
||||
Page<DdosIpCfg> page = ddosCfgService.findPage(new Page<DdosIpCfg>(request, response,"r"), entity);
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DdosIpCfg entity) {
|
||||
Page<DdosIpCfg> page = ddosCfgService.findPage(new Page<DdosIpCfg>(request, response, "r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/ddosIpCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"ddos:ip:config"})
|
||||
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")DdosIpCfg cfg){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids),null);
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "ddos:ip:config" })
|
||||
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") DdosIpCfg cfg) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids), null);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
}else{
|
||||
initFormCondition(model,cfg);
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/ddosIpCfgForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"ddos:ip:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DdosIpCfg cfg, RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "ddos:ip:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DdosIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
ddosCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"ddos:ip:config"})
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){
|
||||
ddosCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "ddos:ip:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
||||
ddosCfgService.delete(isAudit, isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"/audit"})
|
||||
//@RequiresPermissions(value={"ddos:ip:confirm"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")DdosIpCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
// @RequiresPermissions(value={"ddos:ip:confirm"})
|
||||
public String audit(Model model, @ModelAttribute("cfg") DdosIpCfg cfg, Integer isValid, Integer isAudit, String ids,
|
||||
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
ddosCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}else {
|
||||
Page<DdosIpCfg> searchPage=new Page<DdosIpCfg>(request,response,"r");
|
||||
Page<DdosIpCfg> auditPage=new Page<DdosIpCfg>(request,response,"r");
|
||||
|
||||
} else {
|
||||
Page<DdosIpCfg> searchPage = new Page<DdosIpCfg>(request, response, "r");
|
||||
Page<DdosIpCfg> auditPage = new Page<DdosIpCfg>(request, response, "r");
|
||||
|
||||
try {
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return list(model, request, response, cfg);
|
||||
}
|
||||
return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
//ddos配置导出
|
||||
|
||||
// ddos配置导出
|
||||
@RequestMapping(value = "exportDdos")
|
||||
public void exportddos(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DdosIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
public void exportddos(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DdosIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
List<DdosIpCfg> ipLists=new ArrayList<DdosIpCfg>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=ddosCfgService.findByPage(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<DdosIpCfg> pageInfo=new Page<DdosIpCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
|
||||
String cfgIndexInfoNoExport=",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<DdosIpCfg> ipLists = new ArrayList<DdosIpCfg>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = ddosCfgService.findByPage(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<DdosIpCfg> pageInfo = new Page<DdosIpCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||
* , entity.getFunctionId(), ids); }else{
|
||||
*/
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
|
||||
String cfgIndexInfoNoExport = ",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("ddos export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
logger.error("ddos export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据索引表信息异步获取子表信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/ajaxDdosInfo"})
|
||||
public String getDdosInfo(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
@RequestMapping(value = { "/ajaxDdosInfo" })
|
||||
public String getDdosInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
DdosIpCfg cfg = ddosCfgService.getDdosIpCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
//获取DdosIpCfg信息
|
||||
String cfgType = null;
|
||||
if(!cfg.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",cfg.getCfgType()});
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
// 获取DdosIpCfg信息
|
||||
String cfgType = null;
|
||||
if (!cfg.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", cfg.getCfgType() });
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/ddosSubList";
|
||||
|
||||
@@ -46,101 +46,116 @@ import com.nis.web.controller.configuration.CommonController;
|
||||
import com.nis.web.service.configuration.IpMultiplexService;
|
||||
|
||||
/**
|
||||
* @ClassName: ControlController.java
|
||||
* @ClassName: ControlController.java
|
||||
* @Description: TODO
|
||||
* @author (dell)
|
||||
* @date 2018年6月22日 下午4:35:42
|
||||
* @version V1.0
|
||||
*/
|
||||
@Controller
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/manipulation/ipmulitiplex")
|
||||
public class IpMultiplexController extends CommonController {
|
||||
|
||||
|
||||
@Autowired
|
||||
private IpMultiplexService ipMultiplexService;
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
// @RequiresPermissions(value={"ip:mulitiplex:config","ip:mulitiplex:confirm"},logical=Logical.OR)
|
||||
public String ipList(String cfgName,Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
this._ipList(cfgName,model, cfg, request, response);
|
||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
||||
model.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
// @RequiresPermissions(value={"ip:mulitiplex:config","ip:mulitiplex:confirm"},logical=Logical.OR)
|
||||
public String ipList(String cfgName, Model model, @ModelAttribute("cfg") IpPortCfg cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
this._ipList(cfgName, model, cfg, request, response);
|
||||
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||
return "/cfg/common/ipList";
|
||||
}
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:config"})
|
||||
public String ipForm(String cfgName,Model model,String ids,Integer functionId,BaseIpCfg entity) {
|
||||
this._ipForm(cfgName,model, ids, functionId, entity);
|
||||
SysDataDictionaryItem dict=null;
|
||||
List<SysDataDictionaryItem> dictList= DictUtils.getDictList("GROUP_TYPE");
|
||||
for(SysDataDictionaryItem di:dictList){
|
||||
if("IP".equals(di.getItemValue())){
|
||||
dict=di;
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:config" })
|
||||
public String ipForm(String cfgName, Model model, String ids, Integer functionId, BaseIpCfg entity) {
|
||||
this._ipForm(cfgName, model, ids, functionId, entity);
|
||||
SysDataDictionaryItem dict = null;
|
||||
List<SysDataDictionaryItem> dictList = DictUtils.getDictList("GROUP_TYPE");
|
||||
for (SysDataDictionaryItem di : dictList) {
|
||||
if ("IP".equals(di.getItemValue())) {
|
||||
dict = di;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(dict!=null){
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode()));
|
||||
if (dict != null) {
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService
|
||||
.findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode()));
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
}
|
||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
||||
model.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
||||
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||
return "/cfg/manipulation/ipmulitiplex/form";
|
||||
}
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
public String saveOrUpdateIp(String cfgName,RedirectAttributes model, IpPortCfg cfg) {
|
||||
this._saveOrUpdateIp(cfgName,model, cfg);
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
public String saveOrUpdateIp(String cfgName, RedirectAttributes model, IpPortCfg cfg) {
|
||||
this._saveOrUpdateIp(cfgName, model, cfg);
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/delete"})
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions("ip:mulitiplex:config")
|
||||
public String deleteIp(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
||||
this._deleteIp(cfgName,ids, compileIds, functionId, model);
|
||||
model.addAttribute("urlPrefix","/proxy/ipmulitiplex");
|
||||
model.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+functionId;
|
||||
public String deleteIp(String cfgName, String ids, String compileIds, Integer functionId,
|
||||
RedirectAttributes model) {
|
||||
this._deleteIp(cfgName, ids, compileIds, functionId, model);
|
||||
model.addAttribute("urlPrefix", "/proxy/ipmulitiplex");
|
||||
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"/audit"})
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions("ip:mulitiplex:confirm")
|
||||
public String auditIp(String cfgName,String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) {
|
||||
this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
||||
redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
||||
redirectAttributes.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId();
|
||||
public String auditIp(String cfgName, String ids, IpPortCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
this._auditIp(cfgName, ids, cfg, redirectAttributes);
|
||||
redirectAttributes.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||
redirectAttributes.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
//ip配置导入
|
||||
/*@RequestMapping(value = "/import", method=RequestMethod.POST)
|
||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
this._importIp(cfgName,redirectAttributes, file,cfg,IpMultiplexPolicyTemplate.class);
|
||||
redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
||||
redirectAttributes.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId();
|
||||
}*/
|
||||
//ip模板下载
|
||||
|
||||
// ip配置导入
|
||||
/*
|
||||
* @RequestMapping(value = "/import", method=RequestMethod.POST) public
|
||||
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
*
|
||||
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
* this._importIp(cfgName,redirectAttributes,
|
||||
* file,cfg,IpMultiplexPolicyTemplate.class);
|
||||
* redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex")
|
||||
* ; redirectAttributes.addAttribute("requiresPermissionPrefix",
|
||||
* "ip:mulitiplex"); return "redirect:" + adminPath
|
||||
* +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); }
|
||||
*/
|
||||
// ip模板下载
|
||||
@RequestMapping(value = "import/template")
|
||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpMultiplexPolicyTemplate.class);
|
||||
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||
IpMultiplexPolicyTemplate.class);
|
||||
}
|
||||
//ip配置导出
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "export")
|
||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
this._exportIp(columns,model, request, response, entity, ids, redirectAttributes);
|
||||
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpPortCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
this._exportIp(columns, model, request, response, entity, ids, redirectAttributes);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* IP复用策略拆分为SNAT/DNAT复用策略
|
||||
*/
|
||||
@RequestMapping(value = {"/snatPolicyList"})
|
||||
public String snatPolicyList(Model model,@ModelAttribute("cfg")IpReusePolicyCfg cfg,
|
||||
HttpServletRequest request,HttpServletResponse response) {
|
||||
|
||||
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(new Page<IpReusePolicyCfg>(request, response,"r"), cfg);
|
||||
@RequestMapping(value = { "/snatPolicyList" })
|
||||
public String snatPolicyList(Model model, @ModelAttribute("cfg") IpReusePolicyCfg cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
|
||||
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(new Page<IpReusePolicyCfg>(request, response, "r"),
|
||||
cfg);
|
||||
model.addAttribute("page", page);
|
||||
initFormCondition(model,cfg);
|
||||
|
||||
initFormCondition(model, cfg);
|
||||
|
||||
// 获取地址池、用户信息
|
||||
List<UserManage> users = userManageService.findUsers();
|
||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||
@@ -148,357 +163,401 @@ public class IpMultiplexController extends CommonController {
|
||||
model.addAttribute("addrPools", addrPools);
|
||||
return "/cfg/manipulation/ipmulitiplex/snatPolicyList2";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snatPolicyForm"})
|
||||
@RequiresPermissions(value={"snat_policy:config"})
|
||||
public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg,
|
||||
HttpServletRequest request,HttpServletResponse response) {
|
||||
if(cfg == null){
|
||||
cfg=new IpReusePolicyCfg();
|
||||
|
||||
@RequestMapping(value = { "/snatPolicyForm" })
|
||||
@RequiresPermissions(value = { "snat_policy:config" })
|
||||
public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
if (cfg == null) {
|
||||
cfg = new IpReusePolicyCfg();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = ipMultiplexService.getPolicyCfg(Long.valueOf(ids),null);
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = ipMultiplexService.getPolicyCfg(Long.valueOf(ids), null);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
}else{
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
|
||||
|
||||
// 获取用户信息 地址池信息
|
||||
List<UserManage> users = userManageService.findUsers();
|
||||
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("users", users);
|
||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
||||
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||
return "/cfg/manipulation/ipmulitiplex/snatPolicyForm2";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdateSnat"})
|
||||
public String saveOrUpdateSnat(Model model, HttpServletRequest request,HttpServletResponse response,
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdateSnat" })
|
||||
public String saveOrUpdateSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, IpReusePolicyCfg cfg) {
|
||||
try{
|
||||
try {
|
||||
// 添加策略配置信息
|
||||
ipMultiplexService.saveOrUpdate(cfg, request, response);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e) {
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snatDelete"})
|
||||
|
||||
@RequestMapping(value = { "/snatDelete" })
|
||||
@RequiresPermissions("snat_policy:config")
|
||||
public String snatDelete(String ids, Integer isValid, Integer functionId,RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request,HttpServletResponse response) {
|
||||
|
||||
try{
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipMultiplexService.delete(isValid,ids,functionId);
|
||||
public String snatDelete(String ids, Integer isValid, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
|
||||
try {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipMultiplexService.delete(isValid, ids, functionId);
|
||||
}
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+functionId;
|
||||
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/auditSnat"})
|
||||
|
||||
@RequestMapping(value = { "/auditSnat" })
|
||||
@RequiresPermissions("snat_policy:confirm")
|
||||
public String auditSnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
public String auditSnat(String ids, Integer isAudit, Integer isValid, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
ipMultiplexService.auditSnatPolicy(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
ipMultiplexService.auditSnatPolicy(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("SNAT策略配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("SNAT策略配置下发失败:" + e.getMessage());
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/ajaxSnatInfo"})
|
||||
public String ajaxSnatInfo(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
|
||||
@RequestMapping(value = { "/ajaxSnatInfo" })
|
||||
public String ajaxSnatInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
IpReusePolicyCfg cfg = ipMultiplexService.getSnatCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
String cfgType = null;
|
||||
if(!cfg.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",cfg.getCfgType()});
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
|
||||
String cfgType = null;
|
||||
if (!cfg.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", cfg.getCfgType() });
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
|
||||
List<UserManage> users = userManageService.findUsers();
|
||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||
model.addAttribute("users", users);
|
||||
model.addAttribute("addrPools", addrPools);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/manipulation/ipmulitiplex/snatSubList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = {"/ajaxDnatInfo"})
|
||||
public String ajaxDnatInfo(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
|
||||
@RequestMapping(value = { "/ajaxDnatInfo" })
|
||||
public String ajaxDnatInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
IpReuseDnatPolicyCfg cfg = ipMultiplexService.getDnatCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
String cfgType = null;
|
||||
if(!cfg.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",cfg.getCfgType()});
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
String cfgType = null;
|
||||
if (!cfg.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", cfg.getCfgType() });
|
||||
cfgType = cfg.getCfgType();
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/manipulation/ipmulitiplex/dnatSubList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 异步获取地址池信息
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/ajaxGetAddrPools"})
|
||||
public List<IpAddrPoolCfg> ajaxGetAddrPools(HttpServletRequest request, HttpServletResponse response){
|
||||
@RequestMapping(value = { "/ajaxGetAddrPools" })
|
||||
public List<IpAddrPoolCfg> ajaxGetAddrPools(HttpServletRequest request, HttpServletResponse response) {
|
||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||
List<IpAddrPoolCfg> addrPoolsNew=new ArrayList<>();
|
||||
List<IpAddrPoolCfg> addrPoolsNew = new ArrayList<>();
|
||||
for (IpAddrPoolCfg addrPool : addrPools) {
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("addr_pool_id", addrPool.getCfgId());
|
||||
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
||||
Map<String, Object> resultMap=ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
||||
if(!StringUtil.isEmpty(resultMap)
|
||||
&& !StringUtil.isEmpty(resultMap.get("num"))
|
||||
String url = Constants.IP_REUSE_CALL_CGI_URL;
|
||||
Map<String, Object> resultMap = ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
||||
if (!StringUtil.isEmpty(resultMap) && !StringUtil.isEmpty(resultMap.get("num"))
|
||||
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
||||
addrPoolsNew.add(addrPool);
|
||||
}
|
||||
}
|
||||
return addrPoolsNew;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验地址池是否被策略引用
|
||||
*
|
||||
* @param addrPoolIds
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/ajaxIsUsed"})
|
||||
public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response){
|
||||
@RequestMapping(value = { "/ajaxIsUsed" })
|
||||
public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response) {
|
||||
for (String addrPoolId : addrPoolIds.split(",")) {
|
||||
List<IpReusePolicyCfg> ipList = ipMultiplexService.checkAddrPoolIsUsed(addrPoolId);
|
||||
if(ipList != null && ipList.size() > 0){
|
||||
if (ipList != null && ipList.size() > 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"/dnatPolicyList"})
|
||||
public String dnatPolicyList(String cfgName,Model model,@ModelAttribute("cfg")IpReuseDnatPolicyCfg cfg,
|
||||
HttpServletRequest request,HttpServletResponse response) {
|
||||
//this._ipList(cfgName,model, cfg, request, response);
|
||||
|
||||
Page<BaseIpCfg> page = ipMultiplexService.findPageDnat(new Page<BaseIpCfg>(request, response,"r"), cfg);
|
||||
|
||||
@RequestMapping(value = { "/dnatPolicyList" })
|
||||
public String dnatPolicyList(String cfgName, Model model, @ModelAttribute("cfg") IpReuseDnatPolicyCfg cfg,
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
// this._ipList(cfgName,model, cfg, request, response);
|
||||
|
||||
Page<BaseIpCfg> page = ipMultiplexService.findPageDnat(new Page<BaseIpCfg>(request, response, "r"), cfg);
|
||||
model.addAttribute("page", page);
|
||||
initFormCondition(model,cfg);
|
||||
|
||||
initFormCondition(model, cfg);
|
||||
|
||||
return "/cfg/manipulation/ipmulitiplex/dnatPolicyList2";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/dnatPolicyForm"})
|
||||
@RequiresPermissions(value={"dnat_policy:config"})
|
||||
public String dnatPolicyForm(String cfgName,Model model,String ids,Integer functionId,IpReuseDnatPolicyCfg cfg) {
|
||||
//this._ipForm(cfgName,model, ids, functionId, entity);
|
||||
|
||||
if(cfg == null){
|
||||
cfg=new IpReuseDnatPolicyCfg();
|
||||
|
||||
@RequestMapping(value = { "/dnatPolicyForm" })
|
||||
@RequiresPermissions(value = { "dnat_policy:config" })
|
||||
public String dnatPolicyForm(String cfgName, Model model, String ids, Integer functionId,
|
||||
IpReuseDnatPolicyCfg cfg) {
|
||||
// this._ipForm(cfgName,model, ids, functionId, entity);
|
||||
|
||||
if (cfg == null) {
|
||||
cfg = new IpReuseDnatPolicyCfg();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = ipMultiplexService.getDnatPolicyCfg(Long.valueOf(ids),null);
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = ipMultiplexService.getDnatPolicyCfg(Long.valueOf(ids), null);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
}else{
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm2";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdateDnat"})
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdateDnat" })
|
||||
public String saveOrUpdateDnat(Model model, RedirectAttributes redirectAttributes, IpReuseDnatPolicyCfg cfg,
|
||||
HttpServletRequest request,HttpServletResponse response) {
|
||||
try{
|
||||
HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
// 添加策略配置信息
|
||||
ipMultiplexService.saveOrUpdateDnat(cfg, request, response);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e) {
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+cfg.getFunctionId();
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/dnatPolicyList?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/dnatDelete"})
|
||||
|
||||
@RequestMapping(value = { "/dnatDelete" })
|
||||
@RequiresPermissions("dnat_policy:config")
|
||||
public String dnatDelete(String ids, Integer isValid, Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
//this._deleteIp(cfgName,ids, compileIds, functionId, model);
|
||||
|
||||
try{
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipMultiplexService.deleteDnat(isValid,ids,functionId);
|
||||
public String dnatDelete(String ids, Integer isValid, Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
// this._deleteIp(cfgName,ids, compileIds, functionId, model);
|
||||
|
||||
try {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipMultiplexService.deleteDnat(isValid, ids, functionId);
|
||||
}
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+functionId;
|
||||
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/dnatPolicyList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/auditDnat"})
|
||||
|
||||
@RequestMapping(value = { "/auditDnat" })
|
||||
@RequiresPermissions("dnat_policy:confirm")
|
||||
public String auditDnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
//this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
||||
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
public String auditDnat(String ids, Integer isAudit, Integer isValid, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
// this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
||||
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
ipMultiplexService.auditDnatPolicy(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
ipMultiplexService.auditDnatPolicy(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("DNAT策略配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("DNAT策略配置下发失败:" + e.getMessage());
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/dnatPolicyList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
//snat配置导出
|
||||
@RequestMapping(value = "exportSnat")
|
||||
public void exportSnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
Properties msgProp = getMsgProp();
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<BaseIpCfg> pageInfo=new Page<BaseIpCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
||||
for (BaseIpCfg baseIp : page.getList()) {
|
||||
if(StringUtil.isEmpty(baseIp.getGroupName())){
|
||||
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), BaseIpCfg.class);
|
||||
String snatNoExport=",client_ip,group_name,server_ip,ip_type,ip_pattern,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("snat export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
|
||||
// snat配置导出
|
||||
@RequestMapping(value = "exportSnat")
|
||||
public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") BaseIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
Properties msgProp = getMsgProp();
|
||||
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||
* , entity.getFunctionId(), ids); }else{
|
||||
*/
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<BaseIpCfg> pageInfo = new Page<BaseIpCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
||||
for (BaseIpCfg baseIp : page.getList()) {
|
||||
if (StringUtil.isEmpty(baseIp.getGroupName())) {
|
||||
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
|
||||
//dnat配置导出
|
||||
@RequestMapping(value = "exportDnat")
|
||||
public void exportDnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
Properties msgProp = getMsgProp();
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<BaseIpCfg> pageInfo=new Page<BaseIpCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
||||
for (BaseIpCfg baseIp : page.getList()) {
|
||||
if(StringUtil.isEmpty(baseIp.getGroupName())){
|
||||
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), BaseIpCfg.class);
|
||||
String snatNoExport=",direction,client_ip,ip_type,ip_pattern,port_pattern,client_port,ir_type,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("dnat export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), BaseIpCfg.class);
|
||||
String snatNoExport = ",client_ip,group_name,server_ip,ip_type,ip_pattern,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
snatNoExport = ",config_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
snatNoExport = ",edit_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
snatNoExport = ",audit_time" + snatNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("snat export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
// dnat配置导出
|
||||
@RequestMapping(value = "exportDnat")
|
||||
public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") BaseIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
Properties msgProp = getMsgProp();
|
||||
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||
* , entity.getFunctionId(), ids); }else{
|
||||
*/
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<BaseIpCfg> pageInfo = new Page<BaseIpCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
||||
for (BaseIpCfg baseIp : page.getList()) {
|
||||
if (StringUtil.isEmpty(baseIp.getGroupName())) {
|
||||
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), BaseIpCfg.class);
|
||||
String snatNoExport = ",direction,client_ip,ip_type,ip_pattern,port_pattern,client_port,ir_type,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
snatNoExport = ",config_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
snatNoExport = ",edit_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
snatNoExport = ",audit_time" + snatNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("dnat export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,87 +19,87 @@ import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/asnPolicy")
|
||||
@Deprecated
|
||||
public class AsnPolicyCfgController extends BaseController {
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
Page<CfgIndexInfo> page = asnPolicyCfgService.findPage(new Page<CfgIndexInfo>(request, response,"r"), entity);
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||
Page<CfgIndexInfo> page = asnPolicyCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/asnPolicyCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"asn:policy:config"})
|
||||
public String form(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "asn:policy:config" })
|
||||
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
entity = asnPolicyCfgService.get(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model, entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
List<ConfigGroupInfo> policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4);
|
||||
List<ConfigGroupInfo> policyGroups = asnPolicyCfgService.getConfigGroupInfoList(4);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/asnPolicyCfgForm";
|
||||
}
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"asn:policy:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "asn:policy:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
asnPolicyCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"asn:policy:config"})
|
||||
public String delete(Integer isAudit,Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "asn:policy:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
asnPolicyCfgService.delete(functionId, isValid, ids);
|
||||
return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + functionId;
|
||||
}
|
||||
// @RequestMapping(value = {"/audit"})
|
||||
// @RequiresPermissions(value={"asn:policy:confirm"})
|
||||
// public String audit(Integer isAudit,Integer isValid,String ids
|
||||
// ,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
// if(!StringUtil.isEmpty(ids)){
|
||||
// String[] idArray = ids.split(",");
|
||||
// Date auditTime=new Date();
|
||||
// for(String id :idArray){
|
||||
// try {
|
||||
// asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
// } catch (MaatConvertException e) {
|
||||
// e.printStackTrace();
|
||||
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||
// addMessage(redirectAttributes,"error","request_service_failed");
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||
// addMessage(redirectAttributes,"error","audit_failed");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId;
|
||||
// }
|
||||
// @RequestMapping(value = {"/audit"})
|
||||
// @RequiresPermissions(value={"asn:policy:confirm"})
|
||||
// public String audit(Integer isAudit,Integer isValid,String ids
|
||||
// ,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
// if(!StringUtil.isEmpty(ids)){
|
||||
// String[] idArray = ids.split(",");
|
||||
// Date auditTime=new Date();
|
||||
// for(String id :idArray){
|
||||
// try {
|
||||
// asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
// } catch (MaatConvertException e) {
|
||||
// e.printStackTrace();
|
||||
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||
// addMessage(redirectAttributes,"error","request_service_failed");
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||
// addMessage(redirectAttributes,"error","audit_failed");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// return "redirect:" + adminPath
|
||||
// +"/cfg/asnPolicy/list?functionId="+functionId;
|
||||
// }
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,5 @@
|
||||
package com.nis.web.controller.configuration.ntc;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -34,227 +33,245 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* BGP配置
|
||||
*
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/ntc/other/")
|
||||
public class BgpCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"bgpList"})
|
||||
// @RequiresPermissions(value={"other:bgp:config"})
|
||||
public String bgpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
public class BgpCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = { "bgpList" })
|
||||
// @RequiresPermissions(value={"other:bgp:config"})
|
||||
public String bgpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/other/bgpList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"bgpForm"})
|
||||
@RequiresPermissions(value={"other:bgp:config"})
|
||||
public String bgpForm(Model model,String ids,CfgIndexInfo entity,RedirectAttributes redirectAttributes) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(ids),null);
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
|
||||
@RequestMapping(value = { "bgpForm" })
|
||||
@RequiresPermissions(value = { "other:bgp:config" })
|
||||
public String bgpForm(Model model, String ids, CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(ids), null);
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/other/bgpForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"saveBgpCfg"})
|
||||
@RequiresPermissions(value={"other:bgp:config"})
|
||||
public String saveBgpCfg(Model model,HttpServletRequest request,HttpServletResponse response
|
||||
,String ids,CfgIndexInfo entity
|
||||
,RedirectAttributes redirectAttributes) {
|
||||
|
||||
@RequestMapping(value = { "saveBgpCfg" })
|
||||
@RequiresPermissions(value = { "other:bgp:config" })
|
||||
public String saveBgpCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||
bgpCfgService.saveBgpCfg(entity);
|
||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+entity.getFunctionId();
|
||||
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"ajaxBgpSubList"})
|
||||
public String ajaxBgpSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
CfgIndexInfo cfg = bgpCfgService.getBgpCfg(cfgId,compileId);
|
||||
|
||||
@RequestMapping(value = { "ajaxBgpSubList" })
|
||||
public String ajaxBgpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
CfgIndexInfo cfg = bgpCfgService.getBgpCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getIpPortList()!=null){
|
||||
if (cfg.getIpPortList() != null) {
|
||||
String cfgType = null;
|
||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcBgpAsCfgList()!=null){
|
||||
if (cfg.getNtcBgpAsCfgList() != null) {
|
||||
String cfgType = null;
|
||||
for(NtcBgpAsCfg ip:cfg.getNtcBgpAsCfgList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ip.getCfgType()});
|
||||
for (NtcBgpAsCfg ip : cfg.getNtcBgpAsCfgList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg ip:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",ip.getCfgType()});
|
||||
for (NtcSubscribeIdCfg ip : cfg.getNtcSubscribeIdCfgList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*TODO
|
||||
* if(cfg.getDomainList()!=null){
|
||||
String cfgType = null;
|
||||
for(ComplexkeywordCfg keyword:cfg.getDomainList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"3",keyword.getCfgType()});
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
model.addAttribute("_cfg", cfg);
|
||||
/*
|
||||
* TODO if(cfg.getDomainList()!=null){ String cfgType = null;
|
||||
* for(ComplexkeywordCfg keyword:cfg.getDomainList()){
|
||||
* if(!keyword.getCfgType().equals(cfgType)){ tabList.add(new
|
||||
* String[]{"3",keyword.getCfgType()}); cfgType = keyword.getCfgType();
|
||||
* } } }
|
||||
*/
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/other/bgpSubList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"updateBgpCfgValid"})
|
||||
@RequiresPermissions(value={"other:bgp:config"})
|
||||
public String updateBgpCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
bgpCfgService.updateBgpCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "updateBgpCfgValid" })
|
||||
@RequiresPermissions(value = { "other:bgp:config" })
|
||||
public String updateBgpCfgValid(Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
bgpCfgService.updateBgpCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"auditBgpCfg"})
|
||||
@RequiresPermissions(value={"other:bgp:confirm"})
|
||||
public String auditBgpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
|
||||
@RequestMapping(value = { "auditBgpCfg" })
|
||||
@RequiresPermissions(value = { "other:bgp:confirm" })
|
||||
public String auditBgpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(id),null);
|
||||
for (String id : idArray) {
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
bgpCfgService.auditBgpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
bgpCfgService.auditBgpCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("bgp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.error("bgp配置下发失败", e);
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("bgp配置下发失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
logger.error("bgp配置下发失败", e);
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
} else {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return bgpList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
//bgp配置导出
|
||||
@RequestMapping(value = "exportbgp")
|
||||
public void exportbgp(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=ipCfgService.getByIdsList(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_BGP_AS");
|
||||
// titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_BGP_AS", BaseStringCfg.class);
|
||||
// classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_BGP_AS", regionCfgNoExport);
|
||||
// noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
// List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> asInfoList=new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
CfgIndexInfo cfgIndexInfo=bgpCfgService.exportbgp(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
// subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
asInfoList.addAll(cfgIndexInfo.getNtcBgpAsCfgList());
|
||||
}
|
||||
asInfoList=BaseStringCfg.replaceBaseKeyList(asInfoList);
|
||||
// subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_BGP_AS", asInfoList);
|
||||
// dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("bgp export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
|
||||
// bgp配置导出
|
||||
@RequestMapping(value = "exportbgp")
|
||||
public void exportbgp(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = ipCfgService.getByIdsList(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_BGP_AS");
|
||||
// titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_BGP_AS", BaseStringCfg.class);
|
||||
// classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String regionCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_BGP_AS", regionCfgNoExport);
|
||||
// noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
// List<BaseStringCfg> subscribeInfoList=new
|
||||
// ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> asInfoList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
CfgIndexInfo cfgIndexInfo = bgpCfgService.exportbgp(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
// subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
asInfoList.addAll(cfgIndexInfo.getNtcBgpAsCfgList());
|
||||
}
|
||||
asInfoList = BaseStringCfg.replaceBaseKeyList(asInfoList);
|
||||
// subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_BGP_AS", asInfoList);
|
||||
// dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("bgp export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -467,6 +467,19 @@ public class IpController extends BaseController{
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String asnGroupInfoNoExport="";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("asn_policy", asnGroupInfoNoExport);
|
||||
@@ -485,9 +498,16 @@ public class IpController extends BaseController{
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("asn_policy", groupInfoList);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("ip addr export failed",e);
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
|
||||
@@ -44,275 +44,303 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* 邮件相关配置控制类
|
||||
*
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/ntc/mail/")
|
||||
public class MailCfgController extends BaseController{
|
||||
@RequestMapping(value = {"mailList"})
|
||||
// @RequiresPermissions(value={"mail:config"})
|
||||
public String mailList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
public class MailCfgController extends BaseController {
|
||||
@RequestMapping(value = { "mailList" })
|
||||
// @RequiresPermissions(value={"mail:config"})
|
||||
public String mailList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/mail/mailList";
|
||||
}
|
||||
@RequestMapping(value = {"mailForm"})
|
||||
@RequiresPermissions(value={"mail:config"})
|
||||
public String mailForm(Model model,String ids,CfgIndexInfo entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = mailCfgService.getMailCfg(Long.parseLong(ids),null);
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
|
||||
@RequestMapping(value = { "mailForm" })
|
||||
@RequiresPermissions(value = { "mail:config" })
|
||||
public String mailForm(Model model, String ids, CfgIndexInfo entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = mailCfgService.getMailCfg(Long.parseLong(ids), null);
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/mail/mailForm";
|
||||
}
|
||||
@RequestMapping(value = {"saveMailCfg"})
|
||||
@RequiresPermissions(value={"mail:config"})
|
||||
public String saveMailCfg( RedirectAttributes redirectAttributes, Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
||||
CfgIndexInfo entity,MultipartFile file) {
|
||||
|
||||
|
||||
@RequestMapping(value = { "saveMailCfg" })
|
||||
@RequiresPermissions(value = { "mail:config" })
|
||||
public String saveMailCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request,
|
||||
HttpServletResponse response, String ids, CfgIndexInfo entity, MultipartFile file) {
|
||||
|
||||
try {
|
||||
ToMaatResult result = null;
|
||||
if(file!=null && file.getSize()>0 && entity.getDigestList()!=null && entity.getDigestList().size()>0){
|
||||
if (file != null && file.getSize() > 0 && entity.getDigestList() != null
|
||||
&& entity.getDigestList().size() > 0) {
|
||||
String sep = System.getProperty("file.separator");
|
||||
String digestFilePath = request.getRealPath("/")+"digestFile";
|
||||
String digestFilePath = request.getRealPath("/") + "digestFile";
|
||||
FileUtils.createDirectory(digestFilePath);
|
||||
String fileName = UUID.randomUUID()+FileUtils.getSuffix(file.getOriginalFilename(), true);
|
||||
File uploadFile = new File(digestFilePath+sep+fileName);
|
||||
String fileName = UUID.randomUUID() + FileUtils.getSuffix(file.getOriginalFilename(), true);
|
||||
File uploadFile = new File(digestFilePath + sep + fileName);
|
||||
FileCopyUtils.copy(file.getBytes(), uploadFile);
|
||||
Date creatTime = entity.getCreateTime();
|
||||
//获取文件摘要接口调用
|
||||
Map<String,Object> fileMap = new HashMap();
|
||||
// 获取文件摘要接口调用
|
||||
Map<String, Object> fileMap = new HashMap();
|
||||
fileMap.put("filetype", FileUtils.getSuffix(file.getOriginalFilename(), false));
|
||||
fileMap.put("datatype", "dbSystem");//源文件存入数据中心
|
||||
|
||||
fileMap.put("createTime",creatTime);
|
||||
fileMap.put("key",FileUtils.getPrefix(file.getOriginalFilename(), false));
|
||||
fileMap.put("datatype", "dbSystem");// 源文件存入数据中心
|
||||
|
||||
fileMap.put("createTime", creatTime);
|
||||
fileMap.put("key", FileUtils.getPrefix(file.getOriginalFilename(), false));
|
||||
fileMap.put("fileName", file.getOriginalFilename());
|
||||
String md5 = DigestUtils.md5Hex(file.getBytes());
|
||||
fileMap.put("checksum", md5);
|
||||
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
|
||||
logger.info("获取文件摘要响应信息:"+result);
|
||||
}
|
||||
mailCfgService.saveMailCfg(entity,result);
|
||||
addMessage(redirectAttributes,"success", "save_success");
|
||||
} catch ( Exception e) {
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
logger.info("获取文件摘要响应信息:" + result);
|
||||
}
|
||||
mailCfgService.saveMailCfg(entity, result);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
|
||||
} else if (e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+entity.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"ajaxMailSubList"})
|
||||
public String ajaxMailSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId,compileId);
|
||||
|
||||
@RequestMapping(value = { "ajaxMailSubList" })
|
||||
public String ajaxMailSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getIpPortList()!=null){
|
||||
if (cfg.getIpPortList() != null) {
|
||||
String cfgType = null;
|
||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getComplexList()!=null){
|
||||
if (cfg.getComplexList() != null) {
|
||||
String cfgType = null;
|
||||
for(ComplexkeywordCfg keyword:cfg.getComplexList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"3",keyword.getCfgType()});
|
||||
for (ComplexkeywordCfg keyword : cfg.getComplexList()) {
|
||||
if (!keyword.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "3", keyword.getCfgType() });
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getDigestList()!=null){
|
||||
if (cfg.getDigestList() != null) {
|
||||
String cfgType = null;
|
||||
for(FileDigestCfg digest:cfg.getDigestList()){
|
||||
if(!digest.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"5",digest.getCfgType()});
|
||||
for (FileDigestCfg digest : cfg.getDigestList()) {
|
||||
if (!digest.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "5", digest.getCfgType() });
|
||||
cfgType = digest.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||
for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) {
|
||||
if (!keyword.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/mail/mailSubList";
|
||||
}
|
||||
@RequestMapping(value = {"updateMailCfgValid"})
|
||||
@RequiresPermissions(value={"mail:config"})
|
||||
public String updateMailCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
mailCfgService.updateMailCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "updateMailCfgValid" })
|
||||
@RequiresPermissions(value = { "mail:config" })
|
||||
public String updateMailCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||
mailCfgService.updateMailCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"auditMailCfg"})
|
||||
@RequiresPermissions(value={"mail:confirm"})
|
||||
public String auditMailCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
|
||||
@RequestMapping(value = { "auditMailCfg" })
|
||||
@RequiresPermissions(value = { "mail:confirm" })
|
||||
public String auditMailCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = mailCfgService.getMailCfg(Long.parseLong(id),null);
|
||||
for (String id : idArray) {
|
||||
entity = mailCfgService.getMailCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
mailCfgService.auditMailCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
} catch ( Exception e) {
|
||||
mailCfgService.auditMailCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("mail配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
|
||||
}else if(e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
logger.error("mail配置下发失败:" + e.getMessage());
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
|
||||
} else if (e instanceof CallExternalProceduresException) {
|
||||
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
} else {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return mailList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
//mail配置导出
|
||||
@RequestMapping(value = "exportmail")
|
||||
public void exportmail(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=ipCfgService.getByIdsList(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String regionCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
if(entity.getFunctionId()!=null){
|
||||
if(entity.getFunctionId()!=37){
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_MAIL_BODY");
|
||||
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_MAIL_BODY", ComplexkeywordCfg.class);
|
||||
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_MAIL_BODY", regionCfgNoExport);
|
||||
|
||||
}
|
||||
}
|
||||
titleList.add("NTC_MAIL_HDR");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_MAIL_HDR", ComplexkeywordCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_MAIL_HDR", regionCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
||||
List<ComplexkeywordCfg> mailBodyList=new ArrayList<ComplexkeywordCfg>();
|
||||
List<ComplexkeywordCfg> mailReqHdrList=new ArrayList<ComplexkeywordCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
Map<String, List> maps=mailCfgService.exportmail(cfg);
|
||||
mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR"));
|
||||
mailBodyList.addAll(maps.get("NTC_MAIL_BODY"));
|
||||
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||
}
|
||||
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
mailBodyList=ComplexkeywordCfg.replaceComplexKeyList(mailBodyList);
|
||||
mailReqHdrList=ComplexkeywordCfg.replaceComplexKeyList(mailReqHdrList);
|
||||
if(entity.getFunctionId()!=null){
|
||||
if(entity.getFunctionId()!=37){
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_MAIL_BODY", mailBodyList);
|
||||
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_MAIL_HDR", mailReqHdrList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("mail export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
|
||||
// mail配置导出
|
||||
@RequestMapping(value = "exportmail")
|
||||
public void exportmail(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = ipCfgService.getByIdsList(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String regionCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
if (entity.getFunctionId() != null) {
|
||||
if (entity.getFunctionId() != 37) {
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_MAIL_BODY");
|
||||
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_MAIL_BODY", ComplexkeywordCfg.class);
|
||||
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("NTC_MAIL_BODY", regionCfgNoExport);
|
||||
|
||||
}
|
||||
}
|
||||
titleList.add("NTC_MAIL_HDR");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_MAIL_HDR", ComplexkeywordCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_MAIL_HDR", regionCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
List<ComplexkeywordCfg> mailBodyList = new ArrayList<ComplexkeywordCfg>();
|
||||
List<ComplexkeywordCfg> mailReqHdrList = new ArrayList<ComplexkeywordCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
Map<String, List> maps = mailCfgService.exportmail(cfg);
|
||||
mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR"));
|
||||
mailBodyList.addAll(maps.get("NTC_MAIL_BODY"));
|
||||
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
subscribeInfoList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||
}
|
||||
subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList);
|
||||
mailBodyList = ComplexkeywordCfg.replaceComplexKeyList(mailBodyList);
|
||||
mailReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(mailReqHdrList);
|
||||
if (entity.getFunctionId() != null) {
|
||||
if (entity.getFunctionId() != 37) {
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
dataMap.put("NTC_MAIL_BODY", mailBodyList);
|
||||
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_MAIL_HDR", mailReqHdrList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("mail export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,145 +33,151 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* 白名单
|
||||
*
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/ntc/whitelist")
|
||||
public class WhiteListController extends CommonController{
|
||||
|
||||
@RequestMapping(value = {"ip/list"})
|
||||
//@RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:confirm","whitelist:ip:aduit"},logical=Logical.OR)
|
||||
public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
public class WhiteListController extends CommonController {
|
||||
|
||||
@RequestMapping(value = { "ip/list" })
|
||||
// @RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:confirm","whitelist:ip:aduit"},logical=Logical.OR)
|
||||
public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/whitelist/ipList";
|
||||
}
|
||||
@RequestMapping(value = {"ajaxIpSubList"})
|
||||
public String ajaxIpSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId,compileId);
|
||||
|
||||
@RequestMapping(value = { "ajaxIpSubList" })
|
||||
public String ajaxIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getIpPortList()!=null){
|
||||
if (cfg.getIpPortList() != null) {
|
||||
String cfgType = null;
|
||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||
for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) {
|
||||
if (!keyword.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/whitelist/ipSubList";
|
||||
}
|
||||
@RequestMapping(value = {"ip/form"})
|
||||
@RequiresPermissions(value={"whitelist:ip:config"})
|
||||
public String ipForm(Model model,String ids,CfgIndexInfo entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
|
||||
entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids),null);
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
|
||||
@RequestMapping(value = { "ip/form" })
|
||||
@RequiresPermissions(value = { "whitelist:ip:config" })
|
||||
public String ipForm(Model model, String ids, CfgIndexInfo entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
|
||||
entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids), null);
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/whitelist/ipForm";
|
||||
}
|
||||
@RequestMapping(value = {"ip/save"})
|
||||
public String saveIpCfg(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
||||
|
||||
@RequestMapping(value = { "ip/save" })
|
||||
public String saveIpCfg(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||
String ids, CfgIndexInfo entity) {
|
||||
ipCfgService.saveIpCfg(entity);
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+entity.getFunctionId();
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"ip/audit"})
|
||||
|
||||
@RequestMapping(value = { "ip/audit" })
|
||||
@RequiresPermissions("whitelist:ip:confirm")
|
||||
public String auditIp(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request
|
||||
) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
public String auditIp(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null);
|
||||
for (String id : idArray) {
|
||||
entity = ipCfgService.getIpPortCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
ipCfgService.auditIpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
ipCfgService.auditIpCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.info("ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.info("ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
logger.info("ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
} else {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return ipList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"updateIpValid"})
|
||||
@RequiresPermissions(value={"whitelist:ip:config"})
|
||||
public String updateIpCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
ipCfgService.updateIpCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "updateIpValid" })
|
||||
@RequiresPermissions(value = { "whitelist:ip:config" })
|
||||
public String updateIpCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||
ipCfgService.updateIpCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/ip/list?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"domain/list"})
|
||||
//@RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:confirm","whitelist:domain:aduit"},logical=Logical.OR)
|
||||
public String domainList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
|
||||
@RequestMapping(value = { "domain/list" })
|
||||
// @RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:confirm","whitelist:domain:aduit"},logical=Logical.OR)
|
||||
public String domainList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> page = domainService.getDomainList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
initPageCondition(model, cfg);
|
||||
return "/cfg/whitelist/domainList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"saveHttpUrlCfgs"})
|
||||
public String saveHttpUrlCfgs(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,CfgIndexInfo entity) {
|
||||
if(!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())){
|
||||
|
||||
CfgIndexInfo sourceCfg=websiteCfgService.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId());
|
||||
|
||||
@RequestMapping(value = { "saveHttpUrlCfgs" })
|
||||
public String saveHttpUrlCfgs(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||
CfgIndexInfo entity) {
|
||||
if (!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())) {
|
||||
|
||||
CfgIndexInfo sourceCfg = websiteCfgService
|
||||
.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId());
|
||||
for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) {
|
||||
CfgIndexInfo cfg=new CfgIndexInfo();
|
||||
List httpList=new ArrayList<>();
|
||||
CfgIndexInfo cfg = new CfgIndexInfo();
|
||||
List httpList = new ArrayList<>();
|
||||
httpUrlCfg.setRequestId(sourceCfg.getRequestId());
|
||||
BeanUtils.copyProperties(httpUrlCfg, cfg);
|
||||
httpList.add(httpUrlCfg);
|
||||
@@ -179,258 +185,315 @@ public class WhiteListController extends CommonController{
|
||||
websiteCfgService.saveHttpCfg(cfg);
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+entity.getFunctionId();
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"domain/form"})
|
||||
@RequiresPermissions(value={"whitelist:domain:config"})
|
||||
public String domainForm(Model model,String ids,CfgIndexInfo entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = domainService.getDomainCfg(Long.parseLong(ids),null);
|
||||
|
||||
@RequestMapping(value = { "domain/form" })
|
||||
@RequiresPermissions(value = { "whitelist:domain:config" })
|
||||
public String domainForm(Model model, String ids, CfgIndexInfo entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = domainService.getDomainCfg(Long.parseLong(ids), null);
|
||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||
urlCfg.setCfgType(Constants.HTTP_URL_REGION);
|
||||
entity.setHttpUrl(urlCfg);
|
||||
if(entity.getHttpUrlList().size()==0){
|
||||
if (entity.getHttpUrlList().size() == 0) {
|
||||
entity.getHttpUrlList().add(urlCfg);
|
||||
}
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||
urlCfg.setCfgType(Constants.HTTP_URL_REGION);
|
||||
entity.setHttpUrl(urlCfg);
|
||||
List<HttpUrlCfg> urlList=new ArrayList<HttpUrlCfg>();
|
||||
List<HttpUrlCfg> urlList = new ArrayList<HttpUrlCfg>();
|
||||
urlList.add(urlCfg);
|
||||
entity.setHttpUrlList(urlList);
|
||||
initFormCondition(model,entity);
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/whitelist/domainForm";
|
||||
}
|
||||
@RequestMapping(value = {"domain/save"})
|
||||
public String saveOrUpdateDomain(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
||||
|
||||
@RequestMapping(value = { "domain/save" })
|
||||
public String saveOrUpdateDomain(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||
String ids, CfgIndexInfo entity) {
|
||||
domainService.saveDomainCfg(entity);
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+entity.getFunctionId();
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"domain/ajaxSubList"})
|
||||
public String ajaxDomainSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
CfgIndexInfo cfg = domainService.getDomainCfg(cfgId,compileId);
|
||||
|
||||
@RequestMapping(value = { "domain/ajaxSubList" })
|
||||
public String ajaxDomainSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
CfgIndexInfo cfg = domainService.getDomainCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getHttpUrlList()!=null){
|
||||
if (cfg.getHttpUrlList() != null) {
|
||||
String cfgType = null;
|
||||
for(BaseStringCfg keyword:cfg.getHttpUrlList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||
for (BaseStringCfg keyword : cfg.getHttpUrlList()) {
|
||||
if (!keyword.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
||||
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||
String cfgType = null;
|
||||
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||
for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) {
|
||||
if (!keyword.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/whitelist/domianSubList";
|
||||
}
|
||||
@RequestMapping(value = {"domain/updateValid"})
|
||||
@RequiresPermissions(value={"whitelist:domain:config"})
|
||||
public String updateDomainValid(Integer isValid,String ids,Integer functionId) {
|
||||
domainService.updateDomainCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "domain/updateValid" })
|
||||
@RequiresPermissions(value = { "whitelist:domain:config" })
|
||||
public String updateDomainValid(Integer isValid, String ids, Integer functionId) {
|
||||
domainService.updateDomainCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"domain/delete"})
|
||||
|
||||
@RequestMapping(value = { "domain/delete" })
|
||||
@RequiresPermissions("whitelist:domain:config")
|
||||
public String deleteDomain(String ids,Integer functionId,RedirectAttributes model) {
|
||||
try{
|
||||
public String deleteDomain(String ids, Integer functionId, RedirectAttributes model) {
|
||||
try {
|
||||
domainService.deleteWhiteDomain(ids);
|
||||
addMessage(model,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
addMessage(model, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"error","delete_failed");
|
||||
addMessage(model, "error", "delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"domain/audit"})
|
||||
|
||||
@RequestMapping(value = { "domain/audit" })
|
||||
@RequiresPermissions("whitelist:domain:confirm")
|
||||
public String auditDomain(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
public String auditDomain(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = domainService.getDomainCfg(Long.parseLong(id),null);
|
||||
for (String id : idArray) {
|
||||
entity = domainService.getDomainCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
domainService.auditDomainCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
domainService.auditDomainCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.error("domain配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("domain配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
logger.error("domain配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
} else {// 条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return domainList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/ntc/whitelist/domain/list?functionId=" + functionId;
|
||||
}
|
||||
//ip配置导入
|
||||
/*@RequestMapping(value = "ip/import", method=RequestMethod.POST)
|
||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
this._importIp(cfgName,redirectAttributes, file,cfg,WhiteListIpTemplate.class);
|
||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId();
|
||||
}*/
|
||||
//ip模板下载
|
||||
|
||||
// ip配置导入
|
||||
/*
|
||||
* @RequestMapping(value = "ip/import", method=RequestMethod.POST) public
|
||||
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
*
|
||||
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
* this._importIp(cfgName,redirectAttributes,
|
||||
* file,cfg,WhiteListIpTemplate.class); return "redirect:" + adminPath
|
||||
* +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); }
|
||||
*/
|
||||
// ip模板下载
|
||||
@RequestMapping(value = "ip/import/template")
|
||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,WhiteListIpTemplate.class);
|
||||
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||
WhiteListIpTemplate.class);
|
||||
}
|
||||
//ip配置导出
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "ip/export")
|
||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
this._exportIp(columns,model, request, response, entity, ids, redirectAttributes);
|
||||
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpPortCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
this._exportIp(columns, model, request, response, entity, ids, redirectAttributes);
|
||||
}
|
||||
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "exportIpAddr")
|
||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=ipCfgService.getByIdsList(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport=",policy_name,do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport=",protocol,direction,do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
for (CfgIndexInfo cfg :ipLists) {
|
||||
CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("ip white export failed",e);
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "exportIpAddr")
|
||||
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = ipCfgService.getByIdsList(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "exportdomain")
|
||||
public void exportdomain(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=ipCfgService.getByIdsList(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = domainService.getDomainList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpUrlInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
|
||||
List<BaseStringCfg> httpurlList=new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
CfgIndexInfo cfgIndexInfo=domainService.exportDomainInfo(cfg);
|
||||
httpurlList.addAll(cfgIndexInfo.getHttpUrlList());
|
||||
}
|
||||
httpurlList=BaseStringCfg.replaceBaseKeyList(httpurlList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_HTTP_URL", httpurlList);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("ip white export failed",e);
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport = ",policy_name,do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",protocol,direction,do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
CfgIndexInfo cfgIndexInfo = ipCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_IP", ipList);
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("ip white export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "exportdomain")
|
||||
public void exportdomain(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = ipCfgService.getByIdsList(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = domainService.getDomainList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpUrlInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
|
||||
List<BaseStringCfg> httpurlList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
CfgIndexInfo cfgIndexInfo = domainService.exportDomainInfo(cfg);
|
||||
httpurlList.addAll(cfgIndexInfo.getHttpUrlList());
|
||||
}
|
||||
httpurlList = BaseStringCfg.replaceBaseKeyList(httpurlList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_HTTP_URL", httpurlList);
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("ip white export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -44,35 +44,37 @@ import jersey.repackaged.com.google.common.collect.Lists;
|
||||
|
||||
/**
|
||||
* http重定向策略
|
||||
*
|
||||
* @author zhangwei
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/proxy/control/httpRedirect")
|
||||
public class HttpRedirectPolicyController extends BaseController{
|
||||
@RequestMapping(value = {"httpRedirectList","httpBlockList","httpReplaceList","httpMonitList","httpWhitelistList"})
|
||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg){
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
public class HttpRedirectPolicyController extends BaseController {
|
||||
@RequestMapping(value = { "httpRedirectList", "httpBlockList", "httpReplaceList", "httpMonitList",
|
||||
"httpWhitelistList" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo cfg) {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
//获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||
initPageCondition(model, cfg);
|
||||
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||
.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
||||
return "/cfg/proxy/control/httpRedirectList";
|
||||
}
|
||||
@RequestMapping(value = {"form"})
|
||||
@RequiresPermissions(value={"control:httpBlock:config"
|
||||
,"control:httpRedirect:config"
|
||||
,"control:httpReplace:config"
|
||||
,"control:httpMinit:config"
|
||||
,"control:httpWhitelist:config"
|
||||
}
|
||||
,logical=Logical.OR)
|
||||
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity){
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids),null);
|
||||
|
||||
|
||||
@RequestMapping(value = { "form" })
|
||||
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||
"control:httpReplace:config", "control:httpMinit:config",
|
||||
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids), null);
|
||||
|
||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
||||
entity.setHttpUrl(urlCfg);
|
||||
@@ -94,31 +96,31 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
||||
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
||||
|
||||
if(entity.getHttpUrlList().size()==0){
|
||||
|
||||
if (entity.getHttpUrlList().size() == 0) {
|
||||
entity.getHttpUrlList().add(urlCfg);
|
||||
}
|
||||
if(entity.getHttpReqHdrList().size()==0){
|
||||
if (entity.getHttpReqHdrList().size() == 0) {
|
||||
entity.getHttpReqHdrList().add(reqHdrCfg);
|
||||
}
|
||||
if(entity.getHttpResHdrList().size()==0){
|
||||
if (entity.getHttpResHdrList().size() == 0) {
|
||||
entity.getHttpResHdrList().add(resHdrCfg);
|
||||
}
|
||||
if(entity.getHttpReqBodyList().size()==0){
|
||||
if (entity.getHttpReqBodyList().size() == 0) {
|
||||
entity.getHttpReqBodyList().add(reqBodyCfg);
|
||||
}
|
||||
if(entity.getHttpResBodyList().size()==0){
|
||||
if (entity.getHttpResBodyList().size() == 0) {
|
||||
entity.getHttpResBodyList().add(resBodyCfg);
|
||||
}
|
||||
if(entity.getIpPortList().size()==0){
|
||||
if (entity.getIpPortList().size() == 0) {
|
||||
entity.getIpPortList().add(ipPortCfg);
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList().size()==0){
|
||||
if (entity.getNtcSubscribeIdCfgList().size() == 0) {
|
||||
entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg);
|
||||
}
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
//设置http各类配置的配置域类型
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
// 设置http各类配置的配置域类型
|
||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
||||
entity.setHttpUrl(urlCfg);
|
||||
@@ -137,303 +139,321 @@ public class HttpRedirectPolicyController extends BaseController{
|
||||
IpPortCfg ipPortCfg = new IpPortCfg();
|
||||
ipPortCfg.setCfgType(Constants.HTTP_IP_REGION);
|
||||
entity.setIpPort(ipPortCfg);
|
||||
//subscribeId
|
||||
// subscribeId
|
||||
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
||||
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
||||
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
||||
|
||||
List<HttpUrlCfg> urlList=new ArrayList<HttpUrlCfg>();
|
||||
|
||||
List<HttpUrlCfg> urlList = new ArrayList<HttpUrlCfg>();
|
||||
urlList.add(urlCfg);
|
||||
entity.setHttpUrlList(urlList);
|
||||
List<HttpReqHeadCfg> reqHdrList=new ArrayList<HttpReqHeadCfg>();
|
||||
List<HttpReqHeadCfg> reqHdrList = new ArrayList<HttpReqHeadCfg>();
|
||||
reqHdrList.add(reqHdrCfg);
|
||||
entity.setHttpReqHdrList(reqHdrList);
|
||||
List<HttpResHeadCfg> resHdrList=new ArrayList<HttpResHeadCfg>();
|
||||
List<HttpResHeadCfg> resHdrList = new ArrayList<HttpResHeadCfg>();
|
||||
resHdrList.add(resHdrCfg);
|
||||
entity.setHttpResHdrList(resHdrList);
|
||||
List<HttpBodyCfg> reqBodyList=new ArrayList<HttpBodyCfg>();
|
||||
List<HttpBodyCfg> reqBodyList = new ArrayList<HttpBodyCfg>();
|
||||
reqBodyList.add(reqBodyCfg);
|
||||
entity.setHttpReqBodyList(reqBodyList);
|
||||
List<HttpBodyCfg> resBodyList=new ArrayList<HttpBodyCfg>();
|
||||
List<HttpBodyCfg> resBodyList = new ArrayList<HttpBodyCfg>();
|
||||
resBodyList.add(resBodyCfg);
|
||||
entity.setHttpResBodyList(resBodyList);
|
||||
|
||||
List<IpPortCfg> ipPortList=new ArrayList<IpPortCfg>();
|
||||
|
||||
List<IpPortCfg> ipPortList = new ArrayList<IpPortCfg>();
|
||||
ipPortList.add(ipPortCfg);
|
||||
entity.setIpPortList(ipPortList);
|
||||
|
||||
|
||||
List<NtcSubscribeIdCfg> subscribeCfgList = Lists.newArrayList();
|
||||
subscribeCfgList.add(subscribeIdCfg);
|
||||
entity.setNtcSubscribeIdCfgList(subscribeCfgList);
|
||||
|
||||
initFormCondition(model,entity);
|
||||
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
//获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||
.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||
model.addAttribute("_cfg", entity);
|
||||
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
||||
return "/cfg/proxy/control/httpRedirectForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"saveOrUpdate"})
|
||||
@RequiresPermissions(value={"control:httpBlock:config"
|
||||
,"control:httpRedirect:config"
|
||||
,"control:httpReplace:config"
|
||||
,"control:httpMinit:config"
|
||||
,"control:httpWhitelist:config"}
|
||||
,logical=Logical.OR)
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
@RequestMapping(value = { "saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||
"control:httpReplace:config", "control:httpMinit:config",
|
||||
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
httpRedirectCfgService.saveHttpCfg(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId="
|
||||
+ cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"ajaxHttpSubList"})
|
||||
public String ajaxHttpSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId,compileId);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
|
||||
@RequestMapping(value = { "ajaxHttpSubList" })
|
||||
public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId, compileId);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
return "/cfg/proxy/control/httpRedirectSubList";
|
||||
}
|
||||
@RequestMapping(value = {"delete"})
|
||||
@RequiresPermissions(value={"control:httpBlock:config"
|
||||
,"control:httpRedirect:config"
|
||||
,"control:httpReplace:config"
|
||||
,"control:httpMinit:config"
|
||||
,"control:httpWhitelist:config"}
|
||||
,logical=Logical.OR)
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){
|
||||
httpRedirectCfgService.updateHttpCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "delete" })
|
||||
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||
"control:httpReplace:config", "control:httpMinit:config",
|
||||
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
||||
httpRedirectCfgService.updateHttpCfgValid(isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"audit"})
|
||||
@RequiresPermissions(value={"control:httpBlock:confirm"
|
||||
,"control:httpRedirect:confirm"
|
||||
,"control:httpReplace:confirm"
|
||||
,"control:httpMinit:confirm"
|
||||
,"control:httpWhitelist:confirm"}
|
||||
,logical=Logical.OR)
|
||||
public String audit(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id),null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
httpRedirectCfgService.auditHttpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
} catch ( Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("http重定向配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
@RequestMapping(value = { "audit" })
|
||||
@RequiresPermissions(value = { "control:httpBlock:confirm", "control:httpRedirect:confirm",
|
||||
"control:httpReplace:confirm", "control:httpMinit:confirm",
|
||||
"control:httpWhitelist:confirm" }, logical = Logical.OR)
|
||||
public String audit(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for (String id : idArray) {
|
||||
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
httpRedirectCfgService.auditHttpCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
e.printStackTrace();
|
||||
logger.info("http重定向配置下发失败:" + e.getMessage());
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response, cfg);
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId;
|
||||
}
|
||||
|
||||
|
||||
//http配置导出
|
||||
@RequestMapping(value = "exportHttp")
|
||||
public void exportHttp(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
} else {// 条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
|
||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=ipCfgService.getByIdsList(ids);
|
||||
}else{
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response, cfg);
|
||||
}
|
||||
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
||||
}
|
||||
|
||||
// http配置导出
|
||||
@RequestMapping(value = "exportHttp")
|
||||
public void exportHttp(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
|
||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = ipCfgService.getByIdsList(ids);
|
||||
} else {
|
||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
Properties prop = getMsgProp();
|
||||
for (CfgIndexInfo str : ipLists) {
|
||||
if (entity.getFunctionId() != 210 && entity.getFunctionId() != 211) {
|
||||
String type = "RESPONSE_CODE";
|
||||
if (entity.getFunctionId() == 207) {
|
||||
type = "RESPONSE_CODE";
|
||||
} else if (entity.getFunctionId() == 208) {
|
||||
type = "REDIRECT_RESPONSE_CODE";
|
||||
} else if (entity.getFunctionId() == 209) {
|
||||
type = "CONTROL_REPLACE_ZONE";
|
||||
}
|
||||
|
||||
Properties prop = getMsgProp();
|
||||
for (CfgIndexInfo str :ipLists) {
|
||||
if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){
|
||||
String type="RESPONSE_CODE";
|
||||
if(entity.getFunctionId()==207){
|
||||
type="RESPONSE_CODE";
|
||||
}else if(entity.getFunctionId()==208){
|
||||
type="REDIRECT_RESPONSE_CODE";
|
||||
}else if(entity.getFunctionId()==209){
|
||||
type="CONTROL_REPLACE_ZONE";
|
||||
}
|
||||
String dictlabel= DictUtils.getDictLabel(type, str.getUserRegion1());
|
||||
str.setUserRegion1(prop.getProperty(dictlabel));
|
||||
if(entity.getFunctionId()==207 || entity.getFunctionId()==208){
|
||||
if(StringUtil.isEmpty(str.getUserRegion2())){
|
||||
if(!StringUtil.isEmpty(str.getUserRegion3())){
|
||||
ProxyFileStrategyCfg file= new ProxyFileStrategyCfg();
|
||||
file.setCompileId(Integer.valueOf(str.getUserRegion3()));
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(file);
|
||||
if(allProxyFileStrategys!=null && allProxyFileStrategys.size()>0){
|
||||
str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc());
|
||||
}
|
||||
String dictlabel = DictUtils.getDictLabel(type, str.getUserRegion1());
|
||||
str.setUserRegion1(prop.getProperty(dictlabel));
|
||||
if (entity.getFunctionId() == 207 || entity.getFunctionId() == 208) {
|
||||
if (StringUtil.isEmpty(str.getUserRegion2())) {
|
||||
if (!StringUtil.isEmpty(str.getUserRegion3())) {
|
||||
ProxyFileStrategyCfg file = new ProxyFileStrategyCfg();
|
||||
file.setCompileId(Integer.valueOf(str.getUserRegion3()));
|
||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||
.getProxyFileStrategyCfgList(file);
|
||||
if (allProxyFileStrategys != null && allProxyFileStrategys.size() > 0) {
|
||||
str.setUserRegion2(allProxyFileStrategys.get(0).getCfgDesc());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
if(entity.getFunctionId()==207){
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
||||
}else if(entity.getFunctionId()==208){
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-";
|
||||
}else if(entity.getFunctionId()==209){
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
||||
}else if(entity.getFunctionId()==211){
|
||||
cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
}
|
||||
String httpUrlCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpReqHeadCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpResHeadCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpReqBodyCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpResBodyCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
||||
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
||||
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
||||
List<BaseStringCfg> httpReqBodyList = new ArrayList<>();
|
||||
List<BaseStringCfg> httpResBodyList = new ArrayList<>();
|
||||
List<IpPortCfg> ipPortList = new ArrayList<>();
|
||||
List<BaseStringCfg> subscribeIdList = new ArrayList<>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
Map<String, List> maps=httpRedirectCfgService.exportHttpCfg(cfg);
|
||||
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
||||
httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR"));
|
||||
httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR"));
|
||||
httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY"));
|
||||
httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY"));
|
||||
ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||
}
|
||||
httpUrlList=BaseStringCfg.replaceBaseKeyList(httpUrlList);
|
||||
httpReqHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList);
|
||||
httpResHdrList=ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList);
|
||||
httpReqBodyList=BaseStringCfg.replaceBaseKeyList(httpReqBodyList);
|
||||
httpResBodyList=BaseStringCfg.replaceBaseKeyList(httpResBodyList);
|
||||
subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
titleList.add("NTC_HTTP_REQ_HDR");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class);
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
|
||||
if(entity.getFunctionId()!=208 && entity.getFunctionId()!=211){
|
||||
titleList.add("NTC_HTTP_RES_BODY");
|
||||
classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class);
|
||||
noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList);
|
||||
}else if(entity.getFunctionId()!=211){
|
||||
titleList.add("NTC_HTTP_RES_HDR");
|
||||
titleList.add("NTC_HTTP_REQ_BODY");
|
||||
classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class);
|
||||
classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class);
|
||||
noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
||||
}
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
dataMap.put("NTC_UNIVERSAL_IP", ipPortList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID",subscribeIdList);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("http export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
}
|
||||
/*return "redirect:" + adminPath +"/ntc/website/httpList?functionId="+entity.getFunctionId();*/
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
if (entity.getFunctionId() == 207) {
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
||||
} else if (entity.getFunctionId() == 208) {
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:redirect_response_code-userregion2:redirect_url-";
|
||||
} else if (entity.getFunctionId() == 209) {
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
||||
} else if (entity.getFunctionId() == 211) {
|
||||
cfgIndexInfoNoExport = ",do_log,log_total,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
}
|
||||
String httpUrlCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpReqHeadCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpResHeadCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpReqBodyCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String httpResBodyCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String ntcSubscribeIdCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
List<BaseStringCfg> httpUrlList = new ArrayList<>();
|
||||
List<ComplexkeywordCfg> httpReqHdrList = new ArrayList<>();
|
||||
List<ComplexkeywordCfg> httpResHdrList = new ArrayList<>();
|
||||
List<BaseStringCfg> httpReqBodyList = new ArrayList<>();
|
||||
List<BaseStringCfg> httpResBodyList = new ArrayList<>();
|
||||
List<IpPortCfg> ipPortList = new ArrayList<>();
|
||||
List<BaseStringCfg> subscribeIdList = new ArrayList<>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
Map<String, List> maps = httpRedirectCfgService.exportHttpCfg(cfg);
|
||||
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
||||
httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR"));
|
||||
httpResHdrList.addAll(maps.get("NTC_HTTP_RES_HDR"));
|
||||
httpReqBodyList.addAll(maps.get("NTC_HTTP_REQ_BODY"));
|
||||
httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY"));
|
||||
ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||
}
|
||||
httpUrlList = BaseStringCfg.replaceBaseKeyList(httpUrlList);
|
||||
httpReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList);
|
||||
httpResHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpResHdrList);
|
||||
httpReqBodyList = BaseStringCfg.replaceBaseKeyList(httpReqBodyList);
|
||||
httpResBodyList = BaseStringCfg.replaceBaseKeyList(httpResBodyList);
|
||||
subscribeIdList = BaseStringCfg.baseHexList(subscribeIdList);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
titleList.add("NTC_HTTP_REQ_HDR");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
classMap.put("NTC_HTTP_REQ_HDR", HttpReqHeadCfg.class);
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
|
||||
if (entity.getFunctionId() != 208 && entity.getFunctionId() != 211) {
|
||||
titleList.add("NTC_HTTP_RES_BODY");
|
||||
classMap.put("NTC_HTTP_RES_BODY", HttpBodyCfg.class);
|
||||
noExportMap.put("NTC_HTTP_RES_BODY", httpResBodyCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_RES_BODY", httpResBodyList);
|
||||
} else if (entity.getFunctionId() != 211) {
|
||||
titleList.add("NTC_HTTP_RES_HDR");
|
||||
titleList.add("NTC_HTTP_REQ_BODY");
|
||||
classMap.put("NTC_HTTP_RES_HDR", HttpResHeadCfg.class);
|
||||
classMap.put("NTC_HTTP_REQ_BODY", HttpBodyCfg.class);
|
||||
noExportMap.put("NTC_HTTP_RES_HDR", httpResHeadCfgNoExport);
|
||||
noExportMap.put("NTC_HTTP_REQ_BODY", httpReqBodyCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_RES_HDR", httpResHdrList);
|
||||
dataMap.put("NTC_HTTP_REQ_BODY", httpReqBodyList);
|
||||
}
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put("NTC_UNIVERSAL_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
noExportMap.put("NTC_UNIVERSAL_IP", ipPortCfgNoExport);
|
||||
noExportMap.put("NTC_SUBSCRIBE_ID", ntcSubscribeIdCfgNoExport);
|
||||
dataMap.put("NTC_UNIVERSAL_IP", ipPortList);
|
||||
dataMap.put("NTC_SUBSCRIBE_ID", subscribeIdList);
|
||||
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("http export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
/*
|
||||
* return "redirect:" + adminPath
|
||||
* +"/ntc/website/httpList?functionId="+entity.getFunctionId();
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
@@ -36,315 +35,347 @@ import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* IP相关配置控制类
|
||||
*
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value={"${adminPath}/proxy/intercept"})
|
||||
public class InterceptController extends CommonController{
|
||||
|
||||
@RequestMapping(value = {"/ip/list","/domain/list","/ippayload/list"})
|
||||
public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
@RequestMapping(value = { "${adminPath}/proxy/intercept" })
|
||||
public class InterceptController extends CommonController {
|
||||
|
||||
@RequestMapping(value = { "/ip/list", "/domain/list", "/ippayload/list" })
|
||||
public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
|
||||
//获取证书信息
|
||||
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
|
||||
if(cfg.getFunctionId().equals(200)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
initPageCondition(model, cfg);
|
||||
|
||||
// 获取证书信息
|
||||
List<PxyObjKeyring> certificateList = new ArrayList<PxyObjKeyring>();
|
||||
if (cfg.getFunctionId().equals(200)) {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
}
|
||||
if(cfg.getFunctionId().equals(201)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
if (cfg.getFunctionId().equals(201)) {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
}
|
||||
model.addAttribute("certificateList", certificateList);
|
||||
//IP地址仿冒策略使用策略组
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
// IP地址仿冒策略使用策略组
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
return "/cfg/intercept/interceptList";
|
||||
}
|
||||
@RequestMapping(value = {"/interceptIpForm","interceptDomainForm","interceptIpPayloadForm"})
|
||||
public String interceptIpForm(Model model,String ids,CfgIndexInfo entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = interceptCfgService.getInterceptCfg(Long.parseLong(ids),null);
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
|
||||
@RequestMapping(value = { "/interceptIpForm", "interceptDomainForm", "interceptIpPayloadForm" })
|
||||
public String interceptIpForm(Model model, String ids, CfgIndexInfo entity) {
|
||||
if (StringUtils.isNotBlank(ids)) {
|
||||
entity = interceptCfgService.getInterceptCfg(Long.parseLong(ids), null);
|
||||
initUpdateFormCondition(model, entity);
|
||||
} else {
|
||||
initFormCondition(model, entity);
|
||||
}
|
||||
//获取证书信息
|
||||
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
|
||||
if(entity.getFunctionId().equals(200)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
// 获取证书信息
|
||||
List<PxyObjKeyring> certificateList = new ArrayList<PxyObjKeyring>();
|
||||
if (entity.getFunctionId().equals(200)) {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
}
|
||||
if(entity.getFunctionId().equals(201)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
if (entity.getFunctionId().equals(201)) {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
}
|
||||
model.addAttribute("certificateList", certificateList);
|
||||
|
||||
|
||||
model.addAttribute("_cfg", entity);
|
||||
//IP地址仿冒策略使用策略组
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
// IP地址仿冒策略使用策略组
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
|
||||
|
||||
return "/cfg/intercept/interceptForm";
|
||||
}
|
||||
@RequestMapping(value = {"/ip/saveOrUpdate","/domain/saveOrUpdate","/ippayload/SaveOrUpdate"})
|
||||
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes,Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
||||
|
||||
@RequestMapping(value = { "/ip/saveOrUpdate", "/domain/saveOrUpdate", "/ippayload/SaveOrUpdate" })
|
||||
public String saveInterceptIpCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request,
|
||||
HttpServletResponse response, String ids, CfgIndexInfo entity) {
|
||||
try {
|
||||
interceptCfgService.saveInterceptCfg(entity);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("save_failed", e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+entity.getFunctionId();
|
||||
return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + entity.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/ajaxInterceptIpSubList","/ajaxInterceptDomainSubList","/ajaxInterceptIpPayloadSubList"})
|
||||
public String ajaxInterceptIpSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
||||
CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId,compileId);
|
||||
|
||||
@RequestMapping(value = { "/ajaxInterceptIpSubList", "/ajaxInterceptDomainSubList",
|
||||
"/ajaxInterceptIpPayloadSubList" })
|
||||
public String ajaxInterceptIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||
CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId, compileId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getIpPortList()!=null){
|
||||
if (cfg.getIpPortList() != null) {
|
||||
String cfgType = null;
|
||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||
if (!ip.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getInterceptPktBinList()!=null){
|
||||
if (cfg.getInterceptPktBinList() != null) {
|
||||
String cfgType = null;
|
||||
for(BaseStringCfg keyword:cfg.getInterceptPktBinList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||
for (BaseStringCfg keyword : cfg.getInterceptPktBinList()) {
|
||||
if (!keyword.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getHttpUrlList()!=null){
|
||||
if (cfg.getHttpUrlList() != null) {
|
||||
String cfgType = null;
|
||||
for(BaseStringCfg keyword:cfg.getHttpUrlList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
||||
for (BaseStringCfg keyword : cfg.getHttpUrlList()) {
|
||||
if (!keyword.getCfgType().equals(cfgType)) {
|
||||
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/intercept/interceptSubList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"auditInterceptIpCfg","auditInterceptDomainCfg","auditInterceptIpPayloadCfg"})
|
||||
public String auditInterceptIpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
|
||||
@RequestMapping(value = { "auditInterceptIpCfg", "auditInterceptDomainCfg", "auditInterceptIpPayloadCfg" })
|
||||
public String auditInterceptIpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid,
|
||||
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response, HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = interceptCfgService.getInterceptCfg(Long.parseLong(id),null);
|
||||
for (String id : idArray) {
|
||||
entity = interceptCfgService.getInterceptCfg(Long.parseLong(id), null);
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
interceptCfgService.auditInterceptIpCfg(entity,isAudit);
|
||||
addMessage(redirectAttributes,"success","audit_success");
|
||||
} catch ( Exception e) {
|
||||
logger.error("intercept ip audit failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
interceptCfgService.auditInterceptIpCfg(entity, isAudit);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("intercept ip audit failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{//条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
} else {// 条件下所有配置审核
|
||||
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
|
||||
try {
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return ipList(model, cfg, request, response);
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"updateInterceptIpValid","updateInterceptDomainValid","updateInterceptIpPayloadValid"})
|
||||
public String updateInterceptIpValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
|
||||
@RequestMapping(value = { "updateInterceptIpValid", "updateInterceptDomainValid", "updateInterceptIpPayloadValid" })
|
||||
public String updateInterceptIpValid(Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
interceptCfgService.updatInterceptValid(isValid,ids,functionId);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
interceptCfgService.updatInterceptValid(isValid, ids, functionId);
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("intercept ip delete failed",e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
logger.error("intercept ip delete failed", e);
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
//ip配置导入
|
||||
@RequestMapping(value = "/ip/import", method=RequestMethod.POST)
|
||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
this._importIp(cfgName,redirectAttributes, file,cfg,IpAddrTemplate.class);
|
||||
redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip");
|
||||
redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip");
|
||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = "/ip/import/template")
|
||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpAddrTemplate.class);
|
||||
}
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "/ip/export")
|
||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
this._exportIp(columns,model, request, response, entity, ids, redirectAttributes);
|
||||
}*/
|
||||
|
||||
//ip配置导出
|
||||
@RequestMapping(value = "exportIpAddr")
|
||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
Map<String, String> replaceExportMap=new HashMap<String, String>();
|
||||
Properties prop = getMsgProp();
|
||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=ipCfgService.getByIdsList(ids);
|
||||
}else{
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
//获取证书信息
|
||||
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
|
||||
if(entity.getFunctionId().equals(200)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
}
|
||||
if(entity.getFunctionId().equals(201)){
|
||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
}
|
||||
for (CfgIndexInfo str : ipLists) {
|
||||
if(!StringUtil.isEmpty(str.getUserRegion5())){
|
||||
String cs= DictUtils.getDictLabel("INTERCEPT_DOMAIN_INTENSITY", str.getUserRegion5());
|
||||
str.setUserRegion5(prop.getProperty(cs));
|
||||
}
|
||||
if(certificateList!=null){
|
||||
if(entity.getFunctionId()==200|| entity.getFunctionId()==201){
|
||||
if(!StringUtil.isEmpty(str.getUserRegion1())){
|
||||
boolean flag=false;
|
||||
for (PxyObjKeyring pxyObjKeyring : certificateList) {
|
||||
if(str.getUserRegion1().equals(String.valueOf(pxyObjKeyring.getCompileId()))){
|
||||
str.setUserRegion1(pxyObjKeyring.getCfgDesc());
|
||||
flag=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!flag){
|
||||
str.setUserRegion1(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
String cfgIndexInfoNoExport="";
|
||||
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String interceptNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String httpUrlCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+",letter,whether_area_block,classification,attribute,label"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> httpUrlList=new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> pktBinList=new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
Map<String, List> maps=interceptCfgService.exportIpInfo(cfg);
|
||||
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
||||
ipList.addAll(maps.get("PXY_INTERCEPT_IP"));
|
||||
pktBinList.addAll(maps.get("PXY_INTERCEPT_PKT_BIN"));
|
||||
}
|
||||
pktBinList=BaseStringCfg.replaceBaseKeyList(pktBinList);
|
||||
httpUrlList=BaseStringCfg.baseHexList(httpUrlList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
if(entity.getFunctionId()==212){ //IP Payload
|
||||
cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
titleList.add("PXY_INTERCEPT_PKT_BIN");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
classMap.put("PXY_INTERCEPT_PKT_BIN", InterceptPktBin.class);
|
||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("PXY_INTERCEPT_PKT_BIN", interceptNoExport);
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList);
|
||||
}else if(entity.getFunctionId()==200){//IP拦截
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:ratelimit-userregion1:certificate-";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
}else if(entity.getFunctionId()==201){//域名拦截
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:certificate-userregion5:intercept_intensity-";
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("ip addr export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
* //ip配置导入
|
||||
*
|
||||
* @RequestMapping(value = "/ip/import", method=RequestMethod.POST) public
|
||||
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||
*
|
||||
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||
* this._importIp(cfgName,redirectAttributes,
|
||||
* file,cfg,IpAddrTemplate.class);
|
||||
* redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip");
|
||||
* redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip"
|
||||
* ); return "redirect:" + adminPath
|
||||
* +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId(); }
|
||||
*
|
||||
* @RequestMapping(value = "/ip/import/template") public void
|
||||
* importFileTemplate(HttpServletRequest request,HttpServletResponse
|
||||
* response, RedirectAttributes redirectAttributes,Integer
|
||||
* functionId,Integer cfgRegionCode) { this._importFileTemplate(request,
|
||||
* response, redirectAttributes, functionId,
|
||||
* cfgRegionCode,IpAddrTemplate.class); } //ip配置导出
|
||||
*
|
||||
* @RequestMapping(value = "/ip/export") public void exportIp(String
|
||||
* columns,Model model,HttpServletRequest request,HttpServletResponse
|
||||
* response,
|
||||
*
|
||||
* @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes
|
||||
* redirectAttributes){ this._exportIp(columns,model, request, response,
|
||||
* entity, ids, redirectAttributes); }
|
||||
*/
|
||||
|
||||
// ip配置导出
|
||||
@RequestMapping(value = "exportIpAddr")
|
||||
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
Map<String, String> replaceExportMap = new HashMap<String, String>();
|
||||
Properties prop = getMsgProp();
|
||||
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = ipCfgService.getByIdsList(ids);
|
||||
} else {
|
||||
entity.setTableName(IpPortCfg.getTablename());
|
||||
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
// 获取证书信息
|
||||
List<PxyObjKeyring> certificateList = new ArrayList<PxyObjKeyring>();
|
||||
if (entity.getFunctionId().equals(200)) {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||
}
|
||||
if (entity.getFunctionId().equals(201)) {
|
||||
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||
}
|
||||
for (CfgIndexInfo str : ipLists) {
|
||||
if (!StringUtil.isEmpty(str.getUserRegion5())) {
|
||||
String cs = DictUtils.getDictLabel("INTERCEPT_DOMAIN_INTENSITY", str.getUserRegion5());
|
||||
str.setUserRegion5(prop.getProperty(cs));
|
||||
}
|
||||
if (certificateList != null) {
|
||||
if (entity.getFunctionId() == 200 || entity.getFunctionId() == 201) {
|
||||
if (!StringUtil.isEmpty(str.getUserRegion1())) {
|
||||
boolean flag = false;
|
||||
for (PxyObjKeyring pxyObjKeyring : certificateList) {
|
||||
if (str.getUserRegion1().equals(String.valueOf(pxyObjKeyring.getCompileId()))) {
|
||||
str.setUserRegion1(pxyObjKeyring.getCfgDesc());
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!flag) {
|
||||
str.setUserRegion1(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
String cfgIndexInfoNoExport = "";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String interceptNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||
String httpUrlCfgNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> httpUrlList = new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> pktBinList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
Map<String, List> maps = interceptCfgService.exportIpInfo(cfg);
|
||||
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
||||
ipList.addAll(maps.get("PXY_INTERCEPT_IP"));
|
||||
pktBinList.addAll(maps.get("PXY_INTERCEPT_PKT_BIN"));
|
||||
}
|
||||
pktBinList = BaseStringCfg.replaceBaseKeyList(pktBinList);
|
||||
httpUrlList = BaseStringCfg.baseHexList(httpUrlList);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
if (entity.getFunctionId() == 212) { // IP Payload
|
||||
cfgIndexInfoNoExport = ",do_log,log_total,policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
titleList.add("PXY_INTERCEPT_PKT_BIN");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
classMap.put("PXY_INTERCEPT_PKT_BIN", InterceptPktBin.class);
|
||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||
noExportMap.put("PXY_INTERCEPT_PKT_BIN", interceptNoExport);
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList);
|
||||
} else if (entity.getFunctionId() == 200) {// IP拦截
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:ratelimit-userregion1:certificate-";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
} else if (entity.getFunctionId() == 201) {// 域名拦截
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,&userregion2:ratelimit-userregion1:certificate-userregion5:intercept_intensity-";
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
|
||||
dataMap.put("NTC_HTTP_URL", httpUrlList);
|
||||
}else if(entity.getFunctionId()==214){
|
||||
cfgIndexInfoNoExport=",policy_name,group_name,userregion3,userregion4,userregion5,&userregion2:With-userregion1:Spoofing-";
|
||||
}
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("ip addr export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -151,8 +151,20 @@
|
||||
<shiro:hasPermission name="app:domain:config">
|
||||
<sys:delRow url="${ctx}/app/domainCfgForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/updateAppDomainCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/exportDomain?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/domainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/app/exportDomain?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/domainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/app/exportDomain?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/app/domainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/app/exportDomain?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/app/domainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="app:domain:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -152,8 +152,20 @@
|
||||
<shiro:hasPermission name="app:http:config">
|
||||
<sys:delRow url="${ctx}/app/httpCfgForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/updateAppHttpCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/exportAppHttp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/httpCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/app/exportAppHttp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/httpCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/app/exportAppHttp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/app/httpCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/app/exportAppHttp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/app/httpCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="app:http:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -155,8 +155,20 @@
|
||||
<shiro:hasPermission name="app:ip:config">
|
||||
<sys:delRow url="${ctx}/app/ipCfgForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/updateAppIpCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/exportAppIp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/ipCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/app/exportAppIp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/ipCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/app/exportAppIp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/app/ipCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/app/exportAppIp?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/app/ipCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="app:ip:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -201,8 +201,20 @@
|
||||
<shiro:hasPermission name="${configPermissionName }">
|
||||
<sys:delRow url="${ctx}/app/feature/multiFeatureCfgForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/feature/updateAppFeatureCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/feature/exportFeature?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/feature/multiFeatureCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/app/feature/exportFeature?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/feature/multiFeatureCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/app/feature/exportFeature?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/app/feature/multiFeatureCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/app/feature/exportFeature?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/app/feature/multiFeatureCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="${confirmPermissionName }">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -354,18 +366,18 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column r.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column r.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="social_app"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th class="sort-column r.compile_id" style="display: none;" column="cfg_id"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column r.cfg_desc cfgDesc" column="config_describe"><spring:message code="config_describe"/></th>
|
||||
<th column="social_app"><spring:message code="social_app"/></th>
|
||||
<th column="is_audit"><spring:message code="is_audit"/></th>
|
||||
<th class="sort-column r.is_valid" column="valid_identifier"><spring:message code="valid_identifier"/></th>
|
||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th column="creator"><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time" column="config_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor"><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time" column="edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor"><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time" column="audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -215,8 +215,20 @@
|
||||
<shiro:hasPermission name="app:policy:config">
|
||||
<sys:delRow url="${ctx}/app/policyCfgForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/updateAppPolicyCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/policyCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/app/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/policyCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/app/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/app/policyCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/app/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/app/policyCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="app:policy:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -134,8 +134,20 @@
|
||||
<shiro:hasPermission name="app:ssl:config">
|
||||
<sys:delRow url="${ctx}/app/sslCfgForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/updateAppSslCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/exportAppSsl?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/sslCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/app/exportAppSsl?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/app/sslCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/app/exportAppSsl?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/app/sslCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/app/exportAppSsl?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/app/sslCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="app:ssl:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -132,8 +132,20 @@
|
||||
<shiro:hasPermission name="app:topic:config">
|
||||
<sys:delRow url="${ctx}/app/topicDomainCfgForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/updateAppTopicDomainCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/app/exportTop?functionId=${cfg.functionId }" searchUrl="${ctx}/app/topicDomainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/app/exportTop?functionId=${cfg.functionId }" searchUrl="${ctx}/app/topicDomainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/app/exportTop?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/app/topicDomainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/app/exportTop?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/app/topicDomainCfgList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="app:domain:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -213,8 +213,20 @@
|
||||
<shiro:hasPermission name="avVoip:config">
|
||||
<sys:delRow url="${ctx}/ntc/av/contUrlForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/av/updateAvContUrlValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/av/exportStream?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/av/contUrlList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/av/exportStream?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/av/contUrlList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/av/exportStream?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/av/contUrlList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/av/exportStream?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/av/contUrlList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%-- <sys:delRow url="${ctx}/ntc/av/voipExport?functionId=${cfg.functionId }" id="contentTable" label="export" maxRow="${page.maxExportSize }"></sys:delRow> --%>
|
||||
<shiro:hasPermission name="avVoip:confirm">
|
||||
<div class="btn-group">
|
||||
|
||||
@@ -205,8 +205,20 @@
|
||||
<shiro:hasPermission name="avVoip:config">
|
||||
<sys:delRow url="${ctx}/ntc/av/voipForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/av/updateAvVoipValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/av/exportVoip?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/av/voipList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/av/exportVoip?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/av/voipList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/av/exportVoip?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/av/voipList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/av/exportVoip?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/av/voipList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<%-- <sys:delRow url="${ctx}/ntc/av/voipExport?functionId=${cfg.functionId }" id="contentTable" label="export" maxRow="${page.maxExportSize }"></sys:delRow> --%>
|
||||
<shiro:hasPermission name="avVoip:confirm">
|
||||
<div class="btn-group">
|
||||
@@ -361,23 +373,23 @@
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column r.compile_id" style="display: none" column="cfg_id" ><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column r.cfg_desc cfgDesc" column="cfg_id" ><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column r.action" column="cfg_id" ><spring:message code="block_type"/></th>
|
||||
<th column="cfg_id" ><spring:message code="is_audit"/></th>
|
||||
<th column="cfg_id" ><spring:message code="do_log"/></th>
|
||||
<th column="cfg_id" ><spring:message code="log_total"/></th>
|
||||
<th column="cfg_id" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="cfg_id" ><spring:message code="letter"/></th>
|
||||
<th column="cfg_id" ><spring:message code="classification"/></th>
|
||||
<th column="cfg_id" ><spring:message code="attribute"/></th>
|
||||
<th column="cfg_id" ><spring:message code="label"/></th>
|
||||
<th class="sort-column r.is_valid" column="cfg_id" ><spring:message code="valid_identifier"/></th>
|
||||
<th column="cfg_id" ><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time" column="cfg_id" ><spring:message code="config_time"/></th>
|
||||
<th column="cfg_id" ><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time" column="cfg_id" ><spring:message code="edit_time"/></th>
|
||||
<th column="cfg_id" ><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time" column="cfg_id" ><spring:message code="audit_time"/></th>
|
||||
<th class="sort-column r.cfg_desc cfgDesc" column="config_describe" ><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column r.action" column="block_type" ><spring:message code="block_type"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th class="sort-column r.is_valid" column="valid_identifier" ><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time" column="config_time" ><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time" column="edit_time" ><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time" column="audit_time" ><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -218,8 +218,20 @@
|
||||
<shiro:hasPermission name="basicprotocol:config">
|
||||
<sys:delRow url="${ctx}/basicprotocol/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/basicprotocol/updateValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/basicprotocol/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/basicprotocol/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/basicprotocol/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/basicprotocol/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/basicprotocol/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/basicprotocol/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basicprotocol/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/basicprotocol/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="basicprotocol:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -164,8 +164,20 @@
|
||||
<shiro:hasPermission name="ddos:ip:config">
|
||||
<sys:delRow url="${ctx}/manipulation/ddos/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/manipulation/ddos/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/manipulation/ddos/exportDdos?functionId=${cfg.functionId }" searchUrl="${ctx}/manipulation/ddos/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/manipulation/ddos/exportDdos?functionId=${cfg.functionId }" searchUrl="${ctx}/manipulation/ddos/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/manipulation/ddos/exportDdos?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/manipulation/ddos/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/manipulation/ddos/exportDdos?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/manipulation/ddos/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="ddos:ip:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -318,41 +330,41 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th class="sort-column r.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column r.action"><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="log_total"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<%-- <th column="seq" ><spring:message code="seq"/></th> --%>
|
||||
<th column="cfg_id" class="sort-column r.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column r.action"><spring:message code="block_type"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
|
||||
<th><spring:message code="antiddos_protocol"/></th>
|
||||
<th><spring:message code="bps_threadshold"/></th>
|
||||
<th><spring:message code="pps_threadshold"/></th>
|
||||
<th column="antiddos_protocol" ><spring:message code="antiddos_protocol"/></th>
|
||||
<th column="bps_threadshold" ><spring:message code="bps_threadshold"/></th>
|
||||
<th column="pps_threadshold" ><spring:message code="pps_threadshold"/></th>
|
||||
|
||||
<th><spring:message code="ip_type"/></th>
|
||||
<%-- <th><spring:message code="client_ip"/></th>
|
||||
<th><spring:message code="client_port"/></th> --%>
|
||||
<th><spring:message code="ip_pattern"/></th>
|
||||
<th><spring:message code="server_ip"/></th>
|
||||
<th><spring:message code="port_pattern"/></th>
|
||||
<th><spring:message code="server_port"/></th>
|
||||
<th><spring:message code="direction"/></th>
|
||||
<th><spring:message code="protocol"/></th>
|
||||
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||
<%-- <th column="client_ip" ><spring:message code="client_ip"/></th>
|
||||
<th column="client_port" ><spring:message code="client_port"/></th> --%>
|
||||
<th column="ip_pattern" ><spring:message code="ip_pattern"/></th>
|
||||
<th column="server_ip" ><spring:message code="server_ip"/></th>
|
||||
<th column="port_pattern" ><spring:message code="port_pattern"/></th>
|
||||
<th column="server_port" ><spring:message code="server_port"/></th>
|
||||
<th column="direction" ><spring:message code="direction"/></th>
|
||||
<th column="protocol" ><spring:message code="protocol"/></th>
|
||||
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th column="operation" ><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -161,8 +161,20 @@
|
||||
<shiro:hasPermission name="dns:fake:ip:config">
|
||||
<sys:delRow url="${ctx}/cfg/dnsIp/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/cfg/dnsIp/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/cfg/dnsIp/exportDnsIp?functionId=${cfg.functionId }" searchUrl="${ctx}/cfg/dnsIp/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/cfg/dnsIp/exportDnsIp?functionId=${cfg.functionId }" searchUrl="${ctx}/cfg/dnsIp/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/cfg/dnsIp/exportDnsIp?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/cfg/dnsIp/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/cfg/dnsIp/exportDnsIp?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/cfg/dnsIp/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="dns:fake:ip:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -315,30 +327,30 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th class="sort-column r.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column r.action"><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="group"/></th>
|
||||
<th><spring:message code="ip_type"/></th>
|
||||
<th><spring:message code="IP"/></th>
|
||||
<%-- <th><spring:message code="port"/></th> --%>
|
||||
<th><spring:message code="ip_pattern"/></th>
|
||||
<%-- <th><spring:message code="port_pattern"/></th> --%>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
<%-- <th column="seq" ><spring:message code="seq"/></th> --%>
|
||||
<th column="cfg_id" class="sort-column r.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column r.action"><spring:message code="block_type"/></th>
|
||||
<th column="group" ><spring:message code="group"/></th>
|
||||
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||
<th column="IP" ><spring:message code="IP"/></th>
|
||||
<%-- <th column="port" ><spring:message code="port"/></th> --%>
|
||||
<th column="ip_pattern" ><spring:message code="ip_pattern"/></th>
|
||||
<%-- <th column="port_pattern" ><spring:message code="port_pattern"/></th> --%>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<%-- <th column="log_total" ><spring:message code="log_total"/></th> --%>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th column="operation" ><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -215,8 +215,20 @@
|
||||
<shiro:hasPermission name="encryptedtunnelbehav:config">
|
||||
<sys:delRow url="${ctx}/encryptedtunnelbehav/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/encryptedtunnelbehav/updateValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/encryptedtunnelbehav/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/encryptedtunnelbehav/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/encryptedtunnelbehav/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}" searchUrl="${ctx}/encryptedtunnelbehav/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/encryptedtunnelbehav/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=excel" searchUrl="${ctx}/encryptedtunnelbehav/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/encryptedtunnelbehav/exportIpAddr?functionId=${cfg.functionId }&specServiceId=${cfg.specServiceId}&exType=csv" searchUrl="${ctx}/encryptedtunnelbehav/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="encryptedtunnelbehav:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -186,8 +186,20 @@
|
||||
<shiro:hasPermission name="fileTransfer:ftp:config">
|
||||
<sys:delRow url="${ctx}/ntc/fileTransfer/ftpForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/fileTransfer/updateFtpCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/fileTransfer/exportftp?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/fileTransfer/ftpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/fileTransfer/exportftp?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/fileTransfer/ftpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/fileTransfer/exportftp?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/fileTransfer/ftpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/fileTransfer/exportftp?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/fileTransfer/ftpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="fileTransfer:ftp:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -200,8 +200,20 @@
|
||||
<shiro:hasPermission name="fileTransfer:p2p:config">
|
||||
<sys:delRow url="${ctx}/ntc/fileTransfer/p2pForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/fileTransfer/updateP2pCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/fileTransfer/exportP2p?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/fileTransfer/p2pList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/fileTransfer/exportP2p?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/fileTransfer/p2pList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/fileTransfer/exportP2p?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/fileTransfer/p2pList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/fileTransfer/exportP2p?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/fileTransfer/p2pList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="fileTransfer:p2p:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -213,8 +213,20 @@
|
||||
<shiro:hasPermission name="intercept:${fn:toLowerCase(interceptType)}:config">
|
||||
<sys:delRow url="${ctx}/proxy/intercept/intercept${interceptType}Form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/intercept/updateIntercept${interceptType}Valid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/intercept/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/${fn:toLowerCase(interceptType)}/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/proxy/intercept/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/${fn:toLowerCase(interceptType)}/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/proxy/intercept/exportIpAddr?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/proxy/intercept/${fn:toLowerCase(interceptType)}/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/proxy/intercept/exportIpAddr?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/proxy/intercept/${fn:toLowerCase(interceptType)}/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="intercept:${fn:toLowerCase(interceptType)}:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -371,25 +383,25 @@
|
||||
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<c:if test="${cfg.functionId eq 201 }">
|
||||
<th column="ratelimit" ><spring:message code="ratelimit"/></th>
|
||||
<th column="userregion2" ><spring:message code="ratelimit"/></th>
|
||||
<%-- <th column="bandwith" ><spring:message code="bandwith"/></th> --%>
|
||||
<th column="intercept_file_strategy" ><spring:message code="intercept_file_strategy"/></th>
|
||||
<th column="userregion1" ><spring:message code="intercept_file_strategy"/></th>
|
||||
</c:if>
|
||||
<c:if test="${cfg.functionId eq 200 }">
|
||||
<%-- <th column="bandwith" ><spring:message code="bandwith"/></th> --%>
|
||||
<th column="intercept_file_strategy" ><spring:message code="intercept_file_strategy"/></th>
|
||||
<th column="userRegion1" ><spring:message code="intercept_file_strategy"/></th>
|
||||
</c:if>
|
||||
<c:if test="${cfg.functionId eq 212 }">
|
||||
<th column="replace_zone" ><spring:message code="replace_zone"/></th>
|
||||
<th column="replaced_content" ><spring:message code="replaced_content"/></th>
|
||||
<th column="replace_content" ><spring:message code="replace_content"/></th>
|
||||
<th column="userregion1" ><spring:message code="replace_zone"/></th>
|
||||
<th column="userregion2" ><spring:message code="replaced_content"/></th>
|
||||
<th column="userregion3" ><spring:message code="replace_content"/></th>
|
||||
</c:if>
|
||||
<c:if test="${cfg.functionId eq 214 }">
|
||||
<th column="Spoofing" ><spring:message code="Spoofing"/></th>
|
||||
<th column="With" ><spring:message code="With"/></th>
|
||||
<th column="userregion1" ><spring:message code="Spoofing"/></th>
|
||||
<th column="userregion2" ><spring:message code="With"/></th>
|
||||
</c:if>
|
||||
<c:if test="${cfg.functionId eq 201 }">
|
||||
<th column="intercept_intensity" ><spring:message code="intercept_intensity"/></th>
|
||||
<th column="userregion1" ><spring:message code="intercept_intensity"/></th>
|
||||
</c:if>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<%-- <th column="do_log" ><spring:message code="do_log"/></th> --%>
|
||||
|
||||
@@ -123,8 +123,20 @@
|
||||
<shiro:hasPermission name="proxy:intercept:config">
|
||||
<sys:delRow url="${ctx}/proxy/intercept/strateagy/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/intercept/strateagy/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/intercept/strateagy/exportPxy?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/strateagy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/proxy/intercept/strateagy/exportPxy?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/strateagy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/proxy/intercept/strateagy/exportPxy?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/proxy/intercept/strateagy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/proxy/intercept/strateagy/exportPxy?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/proxy/intercept/strateagy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="proxy:intercept:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -202,8 +202,20 @@
|
||||
<shiro:hasPermission name="proxy:trustedCert:config">
|
||||
<sys:delRow url="${ctx}/proxy/intercept/strateagy/trustedCertForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/intercept/strateagy/trustedCertDelete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/intercept/strateagy/exportCert?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/strateagy/trustedCertList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/proxy/intercept/strateagy/exportCert?functionId=${cfg.functionId }" searchUrl="${ctx}/proxy/intercept/strateagy/trustedCertList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/proxy/intercept/strateagy/exportCert?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/proxy/intercept/strateagy/trustedCertList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/proxy/intercept/strateagy/exportCert?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/proxy/intercept/strateagy/trustedCertList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="proxy:trustedCert:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -198,8 +198,20 @@
|
||||
<shiro:hasPermission name="iplist:config">
|
||||
<sys:delRow url="${ctx}/ntc/iplist/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/iplist/updateValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/iplist/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/iplist/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/iplist/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/iplist/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/iplist/exportIpAddr?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/iplist/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/iplist/exportIpAddr?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/iplist/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="iplist:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -201,8 +201,20 @@
|
||||
<shiro:hasPermission name="mail:config">
|
||||
<sys:delRow url="${ctx}/ntc/mail/mailForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/mail/updateMailCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/mail/exportmail?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/mail/mailList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/mail/exportmail?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/mail/mailList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/mail/exportmail?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/mail/mailList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/mail/exportmail?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/mail/mailList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="mail:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -145,8 +145,20 @@
|
||||
<shiro:hasPermission name="dns:res:strategy:config">
|
||||
<sys:delRow url="${ctx}/maintenance/dnsResStrategy/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/maintenance/dnsResStrategy/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/maintenance/dnsResStrategy/exportDns?functionId=${cfg.functionId }" searchUrl="${ctx}/maintenance/dnsResStrategy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/maintenance/dnsResStrategy/exportDns?functionId=${cfg.functionId }" searchUrl="${ctx}/maintenance/dnsResStrategy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/maintenance/dnsResStrategy/exportDns?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/maintenance/dnsResStrategy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/maintenance/dnsResStrategy/exportDns?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/maintenance/dnsResStrategy/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="dns:res:strategy:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -200,8 +200,20 @@
|
||||
<shiro:hasPermission name="other:bgp:config">
|
||||
<sys:delRow url="${ctx}/ntc/other/bgpForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/other/updateBgpCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/other/exportbgp?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/other/bgpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/other/exportbgp?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/other/bgpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/other/exportbgp?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/other/bgpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/other/exportbgp?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/other/bgpList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="other:bgp:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -180,8 +180,20 @@
|
||||
<shiro:hasPermission name="${configPermissionName }">
|
||||
<sys:delRow url="${ctx}/proxy/cache/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/cache/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/cache/exportHttp?functionId=${cfg.functionId }" id="contentTable" searchUrl="${actionPath }" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/proxy/cache/exportHttp?functionId=${cfg.functionId }" id="contentTable" searchUrl="${actionPath }" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<!-- <div class="btn-group"> -->
|
||||
<!-- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"> -->
|
||||
<%-- <i class="fa fa-wrench"></i> <spring:message code="export"></spring:message> --%>
|
||||
<!-- <i class="fa fa-angle-down"></i> -->
|
||||
<!-- </button> -->
|
||||
<!-- <ul class="dropdown-menu pull-right" style="min-width: 110px;" > -->
|
||||
<%-- <li><sys:delRow url="${ctx}/proxy/cache/exportHttp?functionId=${cfg.functionId }&exType=excel" id="contentTable" searchUrl="${actionPath }" label="cfg_excel"></sys:delRow></li> --%>
|
||||
<%-- <li><sys:delRow url="${ctx}/proxy/cache/exportHttp?functionId=${cfg.functionId }&exType=csv" id="contentTable" searchUrl="${actionPath }" label="cfg_csv"></sys:delRow></li> --%>
|
||||
<!-- </ul> -->
|
||||
<!-- </div> -->
|
||||
|
||||
<shiro:hasPermission name="${confirmPermissionName }">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
|
||||
@@ -385,8 +385,20 @@
|
||||
<shiro:hasPermission name="${configPermissionName }">
|
||||
<sys:delRow url="${ctx}/proxy/control/httpRedirect/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/control/httpRedirect/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/proxy/control/httpRedirect/exportHttp?functionId=${cfg.functionId }" id="contentTable" searchUrl="${actionPath }" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/proxy/control/httpRedirect/exportHttp?functionId=${cfg.functionId }" id="contentTable" searchUrl="${actionPath }" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/proxy/control/httpRedirect/exportHttp?functionId=${cfg.functionId }&exType=excel" id="contentTable" searchUrl="${actionPath }" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/proxy/control/httpRedirect/exportHttp?functionId=${cfg.functionId }&exType=csv" id="contentTable" searchUrl="${actionPath }" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="${confirmPermissionName }">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -546,42 +558,42 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<c:if test="${action == 16}">
|
||||
<th><spring:message code="response_code"/></th>
|
||||
<th><spring:message code="response_content"/></th>
|
||||
<th column="response_code" ><spring:message code="response_code"/></th>
|
||||
<th column="response_content" ><spring:message code="response_content"/></th>
|
||||
</c:if>
|
||||
<c:if test="${action == 48}">
|
||||
<th><spring:message code="redirect_response_code"/></th>
|
||||
<th><spring:message code="redirect_url"/></th>
|
||||
<th column="redirect_response_code" ><spring:message code="redirect_response_code"/></th>
|
||||
<th column="redirect_url" ><spring:message code="redirect_url"/></th>
|
||||
</c:if>
|
||||
<c:if test="${action == 80}">
|
||||
<th><spring:message code="replace_zone"/></th>
|
||||
<th><spring:message code="replaced_content"/></th>
|
||||
<th><spring:message code="replace_content"/></th>
|
||||
<th column="replace_zone" ><spring:message code="replace_zone"/></th>
|
||||
<th column="replaced_content" ><spring:message code="replaced_content"/></th>
|
||||
<th column="replace_content" ><spring:message code="replace_content"/></th>
|
||||
</c:if>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<c:if test="${action ne 128}">
|
||||
<th><spring:message code="do_log"/></th>
|
||||
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||
</c:if>
|
||||
<c:if test="${action ne 128}">
|
||||
<th><spring:message code="log_total"/></th>
|
||||
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||
</c:if>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -298,26 +298,26 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th class="sort-column r.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
|
||||
<th><spring:message code="group"/></th>
|
||||
<th><spring:message code="ip_type"/></th>
|
||||
<th><spring:message code="IP"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
<%-- <th column="seq" ><spring:message code="seq"/></th> --%>
|
||||
<th column="cfg_id" class="sort-column r.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
|
||||
<th column="group" ><spring:message code="group"/></th>
|
||||
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||
<th column="IP" ><spring:message code="IP"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<%-- <th column="log_total" ><spring:message code="log_total"/></th> --%>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th column="operation" ><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -75,10 +75,22 @@
|
||||
<button type="button" class="btn btn-default" onClick="edit(${requestInfo.functionId})">
|
||||
<i class="fa fa-edit"></i> <spring:message code="edit"></spring:message></button>
|
||||
<sys:delRow url="${ctx}/cfg/request/delete?functionId=${requestInfo.functionId}" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/cfg/request/exportRequestInfo?functionId=${requestInfo.functionId}" searchUrl="${ctx}/cfg/request/list?functionId=${requestInfo.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/cfg/request/exportRequestInfo?functionId=${requestInfo.functionId}" searchUrl="${ctx}/cfg/request/list?functionId=${requestInfo.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
<!-- <button type="button" class="btn btn-default">
|
||||
<i class="fa fa-download"></i> 导出</button> -->
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/cfg/request/exportRequestInfo?functionId=${requestInfo.functionId}&exType=excel" searchUrl="${ctx}/cfg/request/list?functionId=${requestInfo.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/cfg/request/exportRequestInfo?functionId=${requestInfo.functionId}&exType=csv" searchUrl="${ctx}/cfg/request/list?functionId=${requestInfo.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="cfg:requestInfo:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -173,20 +185,20 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th><spring:message code="Id"></spring:message></th>
|
||||
<th><spring:message code="title"></spring:message></th>
|
||||
<th><spring:message code="request_organization"></spring:message></th>
|
||||
<th><spring:message code="request_time"></spring:message></th>
|
||||
<th><spring:message code="state"></spring:message></th>
|
||||
<th><spring:message code="request_number"></spring:message></th>
|
||||
<th><spring:message code="content"></spring:message></th>
|
||||
<th><spring:message code="special_task"></spring:message></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column createTime"><spring:message code="create_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column editTime"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"></spring:message></th>
|
||||
<th class="sort-column auditTime"><spring:message code="audit_time"></spring:message></th>
|
||||
<th column="Id" ><spring:message code="Id"></spring:message></th>
|
||||
<th column="title" ><spring:message code="title"></spring:message></th>
|
||||
<th column="request_organization" ><spring:message code="request_organization"></spring:message></th>
|
||||
<th column="request_time" ><spring:message code="request_time"></spring:message></th>
|
||||
<th column="state" ><spring:message code="state"></spring:message></th>
|
||||
<th column="request_number" ><spring:message code="request_number"></spring:message></th>
|
||||
<th column="content" ><spring:message code="content"></spring:message></th>
|
||||
<th column="special_task" ><spring:message code="special_task"></spring:message></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="create_time" class="sort-column createTime"><spring:message code="create_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column editTime"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"></spring:message></th>
|
||||
<th column="audit_time" class="sort-column auditTime"><spring:message code="audit_time"></spring:message></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -198,8 +198,20 @@
|
||||
<shiro:hasPermission name="website:dns:config">
|
||||
<sys:delRow url="${ctx}/ntc/website/dnsForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/website/updateDnsCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/website/exportdns?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/website/dnsList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/website/exportdns?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/website/dnsList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/website/exportdns?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/website/dnsList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/website/exportdns?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/website/dnsList?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="website:dns:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -352,25 +364,25 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="policy_name"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="log_total"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th column="policy_name" ><spring:message code="policy_name"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -356,8 +356,20 @@
|
||||
<shiro:hasPermission name="website:http:config">
|
||||
<sys:delRow url ="${ctx}/ntc/website/httpForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/website/updateHttpCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/website/exportHttp?functionId=${cfg.functionId }" id="contentTable" searchUrl="${ctx}/ntc/website/httpList?functionId=${cfg.functionId}" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/website/exportHttp?functionId=${cfg.functionId }" id="contentTable" searchUrl="${ctx}/ntc/website/httpList?functionId=${cfg.functionId}" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/website/exportHttp?functionId=${cfg.functionId }&exType=excel" id="contentTable" searchUrl="${ctx}/ntc/website/httpList?functionId=${cfg.functionId}" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/website/exportHttp?functionId=${cfg.functionId }&exType=csv" id="contentTable" searchUrl="${ctx}/ntc/website/httpList?functionId=${cfg.functionId}" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="website:http:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -510,24 +522,24 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="log_total"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -197,8 +197,20 @@
|
||||
<shiro:hasPermission name="website:ssl:config">
|
||||
<sys:delRow url="${ctx}/ntc/website/sslForm" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/website/updateSslCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/website/exportSsl?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/website/sslLists?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/website/exportSsl?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/website/sslLists?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/website/exportSsl?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/website/sslLists?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/website/exportSsl?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/website/sslLists?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="website:ssl:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -351,24 +363,24 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="log_total"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -178,8 +178,20 @@
|
||||
<shiro:hasPermission name="whitelist:domain:config">
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/domain/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/domain/updateValid?isValid=-1&functionId=${cfg.functionId}" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/exportdomain?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/whitelist/domain/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/whitelist/exportdomain?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/whitelist/domain/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/whitelist/exportdomain?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/whitelist/domain/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/whitelist/exportdomain?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/whitelist/domain/list?functionId=${cfg.functionId}" id="contentTable" maxRow="10000" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="whitelist:domain:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -332,25 +344,25 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="log_total"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th><spring:message code="source_compile_id"/></th>
|
||||
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th>
|
||||
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th column="source_compile_id" ><spring:message code="source_compile_id"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@@ -198,8 +198,20 @@
|
||||
<shiro:hasPermission name="whitelist:ip:config">
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/ip/form" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/updateIpValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/whitelist/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/whitelist/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="export"></sys:delRow>
|
||||
<%-- <sys:delRow url="${ctx}/ntc/whitelist/exportIpAddr?functionId=${cfg.functionId }" searchUrl="${ctx}/ntc/whitelist/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="export"></sys:delRow> --%>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/ntc/whitelist/exportIpAddr?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/ntc/whitelist/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/whitelist/exportIpAddr?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/ntc/whitelist/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<shiro:hasPermission name="whitelist:ip:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
@@ -352,25 +364,25 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<%-- <th><spring:message code="do_log"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th> --%>
|
||||
<th column="cfg_id" class="sort-column a.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
||||
<th column="config_describe" class="sort-column a.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
||||
<th column="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||
<%-- <th column="do_log" ><spring:message code="do_log"/></th>
|
||||
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||
<th column="letter" ><spring:message code="letter"/></th>
|
||||
<th column="classification" ><spring:message code="classification"/></th>
|
||||
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||
<th column="label" ><spring:message code="label"/></th> --%>
|
||||
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||
<%-- <th column="log_total" ><spring:message code="log_total"/></th> --%>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user