修复代理(劫持、镜像、阻断、注入)菜单的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());

View File

@@ -1531,7 +1531,6 @@ https_url_format_tip=URL(http[s]://xxx.xx)
hijack_file_strategy=Hijack File
profile_name=Profile Name
file_insert_script=File Insert Script
disk_path=disk_path
format=Format
file_quote_disable_delete=File quote Disable Delete
target_type=Target Type

View File

@@ -1534,7 +1534,6 @@ https_url_format_tip=URL(http[s]://xxx.xx)
hijack_file_strategy=\u0417\u0430\u0445\u0432\u0430\u0442 \u0444\u0430\u0439\u043B
profile_name=Profile Name
file_insert_script=File Insert Script
disk_path=disk_path
format=Format
file_quote_disable_delete=File quote Disable Delete
mac=MAC

View File

@@ -1532,7 +1532,6 @@ https_url_format_tip=URL(http[s]://xxx.xx)
hijack_file_strategy=\u52AB\u6301\u6587\u4EF6
profile_name=\u6587\u4EF6\u540D\u79F0
file_insert_script=\u6CE8\u5165\u811A\u672C\u6587\u4EF6
disk_path=\u50A8\u5B58\u8DEF\u5F84
format=\u683C\u5F0F
file_quote_disable_delete=\u6587\u4EF6\u88AB\u5F15\u7528 \u4E0D\u53EF\u5220\u9664
vlan=\u865A\u62DF\u5C40\u57DF\u7F51

View File

@@ -293,10 +293,10 @@
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th column="cfg_id" class="sort-column a.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
<th column="profile_name" class="sort-column a.cfg_desc"><spring:message code="profile_name"/></th>
<th column="disk_path" ><spring:message code="disk_path"/></th>
<th column="content_type" ><spring:message code="content_type"/></th>
<th column="content_name" ><spring:message code="content_name"/></th>
<th column="is_audit" class="a.is_valid"><spring:message code="is_audit"/></th>
<th column="hijack_file_strategy" class="sort-column a.path"><spring:message code="hijack_file_strategy"/></th>
<th column="content_type" class="sort-column a.content_type"><spring:message code="content_type"/></th>
<th column="content_name" class="sort-column a.content_name"><spring:message code="content_name"/></th>
<th column="is_audit" ><spring:message code="is_audit"/></th>
<th column="letter" ><spring:message code="letter"/></th>
<th column="classification" ><spring:message code="classification"/></th>
<th column="attribute" ><spring:message code="attribute"/></th>

View File

@@ -292,8 +292,8 @@
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th column="cfg_id" class="sort-column a.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
<th column="profile_name" class="sort-column a.cfgDesc"><spring:message code="profile_name"/></th>
<th column="disk_path" ><spring:message code="disk_path"/></th>
<th column="profile_name" class="sort-column a.cfg_desc"><spring:message code="profile_name"/></th>
<th column="file_insert_script" ><spring:message code="file_insert_script"/></th>
<th column="format" ><spring:message code="format"/></th>
<th column="is_audit" class="a.is_valid"><spring:message code="is_audit"/></th>
<th column="letter" ><spring:message code="letter"/></th>

View File

@@ -282,9 +282,8 @@
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="sort-column a.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
<th class="sort-column a.cfg_desc"><spring:message code="file_desc"/></th>
<th><spring:message code="content_type"/></th>
<th><spring:message code="content_length"/></th>
<%-- <th><spring:message code="block_type"/></th> --%>
<th class="sort-column a.content_type"><spring:message code="content_type"/></th>
<th class="sort-column a.content_length"><spring:message code="content_length"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>

View File

@@ -174,8 +174,7 @@ word-break:break-all;
<font color="red">*</font><spring:message code="mirror_addr_type" />
</label>
<div class="col-md-6">
<select id="addrTypeList" name="addrType" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value=""><spring:message code="select"/></option>
<select id="addrTypeList" name="addrType" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
<option value="vlan" <c:if test="${'vlan'==_cfg.addrType}">selected</c:if>>vlan</option>
<option value="mac" <c:if test="${'mac'==_cfg.addrType}">selected</c:if>>mac</option>
</select>

View File

@@ -299,10 +299,10 @@
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th column="cfg_id" class="sort-column a.compile_id" style="display: none;"><spring:message code="cfg_id"/></th>
<th column="target_name" class="sort-column a.cfgDesc"><spring:message code="target_name"/></th>
<th column="addr_type" ><spring:message code="mirror_addr_type"/></th>
<th column="addr_list" ><spring:message code="mirror_addr_list"/></th>
<th column="is_audit" class="a.is_valid"><spring:message code="is_audit"/></th>
<th column="target_name" class="sort-column a.cfg_desc"><spring:message code="target_name"/></th>
<th column="mirror_addr_type" class="sort-column a.addr_type"><spring:message code="mirror_addr_type"/></th>
<th column="mirror_addr_list"><spring:message code="mirror_addr_list"/></th>
<th column="is_audit"><spring:message code="is_audit"/></th>
<th column="letter" ><spring:message code="letter"/></th>
<th column="classification" ><spring:message code="classification"/></th>
<th column="attribute" ><spring:message code="attribute"/></th>