业务配置导出首行增加标题和时间范围
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
|
* @author zhangwei
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -72,48 +73,58 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class AppFeatureCfgController extends BaseController {
|
public class AppFeatureCfgController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* app协议复杂特征配置列表
|
* app协议复杂特征配置列表
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"multiFeatureCfgList"})
|
@RequestMapping(value = { "multiFeatureCfgList" })
|
||||||
public String multiFeatureCfgList(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String multiFeatureCfgList(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg,
|
||||||
Page<AppFeatureIndex> searchPage=new Page<AppFeatureIndex>(request,response,"r");
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
Page<AppFeatureIndex> searchPage = new Page<AppFeatureIndex>(request, response, "r");
|
||||||
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg);
|
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(searchPage, cfg);
|
||||||
for(AppFeatureIndex entity:page.getList()){
|
for (AppFeatureIndex entity : page.getList()) {
|
||||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
entity.setAppName(app.getSpecServiceName());
|
entity.setAppName(app.getSpecServiceName());
|
||||||
}
|
}
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/app/appMultiFeatureCfgList";
|
return "/cfg/app/appMultiFeatureCfgList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征配置表单
|
* 特征配置表单
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param entity
|
* @param entity
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"multiFeatureCfgForm"})
|
@RequestMapping(value = { "multiFeatureCfgForm" })
|
||||||
public String multiFeatureCfgForm(Model model,String ids,AppFeatureIndex entity) {
|
public String multiFeatureCfgForm(Model model, String ids, AppFeatureIndex entity) {
|
||||||
if(StringUtils.isNotBlank(ids)){
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(ids));
|
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(ids));
|
||||||
entity.setIpPortList(appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
entity.setIpPortList(
|
||||||
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
appMultiFeatureCfgService.getAppIpRangeCfg(entity.getCompileId(), entity.getFunctionId()));
|
||||||
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
entity.setStrList(appMultiFeatureCfgService.getAppStringFeatureCfg(entity.getCompileId(),
|
||||||
entity.setNumCfgList(appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(),null));
|
entity.getFunctionId(), null));
|
||||||
initUpdateFormCondition(model,entity);
|
entity.setComplexList(appMultiFeatureCfgService.getAppComplexFeatureCfg(entity.getCompileId(),
|
||||||
}else{
|
entity.getFunctionId(), null));
|
||||||
initFormCondition(model,entity);
|
entity.setNumCfgList(
|
||||||
|
appMultiFeatureCfgService.getAppTcpCfg(entity.getCompileId(), entity.getFunctionId(), null));
|
||||||
|
initUpdateFormCondition(model, entity);
|
||||||
|
} else {
|
||||||
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/app/appMultiFeatureCfgForm";
|
return "/cfg/app/appMultiFeatureCfgForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 特征配置新增修改
|
* 特征配置新增修改
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -121,29 +132,32 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"saveAppMultiFeatureCfg"})
|
@RequestMapping(value = { "saveAppMultiFeatureCfg" })
|
||||||
public String saveAppMultiFeatureCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
public String saveAppMultiFeatureCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
AppFeatureIndex entity,RedirectAttributes redirectAttributes) {
|
AppFeatureIndex entity, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
SpecificServiceCfg specificService = specificServiceCfgService
|
||||||
if(specificService!=null){
|
.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
|
if (specificService != null) {
|
||||||
entity.setAppCode(specificService.getSpecServiceCode());
|
entity.setAppCode(specificService.getSpecServiceCode());
|
||||||
}
|
}
|
||||||
appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity);
|
appMultiFeatureCfgService.saveOrUpdateAppFeatureCfg(entity);
|
||||||
addMessage(redirectAttributes,"success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "save_failed");
|
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 isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -151,19 +165,14 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"auditAppFeatureCfg"})
|
@RequestMapping(value = { "auditAppFeatureCfg" })
|
||||||
public String auditAppFeatureCfg(Model model,@ModelAttribute("cfg")AppFeatureIndex cfg,
|
public String auditAppFeatureCfg(Model model, @ModelAttribute("cfg") AppFeatureIndex cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
AppFeatureIndex entity = new AppFeatureIndex();
|
AppFeatureIndex entity = new AppFeatureIndex();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id));
|
entity = appMultiFeatureCfgService.getAppFeatureIndex(Long.parseLong(id));
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
@@ -171,247 +180,264 @@ public class AppFeatureCfgController extends BaseController {
|
|||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
try {
|
try {
|
||||||
appMultiFeatureCfgService.auditAppFeatureCfg(entity,isAudit);
|
appMultiFeatureCfgService.auditAppFeatureCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
logger.error("app 特征配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("app 特征配置下发失败:"+e.getMessage());
|
logger.error("app 特征配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
Page<AppPolicyCfg> auditPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return multiFeatureCfgList(model, cfg, request, response);
|
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 isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"updateAppFeatureCfgValid"})
|
@RequestMapping(value = { "updateAppFeatureCfgValid" })
|
||||||
public String updateAppFeatureCfgValid(Integer isValid,String ids,Integer functionId) {
|
public String updateAppFeatureCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid,ids,functionId);
|
appMultiFeatureCfgService.updateAppFeatureCfgValid(isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath +"/app/feature/multiFeatureCfgList?functionId="+functionId;
|
return "redirect:" + adminPath + "/app/feature/multiFeatureCfgList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询特征子配置
|
* 查询特征子配置
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfgId
|
* @param cfgId
|
||||||
* @param index
|
* @param index
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"ajaxAppFeatureList"})
|
@RequestMapping(value = { "ajaxAppFeatureList" })
|
||||||
public String ajaxAppFeatureList(Model model,Long cfgId,Integer compileId,Integer functionId,Integer index) {
|
public String ajaxAppFeatureList(Model model, Long cfgId, Integer compileId, Integer functionId, Integer index) {
|
||||||
List<AppIpCfg> ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId,functionId);
|
List<AppIpCfg> ipRangeList = appMultiFeatureCfgService.getAppIpRangeCfg(compileId, functionId);
|
||||||
AppFeatureIndex cfg = appMultiFeatureCfgService.getAppFeatureIndex(cfgId);
|
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[] cfgRegionValue = cfg.getCfgRegionValue().split(",");
|
||||||
String[] cfgRegionType = cfg.getCfgRegionType().split(",");
|
String[] cfgRegionType = cfg.getCfgRegionType().split(",");
|
||||||
String[] cfgRegionCode = cfg.getCfgRegionCode1().split(",");
|
String[] cfgRegionCode = cfg.getCfgRegionCode1().split(",");
|
||||||
if(cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length==cfgRegionCode.length){
|
if (cfgRegionValue.length == cfgRegionType.length && cfgRegionValue.length == cfgRegionCode.length) {
|
||||||
for(int i=0;i<cfgRegionValue.length;i++){
|
for (int i = 0; i < cfgRegionValue.length; i++) {
|
||||||
Map<String,Object> map = new HashMap();
|
Map<String, Object> map = new HashMap();
|
||||||
map.put("regionType", cfgRegionType[i]);
|
map.put("regionType", cfgRegionType[i]);
|
||||||
map.put("regionValue", cfgRegionValue[i]);
|
map.put("regionValue", cfgRegionValue[i]);
|
||||||
if("1".equals(cfgRegionType[i])){
|
if ("1".equals(cfgRegionType[i])) {
|
||||||
map.put("ipRangeList", ipRangeList);
|
map.put("ipRangeList", ipRangeList);
|
||||||
}
|
}
|
||||||
if("2".equals(cfgRegionType[i])){
|
if ("2".equals(cfgRegionType[i])) {
|
||||||
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
List<AppStringFeatureCfg> strList = appMultiFeatureCfgService.getAppStringFeatureCfg(compileId,
|
||||||
|
functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||||
map.put("strList", strList);
|
map.put("strList", strList);
|
||||||
}
|
}
|
||||||
if("3".equals(cfgRegionType[i])){
|
if ("3".equals(cfgRegionType[i])) {
|
||||||
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService.getAppComplexFeatureCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
List<AppComplexFeatureCfg> complexList = appMultiFeatureCfgService
|
||||||
|
.getAppComplexFeatureCfg(compileId, functionId, Integer.valueOf(cfgRegionCode[i]));
|
||||||
map.put("complexList", complexList);
|
map.put("complexList", complexList);
|
||||||
}
|
}
|
||||||
if("4".equals(cfgRegionType[i])){
|
if ("4".equals(cfgRegionType[i])) {
|
||||||
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId,functionId,Integer.valueOf(cfgRegionCode[i]));
|
List<AppTcpCfg> numCfgList = appMultiFeatureCfgService.getAppTcpCfg(compileId, functionId,
|
||||||
|
Integer.valueOf(cfgRegionCode[i]));
|
||||||
map.put("numCfgList", numCfgList);
|
map.put("numCfgList", numCfgList);
|
||||||
}
|
}
|
||||||
tabList.add(map);
|
tabList.add(map);
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
Map<String,Object> map = new HashMap();
|
Map<String, Object> map = new HashMap();
|
||||||
map.put("regionType", "0");
|
map.put("regionType", "0");
|
||||||
map.put("regionValue", "query config detail error");
|
map.put("regionValue", "query config detail error");
|
||||||
tabList.add(map);
|
tabList.add(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if(ipRangeList!=null){
|
/*
|
||||||
String cfgType = null;
|
* if(ipRangeList!=null){ String cfgType = null; for(AppIpCfg
|
||||||
for(AppIpCfg ip:ipRangeList){
|
* ip:ipRangeList){ if(!ip.getCfgType().equals(cfgType)){
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
* tabList.add(new String[]{"1",ip.getCfgType()}); cfgType =
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
* ip.getCfgType(); } } } if(strList!=null){ String cfgType = null;
|
||||||
cfgType = ip.getCfgType();
|
* 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;
|
||||||
if(strList!=null){
|
* for(AppComplexFeatureCfg cfg:complexList){
|
||||||
String cfgType = null;
|
* if(!cfg.getCfgType().equals(cfgType)){ tabList.add(new
|
||||||
for(AppStringFeatureCfg cfg:strList){
|
* String[]{"3",cfg.getCfgType()}); cfgType = cfg.getCfgType();0.
|
||||||
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("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/app/appSubFeatureList";
|
return "/cfg/app/appSubFeatureList";
|
||||||
}
|
}
|
||||||
|
|
||||||
//appfeature配置导出
|
// appfeature配置导出
|
||||||
@RequestMapping(value = "exportFeature")
|
@RequestMapping(value = "exportFeature")
|
||||||
public void exportFeature(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportFeature(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")AppFeatureIndex entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") AppFeatureIndex entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
List<AppFeatureIndex> ipLists=new ArrayList<AppFeatureIndex>();
|
List<AppFeatureIndex> ipLists = new ArrayList<AppFeatureIndex>();
|
||||||
//导出选中记录
|
// 导出选中记录
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipLists=appMultiFeatureCfgService.findAppByFeatureIndexList(ids);
|
ipLists = appMultiFeatureCfgService.findAppByFeatureIndexList(ids);
|
||||||
}else{
|
} else {
|
||||||
Page<AppFeatureIndex> pageInfo=new Page<AppFeatureIndex>(request, response,"r");
|
Page<AppFeatureIndex> pageInfo = new Page<AppFeatureIndex>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(pageInfo, entity);
|
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(pageInfo, entity);
|
||||||
ipLists=page.getList();
|
ipLists = page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
for(AppFeatureIndex feature:ipLists){
|
for (AppFeatureIndex feature : ipLists) {
|
||||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId());
|
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId());
|
||||||
feature.setAppName(app.getSpecServiceName());
|
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,";
|
ipList.addAll(maps.get("APP_IP_RANGE"));
|
||||||
String appComplexNoExport=",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
}
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
if (entity.getFunctionId() != 564 && entity.getFunctionId() != 567) {
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
keywordList = replaceKeyList(keywordList);
|
||||||
String ipPortInfoNoExport=",do_log,block_type,config_describe,valid_identifier,is_audit,creator,creator"
|
titleList.add("APP_IP_RANGE");
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
classMap.put("APP_IP_RANGE", IpPortCfg.class);
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
noExportMap.put("APP_IP_RANGE", ipPortInfoNoExport);
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
dataMap.put("APP_IP_RANGE", ipList);
|
||||||
titleList.add(entity.getMenuNameCode());
|
}
|
||||||
classMap.put(entity.getMenuNameCode(), AppFeatureIndex.class);
|
if (entity.getFunctionId() == 563) {
|
||||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
titleList.add("APP_PAYLOAD");
|
||||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class);
|
||||||
List<AppComplexFeatureCfg> keywordList=new ArrayList<AppComplexFeatureCfg>();
|
noExportMap.put("APP_PAYLOAD", appComplexNoExport);
|
||||||
List<AppStringFeatureCfg> strList=new ArrayList<AppStringFeatureCfg>();
|
dataMap.put("APP_PAYLOAD", keywordList);
|
||||||
for (AppFeatureIndex cfg : ipLists) {
|
} else if (entity.getFunctionId() == 565) {
|
||||||
Map<String, List> maps=appMultiFeatureCfgService.exportFeature(cfg);
|
titleList.add("APP_HTTP");
|
||||||
if(entity.getFunctionId()!=567){
|
classMap.put("APP_HTTP", AppComplexFeatureCfg.class);
|
||||||
keywordList.addAll(maps.get("APP_KEYWORDS"));
|
noExportMap.put("APP_HTTP", appComplexNoExport);
|
||||||
}else{
|
dataMap.put("APP_HTTP", keywordList);
|
||||||
strList.addAll(maps.get("APP_DK_GL"));
|
} else if (entity.getFunctionId() == 566) {
|
||||||
}
|
titleList.add("APP_SSL");
|
||||||
ipList.addAll(maps.get("APP_IP_RANGE"));
|
classMap.put("APP_SSL", AppComplexFeatureCfg.class);
|
||||||
}
|
noExportMap.put("APP_SSL", appComplexNoExport);
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put("APP_SSL", keywordList);
|
||||||
if(entity.getFunctionId()!=564 && entity.getFunctionId()!=567 ){
|
} else if (entity.getFunctionId() == 564) {
|
||||||
keywordList=replaceKeyList(keywordList);
|
keywordList = replaceKeyList(keywordList);
|
||||||
titleList.add("APP_IP_RANGE");
|
titleList.add("APP_DNS");
|
||||||
classMap.put("APP_IP_RANGE", IpPortCfg.class);
|
classMap.put("APP_DNS", AppComplexFeatureCfg.class);
|
||||||
noExportMap.put("APP_IP_RANGE",ipPortInfoNoExport);
|
noExportMap.put("APP_DNS", appComplexNoExport);
|
||||||
dataMap.put("APP_IP_RANGE", ipList);
|
dataMap.put("APP_DNS", keywordList);
|
||||||
}
|
} else if (entity.getFunctionId() == 567) {
|
||||||
if(entity.getFunctionId()==563){
|
strList = replaceFeatureList(strList);
|
||||||
titleList.add("APP_PAYLOAD");
|
appComplexNoExport = appComplexNoExport + "district,";
|
||||||
classMap.put("APP_PAYLOAD", AppComplexFeatureCfg.class);
|
titleList.add("APP_DK");
|
||||||
noExportMap.put("APP_PAYLOAD",appComplexNoExport);
|
classMap.put("APP_DK", AppStringFeatureCfg.class);
|
||||||
dataMap.put("APP_PAYLOAD", keywordList);
|
noExportMap.put("APP_DK", appComplexNoExport);
|
||||||
}else if(entity.getFunctionId()==565){
|
dataMap.put("APP_DK", strList);
|
||||||
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){
|
String timeRange = initTimeMap(entity);
|
||||||
titleList.add("APP_SSL");
|
noExportMap.put("timeRange", timeRange);
|
||||||
classMap.put("APP_SSL", AppComplexFeatureCfg.class);
|
if ("csv".equals(entity.getExType())) {
|
||||||
noExportMap.put("APP_SSL",appComplexNoExport);
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
dataMap.put("APP_SSL", keywordList);
|
classMap, dataMap, noExportMap);
|
||||||
}else if(entity.getFunctionId()==564){
|
} else {
|
||||||
keywordList=replaceKeyList(keywordList);
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
titleList.add("APP_DNS");
|
classMap, dataMap, noExportMap);
|
||||||
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);
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Appfeature export failed",e);
|
logger.error("Appfeature export failed", e);
|
||||||
addMessage(redirectAttributes,"error","export_failed");
|
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++) {
|
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.setIsHex(base.getIsHexbin());
|
||||||
base.setIsCaseInsenstive(base.getIsHexbin());
|
base.setIsCaseInsenstive(base.getIsHexbin());
|
||||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
|
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " "));
|
||||||
}
|
}
|
||||||
return list;
|
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++) {
|
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.setIsHex(base.getIsHexbin());
|
||||||
base.setIsCaseInsenstive(base.getIsHexbin());
|
base.setIsCaseInsenstive(base.getIsHexbin());
|
||||||
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***"," "));
|
base.setCfgKeywords(Functions.replace(base.getCfgKeywords(), "***and***", " "));
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 基础协议控制类
|
* 基础协议控制类
|
||||||
|
*
|
||||||
* @author wx
|
* @author wx
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -43,52 +44,57 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class BasicProtocolController extends BaseController {
|
public class BasicProtocolController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* app策略列表
|
* app策略列表
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"list"})
|
@RequestMapping(value = { "list" })
|
||||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request,
|
||||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
HttpServletResponse response) {
|
||||||
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||||
// for(AppPolicyCfg entity:page.getList()){
|
// for(AppPolicyCfg entity:page.getList()){
|
||||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
// SpecificServiceCfg app =
|
||||||
// if(app!=null) {
|
// specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
// entity.setAppName(app.getSpecServiceName());
|
// if(app!=null) {
|
||||||
// }
|
// entity.setAppName(app.getSpecServiceName());
|
||||||
//
|
// }
|
||||||
// }
|
//
|
||||||
|
// }
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/basicprotocol/list";
|
return "/cfg/basicprotocol/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询APP策略IP子配置
|
* 查询APP策略IP子配置
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfgId
|
* @param cfgId
|
||||||
* @param index
|
* @param index
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"ajaxIpList"})
|
@RequestMapping(value = { "ajaxIpList" })
|
||||||
public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId,compileId);
|
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if(cfg.getIpPortList()!=null){
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) {
|
||||||
if(!ntc.getCfgType().equals(cfgType)){
|
if (!ntc.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
tabList.add(new String[] { "2", ntc.getCfgType() });
|
||||||
cfgType = ntc.getCfgType();
|
cfgType = ntc.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,27 +104,31 @@ public class BasicProtocolController extends BaseController {
|
|||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/basicprotocol/basicProtocolSubList";
|
return "/cfg/basicprotocol/basicProtocolSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置表单
|
* 策略配置表单
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param entity
|
* @param entity
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"form"})
|
@RequestMapping(value = { "form" })
|
||||||
@RequiresPermissions(value={"basicprotocol:config"})
|
@RequiresPermissions(value = { "basicprotocol:config" })
|
||||||
public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) {
|
public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) {
|
||||||
if(StringUtils.isNotBlank(ids)){
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null);
|
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null);
|
||||||
initUpdateFormCondition(model,entity);
|
initUpdateFormCondition(model, entity);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model,entity);
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/basicprotocol/form";
|
return "/cfg/basicprotocol/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置新增修改
|
* 策略配置新增修改
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -126,34 +136,37 @@ public class BasicProtocolController extends BaseController {
|
|||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"save"})
|
@RequestMapping(value = { "save" })
|
||||||
@RequiresPermissions(value={"basicprotocol:config"})
|
@RequiresPermissions(value = { "basicprotocol:config" })
|
||||||
public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
AppPolicyCfg entity,RedirectAttributes redirectAttributes) {
|
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
SpecificServiceCfg specificService = specificServiceCfgService
|
||||||
if(specificService!=null){
|
.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
|
if (specificService != null) {
|
||||||
entity.setAppCode(specificService.getSpecServiceCode());
|
entity.setAppCode(specificService.getSpecServiceCode());
|
||||||
}
|
}
|
||||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("基础协议信息保存失败",e);
|
logger.error("基础协议信息保存失败", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
// addMessage(redirectAttributes,e.getMessage());
|
// addMessage(redirectAttributes,e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else if(e instanceof CallExternalProceduresException) {
|
} else if (e instanceof CallExternalProceduresException) {
|
||||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
addMessage(redirectAttributes, "error", "save_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+entity.getFunctionId();
|
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置审核
|
* 策略配置审核
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -161,21 +174,16 @@ public class BasicProtocolController extends BaseController {
|
|||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"audit"})
|
@RequestMapping(value = { "audit" })
|
||||||
@RequiresPermissions(value={"basicprotocol:confirm"})
|
@RequiresPermissions(value = { "basicprotocol:confirm" })
|
||||||
public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,
|
public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
AppPolicyCfg entity = new AppPolicyCfg();
|
AppPolicyCfg entity = new AppPolicyCfg();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null);
|
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
@@ -183,138 +191,167 @@ public class BasicProtocolController extends BaseController {
|
|||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
|
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_BASIC_PROTOCOL);
|
||||||
try {
|
try {
|
||||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
appCfgService.auditAppPolicyCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success","audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("app策略配置下发失败:"+e.getMessage());;
|
logger.info("app策略配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
;
|
||||||
}else {
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("app策略配置下发失败",e);
|
logger.error("app策略配置下发失败", e);
|
||||||
addMessage(redirectAttributes,"error","audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
Page<AppPolicyCfg> auditPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return policyCfgList(model, cfg, request, response);
|
return policyCfgList(model, cfg, request, response);
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/basicprotocol/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/basicprotocol/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置删除
|
* 策略配置删除
|
||||||
|
*
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"updateValid"})
|
@RequestMapping(value = { "updateValid" })
|
||||||
@RequiresPermissions(value={"basicprotocol:config"})
|
@RequiresPermissions(value = { "basicprotocol:config" })
|
||||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("基础协议信息保存失败",e);
|
logger.error("基础协议信息保存失败", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else if(e instanceof CallExternalProceduresException) {
|
} else if (e instanceof CallExternalProceduresException) {
|
||||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||||
}else {
|
} else {
|
||||||
e.printStackTrace();
|
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配置导出
|
// ip配置导出
|
||||||
@RequestMapping(value = "exportIpAddr")
|
@RequestMapping(value = "exportIpAddr")
|
||||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")AppPolicyCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") AppPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
List<AppPolicyCfg> ipLists=new ArrayList<AppPolicyCfg>();
|
List<AppPolicyCfg> ipLists = new ArrayList<AppPolicyCfg>();
|
||||||
//导出选中记录
|
// 导出选中记录
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipLists=appCfgService.findAppByPolicyList(ids);
|
ipLists = appCfgService.findAppByPolicyList(ids);
|
||||||
}else{
|
} else {
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
|
Page<AppPolicyCfg> pageInfo = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||||
ipLists=page.getList();
|
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");
|
|
||||||
}
|
}
|
||||||
//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
|
* @author wx
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -45,103 +46,117 @@ import com.nis.web.security.UserUtils;
|
|||||||
public class EncryptedTunnelBehaviorController extends BaseController {
|
public class EncryptedTunnelBehaviorController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* app策略列表
|
* app策略列表
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"list"})
|
@RequestMapping(value = { "list" })
|
||||||
public String policyCfgList(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String policyCfgList(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, HttpServletRequest request,
|
||||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
HttpServletResponse response) {
|
||||||
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(searchPage, cfg);
|
||||||
// for(AppPolicyCfg entity:page.getList()){
|
// for(AppPolicyCfg entity:page.getList()){
|
||||||
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
// SpecificServiceCfg app =
|
||||||
// if(app!=null) {
|
// specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
// entity.setAppName(app.getSpecServiceName());
|
// if(app!=null) {
|
||||||
// }
|
// entity.setAppName(app.getSpecServiceName());
|
||||||
// }
|
// }
|
||||||
// //查找社交应用的所有有效二级特定服务
|
// }
|
||||||
// SpecificServiceCfg second=new SpecificServiceCfg();
|
// //查找社交应用的所有有效二级特定服务
|
||||||
// for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
// SpecificServiceCfg second=new SpecificServiceCfg();
|
||||||
// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
// for(SysDataDictionaryItem
|
||||||
// second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
// dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||||
// break;
|
// if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue()))
|
||||||
// }
|
// {
|
||||||
// }
|
// second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
||||||
// second.setIsValid(Constants.VALID_YES);
|
// break;
|
||||||
// second.setIsLeaf(1);
|
// }
|
||||||
// List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
// }
|
||||||
// //遍历,找到匹配项后将行为设置进去
|
// second.setIsValid(Constants.VALID_YES);
|
||||||
// for(AppPolicyCfg entity:page.getList()){
|
// second.setIsLeaf(1);
|
||||||
// if(entity.getBehavCode()==null) continue;
|
// List<SpecificServiceCfg>
|
||||||
// for(SpecificServiceCfg secondCfg:secondList) {
|
// secondList=specificServiceCfgService.findAllSpecificServiceCfg(second,
|
||||||
// if(secondCfg.getSpecServiceCode()==null) continue;
|
// null);
|
||||||
// if(secondCfg.getSpecServiceCode().intValue()==entity.getBehavCode().intValue()) {
|
// //遍历,找到匹配项后将行为设置进去
|
||||||
// entity.setBehavName(secondCfg.getSpecServiceName());
|
// for(AppPolicyCfg entity:page.getList()){
|
||||||
// break;
|
// 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);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/encryptedtunnelbehav/list";
|
return "/cfg/encryptedtunnelbehav/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询APP策略IP子配置
|
* 查询APP策略IP子配置
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param cfgId
|
* @param cfgId
|
||||||
* @param index
|
* @param index
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"ajaxIpList"})
|
@RequestMapping(value = { "ajaxIpList" })
|
||||||
public String ajaxSslSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
public String ajaxSslSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId,compileId);
|
AppPolicyCfg cfg = appCfgService.getAppPolicyCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if(cfg.getIpPortList()!=null){
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
|
for (NtcSubscribeIdCfg ntc : cfg.getNtcSubscribeIdCfgList()) {
|
||||||
if(!ntc.getCfgType().equals(cfgType)){
|
if (!ntc.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",ntc.getCfgType()});
|
tabList.add(new String[] { "2", ntc.getCfgType() });
|
||||||
cfgType = ntc.getCfgType();
|
cfgType = ntc.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/encryptedtunnelbehav/encrypedTunnelSubList";
|
return "/cfg/encryptedtunnelbehav/encrypedTunnelSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置表单
|
* 策略配置表单
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param entity
|
* @param entity
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"form"})
|
@RequestMapping(value = { "form" })
|
||||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
||||||
public String policyCfgForm(Model model,String ids,AppPolicyCfg entity) {
|
public String policyCfgForm(Model model, String ids, AppPolicyCfg entity) {
|
||||||
if(StringUtils.isNotBlank(ids)){
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids),null);
|
entity = appCfgService.getAppPolicyCfg(Long.parseLong(ids), null);
|
||||||
initUpdateFormCondition(model,entity);
|
initUpdateFormCondition(model, entity);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model,entity);
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/encryptedtunnelbehav/form";
|
return "/cfg/encryptedtunnelbehav/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置新增修改
|
* 策略配置新增修改
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
@@ -149,33 +164,36 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"save"})
|
@RequestMapping(value = { "save" })
|
||||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
||||||
public String saveAppPolicyCfg(Model model,HttpServletRequest request,HttpServletResponse response,
|
public String saveAppPolicyCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
AppPolicyCfg entity,RedirectAttributes redirectAttributes) {
|
AppPolicyCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
|
SpecificServiceCfg specificService = specificServiceCfgService
|
||||||
if(specificService!=null){
|
.getBySpecServiceId(entity.getSpecServiceId());
|
||||||
|
if (specificService != null) {
|
||||||
entity.setAppCode(specificService.getSpecServiceCode());
|
entity.setAppCode(specificService.getSpecServiceCode());
|
||||||
}
|
}
|
||||||
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
appCfgService.saveOrUpdateAppPolicyCfg(entity);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("加密隧道信息保存失败",e);
|
logger.error("加密隧道信息保存失败", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else if(e instanceof CallExternalProceduresException) {
|
} else if (e instanceof CallExternalProceduresException) {
|
||||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
addMessage(redirectAttributes, "error", "save_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId();
|
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置审核
|
* 策略配置审核
|
||||||
|
*
|
||||||
* @param isAudit
|
* @param isAudit
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
@@ -183,21 +201,16 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"audit"})
|
@RequestMapping(value = { "audit" })
|
||||||
@RequiresPermissions(value={"encryptedtunnelbehav:confirm"})
|
@RequiresPermissions(value = { "encryptedtunnelbehav:confirm" })
|
||||||
public String auditAppPolicyCfg(Model model,@ModelAttribute("cfg")AppPolicyCfg cfg,
|
public String auditAppPolicyCfg(Model model, @ModelAttribute("cfg") AppPolicyCfg cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
AppPolicyCfg entity = new AppPolicyCfg();
|
AppPolicyCfg entity = new AppPolicyCfg();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id),null);
|
entity = appCfgService.getAppPolicyCfg(Long.parseLong(id), null);
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
@@ -205,157 +218,187 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
|||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
|
entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR);
|
||||||
try {
|
try {
|
||||||
appCfgService.auditAppPolicyCfg(entity,isAudit);
|
appCfgService.auditAppPolicyCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success","audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("加密隧道配置下发失败:"+e.getMessage());;
|
logger.info("加密隧道配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
;
|
||||||
}else {
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
} else {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("加密隧道配置下发失败",e);
|
logger.error("加密隧道配置下发失败", e);
|
||||||
addMessage(redirectAttributes,"error","audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
Page<AppPolicyCfg> searchPage=new Page<AppPolicyCfg>(request,response,"r");
|
Page<AppPolicyCfg> searchPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
Page<AppPolicyCfg> auditPage=new Page<AppPolicyCfg>(request,response,"r");
|
Page<AppPolicyCfg> auditPage = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return policyCfgList(model, cfg, request, response);
|
return policyCfgList(model, cfg, request, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 策略配置删除
|
* 策略配置删除
|
||||||
|
*
|
||||||
* @param isValid
|
* @param isValid
|
||||||
* @param ids
|
* @param ids
|
||||||
* @param functionId
|
* @param functionId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"updateValid"})
|
@RequestMapping(value = { "updateValid" })
|
||||||
@RequiresPermissions(value={"encryptedtunnelbehav:config"})
|
@RequiresPermissions(value = { "encryptedtunnelbehav:config" })
|
||||||
public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String updateAppPolicyCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId);
|
appCfgService.updateAppPolicyCfgValid(isValid, ids, functionId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("加密隧道协议保存失败",e);
|
logger.error("加密隧道协议保存失败", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else if(e instanceof CallExternalProceduresException) {
|
} else if (e instanceof CallExternalProceduresException) {
|
||||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","delete_failed");
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/encryptedtunnelbehav/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//ip配置导出
|
// ip配置导出
|
||||||
@RequestMapping(value = "exportIpAddr")
|
@RequestMapping(value = "exportIpAddr")
|
||||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")AppPolicyCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") AppPolicyCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
List<AppPolicyCfg> ipLists=new ArrayList<AppPolicyCfg>();
|
List<AppPolicyCfg> ipLists = new ArrayList<AppPolicyCfg>();
|
||||||
//导出选中记录
|
// 导出选中记录
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipLists=appCfgService.findAppByPolicyList(ids);
|
ipLists = appCfgService.findAppByPolicyList(ids);
|
||||||
}else{
|
} else {
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
|
Page<AppPolicyCfg> pageInfo = new Page<AppPolicyCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||||
ipLists=page.getList();
|
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) {
|
SpecificServiceCfg second = new SpecificServiceCfg();
|
||||||
policy.setBehaviorName(app.getSpecServiceName());
|
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();
|
second.setIsValid(Constants.VALID_YES);
|
||||||
for(SysDataDictionaryItem dict:DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
second.setIsLeaf(1);
|
||||||
if(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR.equals(dict.getItemValue())) {
|
List<SpecificServiceCfg> secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||||
second.setCfgType(Integer.parseInt(dict.getItemCode()));
|
// 遍历,找到匹配项后将行为设置进去
|
||||||
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
second.setIsValid(Constants.VALID_YES);
|
}
|
||||||
second.setIsLeaf(1);
|
titleList.add(entity.getMenuNameCode());
|
||||||
List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
titleList.add("NTC_IP");
|
||||||
//遍历,找到匹配项后将行为设置进去
|
titleList.add("NTC_SUBSCRIBE_ID");
|
||||||
for(AppPolicyCfg policy:ipLists){
|
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||||
if(policy.getBehavCode()==null) continue;
|
classMap.put("NTC_IP", IpPortCfg.class);
|
||||||
for(SpecificServiceCfg secondCfg:secondList) {
|
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||||
if(secondCfg.getSpecServiceCode()==null) continue;
|
String cfgIndexInfoNoExport = ",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
if(secondCfg.getSpecServiceCode().intValue()==policy.getBehavCode().intValue()) {
|
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
policy.setBehavName(secondCfg.getSpecServiceName());
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
break;
|
+ ",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"
|
||||||
titleList.add(entity.getMenuNameCode());
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
titleList.add("NTC_IP");
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
titleList.add("NTC_SUBSCRIBE_ID");
|
|
||||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
// 时间过滤
|
||||||
classMap.put("NTC_IP", IpPortCfg.class);
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
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"
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
}
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
String subscribeInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
}
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
}
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
|
||||||
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
|
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
|
||||||
for (AppPolicyCfg cfg : ipLists) {
|
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||||
AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg);
|
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
for (AppPolicyCfg cfg : ipLists) {
|
||||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg);
|
||||||
}
|
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||||
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
|
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
}
|
||||||
dataMap.put("NTC_IP", ipList);
|
subscribeInfoList = BaseStringCfg.baseHexList(subscribeInfoList);
|
||||||
dataMap.put("NTC_SUBSCRIBE_ID", 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);
|
|
||||||
|
/* } */
|
||||||
|
|
||||||
|
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) {
|
} catch (Exception e) {
|
||||||
logger.error("TunnelBehavior export failed",e);
|
logger.error("TunnelBehavior export failed", e);
|
||||||
addMessage(redirectAttributes,"error","export_failed");
|
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
|
@Controller
|
||||||
@RequestMapping("${adminPath}/cfg/dnsIp")
|
@RequestMapping("${adminPath}/cfg/dnsIp")
|
||||||
public class DnsIpCfgController extends BaseController {
|
public class DnsIpCfgController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = {"/list"})
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,@ModelAttribute("cfg")DnsIpCfg entity
|
@ModelAttribute("cfg") DnsIpCfg entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, "r"), entity);
|
||||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response,"r"), entity);
|
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/dnsIpCfgList";
|
return "/cfg/dnsIpCfgList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/form"})
|
|
||||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
@RequestMapping(value = { "/form" })
|
||||||
public String form(Model model,HttpServletRequest request
|
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")DnsIpCfg cfg
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids));
|
cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids));
|
||||||
initUpdateFormCondition(model, cfg);
|
initUpdateFormCondition(model, cfg);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model,cfg);
|
initFormCondition(model, cfg);
|
||||||
}
|
}
|
||||||
/*//获取所有响应策略信息
|
/*
|
||||||
List<DnsResStrategy> resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
* //获取所有响应策略信息 List<DnsResStrategy>
|
||||||
model.addAttribute("dnsResStrategys", resStrategys);*/
|
* resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
||||||
//查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
* model.addAttribute("dnsResStrategys", resStrategys);
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
*/
|
||||||
|
// 查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
||||||
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
return "/cfg/dnsIpCfgForm";
|
return "/cfg/dnsIpCfgForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化一条dns fakeip配置
|
* 初始化一条dns fakeip配置
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = {"initSpoofingIp"})
|
@RequestMapping(value = { "initSpoofingIp" })
|
||||||
public String initSpoofingIp(){
|
public String initSpoofingIp() {
|
||||||
Properties msg=getMsgProp();
|
Properties msg = getMsgProp();
|
||||||
try {
|
try {
|
||||||
DnsIpCfg entity=new DnsIpCfg();
|
DnsIpCfg entity = new DnsIpCfg();
|
||||||
entity.setIsAudit(1);
|
entity.setIsAudit(1);
|
||||||
entity.setIsValid(1);
|
entity.setIsValid(1);
|
||||||
entity.setDnsStrategyId(0);
|
entity.setDnsStrategyId(0);
|
||||||
List<DnsIpCfg> list=dnsIpCfgService.findDnsIpCfg(entity);
|
List<DnsIpCfg> list = dnsIpCfgService.findDnsIpCfg(entity);
|
||||||
if(StringUtil.isEmpty(list)) {
|
if (StringUtil.isEmpty(list)) {
|
||||||
dnsIpCfgService.saveAndAudit();
|
dnsIpCfgService.saveAndAudit();
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("初始化Spoofing ip失败",e);
|
logger.error("初始化Spoofing ip失败", e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
return msg.getProperty("request_service_failed");
|
return msg.getProperty("request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
return msg.getProperty("save_failed");
|
return msg.getProperty("save_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return "success";
|
return "success";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/saveOrUpdate"})
|
|
||||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||||
,HttpServletResponse response,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")DnsIpCfg cfg
|
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
try {
|
||||||
try{
|
|
||||||
dnsIpCfgService.saveOrUpdate(cfg);
|
dnsIpCfgService.saveOrUpdate(cfg);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("信息保存失败",e);
|
logger.error("信息保存失败", e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
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"})
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,String ids,Integer functionId
|
RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
|
||||||
dnsIpCfgService.delete(isAudit,isValid,ids,functionId);
|
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
||||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId;
|
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/audit"})
|
|
||||||
@RequiresPermissions(value={"dns:fake:ip:confirm"})
|
@RequestMapping(value = { "/audit" })
|
||||||
public String audit(Model model,@ModelAttribute("cfg")DnsIpCfg cfg,
|
@RequiresPermissions(value = { "dns:fake:ip:confirm" })
|
||||||
Integer isValid,
|
public String audit(Model model, @ModelAttribute("cfg") DnsIpCfg cfg, Integer isValid, Integer isAudit, String ids,
|
||||||
Integer isAudit,
|
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
String ids,
|
HttpServletRequest request) {
|
||||||
Integer functionId,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime=new Date();
|
Date auditTime = new Date();
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
try {
|
try {
|
||||||
dnsIpCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
dnsIpCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
Page<DnsIpCfg> searchPage=new Page<DnsIpCfg>(request,response,"r");
|
Page<DnsIpCfg> searchPage = new Page<DnsIpCfg>(request, response, "r");
|
||||||
Page<DnsIpCfg> auditPage=new Page<DnsIpCfg>(request,response,"r");
|
Page<DnsIpCfg> auditPage = new Page<DnsIpCfg>(request, response, "r");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
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阻断无策略时检验
|
* DNS阻断无策略时检验
|
||||||
|
*
|
||||||
* @param entity
|
* @param entity
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = {"/dnsNoStrategyCheck"})
|
@RequestMapping(value = { "/dnsNoStrategyCheck" })
|
||||||
public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response){
|
public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response) {
|
||||||
entity.setIsAudit(1);
|
entity.setIsAudit(1);
|
||||||
entity.setIsValid(1);
|
entity.setIsValid(1);
|
||||||
List<DnsIpCfg> list = dnsIpCfgService.findDnsIpCfg(entity);
|
List<DnsIpCfg> list = dnsIpCfgService.findDnsIpCfg(entity);
|
||||||
if(list.size() > 0){
|
if (list.size() > 0) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
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>();
|
// dnsIp配置导出
|
||||||
//导出选中记录
|
@RequestMapping(value = "exportDnsIp")
|
||||||
if(!StringUtil.isEmpty(ids)){
|
public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
ipLists=dnsIpCfgService.findByPage(ids);
|
@ModelAttribute("cfg") DnsIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
}else{
|
try {
|
||||||
Page<DnsIpCfg> pageInfo=new Page<DnsIpCfg>(request, response,"r");
|
// export data info
|
||||||
pageInfo.setPageNo(1);
|
List<String> titleList = new ArrayList<String>();
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
ipLists=page.getList();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
}
|
|
||||||
|
List<DnsIpCfg> ipLists = new ArrayList<DnsIpCfg>();
|
||||||
for (int i = 0; i < ipLists.size(); i++) {
|
// 导出选中记录
|
||||||
if(StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Properties msgProp = getMsgProp();
|
ipLists = dnsIpCfgService.findByPage(ids);
|
||||||
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
|
} else {
|
||||||
}
|
Page<DnsIpCfg> pageInfo = new Page<DnsIpCfg>(request, response, "r");
|
||||||
}
|
pageInfo.setPageNo(1);
|
||||||
titleList.add(entity.getMenuNameCode());
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
|
||||||
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,";
|
ipLists = page.getList();
|
||||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
}
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
|
||||||
/*}*/
|
for (int i = 0; i < ipLists.size(); i++) {
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
if (StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())) {
|
||||||
} catch (Exception e) {
|
Properties msgProp = getMsgProp();
|
||||||
logger.error("DnsIp export failed",e);
|
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
|
||||||
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();
|
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响应策略
|
* dns响应策略
|
||||||
|
*
|
||||||
* @author ddm
|
* @author ddm
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/maintenance/dnsResStrategy")
|
@RequestMapping("${adminPath}/maintenance/dnsResStrategy")
|
||||||
public class DnsResStrategyController extends BaseController {
|
public class DnsResStrategyController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = {"/form"})
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||||
public String from(Model model,
|
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
HttpServletRequest request,
|
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||||
HttpServletResponse response,
|
if (cfg == null) {
|
||||||
String ids,
|
cfg = new DnsResStrategy();
|
||||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
|
||||||
,RedirectAttributes redirectAttributes){
|
|
||||||
if(cfg == null){
|
|
||||||
cfg=new DnsResStrategy();
|
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids),-1);
|
cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids), -1);
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
model.addAttribute("isAdd", false);
|
model.addAttribute("isAdd", false);
|
||||||
}else{
|
} else {
|
||||||
/*//不存在响应策略为0的配置,则新策略时,cfgId默认为0
|
/*
|
||||||
DnsResStrategy dns0=dnsResStrategyService.getDnsResStrategy(0l,null);
|
* //不存在响应策略为0的配置,则新策略时,cfgId默认为0 DnsResStrategy
|
||||||
if(dns0 == null){
|
* dns0=dnsResStrategyService.getDnsResStrategy(0l,null); if(dns0 ==
|
||||||
cfg.setCfgId(0l);
|
* null){ cfg.setCfgId(0l); cfg.setCfgDesc("无策略"); }
|
||||||
cfg.setCfgDesc("无策略");
|
*/
|
||||||
}*/
|
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
model.addAttribute("isAdd", true);
|
model.addAttribute("isAdd", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询policyGroup列表,供响应策略选择
|
// 查询policyGroup列表,供响应策略选择
|
||||||
// List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
// List<PolicyGroupInfo>
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
// policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||||
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
|
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
return "/cfg/maintenance/dnsResStrategy/form";
|
return "/cfg/maintenance/dnsResStrategy/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/saveOrUpdate"})
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
try {
|
||||||
try{
|
|
||||||
|
|
||||||
dnsResStrategyService.saveOrUpdate(cfg);
|
dnsResStrategyService.saveOrUpdate(cfg);
|
||||||
|
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} catch (Exception e) {
|
} 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"})
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,@ModelAttribute("cfg")DnsResStrategy entity
|
@ModelAttribute("cfg") DnsResStrategy entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
// 查询时left join policyGroup
|
||||||
//查询时left join policyGroup
|
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response, "r"),
|
||||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response,"r"), entity);
|
entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/maintenance/dnsResStrategy/list";
|
return "/cfg/maintenance/dnsResStrategy/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/delete"})
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||||
,Model model,HttpServletRequest request
|
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||||
,HttpServletResponse response
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
,RedirectAttributes redirectAttributes){
|
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
|
||||||
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"})
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions(value={"dns:res:strategy:confirm"})
|
@RequiresPermissions(value = { "dns:res:strategy:confirm" })
|
||||||
public String audit(Model model,@ModelAttribute("cfg")DnsResStrategy cfg,
|
public String audit(Model model, @ModelAttribute("cfg") DnsResStrategy cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime=new Date();
|
Date auditTime = new Date();
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
try {
|
try {
|
||||||
dnsResStrategyService.audit(isAudit,isValid,functionId,id,auditTime);
|
dnsResStrategyService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else {
|
} else {
|
||||||
Page<DnsResStrategy> searchPage=new Page<DnsResStrategy>(request,response,"r");
|
Page<DnsResStrategy> searchPage = new Page<DnsResStrategy>(request, response, "r");
|
||||||
Page<DnsResStrategy> auditPage=new Page<DnsResStrategy>(request,response,"r");
|
Page<DnsResStrategy> auditPage = new Page<DnsResStrategy>(request, response, "r");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
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
|
@ResponseBody
|
||||||
@RequestMapping(value = "/validCfgId")
|
@RequestMapping(value = "/validCfgId")
|
||||||
public boolean validCfgId(Long cfgId) {
|
public boolean validCfgId(Long cfgId) {
|
||||||
DnsResStrategy dns=dnsResStrategyService.getDnsResStrategy(cfgId,null);
|
DnsResStrategy dns = dnsResStrategyService.getDnsResStrategy(cfgId, null);
|
||||||
if(dns == null ){
|
if (dns == null) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//dns配置导出
|
// dns配置导出
|
||||||
@RequestMapping(value = "exportDns")
|
@RequestMapping(value = "exportDns")
|
||||||
public void exportDns(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")DnsResStrategy entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") DnsResStrategy entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
List<DnsResStrategy> ipLists=new ArrayList<DnsResStrategy>();
|
List<DnsResStrategy> ipLists = new ArrayList<DnsResStrategy>();
|
||||||
//导出选中记录
|
// 导出选中记录
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipLists=dnsResStrategyService.findByPage(ids);
|
ipLists = dnsResStrategyService.findByPage(ids);
|
||||||
}else{
|
} else {
|
||||||
Page<DnsResStrategy> pageInfo=new Page<DnsResStrategy>(request, response,"r");
|
Page<DnsResStrategy> pageInfo = new Page<DnsResStrategy>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
|
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
|
||||||
ipLists=page.getList();
|
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;
|
||||||
}
|
}
|
||||||
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + 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()));
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
ipLists.get(i).setDnsId( String.valueOf(ipLists.get(i).getCfgId()));
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
}
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
String timeRange = initTimeMap(entity);
|
||||||
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
noExportMap.put("timeRange", timeRange);
|
||||||
String cfgIndexInfoNoExport=",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
if ("csv".equals(entity.getExType())) {
|
||||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
dataMap.put(entity.getMenuNameCode(),ipLists);
|
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) {
|
} catch (Exception e) {
|
||||||
logger.error("Dns export failed",e);
|
logger.error("Dns export failed", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "export_failed");
|
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
|
@Controller
|
||||||
@RequestMapping("${adminPath}/maintenance/ipMultiplexPoolCfg")
|
@RequestMapping("${adminPath}/maintenance/ipMultiplexPoolCfg")
|
||||||
public class IpMultiplexPoolCfgController extends BaseController {
|
public class IpMultiplexPoolCfgController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = {"/form"})
|
@RequestMapping(value = { "/form" })
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||||
public String from(Model model,
|
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
HttpServletRequest request,
|
@ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||||
HttpServletResponse response,
|
if (cfg == null) {
|
||||||
String ids,
|
cfg = new IpMultiplexPoolCfg();
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
|
||||||
if(cfg == null){
|
|
||||||
cfg=new IpMultiplexPoolCfg();
|
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids), null);
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
//查询ip复用地址池配置的policyGroup列表
|
// 查询ip复用地址池配置的policyGroup列表
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(3);
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.getHasAreaPolicyGroups(3);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
return "/cfg/maintenance/ipMultiplexPool/form";
|
return "/cfg/maintenance/ipMultiplexPool/form";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/saveOrUpdate"})
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
RedirectAttributes redirectAttributes, @ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||||
try{
|
try {
|
||||||
// 设置省份信息
|
// 设置省份信息
|
||||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
groupAreaService.setAreaCodeByGroupId(cfg);
|
||||||
|
|
||||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||||
|
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "save_failed");
|
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"})
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
//查询时left join policyGroup
|
@ModelAttribute("cfg") IpMultiplexPoolCfg entity) {
|
||||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
// 查询时left join policyGroup
|
||||||
|
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService
|
||||||
|
.findPage(new Page<IpMultiplexPoolCfg>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/maintenance/ipMultiplexPool/list";
|
return "/cfg/maintenance/ipMultiplexPool/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/delete"})
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||||
,HttpServletRequest request,HttpServletResponse response){
|
RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) {
|
||||||
try{
|
try {
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
ipMultiplexPoolCfgService.delete(isAudit, isValid, ids, functionId);
|
||||||
}
|
}
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error(e);
|
logger.error(e);
|
||||||
addMessage(redirectAttributes,"error", "delete_failed");
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/audit"})
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
@RequiresPermissions(value = { "ip:mulitiplex:pool:confirm" })
|
||||||
public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String audit(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
if(!StringUtil.isEmpty(ids)){
|
RedirectAttributes redirectAttributes) {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime=new Date();
|
Date auditTime = new Date();
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
try {
|
try {
|
||||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
ipMultiplexPoolCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("IP复用地址池配置下发失败:"+e.getMessage());
|
logger.info("IP复用地址池配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("IP复用地址池配置下发失败:"+e.getMessage());
|
logger.info("IP复用地址池配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = "/validCfgId")
|
@RequestMapping(value = "/validCfgId")
|
||||||
public boolean validCfgId(Long cfgId) {
|
public boolean validCfgId(Long cfgId) {
|
||||||
IpMultiplexPoolCfg dns=ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId,null);
|
IpMultiplexPoolCfg dns = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId, null);
|
||||||
if(dns == null ){
|
if (dns == null) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
} else {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@RequestMapping(value = {"/snatlist"})
|
/*
|
||||||
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
* @RequestMapping(value = {"/snatlist"}) public String snatlist(Model
|
||||||
//查询时left join policyGroup
|
* model,HttpServletRequest request,HttpServletResponse
|
||||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
* response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ //查询时left join
|
||||||
model.addAttribute("page", page);
|
* policyGroup Page<IpMultiplexPoolCfg> page =
|
||||||
initFormCondition(model,entity);
|
* ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request,
|
||||||
return "/cfg/maintenance/ipMultiplexPool/snatlist";
|
* response,"r"), entity); model.addAttribute("page", page);
|
||||||
}
|
* initFormCondition(model,entity); return
|
||||||
|
* "/cfg/maintenance/ipMultiplexPool/snatlist"; }
|
||||||
@RequestMapping(value = {"/snatform"})
|
*
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
* @RequestMapping(value = {"/snatform"})
|
||||||
public String snatfrom(Model model,
|
*
|
||||||
HttpServletRequest request,
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||||
HttpServletResponse response,
|
* snatfrom(Model model, HttpServletRequest request, HttpServletResponse
|
||||||
String ids,
|
* response, String ids,
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
*
|
||||||
if(cfg == null){
|
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ if(cfg == null){ cfg=new
|
||||||
cfg=new IpMultiplexPoolCfg();
|
* IpMultiplexPoolCfg(); } if(!StringUtil.isEmpty(ids)){ cfg =
|
||||||
}
|
* ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||||
if(!StringUtil.isEmpty(ids)){
|
* initUpdateFormCondition(model, cfg); }else{ initFormCondition(model,
|
||||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
* cfg); }
|
||||||
initUpdateFormCondition(model, cfg);
|
*
|
||||||
}else{
|
* //查询ip复用地址池配置的policyGroup列表 List<PolicyGroupInfo>
|
||||||
initFormCondition(model, cfg);
|
* policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
||||||
}
|
* model.addAttribute("policyGroups", policyGroups);
|
||||||
|
* model.addAttribute("_cfg", cfg); return
|
||||||
//查询ip复用地址池配置的policyGroup列表
|
* "/cfg/maintenance/ipMultiplexPool/snatform"; }
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
*
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
* @RequestMapping(value = {"/snatsaveOrUpdate"})
|
||||||
model.addAttribute("_cfg", cfg);
|
*
|
||||||
return "/cfg/maintenance/ipMultiplexPool/snatform";
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||||
}
|
* snatsaveOrUpdate(Model model,HttpServletRequest
|
||||||
|
* request,HttpServletResponse response,RedirectAttributes
|
||||||
@RequestMapping(value = {"/snatsaveOrUpdate"})
|
* redirectAttributes,
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
*
|
||||||
public String snatsaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ try{ // 设置省份信息
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
* if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
||||||
try{
|
* groupAreaService.setAreaCodeByGroupId(cfg); }
|
||||||
// 设置省份信息
|
* ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||||
if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
*
|
||||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
* addMessage(redirectAttributes,"success","save_success"); }catch(Exception
|
||||||
}
|
* e){ e.printStackTrace(); if(e instanceof MaatConvertException) {
|
||||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
* addMessage(redirectAttributes,"error", "request_service_failed"); }else {
|
||||||
|
* addMessage(redirectAttributes,"error", "save_failed"); } }
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
*
|
||||||
}catch(Exception e){
|
* return "redirect:" + adminPath
|
||||||
e.printStackTrace();
|
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId
|
||||||
if(e instanceof MaatConvertException) {
|
* (); }
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
*
|
||||||
}else {
|
* @RequestMapping(value = {"/snataudit"})
|
||||||
addMessage(redirectAttributes,"error", "save_failed");
|
*
|
||||||
}
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) public String
|
||||||
}
|
* snataudit(Integer isAudit,Integer isValid,String ids,Integer
|
||||||
|
* functionId,RedirectAttributes redirectAttributes) {
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId();
|
* if(!StringUtil.isEmpty(ids)){ String[] idArray = ids.split(","); Date
|
||||||
}
|
* auditTime=new Date(); for(String id :idArray){ try {
|
||||||
|
* ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||||
@RequestMapping(value = {"/snataudit"})
|
* } catch (Exception e) { e.printStackTrace();
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
* logger.error("SNAT地址池管理配置下发失败:"+e.getMessage()); if(e instanceof
|
||||||
public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
* MaatConvertException) { addMessage(redirectAttributes,"error",
|
||||||
if(!StringUtil.isEmpty(ids)){
|
* "request_service_failed"); }else { addMessage(redirectAttributes,"error",
|
||||||
String[] idArray = ids.split(",");
|
* "audit_failed"); } } }
|
||||||
Date auditTime=new Date();
|
*
|
||||||
for(String id :idArray){
|
* } return "redirect:" + adminPath
|
||||||
try {
|
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; }
|
||||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
*
|
||||||
} catch (Exception e) {
|
* @RequestMapping(value = {"/snatdelete"})
|
||||||
e.printStackTrace();
|
*
|
||||||
logger.error("SNAT地址池管理配置下发失败:"+e.getMessage());
|
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||||
if(e instanceof MaatConvertException) {
|
* snatdelete(Integer isAudit,Integer isValid,String ids,Integer
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
* functionId,Model model,RedirectAttributes redirectAttributes
|
||||||
}else {
|
* ,HttpServletRequest request,HttpServletResponse response){ try{
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
* 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
|
||||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
* +"/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是否已存在
|
* 校验IP是否已存在
|
||||||
|
*
|
||||||
* @param cfg
|
* @param cfg
|
||||||
* @param redirectAttributes
|
* @param redirectAttributes
|
||||||
* @param request
|
* @param request
|
||||||
@@ -248,97 +235,143 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = {"/checkIp"})
|
@RequestMapping(value = { "/checkIp" })
|
||||||
public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response){
|
public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response) {
|
||||||
// 修改
|
// 修改
|
||||||
if(!StringUtil.isEmpty(cfg.getCfgId())){
|
if (!StringUtil.isEmpty(cfg.getCfgId())) {
|
||||||
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
||||||
if(poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())){
|
if (poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cfg.setCfgId(null);
|
cfg.setCfgId(null);
|
||||||
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
||||||
if(poolCfg != null){
|
if (poolCfg != null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//snat配置导出
|
// snat配置导出
|
||||||
@RequestMapping(value = "exportSnat")
|
@RequestMapping(value = "exportSnat")
|
||||||
public void exportSnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
/*
|
||||||
/*//导出选中记录
|
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||||
for(String id:ids.split(",")){
|
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||||
Long.parseLong(id);
|
* , entity.getFunctionId(), ids); }else{
|
||||||
}
|
*/
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||||
}else{*/
|
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
pageInfo.setPageNo(1);
|
||||||
Page<IpMultiplexPoolCfg> pageInfo=new Page<IpMultiplexPoolCfg>(request, response,"r");
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
pageInfo.setPageNo(1);
|
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
page.setList(ipMultiplexPoolCfgService.getIsp(page.getList()));
|
||||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
titleList.add(entity.getMenuNameCode());
|
||||||
page.setList(ipMultiplexPoolCfgService.getIsp(page.getList()));
|
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||||
titleList.add(entity.getMenuNameCode());
|
String snatNoExport = ",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||||
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);
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
snatNoExport = ",config_time" + snatNoExport;
|
||||||
/*}*/
|
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
//dnat配置导出
|
snatNoExport = ",edit_time" + snatNoExport;
|
||||||
@RequestMapping(value = "exportDnat")
|
}
|
||||||
public void exportDnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
@ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){
|
snatNoExport = ",audit_time" + snatNoExport;
|
||||||
try {
|
}
|
||||||
//export data info
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
List<String> titleList=new ArrayList<String>();
|
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
}
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||||
|
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||||
|
|
||||||
/*//导出选中记录
|
String timeRange = initTimeMap(entity);
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
noExportMap.put("timeRange", timeRange);
|
||||||
for(String id:ids.split(",")){
|
if ("csv".equals(entity.getExType())) {
|
||||||
Long.parseLong(id);
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
}
|
classMap, dataMap, noExportMap);
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
} else {
|
||||||
}else{*/
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
classMap, dataMap, noExportMap);
|
||||||
Page<IpMultiplexPoolCfg> pageInfo=new Page<IpMultiplexPoolCfg>(request, response,"r");
|
}
|
||||||
pageInfo.setPageNo(1);
|
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
} catch (Exception e) {
|
||||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
logger.error("snat export failed", e);
|
||||||
titleList.add(entity.getMenuNameCode());
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
}
|
||||||
String snatNoExport=",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
// return "redirect:" + adminPath
|
||||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
}
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
// dnat配置导出
|
||||||
} catch (Exception e) {
|
@RequestMapping(value = "exportDnat")
|
||||||
logger.error("dnat export failed",e);
|
public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
addMessage(redirectAttributes,"error","export_failed");
|
@ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
}
|
try {
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// 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
|
@Controller
|
||||||
@RequestMapping("${adminPath}/manipulation/ddos")
|
@RequestMapping("${adminPath}/manipulation/ddos")
|
||||||
public class DdosCfgController extends BaseController {
|
public class DdosCfgController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = {"/list"})
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DdosIpCfg entity){
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
Page<DdosIpCfg> page = ddosCfgService.findPage(new Page<DdosIpCfg>(request, response,"r"), entity);
|
@ModelAttribute("cfg") DdosIpCfg entity) {
|
||||||
|
Page<DdosIpCfg> page = ddosCfgService.findPage(new Page<DdosIpCfg>(request, response, "r"), entity);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/ddosIpCfgList";
|
return "/cfg/ddosIpCfgList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/form"})
|
|
||||||
@RequiresPermissions(value={"ddos:ip:config"})
|
@RequestMapping(value = { "/form" })
|
||||||
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")DdosIpCfg cfg){
|
@RequiresPermissions(value = { "ddos:ip:config" })
|
||||||
if(!StringUtil.isEmpty(ids)){
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids),null);
|
@ModelAttribute("cfg") DdosIpCfg cfg) {
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
cfg = ddosCfgService.getDdosIpCfg(Long.parseLong(ids), null);
|
||||||
initUpdateFormCondition(model, cfg);
|
initUpdateFormCondition(model, cfg);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model,cfg);
|
initFormCondition(model, cfg);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
return "/cfg/ddosIpCfgForm";
|
return "/cfg/ddosIpCfgForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/saveOrUpdate"})
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
@RequiresPermissions(value={"ddos:ip:config"})
|
@RequiresPermissions(value = { "ddos:ip:config" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")DdosIpCfg cfg, RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") DdosIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
try{
|
try {
|
||||||
ddosCfgService.saveOrUpdate(cfg);
|
ddosCfgService.saveOrUpdate(cfg);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("信息保存失败",e);
|
logger.error("信息保存失败", e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
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"})
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions(value={"ddos:ip:config"})
|
@RequiresPermissions(value = { "ddos:ip:config" })
|
||||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
||||||
ddosCfgService.delete(isAudit,isValid,ids,functionId);
|
ddosCfgService.delete(isAudit, isValid, ids, functionId);
|
||||||
return "redirect:" + adminPath +"/manipulation/ddos/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/manipulation/ddos/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/audit"})
|
|
||||||
//@RequiresPermissions(value={"ddos:ip:confirm"})
|
@RequestMapping(value = { "/audit" })
|
||||||
public String audit(Model model,@ModelAttribute("cfg")DdosIpCfg cfg,
|
// @RequiresPermissions(value={"ddos:ip:confirm"})
|
||||||
Integer isValid,
|
public String audit(Model model, @ModelAttribute("cfg") DdosIpCfg cfg, Integer isValid, Integer isAudit, String ids,
|
||||||
Integer isAudit,
|
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
String ids,
|
HttpServletRequest request) {
|
||||||
Integer functionId,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime=new Date();
|
Date auditTime = new Date();
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
try {
|
try {
|
||||||
ddosCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
ddosCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
Page<DdosIpCfg> searchPage=new Page<DdosIpCfg>(request,response,"r");
|
Page<DdosIpCfg> searchPage = new Page<DdosIpCfg>(request, response, "r");
|
||||||
Page<DdosIpCfg> auditPage=new Page<DdosIpCfg>(request,response,"r");
|
Page<DdosIpCfg> auditPage = new Page<DdosIpCfg>(request, response, "r");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return list(model, request, response, cfg);
|
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")
|
@RequestMapping(value = "exportDdos")
|
||||||
public void exportddos(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportddos(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")DdosIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") DdosIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
List<DdosIpCfg> ipLists=new ArrayList<DdosIpCfg>();
|
List<DdosIpCfg> ipLists = new ArrayList<DdosIpCfg>();
|
||||||
//导出选中记录
|
// 导出选中记录
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipLists=ddosCfgService.findByPage(ids);
|
ipLists = ddosCfgService.findByPage(ids);
|
||||||
}else{
|
} else {
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<DdosIpCfg> pageInfo=new Page<DdosIpCfg>(request, response,"r");
|
Page<DdosIpCfg> pageInfo = new Page<DdosIpCfg>(request, response, "r");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
||||||
ipLists=page.getList();
|
ipLists = page.getList();
|
||||||
}
|
}
|
||||||
/*//导出选中记录
|
/*
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||||
for(String id:ids.split(",")){
|
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||||
Long.parseLong(id);
|
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||||
}
|
* , entity.getFunctionId(), ids); }else{
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
*/
|
||||||
}else{*/
|
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
titleList.add(entity.getMenuNameCode());
|
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
|
||||||
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
|
String cfgIndexInfoNoExport = ",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
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);
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
/*}*/
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
}
|
||||||
|
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) {
|
} catch (Exception e) {
|
||||||
logger.error("ddos export failed",e);
|
logger.error("ddos export failed", e);
|
||||||
addMessage(redirectAttributes,"error","export_failed");
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// return "redirect:" + adminPath
|
||||||
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据索引表信息异步获取子表信息
|
* 根据索引表信息异步获取子表信息
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"/ajaxDdosInfo"})
|
@RequestMapping(value = { "/ajaxDdosInfo" })
|
||||||
public String getDdosInfo(Model model,Long cfgId,Integer index,Integer compileId) {
|
public String getDdosInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
DdosIpCfg cfg = ddosCfgService.getDdosIpCfg(cfgId, compileId);
|
DdosIpCfg cfg = ddosCfgService.getDdosIpCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
//获取DdosIpCfg信息
|
// 获取DdosIpCfg信息
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
if(!cfg.getCfgType().equals(cfgType)){
|
if (!cfg.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",cfg.getCfgType()});
|
tabList.add(new String[] { "1", cfg.getCfgType() });
|
||||||
cfgType = cfg.getCfgType();
|
cfgType = cfg.getCfgType();
|
||||||
}
|
}
|
||||||
|
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/ddosSubList";
|
return "/cfg/ddosSubList";
|
||||||
|
|||||||
@@ -46,101 +46,116 @@ import com.nis.web.controller.configuration.CommonController;
|
|||||||
import com.nis.web.service.configuration.IpMultiplexService;
|
import com.nis.web.service.configuration.IpMultiplexService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName: ControlController.java
|
* @ClassName: ControlController.java
|
||||||
* @Description: TODO
|
* @Description: TODO
|
||||||
* @author (dell)
|
* @author (dell)
|
||||||
* @date 2018年6月22日 下午4:35:42
|
* @date 2018年6月22日 下午4:35:42
|
||||||
* @version V1.0
|
* @version V1.0
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/manipulation/ipmulitiplex")
|
@RequestMapping("${adminPath}/manipulation/ipmulitiplex")
|
||||||
public class IpMultiplexController extends CommonController {
|
public class IpMultiplexController extends CommonController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IpMultiplexService ipMultiplexService;
|
private IpMultiplexService ipMultiplexService;
|
||||||
|
|
||||||
@RequestMapping(value = {"/list"})
|
@RequestMapping(value = { "/list" })
|
||||||
// @RequiresPermissions(value={"ip:mulitiplex:config","ip:mulitiplex:confirm"},logical=Logical.OR)
|
// @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) {
|
public String ipList(String cfgName, Model model, @ModelAttribute("cfg") IpPortCfg cfg, HttpServletRequest request,
|
||||||
this._ipList(cfgName,model, cfg, request, response);
|
HttpServletResponse response) {
|
||||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
this._ipList(cfgName, model, cfg, request, response);
|
||||||
model.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||||
|
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
return "/cfg/common/ipList";
|
return "/cfg/common/ipList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/form"})
|
|
||||||
@RequiresPermissions(value={"ip:mulitiplex:config"})
|
@RequestMapping(value = { "/form" })
|
||||||
public String ipForm(String cfgName,Model model,String ids,Integer functionId,BaseIpCfg entity) {
|
@RequiresPermissions(value = { "ip:mulitiplex:config" })
|
||||||
this._ipForm(cfgName,model, ids, functionId, entity);
|
public String ipForm(String cfgName, Model model, String ids, Integer functionId, BaseIpCfg entity) {
|
||||||
SysDataDictionaryItem dict=null;
|
this._ipForm(cfgName, model, ids, functionId, entity);
|
||||||
List<SysDataDictionaryItem> dictList= DictUtils.getDictList("GROUP_TYPE");
|
SysDataDictionaryItem dict = null;
|
||||||
for(SysDataDictionaryItem di:dictList){
|
List<SysDataDictionaryItem> dictList = DictUtils.getDictList("GROUP_TYPE");
|
||||||
if("IP".equals(di.getItemValue())){
|
for (SysDataDictionaryItem di : dictList) {
|
||||||
dict=di;
|
if ("IP".equals(di.getItemValue())) {
|
||||||
|
dict = di;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(dict!=null){
|
if (dict != null) {
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode()));
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService
|
||||||
|
.findPolicyGroupInfosByType(Integer.parseInt(dict.getItemCode()));
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
}
|
}
|
||||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||||
model.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
return "/cfg/manipulation/ipmulitiplex/form";
|
return "/cfg/manipulation/ipmulitiplex/form";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/saveOrUpdate"})
|
|
||||||
public String saveOrUpdateIp(String cfgName,RedirectAttributes model, IpPortCfg cfg) {
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
this._saveOrUpdateIp(cfgName,model, cfg);
|
public String saveOrUpdateIp(String cfgName, RedirectAttributes model, IpPortCfg cfg) {
|
||||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId();
|
this._saveOrUpdateIp(cfgName, model, cfg);
|
||||||
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/delete"})
|
|
||||||
|
@RequestMapping(value = { "/delete" })
|
||||||
@RequiresPermissions("ip:mulitiplex:config")
|
@RequiresPermissions("ip:mulitiplex:config")
|
||||||
public String deleteIp(String cfgName,String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
public String deleteIp(String cfgName, String ids, String compileIds, Integer functionId,
|
||||||
this._deleteIp(cfgName,ids, compileIds, functionId, model);
|
RedirectAttributes model) {
|
||||||
model.addAttribute("urlPrefix","/proxy/ipmulitiplex");
|
this._deleteIp(cfgName, ids, compileIds, functionId, model);
|
||||||
model.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
model.addAttribute("urlPrefix", "/proxy/ipmulitiplex");
|
||||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+functionId;
|
model.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/audit"})
|
|
||||||
|
@RequestMapping(value = { "/audit" })
|
||||||
@RequiresPermissions("ip:mulitiplex:confirm")
|
@RequiresPermissions("ip:mulitiplex:confirm")
|
||||||
public String auditIp(String cfgName,String ids,IpPortCfg cfg,RedirectAttributes redirectAttributes) {
|
public String auditIp(String cfgName, String ids, IpPortCfg cfg, RedirectAttributes redirectAttributes) {
|
||||||
this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
this._auditIp(cfgName, ids, cfg, redirectAttributes);
|
||||||
redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
redirectAttributes.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||||
redirectAttributes.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
redirectAttributes.addAttribute("requiresPermissionPrefix", "ip:mulitiplex");
|
||||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId();
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/list?functionId=" + cfg.getFunctionId();
|
||||||
}
|
}
|
||||||
//ip配置导入
|
|
||||||
/*@RequestMapping(value = "/import", method=RequestMethod.POST)
|
// ip配置导入
|
||||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
/*
|
||||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
* @RequestMapping(value = "/import", method=RequestMethod.POST) public
|
||||||
this._importIp(cfgName,redirectAttributes, file,cfg,IpMultiplexPolicyTemplate.class);
|
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||||
redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
*
|
||||||
redirectAttributes.addAttribute("requiresPermissionPrefix","ip:mulitiplex");
|
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId();
|
* this._importIp(cfgName,redirectAttributes,
|
||||||
}*/
|
* file,cfg,IpMultiplexPolicyTemplate.class);
|
||||||
//ip模板下载
|
* redirectAttributes.addAttribute("urlPrefix","/manipulation/ipmulitiplex")
|
||||||
|
* ; redirectAttributes.addAttribute("requiresPermissionPrefix",
|
||||||
|
* "ip:mulitiplex"); return "redirect:" + adminPath
|
||||||
|
* +"/manipulation/ipmulitiplex/list?functionId="+cfg.getFunctionId(); }
|
||||||
|
*/
|
||||||
|
// ip模板下载
|
||||||
@RequestMapping(value = "import/template")
|
@RequestMapping(value = "import/template")
|
||||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpMultiplexPolicyTemplate.class);
|
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||||
|
IpMultiplexPolicyTemplate.class);
|
||||||
}
|
}
|
||||||
//ip配置导出
|
|
||||||
|
// ip配置导出
|
||||||
@RequestMapping(value = "export")
|
@RequestMapping(value = "export")
|
||||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") IpPortCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
this._exportIp(columns,model, request, response, entity, ids, redirectAttributes);
|
this._exportIp(columns, model, request, response, entity, ids, redirectAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IP复用策略拆分为SNAT/DNAT复用策略
|
* IP复用策略拆分为SNAT/DNAT复用策略
|
||||||
*/
|
*/
|
||||||
@RequestMapping(value = {"/snatPolicyList"})
|
@RequestMapping(value = { "/snatPolicyList" })
|
||||||
public String snatPolicyList(Model model,@ModelAttribute("cfg")IpReusePolicyCfg cfg,
|
public String snatPolicyList(Model model, @ModelAttribute("cfg") IpReusePolicyCfg cfg, HttpServletRequest request,
|
||||||
HttpServletRequest request,HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
|
|
||||||
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(new Page<IpReusePolicyCfg>(request, response,"r"), cfg);
|
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(new Page<IpReusePolicyCfg>(request, response, "r"),
|
||||||
|
cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initFormCondition(model,cfg);
|
initFormCondition(model, cfg);
|
||||||
|
|
||||||
// 获取地址池、用户信息
|
// 获取地址池、用户信息
|
||||||
List<UserManage> users = userManageService.findUsers();
|
List<UserManage> users = userManageService.findUsers();
|
||||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||||
@@ -148,357 +163,401 @@ public class IpMultiplexController extends CommonController {
|
|||||||
model.addAttribute("addrPools", addrPools);
|
model.addAttribute("addrPools", addrPools);
|
||||||
return "/cfg/manipulation/ipmulitiplex/snatPolicyList2";
|
return "/cfg/manipulation/ipmulitiplex/snatPolicyList2";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/snatPolicyForm"})
|
@RequestMapping(value = { "/snatPolicyForm" })
|
||||||
@RequiresPermissions(value={"snat_policy:config"})
|
@RequiresPermissions(value = { "snat_policy:config" })
|
||||||
public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg,
|
public String snatPolicyForm(Model model, String ids, IpReusePolicyCfg cfg, HttpServletRequest request,
|
||||||
HttpServletRequest request,HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
if(cfg == null){
|
if (cfg == null) {
|
||||||
cfg=new IpReusePolicyCfg();
|
cfg = new IpReusePolicyCfg();
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg = ipMultiplexService.getPolicyCfg(Long.valueOf(ids),null);
|
cfg = ipMultiplexService.getPolicyCfg(Long.valueOf(ids), null);
|
||||||
initUpdateFormCondition(model, cfg);
|
initUpdateFormCondition(model, cfg);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取用户信息 地址池信息
|
// 获取用户信息 地址池信息
|
||||||
List<UserManage> users = userManageService.findUsers();
|
List<UserManage> users = userManageService.findUsers();
|
||||||
|
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("users", users);
|
model.addAttribute("users", users);
|
||||||
model.addAttribute("urlPrefix","/manipulation/ipmulitiplex");
|
model.addAttribute("urlPrefix", "/manipulation/ipmulitiplex");
|
||||||
return "/cfg/manipulation/ipmulitiplex/snatPolicyForm2";
|
return "/cfg/manipulation/ipmulitiplex/snatPolicyForm2";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/saveOrUpdateSnat"})
|
@RequestMapping(value = { "/saveOrUpdateSnat" })
|
||||||
public String saveOrUpdateSnat(Model model, HttpServletRequest request,HttpServletResponse response,
|
public String saveOrUpdateSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
RedirectAttributes redirectAttributes, IpReusePolicyCfg cfg) {
|
RedirectAttributes redirectAttributes, IpReusePolicyCfg cfg) {
|
||||||
try{
|
try {
|
||||||
// 添加策略配置信息
|
// 添加策略配置信息
|
||||||
ipMultiplexService.saveOrUpdate(cfg, request, response);
|
ipMultiplexService.saveOrUpdate(cfg, request, response);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch(Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "save_failed");
|
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")
|
@RequiresPermissions("snat_policy:config")
|
||||||
public String snatDelete(String ids, Integer isValid, Integer functionId,RedirectAttributes redirectAttributes,
|
public String snatDelete(String ids, Integer isValid, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
HttpServletRequest request,HttpServletResponse response) {
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
|
||||||
try{
|
try {
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipMultiplexService.delete(isValid,ids,functionId);
|
ipMultiplexService.delete(isValid, ids, functionId);
|
||||||
}
|
}
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error(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")
|
@RequiresPermissions("snat_policy:confirm")
|
||||||
public String auditSnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String auditSnat(String ids, Integer isAudit, Integer isValid, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime=new Date();
|
Date auditTime = new Date();
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
try {
|
try {
|
||||||
ipMultiplexService.auditSnatPolicy(isAudit,isValid,functionId,id,auditTime);
|
ipMultiplexService.auditSnatPolicy(isAudit, isValid, functionId, id, auditTime);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("SNAT策略配置下发失败:"+e.getMessage());
|
logger.error("SNAT策略配置下发失败:" + e.getMessage());
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/snatPolicyList?functionId="+functionId;
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/snatPolicyList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = { "/ajaxSnatInfo" })
|
||||||
@RequestMapping(value = {"/ajaxSnatInfo"})
|
public String ajaxSnatInfo(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
public String ajaxSnatInfo(Model model,Long cfgId,Integer index,Integer compileId) {
|
|
||||||
IpReusePolicyCfg cfg = ipMultiplexService.getSnatCfg(cfgId, compileId);
|
IpReusePolicyCfg cfg = ipMultiplexService.getSnatCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
if(!cfg.getCfgType().equals(cfgType)){
|
if (!cfg.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",cfg.getCfgType()});
|
tabList.add(new String[] { "1", cfg.getCfgType() });
|
||||||
cfgType = cfg.getCfgType();
|
cfgType = cfg.getCfgType();
|
||||||
}
|
}
|
||||||
|
|
||||||
List<UserManage> users = userManageService.findUsers();
|
List<UserManage> users = userManageService.findUsers();
|
||||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||||
model.addAttribute("users", users);
|
model.addAttribute("users", users);
|
||||||
model.addAttribute("addrPools", addrPools);
|
model.addAttribute("addrPools", addrPools);
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/manipulation/ipmulitiplex/snatSubList";
|
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);
|
IpReuseDnatPolicyCfg cfg = ipMultiplexService.getDnatCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
if(!cfg.getCfgType().equals(cfgType)){
|
if (!cfg.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",cfg.getCfgType()});
|
tabList.add(new String[] { "1", cfg.getCfgType() });
|
||||||
cfgType = cfg.getCfgType();
|
cfgType = cfg.getCfgType();
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/manipulation/ipmulitiplex/dnatSubList";
|
return "/cfg/manipulation/ipmulitiplex/dnatSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 异步获取地址池信息
|
* 异步获取地址池信息
|
||||||
|
*
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = {"/ajaxGetAddrPools"})
|
@RequestMapping(value = { "/ajaxGetAddrPools" })
|
||||||
public List<IpAddrPoolCfg> ajaxGetAddrPools(HttpServletRequest request, HttpServletResponse response){
|
public List<IpAddrPoolCfg> ajaxGetAddrPools(HttpServletRequest request, HttpServletResponse response) {
|
||||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||||
List<IpAddrPoolCfg> addrPoolsNew=new ArrayList<>();
|
List<IpAddrPoolCfg> addrPoolsNew = new ArrayList<>();
|
||||||
for (IpAddrPoolCfg addrPool : addrPools) {
|
for (IpAddrPoolCfg addrPool : addrPools) {
|
||||||
Map<String, Object> params = new HashMap<String, Object>();
|
Map<String, Object> params = new HashMap<String, Object>();
|
||||||
params.put("addr_pool_id", addrPool.getCfgId());
|
params.put("addr_pool_id", addrPool.getCfgId());
|
||||||
String url =Constants.IP_REUSE_CALL_CGI_URL ;
|
String url = Constants.IP_REUSE_CALL_CGI_URL;
|
||||||
Map<String, Object> resultMap=ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
Map<String, Object> resultMap = ConfigServiceUtil.getCGIInfo(url, Constants.IP_NUM_GET, params);
|
||||||
if(!StringUtil.isEmpty(resultMap)
|
if (!StringUtil.isEmpty(resultMap) && !StringUtil.isEmpty(resultMap.get("num"))
|
||||||
&& !StringUtil.isEmpty(resultMap.get("num"))
|
|
||||||
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
&& Integer.parseInt(resultMap.get("num").toString()) > 0) {
|
||||||
addrPoolsNew.add(addrPool);
|
addrPoolsNew.add(addrPool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return addrPoolsNew;
|
return addrPoolsNew;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验地址池是否被策略引用
|
* 校验地址池是否被策略引用
|
||||||
|
*
|
||||||
* @param addrPoolIds
|
* @param addrPoolIds
|
||||||
* @param request
|
* @param request
|
||||||
* @param response
|
* @param response
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@RequestMapping(value = {"/ajaxIsUsed"})
|
@RequestMapping(value = { "/ajaxIsUsed" })
|
||||||
public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response){
|
public boolean ajaxIsUsed(String addrPoolIds, HttpServletRequest request, HttpServletResponse response) {
|
||||||
for (String addrPoolId : addrPoolIds.split(",")) {
|
for (String addrPoolId : addrPoolIds.split(",")) {
|
||||||
List<IpReusePolicyCfg> ipList = ipMultiplexService.checkAddrPoolIsUsed(addrPoolId);
|
List<IpReusePolicyCfg> ipList = ipMultiplexService.checkAddrPoolIsUsed(addrPoolId);
|
||||||
if(ipList != null && ipList.size() > 0){
|
if (ipList != null && ipList.size() > 0) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = { "/dnatPolicyList" })
|
||||||
@RequestMapping(value = {"/dnatPolicyList"})
|
public String dnatPolicyList(String cfgName, Model model, @ModelAttribute("cfg") IpReuseDnatPolicyCfg cfg,
|
||||||
public String dnatPolicyList(String cfgName,Model model,@ModelAttribute("cfg")IpReuseDnatPolicyCfg cfg,
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
HttpServletRequest request,HttpServletResponse response) {
|
// this._ipList(cfgName,model, cfg, request, response);
|
||||||
//this._ipList(cfgName,model, cfg, request, response);
|
|
||||||
|
Page<BaseIpCfg> page = ipMultiplexService.findPageDnat(new Page<BaseIpCfg>(request, response, "r"), cfg);
|
||||||
Page<BaseIpCfg> page = ipMultiplexService.findPageDnat(new Page<BaseIpCfg>(request, response,"r"), cfg);
|
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initFormCondition(model,cfg);
|
initFormCondition(model, cfg);
|
||||||
|
|
||||||
return "/cfg/manipulation/ipmulitiplex/dnatPolicyList2";
|
return "/cfg/manipulation/ipmulitiplex/dnatPolicyList2";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/dnatPolicyForm"})
|
@RequestMapping(value = { "/dnatPolicyForm" })
|
||||||
@RequiresPermissions(value={"dnat_policy:config"})
|
@RequiresPermissions(value = { "dnat_policy:config" })
|
||||||
public String dnatPolicyForm(String cfgName,Model model,String ids,Integer functionId,IpReuseDnatPolicyCfg cfg) {
|
public String dnatPolicyForm(String cfgName, Model model, String ids, Integer functionId,
|
||||||
//this._ipForm(cfgName,model, ids, functionId, entity);
|
IpReuseDnatPolicyCfg cfg) {
|
||||||
|
// this._ipForm(cfgName,model, ids, functionId, entity);
|
||||||
if(cfg == null){
|
|
||||||
cfg=new IpReuseDnatPolicyCfg();
|
if (cfg == null) {
|
||||||
|
cfg = new IpReuseDnatPolicyCfg();
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
cfg = ipMultiplexService.getDnatPolicyCfg(Long.valueOf(ids),null);
|
cfg = ipMultiplexService.getDnatPolicyCfg(Long.valueOf(ids), null);
|
||||||
initUpdateFormCondition(model, cfg);
|
initUpdateFormCondition(model, cfg);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model, cfg);
|
initFormCondition(model, cfg);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm2";
|
return "/cfg/manipulation/ipmulitiplex/dnatPolicyForm2";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"/saveOrUpdateDnat"})
|
@RequestMapping(value = { "/saveOrUpdateDnat" })
|
||||||
public String saveOrUpdateDnat(Model model, RedirectAttributes redirectAttributes, IpReuseDnatPolicyCfg cfg,
|
public String saveOrUpdateDnat(Model model, RedirectAttributes redirectAttributes, IpReuseDnatPolicyCfg cfg,
|
||||||
HttpServletRequest request,HttpServletResponse response) {
|
HttpServletRequest request, HttpServletResponse response) {
|
||||||
try{
|
try {
|
||||||
// 添加策略配置信息
|
// 添加策略配置信息
|
||||||
ipMultiplexService.saveOrUpdateDnat(cfg, request, response);
|
ipMultiplexService.saveOrUpdateDnat(cfg, request, response);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch(Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "save_failed");
|
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")
|
@RequiresPermissions("dnat_policy:config")
|
||||||
public String dnatDelete(String ids, Integer isValid, Integer functionId,RedirectAttributes redirectAttributes) {
|
public String dnatDelete(String ids, Integer isValid, Integer functionId, RedirectAttributes redirectAttributes) {
|
||||||
//this._deleteIp(cfgName,ids, compileIds, functionId, model);
|
// this._deleteIp(cfgName,ids, compileIds, functionId, model);
|
||||||
|
|
||||||
try{
|
try {
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipMultiplexService.deleteDnat(isValid,ids,functionId);
|
ipMultiplexService.deleteDnat(isValid, ids, functionId);
|
||||||
}
|
}
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error(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")
|
@RequiresPermissions("dnat_policy:confirm")
|
||||||
public String auditDnat(String ids,Integer isAudit,Integer isValid,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String auditDnat(String ids, Integer isAudit, Integer isValid, Integer functionId,
|
||||||
//this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
RedirectAttributes redirectAttributes) {
|
||||||
|
// this._auditIp(cfgName,ids, cfg, redirectAttributes);
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
Date auditTime=new Date();
|
Date auditTime = new Date();
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
try {
|
try {
|
||||||
ipMultiplexService.auditDnatPolicy(isAudit,isValid,functionId,id,auditTime);
|
ipMultiplexService.auditDnatPolicy(isAudit, isValid, functionId, id, auditTime);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("DNAT策略配置下发失败:"+e.getMessage());
|
logger.error("DNAT策略配置下发失败:" + e.getMessage());
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/manipulation/ipmulitiplex/dnatPolicyList?functionId="+functionId;
|
return "redirect:" + adminPath + "/manipulation/ipmulitiplex/dnatPolicyList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//snat配置导出
|
// snat配置导出
|
||||||
@RequestMapping(value = "exportSnat")
|
@RequestMapping(value = "exportSnat")
|
||||||
public void exportSnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") BaseIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
Properties msgProp = getMsgProp();
|
Properties msgProp = getMsgProp();
|
||||||
|
|
||||||
/*//导出选中记录
|
/*
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||||
for(String id:ids.split(",")){
|
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||||
Long.parseLong(id);
|
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||||
}
|
* , entity.getFunctionId(), ids); }else{
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
*/
|
||||||
}else{*/
|
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
Page<BaseIpCfg> pageInfo = new Page<BaseIpCfg>(request, response, "r");
|
||||||
Page<BaseIpCfg> pageInfo=new Page<BaseIpCfg>(request, response,"r");
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
||||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
for (BaseIpCfg baseIp : page.getList()) {
|
||||||
for (BaseIpCfg baseIp : page.getList()) {
|
if (StringUtil.isEmpty(baseIp.getGroupName())) {
|
||||||
if(StringUtil.isEmpty(baseIp.getGroupName())){
|
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
|
||||||
}
|
}
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
|
classMap.put(entity.getMenuNameCode(), BaseIpCfg.class);
|
||||||
//dnat配置导出
|
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,";
|
||||||
@RequestMapping(value = "exportDnat")
|
|
||||||
public void exportDnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
// 时间过滤
|
||||||
@ModelAttribute("cfg")BaseIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
try {
|
snatNoExport = ",config_time" + snatNoExport;
|
||||||
//export data info
|
}
|
||||||
List<String> titleList=new ArrayList<String>();
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
snatNoExport = ",edit_time" + snatNoExport;
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
}
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
Properties msgProp = getMsgProp();
|
snatNoExport = ",audit_time" + snatNoExport;
|
||||||
|
}
|
||||||
/*//导出选中记录
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
* if(!StringUtil.isEmpty(ids)){
|
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||||
for(String id:ids.split(",")){
|
}
|
||||||
Long.parseLong(id);
|
|
||||||
}
|
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||||
}else{*/
|
|
||||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
String timeRange = initTimeMap(entity);
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
noExportMap.put("timeRange", timeRange);
|
||||||
Page<BaseIpCfg> pageInfo=new Page<BaseIpCfg>(request, response,"r");
|
if ("csv".equals(entity.getExType())) {
|
||||||
pageInfo.setPageNo(1);
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
classMap, dataMap, noExportMap);
|
||||||
Page<BaseIpCfg> page = ipCfgService.findPage(pageInfo, entity);//
|
} else {
|
||||||
for (BaseIpCfg baseIp : page.getList()) {
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
if(StringUtil.isEmpty(baseIp.getGroupName())){
|
classMap, dataMap, noExportMap);
|
||||||
baseIp.setGroupName(msgProp.getProperty("default_group"));
|
}
|
||||||
}
|
} catch (Exception e) {
|
||||||
}
|
logger.error("snat export failed", e);
|
||||||
titleList.add(entity.getMenuNameCode());
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
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,";
|
// return "redirect:" + adminPath
|
||||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
}
|
||||||
/*}*/
|
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
// dnat配置导出
|
||||||
} catch (Exception e) {
|
@RequestMapping(value = "exportDnat")
|
||||||
logger.error("dnat export failed",e);
|
public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
addMessage(redirectAttributes,"error","export_failed");
|
@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.exceptions.MaatConvertException;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/cfg/asnPolicy")
|
@RequestMapping("${adminPath}/cfg/asnPolicy")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class AsnPolicyCfgController extends BaseController {
|
public class AsnPolicyCfgController extends BaseController {
|
||||||
@RequestMapping(value = {"/list"})
|
@RequestMapping(value = { "/list" })
|
||||||
public String list(Model model,HttpServletRequest request
|
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo entity
|
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
Page<CfgIndexInfo> page = asnPolicyCfgService.findPage(new Page<CfgIndexInfo>(request, response, "r"), entity);
|
||||||
Page<CfgIndexInfo> page = asnPolicyCfgService.findPage(new Page<CfgIndexInfo>(request, response,"r"), entity);
|
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,entity);
|
initPageCondition(model, entity);
|
||||||
return "/cfg/asnPolicyCfgList";
|
return "/cfg/asnPolicyCfgList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/form"})
|
|
||||||
@RequiresPermissions(value={"asn:policy:config"})
|
@RequestMapping(value = { "/form" })
|
||||||
public String form(Model model,HttpServletRequest request
|
@RequiresPermissions(value = { "asn:policy:config" })
|
||||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
entity = asnPolicyCfgService.get(Long.parseLong(ids));
|
entity = asnPolicyCfgService.get(Long.parseLong(ids));
|
||||||
initUpdateFormCondition(model, entity);
|
initUpdateFormCondition(model, entity);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model,entity);
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
List<ConfigGroupInfo> policyGroups=asnPolicyCfgService.getConfigGroupInfoList(4);
|
List<ConfigGroupInfo> policyGroups = asnPolicyCfgService.getConfigGroupInfoList(4);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/asnPolicyCfgForm";
|
return "/cfg/asnPolicyCfgForm";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/saveOrUpdate"})
|
|
||||||
@RequiresPermissions(value={"asn:policy:config"})
|
@RequestMapping(value = { "/saveOrUpdate" })
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
@RequiresPermissions(value = { "asn:policy:config" })
|
||||||
,HttpServletResponse response,
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")CfgIndexInfo cfg
|
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes){
|
try {
|
||||||
try{
|
|
||||||
asnPolicyCfgService.saveOrUpdate(cfg);
|
asnPolicyCfgService.saveOrUpdate(cfg);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("信息保存失败",e);
|
logger.error("信息保存失败", e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
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"})
|
@RequestMapping(value = { "/delete" })
|
||||||
public String delete(Integer isAudit,Integer isValid
|
@RequiresPermissions(value = { "asn:policy:config" })
|
||||||
,String ids,Integer functionId
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||||
,RedirectAttributes redirectAttributes){
|
RedirectAttributes redirectAttributes) {
|
||||||
asnPolicyCfgService.delete(functionId, isValid, ids);
|
asnPolicyCfgService.delete(functionId, isValid, ids);
|
||||||
return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/cfg/asnPolicy/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
// @RequestMapping(value = {"/audit"})
|
// @RequestMapping(value = {"/audit"})
|
||||||
// @RequiresPermissions(value={"asn:policy:confirm"})
|
// @RequiresPermissions(value={"asn:policy:confirm"})
|
||||||
// public String audit(Integer isAudit,Integer isValid,String ids
|
// public String audit(Integer isAudit,Integer isValid,String ids
|
||||||
// ,Integer functionId, RedirectAttributes redirectAttributes) {
|
// ,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||||
// if(!StringUtil.isEmpty(ids)){
|
// if(!StringUtil.isEmpty(ids)){
|
||||||
// String[] idArray = ids.split(",");
|
// String[] idArray = ids.split(",");
|
||||||
// Date auditTime=new Date();
|
// Date auditTime=new Date();
|
||||||
// for(String id :idArray){
|
// for(String id :idArray){
|
||||||
// try {
|
// try {
|
||||||
// asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
// asnPolicyCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||||
// } catch (MaatConvertException e) {
|
// } catch (MaatConvertException e) {
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||||
// addMessage(redirectAttributes,"error","request_service_failed");
|
// addMessage(redirectAttributes,"error","request_service_failed");
|
||||||
// } catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
// e.printStackTrace();
|
// e.printStackTrace();
|
||||||
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
// logger.error("dns fake ip配置下发失败:"+e.getMessage());
|
||||||
// addMessage(redirectAttributes,"error","audit_failed");
|
// addMessage(redirectAttributes,"error","audit_failed");
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
// return "redirect:" + adminPath +"/cfg/asnPolicy/list?functionId="+functionId;
|
// 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;
|
package com.nis.web.controller.configuration.ntc;
|
||||||
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
@@ -34,227 +33,245 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* BGP配置
|
* BGP配置
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/ntc/other/")
|
@RequestMapping("${adminPath}/ntc/other/")
|
||||||
public class BgpCfgController extends BaseController{
|
public class BgpCfgController extends BaseController {
|
||||||
|
|
||||||
@RequestMapping(value = {"bgpList"})
|
@RequestMapping(value = { "bgpList" })
|
||||||
// @RequiresPermissions(value={"other:bgp:config"})
|
// @RequiresPermissions(value={"other:bgp:config"})
|
||||||
public String bgpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg
|
public String bgpList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
,HttpServletRequest request,HttpServletResponse response) {
|
HttpServletResponse response) {
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(searchPage, cfg);
|
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/other/bgpList";
|
return "/cfg/other/bgpList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"bgpForm"})
|
@RequestMapping(value = { "bgpForm" })
|
||||||
@RequiresPermissions(value={"other:bgp:config"})
|
@RequiresPermissions(value = { "other:bgp:config" })
|
||||||
public String bgpForm(Model model,String ids,CfgIndexInfo entity,RedirectAttributes redirectAttributes) {
|
public String bgpForm(Model model, String ids, CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
if(StringUtils.isNotBlank(ids)){
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(ids),null);
|
entity = bgpCfgService.getBgpCfg(Long.parseLong(ids), null);
|
||||||
initUpdateFormCondition(model,entity);
|
initUpdateFormCondition(model, entity);
|
||||||
}else{
|
} else {
|
||||||
initFormCondition(model,entity);
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/other/bgpForm";
|
return "/cfg/other/bgpForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"saveBgpCfg"})
|
@RequestMapping(value = { "saveBgpCfg" })
|
||||||
@RequiresPermissions(value={"other:bgp:config"})
|
@RequiresPermissions(value = { "other:bgp:config" })
|
||||||
public String saveBgpCfg(Model model,HttpServletRequest request,HttpServletResponse response
|
public String saveBgpCfg(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
,String ids,CfgIndexInfo entity
|
CfgIndexInfo entity, RedirectAttributes redirectAttributes) {
|
||||||
,RedirectAttributes redirectAttributes) {
|
|
||||||
bgpCfgService.saveBgpCfg(entity);
|
bgpCfgService.saveBgpCfg(entity);
|
||||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+entity.getFunctionId();
|
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + entity.getFunctionId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"ajaxBgpSubList"})
|
@RequestMapping(value = { "ajaxBgpSubList" })
|
||||||
public String ajaxBgpSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
public String ajaxBgpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
CfgIndexInfo cfg = bgpCfgService.getBgpCfg(cfgId,compileId);
|
CfgIndexInfo cfg = bgpCfgService.getBgpCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if(cfg.getIpPortList()!=null){
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getNtcBgpAsCfgList()!=null){
|
if (cfg.getNtcBgpAsCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(NtcBgpAsCfg ip:cfg.getNtcBgpAsCfgList()){
|
for (NtcBgpAsCfg ip : cfg.getNtcBgpAsCfgList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",ip.getCfgType()});
|
tabList.add(new String[] { "2", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(NtcSubscribeIdCfg ip:cfg.getNtcSubscribeIdCfgList()){
|
for (NtcSubscribeIdCfg ip : cfg.getNtcSubscribeIdCfgList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",ip.getCfgType()});
|
tabList.add(new String[] { "2", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*TODO
|
/*
|
||||||
* if(cfg.getDomainList()!=null){
|
* TODO if(cfg.getDomainList()!=null){ String cfgType = null;
|
||||||
String cfgType = null;
|
* for(ComplexkeywordCfg keyword:cfg.getDomainList()){
|
||||||
for(ComplexkeywordCfg keyword:cfg.getDomainList()){
|
* if(!keyword.getCfgType().equals(cfgType)){ tabList.add(new
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
* String[]{"3",keyword.getCfgType()}); cfgType = keyword.getCfgType();
|
||||||
tabList.add(new String[]{"3",keyword.getCfgType()});
|
* } } }
|
||||||
cfgType = keyword.getCfgType();
|
*/
|
||||||
}
|
model.addAttribute("_cfg", cfg);
|
||||||
}
|
|
||||||
}*/
|
|
||||||
model.addAttribute("_cfg", cfg);
|
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/other/bgpSubList";
|
return "/cfg/other/bgpSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"updateBgpCfgValid"})
|
@RequestMapping(value = { "updateBgpCfgValid" })
|
||||||
@RequiresPermissions(value={"other:bgp:config"})
|
@RequiresPermissions(value = { "other:bgp:config" })
|
||||||
public String updateBgpCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
public String updateBgpCfgValid(Integer isValid, String ids, Integer functionId,
|
||||||
bgpCfgService.updateBgpCfgValid(isValid,ids,functionId);
|
RedirectAttributes redirectAttributes) {
|
||||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId;
|
bgpCfgService.updateBgpCfgValid(isValid, ids, functionId);
|
||||||
|
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"auditBgpCfg"})
|
@RequestMapping(value = { "auditBgpCfg" })
|
||||||
@RequiresPermissions(value={"other:bgp:confirm"})
|
@RequiresPermissions(value = { "other:bgp:confirm" })
|
||||||
public String auditBgpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditBgpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)) {
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(id),null);
|
entity = bgpCfgService.getBgpCfg(Long.parseLong(id), null);
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
try {
|
try {
|
||||||
bgpCfgService.auditBgpCfg(entity,isAudit);
|
bgpCfgService.auditBgpCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("bgp配置下发失败",e);
|
logger.error("bgp配置下发失败", e);
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("bgp配置下发失败",e);
|
logger.error("bgp配置下发失败", e);
|
||||||
addMessage(redirectAttributes,"error","audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return bgpList(model, cfg, request, response);
|
return bgpList(model, cfg, request, response);
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId;
|
return "redirect:" + adminPath + "/ntc/other/bgpList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//bgp配置导出
|
// bgp配置导出
|
||||||
@RequestMapping(value = "exportbgp")
|
@RequestMapping(value = "exportbgp")
|
||||||
public void exportbgp(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportbgp(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
// 导出选中记录
|
||||||
//导出选中记录
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
if(!StringUtil.isEmpty(ids)){
|
ipLists = ipCfgService.getByIdsList(ids);
|
||||||
ipLists=ipCfgService.getByIdsList(ids);
|
} else {
|
||||||
}else{
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(pageInfo, entity);
|
||||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(pageInfo, entity);
|
ipLists = page.getList();
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
//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"
|
+",letter,whether_area_block,classification,attribute,label"
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
String asnGroupInfoNoExport="";
|
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(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
noExportMap.put("asn_policy", asnGroupInfoNoExport);
|
noExportMap.put("asn_policy", asnGroupInfoNoExport);
|
||||||
@@ -485,9 +498,16 @@ public class IpController extends BaseController{
|
|||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
dataMap.put("NTC_IP", ipList);
|
dataMap.put("NTC_IP", ipList);
|
||||||
dataMap.put("asn_policy", groupInfoList);
|
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) {
|
} catch (Exception e) {
|
||||||
logger.error("ip addr export failed",e);
|
logger.error("ip addr export failed",e);
|
||||||
addMessage(redirectAttributes,"error", "export_failed");
|
addMessage(redirectAttributes,"error", "export_failed");
|
||||||
|
|||||||
@@ -44,275 +44,303 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 邮件相关配置控制类
|
* 邮件相关配置控制类
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/ntc/mail/")
|
@RequestMapping("${adminPath}/ntc/mail/")
|
||||||
public class MailCfgController extends BaseController{
|
public class MailCfgController extends BaseController {
|
||||||
@RequestMapping(value = {"mailList"})
|
@RequestMapping(value = { "mailList" })
|
||||||
// @RequiresPermissions(value={"mail:config"})
|
// @RequiresPermissions(value={"mail:config"})
|
||||||
public String mailList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String mailList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
HttpServletResponse response) {
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(searchPage, cfg);
|
Page<CfgIndexInfo> page = mailCfgService.getMailList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/mail/mailList";
|
return "/cfg/mail/mailList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"mailForm"})
|
|
||||||
@RequiresPermissions(value={"mail:config"})
|
@RequestMapping(value = { "mailForm" })
|
||||||
public String mailForm(Model model,String ids,CfgIndexInfo entity) {
|
@RequiresPermissions(value = { "mail:config" })
|
||||||
if(StringUtils.isNotBlank(ids)){
|
public String mailForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
entity = mailCfgService.getMailCfg(Long.parseLong(ids),null);
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
initUpdateFormCondition(model,entity);
|
entity = mailCfgService.getMailCfg(Long.parseLong(ids), null);
|
||||||
}else{
|
initUpdateFormCondition(model, entity);
|
||||||
initFormCondition(model,entity);
|
} else {
|
||||||
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/mail/mailForm";
|
return "/cfg/mail/mailForm";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"saveMailCfg"})
|
|
||||||
@RequiresPermissions(value={"mail:config"})
|
@RequestMapping(value = { "saveMailCfg" })
|
||||||
public String saveMailCfg( RedirectAttributes redirectAttributes, Model model,HttpServletRequest request,HttpServletResponse response,String ids,
|
@RequiresPermissions(value = { "mail:config" })
|
||||||
CfgIndexInfo entity,MultipartFile file) {
|
public String saveMailCfg(RedirectAttributes redirectAttributes, Model model, HttpServletRequest request,
|
||||||
|
HttpServletResponse response, String ids, CfgIndexInfo entity, MultipartFile file) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ToMaatResult result = null;
|
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 sep = System.getProperty("file.separator");
|
||||||
String digestFilePath = request.getRealPath("/")+"digestFile";
|
String digestFilePath = request.getRealPath("/") + "digestFile";
|
||||||
FileUtils.createDirectory(digestFilePath);
|
FileUtils.createDirectory(digestFilePath);
|
||||||
String fileName = UUID.randomUUID()+FileUtils.getSuffix(file.getOriginalFilename(), true);
|
String fileName = UUID.randomUUID() + FileUtils.getSuffix(file.getOriginalFilename(), true);
|
||||||
File uploadFile = new File(digestFilePath+sep+fileName);
|
File uploadFile = new File(digestFilePath + sep + fileName);
|
||||||
FileCopyUtils.copy(file.getBytes(), uploadFile);
|
FileCopyUtils.copy(file.getBytes(), uploadFile);
|
||||||
Date creatTime = entity.getCreateTime();
|
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("filetype", FileUtils.getSuffix(file.getOriginalFilename(), false));
|
||||||
fileMap.put("datatype", "dbSystem");//源文件存入数据中心
|
fileMap.put("datatype", "dbSystem");// 源文件存入数据中心
|
||||||
|
|
||||||
fileMap.put("createTime",creatTime);
|
fileMap.put("createTime", creatTime);
|
||||||
fileMap.put("key",FileUtils.getPrefix(file.getOriginalFilename(), false));
|
fileMap.put("key", FileUtils.getPrefix(file.getOriginalFilename(), false));
|
||||||
fileMap.put("fileName", file.getOriginalFilename());
|
fileMap.put("fileName", file.getOriginalFilename());
|
||||||
String md5 = DigestUtils.md5Hex(file.getBytes());
|
String md5 = DigestUtils.md5Hex(file.getBytes());
|
||||||
fileMap.put("checksum", md5);
|
fileMap.put("checksum", md5);
|
||||||
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
|
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
|
||||||
logger.info("获取文件摘要响应信息:"+result);
|
logger.info("获取文件摘要响应信息:" + result);
|
||||||
}
|
}
|
||||||
mailCfgService.saveMailCfg(entity,result);
|
mailCfgService.saveMailCfg(entity, result);
|
||||||
addMessage(redirectAttributes,"success", "save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
} catch ( Exception e) {
|
} catch (Exception e) {
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
|
||||||
}else if(e instanceof CallExternalProceduresException) {
|
} else if (e instanceof CallExternalProceduresException) {
|
||||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
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) {
|
@RequestMapping(value = { "ajaxMailSubList" })
|
||||||
CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId,compileId);
|
public String ajaxMailSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
|
CfgIndexInfo cfg = mailCfgService.getMailCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if(cfg.getIpPortList()!=null){
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getComplexList()!=null){
|
if (cfg.getComplexList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(ComplexkeywordCfg keyword:cfg.getComplexList()){
|
for (ComplexkeywordCfg keyword : cfg.getComplexList()) {
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
if (!keyword.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"3",keyword.getCfgType()});
|
tabList.add(new String[] { "3", keyword.getCfgType() });
|
||||||
cfgType = keyword.getCfgType();
|
cfgType = keyword.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getDigestList()!=null){
|
if (cfg.getDigestList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(FileDigestCfg digest:cfg.getDigestList()){
|
for (FileDigestCfg digest : cfg.getDigestList()) {
|
||||||
if(!digest.getCfgType().equals(cfgType)){
|
if (!digest.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"5",digest.getCfgType()});
|
tabList.add(new String[] { "5", digest.getCfgType() });
|
||||||
cfgType = digest.getCfgType();
|
cfgType = digest.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
|
for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) {
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
if (!keyword.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||||
cfgType = keyword.getCfgType();
|
cfgType = keyword.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/mail/mailSubList";
|
return "/cfg/mail/mailSubList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"updateMailCfgValid"})
|
|
||||||
@RequiresPermissions(value={"mail:config"})
|
@RequestMapping(value = { "updateMailCfgValid" })
|
||||||
public String updateMailCfgValid(Integer isValid,String ids,Integer functionId) {
|
@RequiresPermissions(value = { "mail:config" })
|
||||||
mailCfgService.updateMailCfgValid(isValid,ids,functionId);
|
public String updateMailCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId;
|
mailCfgService.updateMailCfgValid(isValid, ids, functionId);
|
||||||
|
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"auditMailCfg"})
|
|
||||||
@RequiresPermissions(value={"mail:confirm"})
|
@RequestMapping(value = { "auditMailCfg" })
|
||||||
public String auditMailCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
@RequiresPermissions(value = { "mail:confirm" })
|
||||||
Integer isValid,
|
public String auditMailCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isAudit,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
String ids,
|
HttpServletRequest request) {
|
||||||
Integer functionId,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)) {
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = mailCfgService.getMailCfg(Long.parseLong(id),null);
|
entity = mailCfgService.getMailCfg(Long.parseLong(id), null);
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
try {
|
try {
|
||||||
mailCfgService.auditMailCfg(entity,isAudit);
|
mailCfgService.auditMailCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch ( Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("mail配置下发失败:"+e.getMessage());
|
logger.error("mail配置下发失败:" + e.getMessage());
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
|
|
||||||
}else if(e instanceof CallExternalProceduresException) {
|
} else if (e instanceof CallExternalProceduresException) {
|
||||||
addMessage(redirectAttributes,"error","call_external_procedures_failed");
|
addMessage(redirectAttributes, "error", "call_external_procedures_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
addMessage(redirectAttributes, "error", "save_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return mailList(model, cfg, request, response);
|
return mailList(model, cfg, request, response);
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/ntc/mail/mailList?functionId="+functionId;
|
return "redirect:" + adminPath + "/ntc/mail/mailList?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
//mail配置导出
|
// mail配置导出
|
||||||
@RequestMapping(value = "exportmail")
|
@RequestMapping(value = "exportmail")
|
||||||
public void exportmail(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportmail(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
//导出选中记录
|
// 导出选中记录
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipLists=ipCfgService.getByIdsList(ids);
|
ipLists = ipCfgService.getByIdsList(ids);
|
||||||
}else{
|
} else {
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
|
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
|
||||||
ipLists=page.getList();
|
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");
|
|
||||||
}
|
}
|
||||||
//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
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/ntc/whitelist")
|
@RequestMapping("${adminPath}/ntc/whitelist")
|
||||||
public class WhiteListController extends CommonController{
|
public class WhiteListController extends CommonController {
|
||||||
|
|
||||||
@RequestMapping(value = {"ip/list"})
|
@RequestMapping(value = { "ip/list" })
|
||||||
//@RequiresPermissions(value={"whitelist:ip:config","whitelist:ip:confirm","whitelist:ip:aduit"},logical=Logical.OR)
|
// @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) {
|
public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
HttpServletResponse response) {
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(searchPage, cfg);
|
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/whitelist/ipList";
|
return "/cfg/whitelist/ipList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"ajaxIpSubList"})
|
|
||||||
public String ajaxIpSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
@RequestMapping(value = { "ajaxIpSubList" })
|
||||||
CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId,compileId);
|
public String ajaxIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
|
CfgIndexInfo cfg = ipCfgService.getIpPortCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if(cfg.getIpPortList()!=null){
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
|
for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) {
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
if (!keyword.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||||
cfgType = keyword.getCfgType();
|
cfgType = keyword.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/whitelist/ipSubList";
|
return "/cfg/whitelist/ipSubList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"ip/form"})
|
|
||||||
@RequiresPermissions(value={"whitelist:ip:config"})
|
@RequestMapping(value = { "ip/form" })
|
||||||
public String ipForm(Model model,String ids,CfgIndexInfo entity) {
|
@RequiresPermissions(value = { "whitelist:ip:config" })
|
||||||
if(StringUtils.isNotBlank(ids)){
|
public String ipForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids),null);
|
|
||||||
initUpdateFormCondition(model,entity);
|
entity = this.ipCfgService.getIpPortCfg(Long.parseLong(ids), null);
|
||||||
}else{
|
initUpdateFormCondition(model, entity);
|
||||||
initFormCondition(model,entity);
|
} else {
|
||||||
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/whitelist/ipForm";
|
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);
|
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")
|
@RequiresPermissions("whitelist:ip:confirm")
|
||||||
public String auditIp(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditIp(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request
|
|
||||||
) {
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = ipCfgService.getIpPortCfg(Long.parseLong(id),null);
|
entity = ipCfgService.getIpPortCfg(Long.parseLong(id), null);
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
try {
|
try {
|
||||||
ipCfgService.auditIpCfg(entity,isAudit);
|
ipCfgService.auditIpCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
logger.info("ip配置下发失败:"+e.getMessage());
|
logger.info("ip配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.info("ip配置下发失败:"+e.getMessage());
|
logger.info("ip配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ipList(model, cfg, request, response);
|
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"})
|
@RequestMapping(value = { "updateIpValid" })
|
||||||
public String updateIpCfgValid(Integer isValid,String ids,Integer functionId) {
|
@RequiresPermissions(value = { "whitelist:ip:config" })
|
||||||
ipCfgService.updateIpCfgValid(isValid,ids,functionId);
|
public String updateIpCfgValid(Integer isValid, String ids, Integer functionId) {
|
||||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+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)
|
@RequestMapping(value = { "domain/list" })
|
||||||
public String domainList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
// @RequiresPermissions(value={"whitelist:domain:config","whitelist:domain:confirm","whitelist:domain:aduit"},logical=Logical.OR)
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
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);
|
Page<CfgIndexInfo> page = domainService.getDomainList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
return "/cfg/whitelist/domainList";
|
return "/cfg/whitelist/domainList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"saveHttpUrlCfgs"})
|
@RequestMapping(value = { "saveHttpUrlCfgs" })
|
||||||
public String saveHttpUrlCfgs(RedirectAttributes model,HttpServletRequest request,HttpServletResponse response,CfgIndexInfo entity) {
|
public String saveHttpUrlCfgs(RedirectAttributes model, HttpServletRequest request, HttpServletResponse response,
|
||||||
if(!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())){
|
CfgIndexInfo entity) {
|
||||||
|
if (!StringUtil.isEmpty(entity) && !StringUtil.isEmpty(entity.getHttpUrlList())) {
|
||||||
CfgIndexInfo sourceCfg=websiteCfgService.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId());
|
|
||||||
|
CfgIndexInfo sourceCfg = websiteCfgService
|
||||||
|
.getCfgIndexInfo(entity.getHttpUrlList().get(0).getSourceCompileId());
|
||||||
for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) {
|
for (HttpUrlCfg httpUrlCfg : entity.getHttpUrlList()) {
|
||||||
CfgIndexInfo cfg=new CfgIndexInfo();
|
CfgIndexInfo cfg = new CfgIndexInfo();
|
||||||
List httpList=new ArrayList<>();
|
List httpList = new ArrayList<>();
|
||||||
httpUrlCfg.setRequestId(sourceCfg.getRequestId());
|
httpUrlCfg.setRequestId(sourceCfg.getRequestId());
|
||||||
BeanUtils.copyProperties(httpUrlCfg, cfg);
|
BeanUtils.copyProperties(httpUrlCfg, cfg);
|
||||||
httpList.add(httpUrlCfg);
|
httpList.add(httpUrlCfg);
|
||||||
@@ -179,258 +185,315 @@ public class WhiteListController extends CommonController{
|
|||||||
websiteCfgService.saveHttpCfg(cfg);
|
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"})
|
@RequestMapping(value = { "domain/form" })
|
||||||
@RequiresPermissions(value={"whitelist:domain:config"})
|
@RequiresPermissions(value = { "whitelist:domain:config" })
|
||||||
public String domainForm(Model model,String ids,CfgIndexInfo entity) {
|
public String domainForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
if(StringUtils.isNotBlank(ids)){
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
entity = domainService.getDomainCfg(Long.parseLong(ids),null);
|
entity = domainService.getDomainCfg(Long.parseLong(ids), null);
|
||||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||||
urlCfg.setCfgType(Constants.HTTP_URL_REGION);
|
urlCfg.setCfgType(Constants.HTTP_URL_REGION);
|
||||||
entity.setHttpUrl(urlCfg);
|
entity.setHttpUrl(urlCfg);
|
||||||
if(entity.getHttpUrlList().size()==0){
|
if (entity.getHttpUrlList().size() == 0) {
|
||||||
entity.getHttpUrlList().add(urlCfg);
|
entity.getHttpUrlList().add(urlCfg);
|
||||||
}
|
}
|
||||||
initUpdateFormCondition(model,entity);
|
initUpdateFormCondition(model, entity);
|
||||||
}else{
|
} else {
|
||||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||||
urlCfg.setCfgType(Constants.HTTP_URL_REGION);
|
urlCfg.setCfgType(Constants.HTTP_URL_REGION);
|
||||||
entity.setHttpUrl(urlCfg);
|
entity.setHttpUrl(urlCfg);
|
||||||
List<HttpUrlCfg> urlList=new ArrayList<HttpUrlCfg>();
|
List<HttpUrlCfg> urlList = new ArrayList<HttpUrlCfg>();
|
||||||
urlList.add(urlCfg);
|
urlList.add(urlCfg);
|
||||||
entity.setHttpUrlList(urlList);
|
entity.setHttpUrlList(urlList);
|
||||||
initFormCondition(model,entity);
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
return "/cfg/whitelist/domainForm";
|
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);
|
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) {
|
@RequestMapping(value = { "domain/ajaxSubList" })
|
||||||
CfgIndexInfo cfg = domainService.getDomainCfg(cfgId,compileId);
|
public String ajaxDomainSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
|
CfgIndexInfo cfg = domainService.getDomainCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if(cfg.getHttpUrlList()!=null){
|
if (cfg.getHttpUrlList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(BaseStringCfg keyword:cfg.getHttpUrlList()){
|
for (BaseStringCfg keyword : cfg.getHttpUrlList()) {
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
if (!keyword.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||||
cfgType = keyword.getCfgType();
|
cfgType = keyword.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getNtcSubscribeIdCfgList()!=null){
|
if (cfg.getNtcSubscribeIdCfgList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
|
for (NtcSubscribeIdCfg keyword : cfg.getNtcSubscribeIdCfgList()) {
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
if (!keyword.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||||
cfgType = keyword.getCfgType();
|
cfgType = keyword.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/whitelist/domianSubList";
|
return "/cfg/whitelist/domianSubList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"domain/updateValid"})
|
|
||||||
@RequiresPermissions(value={"whitelist:domain:config"})
|
@RequestMapping(value = { "domain/updateValid" })
|
||||||
public String updateDomainValid(Integer isValid,String ids,Integer functionId) {
|
@RequiresPermissions(value = { "whitelist:domain:config" })
|
||||||
domainService.updateDomainCfgValid(isValid,ids,functionId);
|
public String updateDomainValid(Integer isValid, String ids, Integer functionId) {
|
||||||
return "redirect:" + adminPath +"/ntc/whitelist/domain/list?functionId="+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")
|
@RequiresPermissions("whitelist:domain:config")
|
||||||
public String deleteDomain(String ids,Integer functionId,RedirectAttributes model) {
|
public String deleteDomain(String ids, Integer functionId, RedirectAttributes model) {
|
||||||
try{
|
try {
|
||||||
domainService.deleteWhiteDomain(ids);
|
domainService.deleteWhiteDomain(ids);
|
||||||
addMessage(model,"success","delete_success");
|
addMessage(model, "success", "delete_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("删除失败", 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")
|
@RequiresPermissions("whitelist:domain:confirm")
|
||||||
public String auditDomain(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditDomain(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
Integer isValid,
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
Integer isAudit,
|
HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)) {
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = domainService.getDomainCfg(Long.parseLong(id),null);
|
entity = domainService.getDomainCfg(Long.parseLong(id), null);
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
try {
|
try {
|
||||||
domainService.auditDomainCfg(entity,isAudit);
|
domainService.auditDomainCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (MaatConvertException e) {
|
} catch (MaatConvertException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("domain配置下发失败:"+e.getMessage());
|
logger.error("domain配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.error("domain配置下发失败:"+e.getMessage());
|
logger.error("domain配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error","audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{//条件下所有配置审核
|
} else {// 条件下所有配置审核
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return domainList(model, cfg, request, response);
|
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)
|
// ip配置导入
|
||||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
/*
|
||||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
* @RequestMapping(value = "ip/import", method=RequestMethod.POST) public
|
||||||
this._importIp(cfgName,redirectAttributes, file,cfg,WhiteListIpTemplate.class);
|
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||||
return "redirect:" + adminPath +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId();
|
*
|
||||||
}*/
|
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||||
//ip模板下载
|
* this._importIp(cfgName,redirectAttributes,
|
||||||
|
* file,cfg,WhiteListIpTemplate.class); return "redirect:" + adminPath
|
||||||
|
* +"/ntc/whitelist/ip/list?functionId="+cfg.getFunctionId(); }
|
||||||
|
*/
|
||||||
|
// ip模板下载
|
||||||
@RequestMapping(value = "ip/import/template")
|
@RequestMapping(value = "ip/import/template")
|
||||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
public void importFileTemplate(HttpServletRequest request, HttpServletResponse response,
|
||||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
RedirectAttributes redirectAttributes, Integer functionId, Integer cfgRegionCode) {
|
||||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,WhiteListIpTemplate.class);
|
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,
|
||||||
|
WhiteListIpTemplate.class);
|
||||||
}
|
}
|
||||||
//ip配置导出
|
|
||||||
|
// ip配置导出
|
||||||
@RequestMapping(value = "ip/export")
|
@RequestMapping(value = "ip/export")
|
||||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportIp(String columns, Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") IpPortCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
this._exportIp(columns,model, request, response, entity, ids, redirectAttributes);
|
this._exportIp(columns, model, request, response, entity, ids, redirectAttributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ip配置导出
|
// ip配置导出
|
||||||
@RequestMapping(value = "exportIpAddr")
|
@RequestMapping(value = "exportIpAddr")
|
||||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
//export data info
|
// export data info
|
||||||
List<String> titleList=new ArrayList<String>();
|
List<String> titleList = new ArrayList<String>();
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
|
|
||||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
//导出选中记录
|
// 导出选中记录
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
ipLists=ipCfgService.getByIdsList(ids);
|
ipLists = ipCfgService.getByIdsList(ids);
|
||||||
}else{
|
} else {
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
pageInfo.setPageNo(1);
|
pageInfo.setPageNo(1);
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||||
ipLists=page.getList();
|
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配置导出
|
titleList.add(entity.getMenuNameCode());
|
||||||
@RequestMapping(value = "exportdomain")
|
titleList.add("NTC_IP");
|
||||||
public void exportdomain(Model model,HttpServletRequest request,HttpServletResponse response,
|
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
classMap.put("NTC_IP", IpPortCfg.class);
|
||||||
try {
|
String cfgIndexInfoNoExport = ",policy_name,do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
//export data info
|
String ipPortInfoNoExport = ",protocol,direction,do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||||
List<String> titleList=new ArrayList<String>();
|
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
+ ",letter,whether_area_block,classification,attribute,label"
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,group_name,";
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
|
||||||
|
// 时间过滤
|
||||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||||
//导出选中记录
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
if(!StringUtil.isEmpty(ids)){
|
}
|
||||||
ipLists=ipCfgService.getByIdsList(ids);
|
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||||
}else{
|
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
}
|
||||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||||
pageInfo.setPageNo(1);
|
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
}
|
||||||
Page<CfgIndexInfo> page = domainService.getDomainList(pageInfo, entity);
|
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||||
ipLists=page.getList();
|
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||||
}
|
}
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||||
titleList.add("NTC_HTTP_URL");
|
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||||
classMap.put("NTC_HTTP_URL", HttpUrlCfg.class);
|
for (CfgIndexInfo cfg : ipLists) {
|
||||||
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
CfgIndexInfo cfgIndexInfo = ipCfgService.exportIpInfo(cfg);
|
||||||
String httpUrlInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
}
|
||||||
+",letter,whether_area_block,classification,attribute,label"
|
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,";
|
dataMap.put("NTC_IP", ipList);
|
||||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
/* } */
|
||||||
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
|
|
||||||
List<BaseStringCfg> httpurlList=new ArrayList<BaseStringCfg>();
|
String timeRange = initTimeMap(entity);
|
||||||
for (CfgIndexInfo cfg : ipLists) {
|
noExportMap.put("timeRange", timeRange);
|
||||||
CfgIndexInfo cfgIndexInfo=domainService.exportDomainInfo(cfg);
|
if ("csv".equals(entity.getExType())) {
|
||||||
httpurlList.addAll(cfgIndexInfo.getHttpUrlList());
|
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
}
|
classMap, dataMap, noExportMap);
|
||||||
httpurlList=BaseStringCfg.replaceBaseKeyList(httpurlList);
|
} else {
|
||||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||||
dataMap.put("NTC_HTTP_URL", httpurlList);
|
classMap, dataMap, noExportMap);
|
||||||
/*}*/
|
}
|
||||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
} catch (Exception e) {
|
||||||
} catch (Exception e) {
|
logger.error("ip white export failed", e);
|
||||||
logger.error("ip white export failed",e);
|
addMessage(redirectAttributes, "error", "export_failed");
|
||||||
addMessage(redirectAttributes,"error", "export_failed");
|
}
|
||||||
}
|
// return "redirect:" + adminPath
|
||||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
// +"/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重定向策略
|
* http重定向策略
|
||||||
|
*
|
||||||
* @author zhangwei
|
* @author zhangwei
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("${adminPath}/proxy/control/httpRedirect")
|
@RequestMapping("${adminPath}/proxy/control/httpRedirect")
|
||||||
public class HttpRedirectPolicyController extends BaseController{
|
public class HttpRedirectPolicyController extends BaseController {
|
||||||
@RequestMapping(value = {"httpRedirectList","httpBlockList","httpReplaceList","httpMonitList","httpWhitelistList"})
|
@RequestMapping(value = { "httpRedirectList", "httpBlockList", "httpReplaceList", "httpMonitList",
|
||||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg){
|
"httpWhitelistList" })
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
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);
|
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
//获取所有的响应文件内容,阻断,或重定向时可以选择
|
// 获取所有的响应文件内容,阻断,或重定向时可以选择
|
||||||
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||||
|
.getProxyFileStrategyCfgList(new ProxyFileStrategyCfg());
|
||||||
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
||||||
return "/cfg/proxy/control/httpRedirectList";
|
return "/cfg/proxy/control/httpRedirectList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"form"})
|
|
||||||
@RequiresPermissions(value={"control:httpBlock:config"
|
@RequestMapping(value = { "form" })
|
||||||
,"control:httpRedirect:config"
|
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||||
,"control:httpReplace:config"
|
"control:httpReplace:config", "control:httpMinit:config",
|
||||||
,"control:httpMinit:config"
|
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||||
,"control:httpWhitelist:config"
|
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||||
}
|
@ModelAttribute("cfg") CfgIndexInfo entity) {
|
||||||
,logical=Logical.OR)
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
public String form(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")CfgIndexInfo entity){
|
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids), null);
|
||||||
if(StringUtils.isNotBlank(ids)){
|
|
||||||
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(ids),null);
|
|
||||||
|
|
||||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||||
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
||||||
entity.setHttpUrl(urlCfg);
|
entity.setHttpUrl(urlCfg);
|
||||||
@@ -94,31 +96,31 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
||||||
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
||||||
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
||||||
|
|
||||||
if(entity.getHttpUrlList().size()==0){
|
if (entity.getHttpUrlList().size() == 0) {
|
||||||
entity.getHttpUrlList().add(urlCfg);
|
entity.getHttpUrlList().add(urlCfg);
|
||||||
}
|
}
|
||||||
if(entity.getHttpReqHdrList().size()==0){
|
if (entity.getHttpReqHdrList().size() == 0) {
|
||||||
entity.getHttpReqHdrList().add(reqHdrCfg);
|
entity.getHttpReqHdrList().add(reqHdrCfg);
|
||||||
}
|
}
|
||||||
if(entity.getHttpResHdrList().size()==0){
|
if (entity.getHttpResHdrList().size() == 0) {
|
||||||
entity.getHttpResHdrList().add(resHdrCfg);
|
entity.getHttpResHdrList().add(resHdrCfg);
|
||||||
}
|
}
|
||||||
if(entity.getHttpReqBodyList().size()==0){
|
if (entity.getHttpReqBodyList().size() == 0) {
|
||||||
entity.getHttpReqBodyList().add(reqBodyCfg);
|
entity.getHttpReqBodyList().add(reqBodyCfg);
|
||||||
}
|
}
|
||||||
if(entity.getHttpResBodyList().size()==0){
|
if (entity.getHttpResBodyList().size() == 0) {
|
||||||
entity.getHttpResBodyList().add(resBodyCfg);
|
entity.getHttpResBodyList().add(resBodyCfg);
|
||||||
}
|
}
|
||||||
if(entity.getIpPortList().size()==0){
|
if (entity.getIpPortList().size() == 0) {
|
||||||
entity.getIpPortList().add(ipPortCfg);
|
entity.getIpPortList().add(ipPortCfg);
|
||||||
}
|
}
|
||||||
if(entity.getNtcSubscribeIdCfgList().size()==0){
|
if (entity.getNtcSubscribeIdCfgList().size() == 0) {
|
||||||
entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg);
|
entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg);
|
||||||
}
|
}
|
||||||
initUpdateFormCondition(model,entity);
|
initUpdateFormCondition(model, entity);
|
||||||
}else{
|
} else {
|
||||||
//设置http各类配置的配置域类型
|
// 设置http各类配置的配置域类型
|
||||||
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
HttpUrlCfg urlCfg = new HttpUrlCfg();
|
||||||
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
urlCfg.setCfgType(Constants.HTTP_REDIRECT_URL_REGION);
|
||||||
entity.setHttpUrl(urlCfg);
|
entity.setHttpUrl(urlCfg);
|
||||||
@@ -137,303 +139,321 @@ public class HttpRedirectPolicyController extends BaseController{
|
|||||||
IpPortCfg ipPortCfg = new IpPortCfg();
|
IpPortCfg ipPortCfg = new IpPortCfg();
|
||||||
ipPortCfg.setCfgType(Constants.HTTP_IP_REGION);
|
ipPortCfg.setCfgType(Constants.HTTP_IP_REGION);
|
||||||
entity.setIpPort(ipPortCfg);
|
entity.setIpPort(ipPortCfg);
|
||||||
//subscribeId
|
// subscribeId
|
||||||
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
|
||||||
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
|
||||||
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
|
||||||
|
|
||||||
List<HttpUrlCfg> urlList=new ArrayList<HttpUrlCfg>();
|
List<HttpUrlCfg> urlList = new ArrayList<HttpUrlCfg>();
|
||||||
urlList.add(urlCfg);
|
urlList.add(urlCfg);
|
||||||
entity.setHttpUrlList(urlList);
|
entity.setHttpUrlList(urlList);
|
||||||
List<HttpReqHeadCfg> reqHdrList=new ArrayList<HttpReqHeadCfg>();
|
List<HttpReqHeadCfg> reqHdrList = new ArrayList<HttpReqHeadCfg>();
|
||||||
reqHdrList.add(reqHdrCfg);
|
reqHdrList.add(reqHdrCfg);
|
||||||
entity.setHttpReqHdrList(reqHdrList);
|
entity.setHttpReqHdrList(reqHdrList);
|
||||||
List<HttpResHeadCfg> resHdrList=new ArrayList<HttpResHeadCfg>();
|
List<HttpResHeadCfg> resHdrList = new ArrayList<HttpResHeadCfg>();
|
||||||
resHdrList.add(resHdrCfg);
|
resHdrList.add(resHdrCfg);
|
||||||
entity.setHttpResHdrList(resHdrList);
|
entity.setHttpResHdrList(resHdrList);
|
||||||
List<HttpBodyCfg> reqBodyList=new ArrayList<HttpBodyCfg>();
|
List<HttpBodyCfg> reqBodyList = new ArrayList<HttpBodyCfg>();
|
||||||
reqBodyList.add(reqBodyCfg);
|
reqBodyList.add(reqBodyCfg);
|
||||||
entity.setHttpReqBodyList(reqBodyList);
|
entity.setHttpReqBodyList(reqBodyList);
|
||||||
List<HttpBodyCfg> resBodyList=new ArrayList<HttpBodyCfg>();
|
List<HttpBodyCfg> resBodyList = new ArrayList<HttpBodyCfg>();
|
||||||
resBodyList.add(resBodyCfg);
|
resBodyList.add(resBodyCfg);
|
||||||
entity.setHttpResBodyList(resBodyList);
|
entity.setHttpResBodyList(resBodyList);
|
||||||
|
|
||||||
List<IpPortCfg> ipPortList=new ArrayList<IpPortCfg>();
|
List<IpPortCfg> ipPortList = new ArrayList<IpPortCfg>();
|
||||||
ipPortList.add(ipPortCfg);
|
ipPortList.add(ipPortCfg);
|
||||||
entity.setIpPortList(ipPortList);
|
entity.setIpPortList(ipPortList);
|
||||||
|
|
||||||
List<NtcSubscribeIdCfg> subscribeCfgList = Lists.newArrayList();
|
List<NtcSubscribeIdCfg> subscribeCfgList = Lists.newArrayList();
|
||||||
subscribeCfgList.add(subscribeIdCfg);
|
subscribeCfgList.add(subscribeIdCfg);
|
||||||
entity.setNtcSubscribeIdCfgList(subscribeCfgList);
|
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("_cfg", entity);
|
||||||
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
model.addAttribute("allProxyFileStrategys", allProxyFileStrategys);
|
||||||
return "/cfg/proxy/control/httpRedirectForm";
|
return "/cfg/proxy/control/httpRedirectForm";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"saveOrUpdate"})
|
@RequestMapping(value = { "saveOrUpdate" })
|
||||||
@RequiresPermissions(value={"control:httpBlock:config"
|
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||||
,"control:httpRedirect:config"
|
"control:httpReplace:config", "control:httpMinit:config",
|
||||||
,"control:httpReplace:config"
|
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||||
,"control:httpMinit:config"
|
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
,"control:httpWhitelist:config"}
|
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||||
,logical=Logical.OR)
|
try {
|
||||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
|
||||||
@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
|
||||||
try{
|
|
||||||
httpRedirectCfgService.saveHttpCfg(cfg);
|
httpRedirectCfgService.saveHttpCfg(cfg);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
}catch(Exception e){
|
} catch (Exception e) {
|
||||||
logger.error("信息保存失败",e);
|
logger.error("信息保存失败", e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
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) {
|
@RequestMapping(value = { "ajaxHttpSubList" })
|
||||||
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId,compileId);
|
public String ajaxHttpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
model.addAttribute("_cfg", cfg);
|
CfgIndexInfo cfg = httpRedirectCfgService.getHttpCfg(cfgId, compileId);
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
return "/cfg/proxy/control/httpRedirectSubList";
|
return "/cfg/proxy/control/httpRedirectSubList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"delete"})
|
|
||||||
@RequiresPermissions(value={"control:httpBlock:config"
|
@RequestMapping(value = { "delete" })
|
||||||
,"control:httpRedirect:config"
|
@RequiresPermissions(value = { "control:httpBlock:config", "control:httpRedirect:config",
|
||||||
,"control:httpReplace:config"
|
"control:httpReplace:config", "control:httpMinit:config",
|
||||||
,"control:httpMinit:config"
|
"control:httpWhitelist:config" }, logical = Logical.OR)
|
||||||
,"control:httpWhitelist:config"}
|
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId) {
|
||||||
,logical=Logical.OR)
|
httpRedirectCfgService.updateHttpCfgValid(isValid, ids, functionId);
|
||||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId){
|
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
||||||
httpRedirectCfgService.updateHttpCfgValid(isValid,ids,functionId);
|
|
||||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId;
|
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"audit"})
|
|
||||||
@RequiresPermissions(value={"control:httpBlock:confirm"
|
@RequestMapping(value = { "audit" })
|
||||||
,"control:httpRedirect:confirm"
|
@RequiresPermissions(value = { "control:httpBlock:confirm", "control:httpRedirect:confirm",
|
||||||
,"control:httpReplace:confirm"
|
"control:httpReplace:confirm", "control:httpMinit:confirm",
|
||||||
,"control:httpMinit:confirm"
|
"control:httpWhitelist:confirm" }, logical = Logical.OR)
|
||||||
,"control:httpWhitelist:confirm"}
|
public String audit(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid, Integer isAudit,
|
||||||
,logical=Logical.OR)
|
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||||
public String audit(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
HttpServletRequest request) {
|
||||||
Integer isValid,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer isAudit,
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String ids,
|
String[] idArray = ids.split(",");
|
||||||
Integer functionId,
|
for (String id : idArray) {
|
||||||
RedirectAttributes redirectAttributes,
|
entity = httpRedirectCfgService.getHttpCfg(Long.parseLong(id), null);
|
||||||
HttpServletResponse response,
|
entity.setIsAudit(isAudit);
|
||||||
HttpServletRequest request) {
|
entity.setIsValid(isValid);
|
||||||
if(!StringUtil.isEmpty(ids)) {
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
entity.setAuditTime(new Date());
|
||||||
String[] idArray = ids.split(",");
|
entity.setFunctionId(functionId);
|
||||||
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);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
httpRedirectCfgService.auditHttpCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success", "audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
e.printStackTrace();
|
||||||
if(e instanceof MaatConvertException) {
|
logger.info("http重定向配置下发失败:" + e.getMessage());
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
if (e instanceof MaatConvertException) {
|
||||||
}else {
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return list(model, request, response, cfg);
|
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/proxy/control/httpRedirect/httpRedirectList?functionId="+functionId;
|
} else {// 条件下所有配置审核
|
||||||
}
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
//http配置导出
|
|
||||||
@RequestMapping(value = "exportHttp")
|
|
||||||
public void exportHttp(Model model,HttpServletRequest request,HttpServletResponse response,
|
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
|
||||||
try {
|
try {
|
||||||
//export data info
|
auditAll(auditPage, isValid, cfg);
|
||||||
List<String> titleList=new ArrayList<String>();
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
} catch (Exception e) {
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
logger.error("配置下发失败:", e);
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
if (e instanceof MaatConvertException) {
|
||||||
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
} else {
|
||||||
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
}
|
||||||
//导出选中记录
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
}
|
||||||
ipLists=ipCfgService.getByIdsList(ids);
|
|
||||||
}else{
|
return list(model, request, response, cfg);
|
||||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
}
|
||||||
pageInfo.setPageNo(1);
|
return "redirect:" + adminPath + "/proxy/control/httpRedirect/httpRedirectList?functionId=" + functionId;
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
}
|
||||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
|
||||||
ipLists=page.getList();
|
// 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";
|
||||||
}
|
}
|
||||||
|
String dictlabel = DictUtils.getDictLabel(type, str.getUserRegion1());
|
||||||
Properties prop = getMsgProp();
|
str.setUserRegion1(prop.getProperty(dictlabel));
|
||||||
for (CfgIndexInfo str :ipLists) {
|
if (entity.getFunctionId() == 207 || entity.getFunctionId() == 208) {
|
||||||
if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){
|
if (StringUtil.isEmpty(str.getUserRegion2())) {
|
||||||
String type="RESPONSE_CODE";
|
if (!StringUtil.isEmpty(str.getUserRegion3())) {
|
||||||
if(entity.getFunctionId()==207){
|
ProxyFileStrategyCfg file = new ProxyFileStrategyCfg();
|
||||||
type="RESPONSE_CODE";
|
file.setCompileId(Integer.valueOf(str.getUserRegion3()));
|
||||||
}else if(entity.getFunctionId()==208){
|
List<ProxyFileStrategyCfg> allProxyFileStrategys = proxyFileStrategyService
|
||||||
type="REDIRECT_RESPONSE_CODE";
|
.getProxyFileStrategyCfgList(file);
|
||||||
}else if(entity.getFunctionId()==209){
|
if (allProxyFileStrategys != null && allProxyFileStrategys.size() > 0) {
|
||||||
type="CONTROL_REPLACE_ZONE";
|
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.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
@@ -36,315 +35,347 @@ import com.nis.web.security.UserUtils;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* IP相关配置控制类
|
* IP相关配置控制类
|
||||||
|
*
|
||||||
* @author dell
|
* @author dell
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping(value={"${adminPath}/proxy/intercept"})
|
@RequestMapping(value = { "${adminPath}/proxy/intercept" })
|
||||||
public class InterceptController extends CommonController{
|
public class InterceptController extends CommonController {
|
||||||
|
|
||||||
@RequestMapping(value = {"/ip/list","/domain/list","/ippayload/list"})
|
@RequestMapping(value = { "/ip/list", "/domain/list", "/ippayload/list" })
|
||||||
public String ipList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
public String ipList(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, HttpServletRequest request,
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
HttpServletResponse response) {
|
||||||
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(searchPage, cfg);
|
||||||
model.addAttribute("page", page);
|
model.addAttribute("page", page);
|
||||||
initPageCondition(model,cfg);
|
initPageCondition(model, cfg);
|
||||||
|
|
||||||
//获取证书信息
|
// 获取证书信息
|
||||||
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
|
List<PxyObjKeyring> certificateList = new ArrayList<PxyObjKeyring>();
|
||||||
if(cfg.getFunctionId().equals(200)){
|
if (cfg.getFunctionId().equals(200)) {
|
||||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||||
}
|
}
|
||||||
if(cfg.getFunctionId().equals(201)){
|
if (cfg.getFunctionId().equals(201)) {
|
||||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||||
}
|
}
|
||||||
model.addAttribute("certificateList", certificateList);
|
model.addAttribute("certificateList", certificateList);
|
||||||
//IP地址仿冒策略使用策略组
|
// IP地址仿冒策略使用策略组
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
return "/cfg/intercept/interceptList";
|
return "/cfg/intercept/interceptList";
|
||||||
}
|
}
|
||||||
@RequestMapping(value = {"/interceptIpForm","interceptDomainForm","interceptIpPayloadForm"})
|
|
||||||
public String interceptIpForm(Model model,String ids,CfgIndexInfo entity) {
|
@RequestMapping(value = { "/interceptIpForm", "interceptDomainForm", "interceptIpPayloadForm" })
|
||||||
if(StringUtils.isNotBlank(ids)){
|
public String interceptIpForm(Model model, String ids, CfgIndexInfo entity) {
|
||||||
entity = interceptCfgService.getInterceptCfg(Long.parseLong(ids),null);
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
initUpdateFormCondition(model,entity);
|
entity = interceptCfgService.getInterceptCfg(Long.parseLong(ids), null);
|
||||||
}else{
|
initUpdateFormCondition(model, entity);
|
||||||
initFormCondition(model,entity);
|
} else {
|
||||||
|
initFormCondition(model, entity);
|
||||||
}
|
}
|
||||||
//获取证书信息
|
// 获取证书信息
|
||||||
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
|
List<PxyObjKeyring> certificateList = new ArrayList<PxyObjKeyring>();
|
||||||
if(entity.getFunctionId().equals(200)){
|
if (entity.getFunctionId().equals(200)) {
|
||||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
||||||
}
|
}
|
||||||
if(entity.getFunctionId().equals(201)){
|
if (entity.getFunctionId().equals(201)) {
|
||||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
certificateList = pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
||||||
}
|
}
|
||||||
model.addAttribute("certificateList", certificateList);
|
model.addAttribute("certificateList", certificateList);
|
||||||
|
|
||||||
model.addAttribute("_cfg", entity);
|
model.addAttribute("_cfg", entity);
|
||||||
//IP地址仿冒策略使用策略组
|
// IP地址仿冒策略使用策略组
|
||||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(6);
|
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(6);
|
||||||
model.addAttribute("policyGroups", policyGroups);
|
model.addAttribute("policyGroups", policyGroups);
|
||||||
|
|
||||||
return "/cfg/intercept/interceptForm";
|
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 {
|
try {
|
||||||
interceptCfgService.saveInterceptCfg(entity);
|
interceptCfgService.saveInterceptCfg(entity);
|
||||||
addMessage(redirectAttributes,"success","save_success");
|
addMessage(redirectAttributes, "success", "save_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("save_failed", e);
|
logger.error("save_failed", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error","request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error","save_failed");
|
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"})
|
@RequestMapping(value = { "/ajaxInterceptIpSubList", "/ajaxInterceptDomainSubList",
|
||||||
public String ajaxInterceptIpSubList(Model model,Long cfgId,Integer index,Integer compileId) {
|
"/ajaxInterceptIpPayloadSubList" })
|
||||||
CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId,compileId);
|
public String ajaxInterceptIpSubList(Model model, Long cfgId, Integer index, Integer compileId) {
|
||||||
|
CfgIndexInfo cfg = interceptCfgService.getInterceptCfg(cfgId, compileId);
|
||||||
List<String[]> tabList = new ArrayList();
|
List<String[]> tabList = new ArrayList();
|
||||||
if(cfg.getIpPortList()!=null){
|
if (cfg.getIpPortList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
for (IpPortCfg ip : cfg.getIpPortList()) {
|
||||||
if(!ip.getCfgType().equals(cfgType)){
|
if (!ip.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
tabList.add(new String[] { "1", ip.getCfgType() });
|
||||||
cfgType = ip.getCfgType();
|
cfgType = ip.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getInterceptPktBinList()!=null){
|
if (cfg.getInterceptPktBinList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(BaseStringCfg keyword:cfg.getInterceptPktBinList()){
|
for (BaseStringCfg keyword : cfg.getInterceptPktBinList()) {
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
if (!keyword.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||||
cfgType = keyword.getCfgType();
|
cfgType = keyword.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cfg.getHttpUrlList()!=null){
|
if (cfg.getHttpUrlList() != null) {
|
||||||
String cfgType = null;
|
String cfgType = null;
|
||||||
for(BaseStringCfg keyword:cfg.getHttpUrlList()){
|
for (BaseStringCfg keyword : cfg.getHttpUrlList()) {
|
||||||
if(!keyword.getCfgType().equals(cfgType)){
|
if (!keyword.getCfgType().equals(cfgType)) {
|
||||||
tabList.add(new String[]{"2",keyword.getCfgType()});
|
tabList.add(new String[] { "2", keyword.getCfgType() });
|
||||||
cfgType = keyword.getCfgType();
|
cfgType = keyword.getCfgType();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
model.addAttribute("index", index);
|
model.addAttribute("index", index);
|
||||||
model.addAttribute("tabList", tabList);
|
model.addAttribute("tabList", tabList);
|
||||||
return "/cfg/intercept/interceptSubList";
|
return "/cfg/intercept/interceptSubList";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = {"auditInterceptIpCfg","auditInterceptDomainCfg","auditInterceptIpPayloadCfg"})
|
@RequestMapping(value = { "auditInterceptIpCfg", "auditInterceptDomainCfg", "auditInterceptIpPayloadCfg" })
|
||||||
public String auditInterceptIpCfg(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,
|
public String auditInterceptIpCfg(Model model, @ModelAttribute("cfg") CfgIndexInfo cfg, Integer isValid,
|
||||||
Integer isValid,
|
Integer isAudit, String ids, Integer functionId, RedirectAttributes redirectAttributes,
|
||||||
Integer isAudit,
|
HttpServletResponse response, HttpServletRequest request) {
|
||||||
String ids,
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
Integer functionId,
|
|
||||||
RedirectAttributes redirectAttributes,
|
|
||||||
HttpServletResponse response,
|
|
||||||
HttpServletRequest request) {
|
|
||||||
if(!StringUtil.isEmpty(ids)) {
|
|
||||||
CfgIndexInfo entity = new CfgIndexInfo();
|
CfgIndexInfo entity = new CfgIndexInfo();
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
for(String id :idArray){
|
for (String id : idArray) {
|
||||||
entity = interceptCfgService.getInterceptCfg(Long.parseLong(id),null);
|
entity = interceptCfgService.getInterceptCfg(Long.parseLong(id), null);
|
||||||
entity.setIsAudit(isAudit);
|
entity.setIsAudit(isAudit);
|
||||||
entity.setIsValid(isValid);
|
entity.setIsValid(isValid);
|
||||||
entity.setAuditorId(UserUtils.getUser().getId());
|
entity.setAuditorId(UserUtils.getUser().getId());
|
||||||
entity.setAuditTime(new Date());
|
entity.setAuditTime(new Date());
|
||||||
entity.setFunctionId(functionId);
|
entity.setFunctionId(functionId);
|
||||||
try {
|
try {
|
||||||
interceptCfgService.auditInterceptIpCfg(entity,isAudit);
|
interceptCfgService.auditInterceptIpCfg(entity, isAudit);
|
||||||
addMessage(redirectAttributes,"success","audit_success");
|
addMessage(redirectAttributes, "success", "audit_success");
|
||||||
} catch ( Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("intercept ip audit failed",e);
|
logger.error("intercept ip audit failed", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{//条件下所有配置审核
|
} else {// 条件下所有配置审核
|
||||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> searchPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
Page<CfgIndexInfo> auditPage=new Page<CfgIndexInfo>(request,response,"a");
|
Page<CfgIndexInfo> auditPage = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
BeanUtils.copyProperties(searchPage, auditPage);
|
BeanUtils.copyProperties(searchPage, auditPage);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
auditAll(auditPage,isValid , cfg);
|
auditAll(auditPage, isValid, cfg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("配置下发失败:",e);
|
logger.error("配置下发失败:", e);
|
||||||
if(e instanceof MaatConvertException) {
|
if (e instanceof MaatConvertException) {
|
||||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||||
}else {
|
} else {
|
||||||
addMessage(redirectAttributes,"error", "audit_failed");
|
addMessage(redirectAttributes, "error", "audit_failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ipList(model, cfg, request, response);
|
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"})
|
@RequestMapping(value = { "updateInterceptIpValid", "updateInterceptDomainValid", "updateInterceptIpPayloadValid" })
|
||||||
public String updateInterceptIpValid(Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
public String updateInterceptIpValid(Integer isValid, String ids, Integer functionId,
|
||||||
|
RedirectAttributes redirectAttributes) {
|
||||||
try {
|
try {
|
||||||
interceptCfgService.updatInterceptValid(isValid,ids,functionId);
|
interceptCfgService.updatInterceptValid(isValid, ids, functionId);
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes, "success", "delete_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("intercept ip delete failed",e);
|
logger.error("intercept ip delete failed", e);
|
||||||
addMessage(redirectAttributes,"error","delete_failed");
|
addMessage(redirectAttributes, "error", "delete_failed");
|
||||||
}
|
}
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+functionId;
|
return "redirect:" + adminPath + "/proxy/intercept/ip/list?functionId=" + functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
//ip配置导入
|
* //ip配置导入
|
||||||
@RequestMapping(value = "/ip/import", method=RequestMethod.POST)
|
*
|
||||||
public String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
* @RequestMapping(value = "/ip/import", method=RequestMethod.POST) public
|
||||||
@RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
* String importIp(String cfgName,RedirectAttributes redirectAttributes,
|
||||||
this._importIp(cfgName,redirectAttributes, file,cfg,IpAddrTemplate.class);
|
*
|
||||||
redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip");
|
* @RequestParam("file") MultipartFile file,IpPortCfg cfg) {
|
||||||
redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip");
|
* this._importIp(cfgName,redirectAttributes,
|
||||||
return "redirect:" + adminPath +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId();
|
* file,cfg,IpAddrTemplate.class);
|
||||||
}
|
* redirectAttributes.addAttribute("urlPrefix","/proxy/intercept/ip");
|
||||||
@RequestMapping(value = "/ip/import/template")
|
* redirectAttributes.addAttribute("requiresPermissionPrefix","intercept:ip"
|
||||||
public void importFileTemplate(HttpServletRequest request,HttpServletResponse response,
|
* ); return "redirect:" + adminPath
|
||||||
RedirectAttributes redirectAttributes,Integer functionId,Integer cfgRegionCode) {
|
* +"/proxy/intercept/ip/list?functionId="+cfg.getFunctionId(); }
|
||||||
this._importFileTemplate(request, response, redirectAttributes, functionId, cfgRegionCode,IpAddrTemplate.class);
|
*
|
||||||
}
|
* @RequestMapping(value = "/ip/import/template") public void
|
||||||
//ip配置导出
|
* importFileTemplate(HttpServletRequest request,HttpServletResponse
|
||||||
@RequestMapping(value = "/ip/export")
|
* response, RedirectAttributes redirectAttributes,Integer
|
||||||
public void exportIp(String columns,Model model,HttpServletRequest request,HttpServletResponse response,
|
* functionId,Integer cfgRegionCode) { this._importFileTemplate(request,
|
||||||
@ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes redirectAttributes){
|
* response, redirectAttributes, functionId,
|
||||||
this._exportIp(columns,model, request, response, entity, ids, redirectAttributes);
|
* cfgRegionCode,IpAddrTemplate.class); } //ip配置导出
|
||||||
}*/
|
*
|
||||||
|
* @RequestMapping(value = "/ip/export") public void exportIp(String
|
||||||
//ip配置导出
|
* columns,Model model,HttpServletRequest request,HttpServletResponse
|
||||||
@RequestMapping(value = "exportIpAddr")
|
* response,
|
||||||
public void exportIpAddr(Model model,HttpServletRequest request,HttpServletResponse response,
|
*
|
||||||
@ModelAttribute("cfg")CfgIndexInfo entity,String ids,RedirectAttributes redirectAttributes){
|
* @ModelAttribute("cfg")IpPortCfg entity,String ids,RedirectAttributes
|
||||||
try {
|
* redirectAttributes){ this._exportIp(columns,model, request, response,
|
||||||
//export data info
|
* entity, ids, redirectAttributes); }
|
||||||
List<String> titleList=new ArrayList<String>();
|
*/
|
||||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
|
||||||
Map<String, List> dataMap=new HashMap<String, List>();
|
// ip配置导出
|
||||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
@RequestMapping(value = "exportIpAddr")
|
||||||
Map<String, String> replaceExportMap=new HashMap<String, String>();
|
public void exportIpAddr(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||||
Properties prop = getMsgProp();
|
@ModelAttribute("cfg") CfgIndexInfo entity, String ids, RedirectAttributes redirectAttributes) {
|
||||||
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
|
try {
|
||||||
//导出选中记录
|
// export data info
|
||||||
if(!StringUtil.isEmpty(ids)){
|
List<String> titleList = new ArrayList<String>();
|
||||||
ipLists=ipCfgService.getByIdsList(ids);
|
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||||
}else{
|
Map<String, List> dataMap = new HashMap<String, List>();
|
||||||
entity.setTableName(IpPortCfg.getTablename());
|
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||||
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
|
Map<String, String> replaceExportMap = new HashMap<String, String>();
|
||||||
pageInfo.setPageNo(1);
|
Properties prop = getMsgProp();
|
||||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
List<CfgIndexInfo> ipLists = new ArrayList<CfgIndexInfo>();
|
||||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
// 导出选中记录
|
||||||
ipLists=page.getList();
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
}
|
ipLists = ipCfgService.getByIdsList(ids);
|
||||||
//获取证书信息
|
} else {
|
||||||
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
|
entity.setTableName(IpPortCfg.getTablename());
|
||||||
if(entity.getFunctionId().equals(200)){
|
Page<CfgIndexInfo> pageInfo = new Page<CfgIndexInfo>(request, response, "a");
|
||||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "ip");
|
pageInfo.setPageNo(1);
|
||||||
}
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
if(entity.getFunctionId().equals(201)){
|
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||||
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
|
ipLists = page.getList();
|
||||||
}
|
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
//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">
|
<shiro:hasPermission name="app:domain:config">
|
||||||
<sys:delRow url="${ctx}/app/domainCfgForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="app:domain:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -152,8 +152,20 @@
|
|||||||
<shiro:hasPermission name="app:http:config">
|
<shiro:hasPermission name="app:http:config">
|
||||||
<sys:delRow url="${ctx}/app/httpCfgForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="app:http:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -155,8 +155,20 @@
|
|||||||
<shiro:hasPermission name="app:ip:config">
|
<shiro:hasPermission name="app:ip:config">
|
||||||
<sys:delRow url="${ctx}/app/ipCfgForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="app:ip:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -201,8 +201,20 @@
|
|||||||
<shiro:hasPermission name="${configPermissionName }">
|
<shiro:hasPermission name="${configPermissionName }">
|
||||||
<sys:delRow url="${ctx}/app/feature/multiFeatureCfgForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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 }">
|
<shiro:hasPermission name="${confirmPermissionName }">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -354,18 +366,18 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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.compile_id" style="display: none;" column="cfg_id"><spring:message code="cfg_id"/></th>
|
||||||
<th class="sort-column r.cfg_desc cfgDesc"><spring:message code="config_describe"/></th>
|
<th class="sort-column r.cfg_desc cfgDesc" column="config_describe"><spring:message code="config_describe"/></th>
|
||||||
<th><spring:message code="social_app"/></th>
|
<th column="social_app"><spring:message code="social_app"/></th>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit"><spring:message code="is_audit"/></th>
|
||||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></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="log_total"/></th> --%>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator"><spring:message code="creator"/></th>
|
||||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
<th class="sort-column r.create_time" column="config_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor"><spring:message code="editor"/></th>
|
||||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
<th class="sort-column r.edit_time" column="edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor"><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
<th class="sort-column r.audit_time" column="audit_time"><spring:message code="audit_time"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -215,8 +215,20 @@
|
|||||||
<shiro:hasPermission name="app:policy:config">
|
<shiro:hasPermission name="app:policy:config">
|
||||||
<sys:delRow url="${ctx}/app/policyCfgForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="app:policy:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -134,8 +134,20 @@
|
|||||||
<shiro:hasPermission name="app:ssl:config">
|
<shiro:hasPermission name="app:ssl:config">
|
||||||
<sys:delRow url="${ctx}/app/sslCfgForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="app:ssl:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -132,8 +132,20 @@
|
|||||||
<shiro:hasPermission name="app:topic:config">
|
<shiro:hasPermission name="app:topic:config">
|
||||||
<sys:delRow url="${ctx}/app/topicDomainCfgForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="app:domain:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -213,8 +213,20 @@
|
|||||||
<shiro:hasPermission name="avVoip:config">
|
<shiro:hasPermission name="avVoip:config">
|
||||||
<sys:delRow url="${ctx}/ntc/av/contUrlForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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> --%>
|
<%-- <sys:delRow url="${ctx}/ntc/av/voipExport?functionId=${cfg.functionId }" id="contentTable" label="export" maxRow="${page.maxExportSize }"></sys:delRow> --%>
|
||||||
<shiro:hasPermission name="avVoip:confirm">
|
<shiro:hasPermission name="avVoip:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
|
|||||||
@@ -205,8 +205,20 @@
|
|||||||
<shiro:hasPermission name="avVoip:config">
|
<shiro:hasPermission name="avVoip:config">
|
||||||
<sys:delRow url="${ctx}/ntc/av/voipForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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> --%>
|
<%-- <sys:delRow url="${ctx}/ntc/av/voipExport?functionId=${cfg.functionId }" id="contentTable" label="export" maxRow="${page.maxExportSize }"></sys:delRow> --%>
|
||||||
<shiro:hasPermission name="avVoip:confirm">
|
<shiro:hasPermission name="avVoip:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
@@ -361,23 +373,23 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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.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.cfg_desc cfgDesc" column="config_describe" ><spring:message code="config_describe"/></th>
|
||||||
<th class="sort-column r.action" column="cfg_id" ><spring:message code="block_type"/></th>
|
<th class="sort-column r.action" column="block_type" ><spring:message code="block_type"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="do_log"/></th>
|
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="log_total"/></th>
|
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column r.is_valid" column="cfg_id" ><spring:message code="valid_identifier"/></th>
|
<th class="sort-column r.is_valid" column="valid_identifier" ><spring:message code="valid_identifier"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column r.create_time" column="cfg_id" ><spring:message code="config_time"/></th>
|
<th class="sort-column r.create_time" column="config_time" ><spring:message code="config_time"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column r.edit_time" column="cfg_id" ><spring:message code="edit_time"/></th>
|
<th class="sort-column r.edit_time" column="edit_time" ><spring:message code="edit_time"/></th>
|
||||||
<th column="cfg_id" ><spring:message code="auditor"/></th>
|
<th column="auditor" ><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.audit_time" column="audit_time" ><spring:message code="audit_time"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -218,8 +218,20 @@
|
|||||||
<shiro:hasPermission name="basicprotocol:config">
|
<shiro:hasPermission name="basicprotocol:config">
|
||||||
<sys:delRow url="${ctx}/basicprotocol/form" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="basicprotocol:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -164,8 +164,20 @@
|
|||||||
<shiro:hasPermission name="ddos:ip:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="ddos:ip:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -318,41 +330,41 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<%-- <th><spring:message code="seq"/></th> --%>
|
<%-- <th column="seq" ><spring:message code="seq"/></th> --%>
|
||||||
<th class="sort-column r.compile_id" style="display: none"><spring:message code="cfg_id"/></th>
|
<th column="cfg_id" 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 column="config_describe" 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 column="block_type" class="sort-column r.action"><spring:message code="block_type"/></th>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th><spring:message code="do_log"/></th>
|
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="log_total"/></th>
|
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
|
|
||||||
<th><spring:message code="antiddos_protocol"/></th>
|
<th column="antiddos_protocol" ><spring:message code="antiddos_protocol"/></th>
|
||||||
<th><spring:message code="bps_threadshold"/></th>
|
<th column="bps_threadshold" ><spring:message code="bps_threadshold"/></th>
|
||||||
<th><spring:message code="pps_threadshold"/></th>
|
<th column="pps_threadshold" ><spring:message code="pps_threadshold"/></th>
|
||||||
|
|
||||||
<th><spring:message code="ip_type"/></th>
|
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||||
<%-- <th><spring:message code="client_ip"/></th>
|
<%-- <th column="client_ip" ><spring:message code="client_ip"/></th>
|
||||||
<th><spring:message code="client_port"/></th> --%>
|
<th column="client_port" ><spring:message code="client_port"/></th> --%>
|
||||||
<th><spring:message code="ip_pattern"/></th>
|
<th column="ip_pattern" ><spring:message code="ip_pattern"/></th>
|
||||||
<th><spring:message code="server_ip"/></th>
|
<th column="server_ip" ><spring:message code="server_ip"/></th>
|
||||||
<th><spring:message code="port_pattern"/></th>
|
<th column="port_pattern" ><spring:message code="port_pattern"/></th>
|
||||||
<th><spring:message code="server_port"/></th>
|
<th column="server_port" ><spring:message code="server_port"/></th>
|
||||||
<th><spring:message code="direction"/></th>
|
<th column="direction" ><spring:message code="direction"/></th>
|
||||||
<th><spring:message code="protocol"/></th>
|
<th column="protocol" ><spring:message code="protocol"/></th>
|
||||||
|
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
<%-- <th column="operation" ><spring:message code="operation"></spring:message></th> --%>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -161,8 +161,20 @@
|
|||||||
<shiro:hasPermission name="dns:fake:ip:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="dns:fake:ip:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -315,30 +327,30 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<%-- <th><spring:message code="seq"/></th> --%>
|
<%-- <th column="seq" ><spring:message code="seq"/></th> --%>
|
||||||
<th class="sort-column r.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
|
<th column="cfg_id" 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 column="config_describe" 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 column="block_type" class="sort-column r.action"><spring:message code="block_type"/></th>
|
||||||
<th><spring:message code="group"/></th>
|
<th column="group" ><spring:message code="group"/></th>
|
||||||
<th><spring:message code="ip_type"/></th>
|
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||||
<th><spring:message code="IP"/></th>
|
<th column="IP" ><spring:message code="IP"/></th>
|
||||||
<%-- <th><spring:message code="port"/></th> --%>
|
<%-- <th column="port" ><spring:message code="port"/></th> --%>
|
||||||
<th><spring:message code="ip_pattern"/></th>
|
<th column="ip_pattern" ><spring:message code="ip_pattern"/></th>
|
||||||
<%-- <th><spring:message code="port_pattern"/></th> --%>
|
<%-- <th column="port_pattern" ><spring:message code="port_pattern"/></th> --%>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
<%-- <th column="log_total" ><spring:message code="log_total"/></th> --%>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
<%-- <th column="operation" ><spring:message code="operation"></spring:message></th> --%>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -215,8 +215,20 @@
|
|||||||
<shiro:hasPermission name="encryptedtunnelbehav:config">
|
<shiro:hasPermission name="encryptedtunnelbehav:config">
|
||||||
<sys:delRow url="${ctx}/encryptedtunnelbehav/form" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="encryptedtunnelbehav:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -186,8 +186,20 @@
|
|||||||
<shiro:hasPermission name="fileTransfer:ftp:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="fileTransfer:ftp:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -200,8 +200,20 @@
|
|||||||
<shiro:hasPermission name="fileTransfer:p2p:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="fileTransfer:p2p:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -213,8 +213,20 @@
|
|||||||
<shiro:hasPermission name="intercept:${fn:toLowerCase(interceptType)}:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="intercept:${fn:toLowerCase(interceptType)}:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<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="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="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
<c:if test="${cfg.functionId eq 201 }">
|
<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="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>
|
||||||
<c:if test="${cfg.functionId eq 200 }">
|
<c:if test="${cfg.functionId eq 200 }">
|
||||||
<%-- <th column="bandwith" ><spring:message code="bandwith"/></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>
|
||||||
<c:if test="${cfg.functionId eq 212 }">
|
<c:if test="${cfg.functionId eq 212 }">
|
||||||
<th column="replace_zone" ><spring:message code="replace_zone"/></th>
|
<th column="userregion1" ><spring:message code="replace_zone"/></th>
|
||||||
<th column="replaced_content" ><spring:message code="replaced_content"/></th>
|
<th column="userregion2" ><spring:message code="replaced_content"/></th>
|
||||||
<th column="replace_content" ><spring:message code="replace_content"/></th>
|
<th column="userregion3" ><spring:message code="replace_content"/></th>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${cfg.functionId eq 214 }">
|
<c:if test="${cfg.functionId eq 214 }">
|
||||||
<th column="Spoofing" ><spring:message code="Spoofing"/></th>
|
<th column="userregion1" ><spring:message code="Spoofing"/></th>
|
||||||
<th column="With" ><spring:message code="With"/></th>
|
<th column="userregion2" ><spring:message code="With"/></th>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${cfg.functionId eq 201 }">
|
<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>
|
</c:if>
|
||||||
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<%-- <th column="do_log" ><spring:message code="do_log"/></th> --%>
|
<%-- <th column="do_log" ><spring:message code="do_log"/></th> --%>
|
||||||
|
|||||||
@@ -123,8 +123,20 @@
|
|||||||
<shiro:hasPermission name="proxy:intercept:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="proxy:intercept:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -202,8 +202,20 @@
|
|||||||
<shiro:hasPermission name="proxy:trustedCert:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="proxy:trustedCert:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -198,8 +198,20 @@
|
|||||||
<shiro:hasPermission name="iplist:config">
|
<shiro:hasPermission name="iplist:config">
|
||||||
<sys:delRow url="${ctx}/ntc/iplist/form" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="iplist:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -201,8 +201,20 @@
|
|||||||
<shiro:hasPermission name="mail:config">
|
<shiro:hasPermission name="mail:config">
|
||||||
<sys:delRow url="${ctx}/ntc/mail/mailForm" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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">
|
<shiro:hasPermission name="mail:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -145,8 +145,20 @@
|
|||||||
<shiro:hasPermission name="dns:res:strategy:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="dns:res:strategy:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -200,8 +200,20 @@
|
|||||||
<shiro:hasPermission name="other:bgp:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="other:bgp:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -180,8 +180,20 @@
|
|||||||
<shiro:hasPermission name="${configPermissionName }">
|
<shiro:hasPermission name="${configPermissionName }">
|
||||||
<sys:delRow url="${ctx}/proxy/cache/form" id="contentTable" label="update"></sys:delRow>
|
<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/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>
|
</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 }">
|
<shiro:hasPermission name="${confirmPermissionName }">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
|
|||||||
@@ -385,8 +385,20 @@
|
|||||||
<shiro:hasPermission name="${configPermissionName }">
|
<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/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/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>
|
</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 }">
|
<shiro:hasPermission name="${confirmPermissionName }">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -546,42 +558,42 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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 column="cfg_id" 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 column="config_describe" 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="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
<c:if test="${action == 16}">
|
<c:if test="${action == 16}">
|
||||||
<th><spring:message code="response_code"/></th>
|
<th column="response_code" ><spring:message code="response_code"/></th>
|
||||||
<th><spring:message code="response_content"/></th>
|
<th column="response_content" ><spring:message code="response_content"/></th>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${action == 48}">
|
<c:if test="${action == 48}">
|
||||||
<th><spring:message code="redirect_response_code"/></th>
|
<th column="redirect_response_code" ><spring:message code="redirect_response_code"/></th>
|
||||||
<th><spring:message code="redirect_url"/></th>
|
<th column="redirect_url" ><spring:message code="redirect_url"/></th>
|
||||||
</c:if>
|
</c:if>
|
||||||
<c:if test="${action == 80}">
|
<c:if test="${action == 80}">
|
||||||
<th><spring:message code="replace_zone"/></th>
|
<th column="replace_zone" ><spring:message code="replace_zone"/></th>
|
||||||
<th><spring:message code="replaced_content"/></th>
|
<th column="replaced_content" ><spring:message code="replaced_content"/></th>
|
||||||
<th><spring:message code="replace_content"/></th>
|
<th column="replace_content" ><spring:message code="replace_content"/></th>
|
||||||
</c:if>
|
</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}">
|
<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>
|
||||||
<c:if test="${action ne 128}">
|
<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>
|
</c:if>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
|
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -298,26 +298,26 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<%-- <th><spring:message code="seq"/></th> --%>
|
<%-- <th column="seq" ><spring:message code="seq"/></th> --%>
|
||||||
<th class="sort-column r.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
|
<th column="cfg_id" 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 column="config_describe" class="sort-column r.cfg_desc"><spring:message code="config_describe"/></th>
|
||||||
<th><spring:message code="group"/></th>
|
<th column="group" ><spring:message code="group"/></th>
|
||||||
<th><spring:message code="ip_type"/></th>
|
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||||
<th><spring:message code="IP"/></th>
|
<th column="IP" ><spring:message code="IP"/></th>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column r.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
<%-- <th column="log_total" ><spring:message code="log_total"/></th> --%>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
<%-- <th column="operation" ><spring:message code="operation"></spring:message></th> --%>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -75,10 +75,22 @@
|
|||||||
<button type="button" class="btn btn-default" onClick="edit(${requestInfo.functionId})">
|
<button type="button" class="btn btn-default" onClick="edit(${requestInfo.functionId})">
|
||||||
<i class="fa fa-edit"></i> <spring:message code="edit"></spring:message></button>
|
<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/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">
|
<!-- <button type="button" class="btn btn-default">
|
||||||
<i class="fa fa-download"></i> 导出</button> -->
|
<i class="fa fa-download"></i> 导出</button> -->
|
||||||
</shiro:hasPermission>
|
</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">
|
<shiro:hasPermission name="cfg:requestInfo:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -173,20 +185,20 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<th><spring:message code="Id"></spring:message></th>
|
<th column="Id" ><spring:message code="Id"></spring:message></th>
|
||||||
<th><spring:message code="title"></spring:message></th>
|
<th column="title" ><spring:message code="title"></spring:message></th>
|
||||||
<th><spring:message code="request_organization"></spring:message></th>
|
<th column="request_organization" ><spring:message code="request_organization"></spring:message></th>
|
||||||
<th><spring:message code="request_time"></spring:message></th>
|
<th column="request_time" ><spring:message code="request_time"></spring:message></th>
|
||||||
<th><spring:message code="state"></spring:message></th>
|
<th column="state" ><spring:message code="state"></spring:message></th>
|
||||||
<th><spring:message code="request_number"></spring:message></th>
|
<th column="request_number" ><spring:message code="request_number"></spring:message></th>
|
||||||
<th><spring:message code="content"></spring:message></th>
|
<th column="content" ><spring:message code="content"></spring:message></th>
|
||||||
<th><spring:message code="special_task"></spring:message></th>
|
<th column="special_task" ><spring:message code="special_task"></spring:message></th>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column createTime"><spring:message code="create_time"/></th>
|
<th column="create_time" class="sort-column createTime"><spring:message code="create_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column editTime"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column editTime"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"></spring:message></th>
|
<th column="auditor" ><spring:message code="auditor"></spring:message></th>
|
||||||
<th class="sort-column auditTime"><spring:message code="audit_time"></spring:message></th>
|
<th column="audit_time" class="sort-column auditTime"><spring:message code="audit_time"></spring:message></th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|||||||
@@ -198,8 +198,20 @@
|
|||||||
<shiro:hasPermission name="website:dns:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="website:dns:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -352,25 +364,25 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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 column="cfg_id" 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 column="config_describe" 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="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
<th><spring:message code="policy_name"/></th>
|
<th column="policy_name" ><spring:message code="policy_name"/></th>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th><spring:message code="do_log"/></th>
|
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="log_total"/></th>
|
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -356,8 +356,20 @@
|
|||||||
<shiro:hasPermission name="website:http:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="website:http:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -510,24 +522,24 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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 column="cfg_id" 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 column="config_describe" 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="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th><spring:message code="do_log"/></th>
|
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="log_total"/></th>
|
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -197,8 +197,20 @@
|
|||||||
<shiro:hasPermission name="website:ssl:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="website:ssl:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -351,24 +363,24 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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 column="cfg_id" 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 column="config_describe" 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="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th><spring:message code="do_log"/></th>
|
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="log_total"/></th>
|
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -178,8 +178,20 @@
|
|||||||
<shiro:hasPermission name="whitelist:domain:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="whitelist:domain:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -332,25 +344,25 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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 column="cfg_id" 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 column="config_describe" 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="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th><spring:message code="do_log"/></th>
|
<th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="log_total"/></th>
|
<th column="log_total" ><spring:message code="log_total"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th>
|
<th column="label" ><spring:message code="label"/></th>
|
||||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||||
<th><spring:message code="source_compile_id"/></th>
|
<th column="source_compile_id" ><spring:message code="source_compile_id"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
@@ -198,8 +198,20 @@
|
|||||||
<shiro:hasPermission name="whitelist:ip:config">
|
<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/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/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>
|
</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">
|
<shiro:hasPermission name="whitelist:ip:confirm">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||||
@@ -352,25 +364,25 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<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 column="cfg_id" 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 column="config_describe" 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="block_type" class="sort-column a.action"><spring:message code="block_type"/></th>
|
||||||
<%-- <th><spring:message code="do_log"/></th>
|
<%-- <th column="do_log" ><spring:message code="do_log"/></th>
|
||||||
<th><spring:message code="whether_area_block"/></th>
|
<th column="whether_area_block" ><spring:message code="whether_area_block"/></th>
|
||||||
<th><spring:message code="letter"/></th>
|
<th column="letter" ><spring:message code="letter"/></th>
|
||||||
<th><spring:message code="classification"/></th>
|
<th column="classification" ><spring:message code="classification"/></th>
|
||||||
<th><spring:message code="attribute"/></th>
|
<th column="attribute" ><spring:message code="attribute"/></th>
|
||||||
<th><spring:message code="label"/></th> --%>
|
<th column="label" ><spring:message code="label"/></th> --%>
|
||||||
|
|
||||||
<th><spring:message code="is_audit"/></th>
|
<th column="is_audit" ><spring:message code="is_audit"/></th>
|
||||||
<th class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
<th column="valid_identifier" class="sort-column a.is_valid"><spring:message code="valid_identifier"/></th>
|
||||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
<%-- <th column="log_total" ><spring:message code="log_total"/></th> --%>
|
||||||
<th><spring:message code="creator"/></th>
|
<th column="creator" ><spring:message code="creator"/></th>
|
||||||
<th class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
<th column="config_time" class="sort-column a.create_time"><spring:message code="config_time"/></th>
|
||||||
<th><spring:message code="editor"/></th>
|
<th column="editor" ><spring:message code="editor"/></th>
|
||||||
<th class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
<th column="edit_time" class="sort-column a.edit_time"><spring:message code="edit_time"/></th>
|
||||||
<th><spring:message code="auditor"/></th>
|
<th column="auditor" ><spring:message code="auditor"/></th>
|
||||||
<th class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
<th column="audit_time" class="sort-column a.audit_time"><spring:message code="audit_time"/></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|||||||
Reference in New Issue
Block a user