修复代理(劫持、镜像、阻断、注入)菜单的bug

This commit is contained in:
wangwei
2019-05-26 16:09:19 +08:00
parent f2d29374da
commit 8472c6efcf
22 changed files with 81 additions and 83 deletions

View File

@@ -16,9 +16,9 @@ public class ProxyFileHijackCfg extends BaseCfg<ProxyFileHijackCfg>{
private String profileName;//名称,辅助记忆
@ExcelField(title="content_type",sort=3)
private String contentType;//填充HTTP content-type如“video/mp4” exe、apk
@ExcelField(title="path",sort=2)
@ExcelField(title="hijack_file_strategy",sort=2)
private String path;//储存路径
@ExcelField(title="content_name",sort=3)
@ExcelField(title="content_name",sort=4)
private String contentName;//内容格式
private int quote;//判断与其他菜单是否关联使用中

View File

@@ -8,30 +8,23 @@ public class ProxyFileInsertScriptCfg extends BaseCfg<ProxyFileInsertScriptCfg>{
private static final long serialVersionUID = 4705202662940705064L;
public String indexTable = "pxy_profile_insert_scripts";//对应表名
@ExcelField(title="profile_name",sort=1)
private String profileName;//名称,辅助记忆
@ExcelField(title="format ",sort=3)
private String cfgDesc;//名称,辅助记忆
@ExcelField(title="format",sort=3)
private String format;//css/js
@ExcelField(title="path",sort=2)
@ExcelField(title="file_insert_script",sort=2)
private String path;//储存路径
private int quote;//判断与其他菜单是否关联使用中
public int getQuote() {
return quote;
}
public void setQuote(int quote) {
this.quote = quote;
}
public String getIndexTable() {
return indexTable;
}
public void setIndexTable(String indexTable) {
this.indexTable = indexTable;
}
public String getProfileName() {
return profileName;
public String getCfgDesc() {
return cfgDesc;
}
public void setProfileName(String profileName) {
this.profileName = profileName;
public void setCfgDesc(String cfgDesc) {
this.cfgDesc = cfgDesc;
}
public String getFormat() {
return format;
@@ -44,5 +37,11 @@ public class ProxyFileInsertScriptCfg extends BaseCfg<ProxyFileInsertScriptCfg>{
}
public void setPath(String path) {
this.path = path;
}
}
public int getQuote() {
return quote;
}
public void setQuote(int quote) {
this.quote = quote;
}
}

View File

@@ -12,35 +12,34 @@ public class ProxyFileTrafficMirrorCfg extends BaseCfg<ProxyFileTrafficMirrorCfg
private static final long serialVersionUID = -5895958073449509268L;
public String indexTable = "pxy_profile_traffic_mirror";//对应表名
@ExcelField(title="profile_name",sort=1)
private String profileName;//名称,辅助记忆
@ExcelField(title="addr_list",sort=2)
@ExcelField(title="target_name",sort=1)
private String cfgDesc;//名称,辅助记忆
@ExcelField(title="mirror_addr_list",sort=3)
private String addrList;//目标表示列表
@ExcelField(title="addr_type",sort=3)
@ExcelField(title="mirror_addr_type",sort=2)
private String addrType;//目标表示类型
public String getAddrList() {
return addrList;
}
public void setAddrList(String addrList) {
this.addrList = addrList;
}
public String getIndexTable() {
return indexTable;
}
public void setIndexTable(String indexTable) {
this.indexTable = indexTable;
}
public String getProfileName() {
return profileName;
public String getCfgDesc() {
return cfgDesc;
}
public void setProfileName(String profileName) {
this.profileName = profileName;
public void setCfgDesc(String cfgDesc) {
this.cfgDesc = cfgDesc;
}
public String getAddrList() {
return addrList;
}
public void setAddrList(String addrList) {
this.addrList = addrList;
}
public String getAddrType() {
return addrType;
}
public void setAddrType(String addrType) {
this.addrType = addrType;
}
}
}

View File

@@ -24,7 +24,7 @@ public class ProxyFileTrafficMirrorCfgAudit {
@Expose
private String profileName;
@Expose
private Map<String,List<String>> addrList;
private Map<String,String> addrList;
@Expose
private String addrContent;
@Expose
@@ -79,10 +79,10 @@ public class ProxyFileTrafficMirrorCfgAudit {
public void setProfileName(String profileName) {
this.profileName = profileName;
}
public Map<String, List<String>> getAddrList() {
public Map<String, String> getAddrList() {
return addrList;
}
public void setAddrList(Map<String, List<String>> addrList) {
public void setAddrList(Map<String, String> addrList) {
this.addrList = addrList;
}
public String getAddrContent() {
@@ -102,5 +102,5 @@ public class ProxyFileTrafficMirrorCfgAudit {
}
public void setOpUser(Long opUser) {
this.opUser = opUser;
}
}
}

View File

@@ -307,7 +307,13 @@ public class FileTransferCfgController extends BaseController {
logger.info("获取文件摘要响应信息:" + result);
}
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity, result, areaCfgIds);
addMessage(redirectAttributes, "success", "save_success");
//配置仅保存
if(StringUtil.isEmpty(entity.getIsValid()) || entity.getIsValid()!=1) {
addMessage(redirectAttributes, "success", "save_success");
}else {
//配置直接生效
addMessage(redirectAttributes, "success", "audit_success");
}
} catch (MaatConvertException e) {
logger.error("文件摘要配置下发失败:",e);
addMessage(redirectAttributes, "error", "request_service_failed");

View File

@@ -117,7 +117,7 @@ public class FileHijackController extends CommonController{
}
@RequestMapping(value = {"delete"})
@RequiresPermissions(value={"proxy:fileStrategy:config"})
@RequiresPermissions(value={"proxy:fileHijack:config"})
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model, @ModelAttribute("cfg")ProxyFileHijackCfg cfg,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes){
try {

View File

@@ -91,7 +91,13 @@ public class FileInsertScriptController extends CommonController{
}
}
proxyFileInsertScriptService.saveOrUpdate(cfg);
addMessage(redirectAttributes,"success","save_success");
//配置仅保存
if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
addMessage(redirectAttributes, "success", "save_success");
}else {
//配置直接生效
addMessage(redirectAttributes, "success", "audit_success");
}
}catch(Exception e){
logger.error("信息保存失败",e);
if(e instanceof MaatConvertException) {
@@ -205,10 +211,7 @@ public class FileInsertScriptController extends CommonController{
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<ProxyFileInsertScriptCfg> page = proxyFileInsertScriptService.findPage(pageInfo, entity);
ipLists = page.getList();
}
for (int i = 0; i < ipLists.size(); i++) {
ipLists.get(i).setProfileName(ipLists.get(i).getCfgDesc());
}
}
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), ProxyFileInsertScriptCfg.class);
String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";

View File

@@ -85,7 +85,13 @@ public class FileTrafficMirrorController extends CommonController {
logger.info("注入脚本文件上传响应信息:"+JsonMapper.toJsonString(result));
}
proxyFileTrafficMirrorService.saveOrUpdate(cfg);
addMessage(redirectAttributes,"success","save_success");
//配置仅保存
if(StringUtil.isEmpty(cfg.getIsValid()) || cfg.getIsValid()!=1) {
addMessage(redirectAttributes, "success", "save_success");
}else {
//配置直接生效
addMessage(redirectAttributes, "success", "audit_success");
}
}catch(Exception e){
logger.error("信息保存失败",e);
if(e instanceof MaatConvertException) {
@@ -194,7 +200,7 @@ public class FileTrafficMirrorController extends CommonController {
ipLists = proxyFileTrafficMirrorService.findByList(ids);
} else {
entity.setTableName(IpPortCfg.getTablename());
Page<ProxyFileTrafficMirrorCfg> pageInfo = new Page<ProxyFileTrafficMirrorCfg>(request, response, "r");
Page<ProxyFileTrafficMirrorCfg> pageInfo = new Page<ProxyFileTrafficMirrorCfg>(request, response, "a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<ProxyFileTrafficMirrorCfg> page = proxyFileTrafficMirrorService.findPage(pageInfo, entity);

View File

@@ -88,10 +88,8 @@
</choose>
<choose>
<!-- 判断是否批量操作 -->
<when test="batchAuditValue != null and batchAuditValue != ''">
<if test="isAudit != null">
<when test="batchAuditValue != null and batchAuditValue != ''">
AND a.IS_AUDIT in(${batchAuditValue})
</if>
</when>
<otherwise>
<if test="isAudit != null">

View File

@@ -88,10 +88,8 @@
</choose>
<choose>
<!-- 判断是否批量操作 -->
<when test="batchAuditValue != null and batchAuditValue != ''">
<if test="isAudit != null">
AND a.IS_AUDIT in(${batchAuditValue})
</if>
<when test="batchAuditValue != null and batchAuditValue != ''">
AND a.IS_AUDIT in(${batchAuditValue})
</when>
<otherwise>
<if test="isAudit != null">

View File

@@ -90,10 +90,8 @@
</choose>
<choose>
<!-- 判断是否批量操作 -->
<when test="batchAuditValue != null and batchAuditValue != ''">
<if test="isAudit != null">
AND a.IS_AUDIT in(${batchAuditValue})
</if>
<when test="batchAuditValue != null and batchAuditValue != ''">
AND a.IS_AUDIT in(${batchAuditValue})
</when>
<otherwise>
<if test="isAudit != null">

View File

@@ -90,10 +90,8 @@
</choose>
<choose>
<!-- 判断是否批量操作 -->
<when test="batchAuditValue != null and batchAuditValue != ''">
<if test="isAudit != null">
<when test="batchAuditValue != null and batchAuditValue != ''">
AND a.IS_AUDIT in(${batchAuditValue})
</if>
</when>
<otherwise>
<if test="isAudit != null">

View File

@@ -87,10 +87,8 @@
</choose>
<choose>
<!-- 判断是否批量操作 -->
<when test="batchAuditValue != null and batchAuditValue != ''">
<if test="isAudit != null">
AND a.IS_AUDIT in(${batchAuditValue})
</if>
<when test="batchAuditValue != null and batchAuditValue != ''">
AND a.IS_AUDIT in(${batchAuditValue})
</when>
<otherwise>
<if test="isAudit != null">

View File

@@ -3223,7 +3223,7 @@ public abstract class BaseService {
public static ProxyFileTrafficMirrorCfgAudit convertCallBackProxyFileTrafficMirror(ProxyFileTrafficMirrorCfg cfg) {
ProxyFileTrafficMirrorCfgAudit fileTemp = new ProxyFileTrafficMirrorCfgAudit();
Map map = new HashMap<String,List>();
map.put(cfg.getAddrType(),Arrays.asList(cfg.getAddrList().split(",")));
map.put(cfg.getAddrType(),cfg.getAddrList());
fileTemp.setId(Long.valueOf(cfg.getCompileId()));
fileTemp.setCfgId(cfg.getCompileId());
fileTemp.setProfileId(cfg.getCompileId());