(1)ip管控提交
(2)delRow.tag修改,删除的时候将编译ID也传过去 (3)配置取消修改,请求应当是put请求
This commit is contained in:
@@ -255,7 +255,7 @@ public class ConfigServiceUtil {
|
||||
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||
//获取响应结果
|
||||
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||
Response response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON));
|
||||
Response response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON));
|
||||
if( response.getStatus() == 200){
|
||||
result= response.readEntity(String.class);
|
||||
JSONObject resObject = JSONObject.fromObject(result);
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
package com.nis.web.controller.configuration.ntc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* IP相关配置控制类
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/ntc/iplist")
|
||||
public class IpController extends BaseController{
|
||||
@RequestMapping(value = {"list"})
|
||||
@RequiresPermissions(value={"iplist:config","iplist:audit"},logical=Logical.OR)
|
||||
public String list(Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
Page<BaseIpCfg> searchPage=new Page<BaseIpCfg>(request,response,"r");
|
||||
Page<BaseIpCfg> page = ipCfgService.findPage(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/iplist/list";
|
||||
}
|
||||
@RequestMapping(value = {"form"})
|
||||
@RequiresPermissions(value={"iplist:config"})
|
||||
public String form(Model model,String ids,BaseIpCfg entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = ipCfgService.getIpCfgById(IpPortCfg.getTablename(),Long.parseLong(ids));
|
||||
}
|
||||
if(entity.getCfgId()!=null){
|
||||
List<BaseIpCfg> areaCfg=ipCfgService.getListByComileId(AreaIpCfg.getTablename(), String.valueOf(entity.getCompileId()));
|
||||
model.addAttribute("areaCfgs", areaCfg);
|
||||
model.addAttribute("_cfg", entity);
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
IpPortCfg cfg=new IpPortCfg();
|
||||
cfg.initDefaultValueImpl();
|
||||
cfg.setFunctionId(entity.getFunctionId());
|
||||
cfg.setProtocolId(entity.getProtocolId());
|
||||
model.addAttribute("_cfg", cfg);
|
||||
initFormCondition(model,entity);
|
||||
}
|
||||
|
||||
return "/cfg/iplist/form";
|
||||
}
|
||||
@RequestMapping(value = {"saveOrUpdate"})
|
||||
public String saveOrUpdate(RedirectAttributes model, IpPortCfg cfg) {
|
||||
Date date=new Date();
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
logger.info("saveOrUpdateIp loaded");
|
||||
try{
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
if(cfg.getCfgId()==null){//新增
|
||||
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
cfg.setCreateTime(date);
|
||||
ipCfgService.addIpCfg(cfg);
|
||||
}else{//修改
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
ipCfgService.updateIpCfg(cfg);
|
||||
}
|
||||
addMessage(model,"save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("保存失败",e);
|
||||
addMessage(model,"save_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
@RequestMapping(value = {"delete"})
|
||||
@RequiresPermissions("iplist:config")
|
||||
public String delete(String ids,String compileIds,Integer functionId,RedirectAttributes model) {
|
||||
try{
|
||||
ipCfgService.deleteIp(ids,compileIds,functionId.intValue());
|
||||
addMessage(model,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
addMessage(model,"delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
@@ -20,13 +20,8 @@ import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.dao.configuration.StringCfgDao;
|
||||
|
||||
/**
|
||||
* 白名单
|
||||
@@ -105,11 +100,11 @@ public class WhiteListController extends BaseController{
|
||||
if(cfg.getCfgId()==null){//新增
|
||||
cfg.setCreatorId(cfg.getCurrentUser().getId());
|
||||
cfg.setCreateTime(date);
|
||||
ipCfgService.addIpCfg((BaseIpCfg)cfg,null);
|
||||
ipCfgService.addIpCfg(cfg);
|
||||
}else{//修改
|
||||
cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
cfg.setEditTime(new Date());
|
||||
ipCfgService.updateIpCfg((BaseIpCfg)cfg,null,null,null);
|
||||
ipCfgService.updateIpCfg(cfg);
|
||||
}
|
||||
addMessage(model,"save_success");
|
||||
}catch(Exception e){
|
||||
@@ -147,7 +142,7 @@ public class WhiteListController extends BaseController{
|
||||
@RequiresPermissions("whitelist:config")
|
||||
public String deleteIp(String ids,Integer functionId,RedirectAttributes model) {
|
||||
try{
|
||||
ipCfgService.deleteWhiteIp(ids);
|
||||
ipCfgService.deleteIp(ids,null,functionId.intValue());
|
||||
addMessage(model,"delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("删除失败", e);
|
||||
|
||||
@@ -501,7 +501,7 @@
|
||||
lable = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
|
||||
@@ -126,13 +126,13 @@ public abstract class CrudService<D extends CrudDao<T>, T extends BaseEntity<T>>
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public void saveIpBatch(List<BaseIpCfg> areaIpCfgs) {
|
||||
public void saveIpBatch(List<AreaIpCfg> areaIpCfgs) {
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
for(int index = 0; index < areaIpCfgs.size();index++){
|
||||
BaseIpCfg t = areaIpCfgs.get(index);
|
||||
AreaIpCfg t = areaIpCfgs.get(index);
|
||||
((CrudDao<BaseIpCfg>) batchSqlSession.getMapper(IpCfgDao.class)).insert(t);
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
|
||||
@@ -38,7 +38,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addStringCfg(ComplexkeywordCfg cfg,List<BaseIpCfg> areaIpCfgs){
|
||||
if(areaIpCfgs!=null&&areaIpCfgs.size()>0){
|
||||
this.saveIpBatch(areaIpCfgs);
|
||||
// this.saveIpBatch(areaIpCfgs);
|
||||
}
|
||||
return complexStringCfgDao.insert(cfg);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ public class ComplexStringCfgService extends CrudService<ComplexStringCfgDao,Com
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateStringCfg(ComplexkeywordCfg cfg,List<BaseIpCfg> addAreaCfg,List<BaseIpCfg> updateAreaCfg,List<BaseIpCfg> deleteAreaCfgs){
|
||||
if(addAreaCfg!=null&&addAreaCfg.size()>0){
|
||||
this.saveIpBatch(addAreaCfg);
|
||||
// this.saveIpBatch(addAreaCfg);
|
||||
}
|
||||
if(updateAreaCfg!=null&&updateAreaCfg.size()>0){
|
||||
this.updateIpBatch(updateAreaCfg);
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.configuration.AreaBean;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
@@ -52,10 +53,10 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addIpCfg(BaseIpCfg baseIpCfg,List<BaseIpCfg> areaIpCfgs){
|
||||
if(areaIpCfgs!=null&&areaIpCfgs.size()>0){
|
||||
this.saveIpBatch(areaIpCfgs);
|
||||
}
|
||||
public void addIpCfg(BaseIpCfg cfg){
|
||||
//区域IPsetAreaEffectiveIds设置
|
||||
List<AreaIpCfg> areaCfg=cfg.getAreaCfg();
|
||||
List<AreaBean> areaIsps=cfg.getAreaIsp();
|
||||
//调用服务接口获取compileId
|
||||
Integer compileId = 0;
|
||||
try {
|
||||
@@ -69,12 +70,71 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
if(compileId!=0){
|
||||
baseIpCfg.setCompileId(compileId);
|
||||
return ipCfgDao.insert(baseIpCfg);
|
||||
cfg.setCompileId(compileId);
|
||||
if(Constants.IS_AREA_EFFECTIVE_NO==cfg.getIsAreaEffective()){
|
||||
cfg.setAreaEffectiveIds("0");
|
||||
cfg.setAreaType(null);
|
||||
}else if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()){
|
||||
if(Constants.AREA_EFFECTIVE_TYPE_AREA_ISP==cfg.getAreaType()&&areaIsps!=null&&areaIsps.size()>0){
|
||||
StringBuffer areaEffectiveIds=new StringBuffer();
|
||||
for(int i=0;i<areaIsps.size();i++){
|
||||
if(StringUtils.isNotBlank(areaIsps.get(i).getArea())&&StringUtils.isNotBlank(areaIsps.get(i).getIsp())){
|
||||
areaEffectiveIds.append(areaIsps.get(i).getArea()+":"+areaIsps.get(i).getIsp());
|
||||
}else if(StringUtils.isNotBlank(areaIsps.get(i).getArea())){
|
||||
areaEffectiveIds.append(areaIsps.get(i).getArea());
|
||||
}else if(StringUtils.isNotBlank(areaIsps.get(i).getIsp())){
|
||||
areaEffectiveIds.append(areaIsps.get(i).getIsp());
|
||||
}
|
||||
if(i!=areaIsps.size()-1){
|
||||
areaEffectiveIds.append(",");
|
||||
}
|
||||
}
|
||||
cfg.setAreaEffectiveIds(areaEffectiveIds.toString());
|
||||
}else if(Constants.AREA_EFFECTIVE_TYPE_AREA_IP==cfg.getAreaType()&&areaCfg!=null&&areaCfg.size()>0){
|
||||
cfg.setAreaEffectiveIds("0");
|
||||
}
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
for(AreaIpCfg c:cfg.getAreaCfg()){
|
||||
c.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
|
||||
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
|
||||
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
this.saveIpBatch(cfg.getAreaCfg());
|
||||
}
|
||||
}
|
||||
|
||||
ipCfgDao.insert(cfg);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
}
|
||||
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void addIpCfg(BaseIpCfg baseIpCfg,List<BaseIpCfg> areaIpCfgs){
|
||||
// if(areaIpCfgs!=null&&areaIpCfgs.size()>0){
|
||||
// this.saveIpBatch(areaIpCfgs);
|
||||
// }
|
||||
// //调用服务接口获取compileId
|
||||
// Integer compileId = 0;
|
||||
// try {
|
||||
// List<Integer> compileIds = ConfigServiceUtil.getId(1,1);
|
||||
// if(!StringUtil.isEmpty(compileIds)){
|
||||
// compileId = compileIds.get(0);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// logger.info("获取编译ID出错");
|
||||
// throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
// }
|
||||
// if(compileId!=0){
|
||||
// baseIpCfg.setCompileId(compileId);
|
||||
// return ipCfgDao.insert(baseIpCfg);
|
||||
// }else{
|
||||
// throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||
// }
|
||||
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -87,17 +147,71 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateIpCfg(BaseIpCfg baseIpCfg,List<BaseIpCfg> addAreaCfg,List<BaseIpCfg> updateAreaCfg,List<BaseIpCfg> deleteAreaCfgs){
|
||||
if(addAreaCfg!=null&&addAreaCfg.size()>0){
|
||||
this.saveIpBatch(addAreaCfg);
|
||||
public void updateIpCfg(BaseIpCfg cfg){
|
||||
AreaIpCfg area=new AreaIpCfg();
|
||||
area.setCompileId(cfg.getCompileId());
|
||||
area.setFunctionId(cfg.getFunctionId());
|
||||
areaIpCfgDao.deleteAreaIpCfg(area);
|
||||
//区域IPsetAreaEffectiveIds设置
|
||||
List<AreaIpCfg> areaCfg=cfg.getAreaCfg();
|
||||
List<AreaBean> areaIsps=cfg.getAreaIsp();
|
||||
if(Constants.IS_AREA_EFFECTIVE_NO==cfg.getIsAreaEffective()){
|
||||
cfg.setAreaEffectiveIds("0");
|
||||
cfg.setAreaType(null);
|
||||
}else if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()){
|
||||
if(Constants.AREA_EFFECTIVE_TYPE_AREA_ISP==cfg.getAreaType()&&areaIsps!=null&&areaIsps.size()>0){
|
||||
StringBuffer areaEffectiveIds=new StringBuffer();
|
||||
for(int i=0;i<areaIsps.size();i++){
|
||||
if(StringUtils.isNotBlank(areaIsps.get(i).getArea())&&StringUtils.isNotBlank(areaIsps.get(i).getIsp())){
|
||||
areaEffectiveIds.append(areaIsps.get(i).getArea()+":"+areaIsps.get(i).getIsp());
|
||||
}else if(StringUtils.isNotBlank(areaIsps.get(i).getArea())){
|
||||
areaEffectiveIds.append(areaIsps.get(i).getArea());
|
||||
}else if(StringUtils.isNotBlank(areaIsps.get(i).getIsp())){
|
||||
areaEffectiveIds.append(areaIsps.get(i).getIsp());
|
||||
}
|
||||
if(i!=areaIsps.size()-1){
|
||||
areaEffectiveIds.append(",");
|
||||
}
|
||||
}
|
||||
cfg.setAreaEffectiveIds(areaEffectiveIds.toString());
|
||||
}else if(Constants.AREA_EFFECTIVE_TYPE_AREA_IP==cfg.getAreaType()&&areaCfg!=null&&areaCfg.size()>0){
|
||||
cfg.setAreaEffectiveIds("0");
|
||||
}
|
||||
if(areaCfg!=null&&areaCfg.size()>0){
|
||||
for(AreaIpCfg c:cfg.getAreaCfg()){
|
||||
c.initDefaultValue();
|
||||
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
|
||||
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
|
||||
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
|
||||
c.setTableName(AreaIpCfg.getTablename());
|
||||
}
|
||||
this.saveIpBatch(cfg.getAreaCfg());
|
||||
}
|
||||
}
|
||||
if(updateAreaCfg!=null&&updateAreaCfg.size()>0){
|
||||
this.updateIpBatch(updateAreaCfg);
|
||||
}
|
||||
if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){
|
||||
this.deleteIpBatch(deleteAreaCfgs);
|
||||
}
|
||||
return ipCfgDao.update(baseIpCfg);
|
||||
ipCfgDao.update(cfg);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* updateIpCfg(更新IP类配置)
|
||||
* (继承BaseIpCfg这个类方可使用)
|
||||
* @param baseIpCfg
|
||||
* @return
|
||||
*int
|
||||
* @exception
|
||||
* @since 1.0.0
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void updateIpCfg(BaseIpCfg baseIpCfg,List<BaseIpCfg> addAreaCfg,List<BaseIpCfg> updateAreaCfg,List<BaseIpCfg> deleteAreaCfgs){
|
||||
// if(addAreaCfg!=null&&addAreaCfg.size()>0){
|
||||
// this.saveIpBatch(addAreaCfg);
|
||||
// }
|
||||
// if(updateAreaCfg!=null&&updateAreaCfg.size()>0){
|
||||
// this.updateIpBatch(updateAreaCfg);
|
||||
// }
|
||||
// if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){
|
||||
// this.deleteIpBatch(deleteAreaCfgs);
|
||||
// }
|
||||
// return ipCfgDao.update(baseIpCfg);
|
||||
}
|
||||
public void auditWhiteIp(BaseIpCfg cfg) throws Exception{
|
||||
List<BaseIpCfg> beans=new ArrayList<>();
|
||||
@@ -160,11 +274,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(beans);
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("IP白名单配置参数:"+json);
|
||||
//调用服务接口取消配置
|
||||
try {
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 2);
|
||||
ToMaatResult result = ConfigServiceUtil.put(json, 1);
|
||||
logger.info("IP白名单取消配置响应信息:"+result.getMsg());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -250,8 +364,36 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
}
|
||||
|
||||
}
|
||||
// @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
// public void deleteWhiteIp(String ids){
|
||||
// List<BaseIpCfg> ipCfgs=new ArrayList<BaseIpCfg>();
|
||||
// Date date =new Date();
|
||||
// if(StringUtils.isNotBlank(ids)){
|
||||
// for(String idStr:ids.split(",")){
|
||||
// if(StringUtils.isNotBlank(idStr)){
|
||||
// BaseIpCfg cfg=new BaseIpCfg();
|
||||
// cfg.setCfgId(Long.parseLong(idStr));
|
||||
// cfg.setTableName(IpPortCfg.getTablename());
|
||||
// cfg.setEditorId(cfg.getCurrentUser().getId());
|
||||
// cfg.setEditTime(date);
|
||||
// cfg.setIsValid(Constants.VALID_DEL);
|
||||
// ipCfgs.add(cfg);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// this.deleteBatch(ipCfgs, IpCfgDao.class);
|
||||
// }
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void deleteWhiteIp(String ids){
|
||||
public void deleteIp(String ids,String compileIds,int functionId){
|
||||
if(StringUtils.isNotBlank(compileIds)){
|
||||
for(String compileId:compileIds.split(",")){
|
||||
AreaIpCfg area=new AreaIpCfg();
|
||||
area.setCompileId(Integer.parseInt(compileId));
|
||||
area.setFunctionId(functionId);
|
||||
area.setIsValid(Constants.VALID_DEL);
|
||||
areaIpCfgDao.updateValid(area);
|
||||
}
|
||||
}
|
||||
List<BaseIpCfg> ipCfgs=new ArrayList<BaseIpCfg>();
|
||||
Date date =new Date();
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
|
||||
@@ -81,7 +81,7 @@ public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearc
|
||||
if(cfg.getAreaCfg()!=null&&cfg.getAreaCfg().size()>0){
|
||||
List<BaseIpCfg> areaCfg=new ArrayList<>();
|
||||
areaCfg.addAll(cfg.getAreaCfg());
|
||||
this.saveIpBatch(areaCfg);
|
||||
// this.saveIpBatch(areaCfg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ public class MultipleCfgService extends CrudService<MultipleCfgDao,MultipleSearc
|
||||
}
|
||||
}
|
||||
if(addAreaCfg!=null&&addAreaCfg.size()>0){
|
||||
this.saveIpBatch(addAreaCfg);
|
||||
// this.saveIpBatch(addAreaCfg);
|
||||
}
|
||||
if(updateAreaCfg!=null&&updateAreaCfg.size()>0){
|
||||
this.updateIpBatch(updateAreaCfg);
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addNumCfg(NumBoundaryCfg cfg,List<BaseIpCfg> areaIpCfgs){
|
||||
if(areaIpCfgs!=null&&areaIpCfgs.size()>0){
|
||||
this.saveIpBatch(areaIpCfgs);
|
||||
// this.saveIpBatch(areaIpCfgs);
|
||||
}
|
||||
return numCfgDao.insert(cfg);
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class NumCfgService extends CrudService<NumCfgDao,NumBoundaryCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateNumCfg(NumBoundaryCfg cfg,List<BaseIpCfg> addAreaCfg,List<BaseIpCfg> updateAreaCfg,List<BaseIpCfg> deleteAreaCfgs){
|
||||
if(addAreaCfg!=null&&addAreaCfg.size()>0){
|
||||
this.saveIpBatch(addAreaCfg);
|
||||
// this.saveIpBatch(addAreaCfg);
|
||||
}
|
||||
if(updateAreaCfg!=null&&updateAreaCfg.size()>0){
|
||||
this.updateIpBatch(updateAreaCfg);
|
||||
|
||||
@@ -52,7 +52,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int addStringCfg(BaseStringCfg baseStringCfg,List<BaseIpCfg> areaIpCfgs){
|
||||
if(areaIpCfgs!=null&&areaIpCfgs.size()>0){
|
||||
this.saveIpBatch(areaIpCfgs);
|
||||
// this.saveIpBatch(areaIpCfgs);
|
||||
}
|
||||
//调用服务接口获取compileId
|
||||
Integer compileId = 0;
|
||||
@@ -88,7 +88,7 @@ public class StringCfgService extends CrudService<StringCfgDao,BaseStringCfg> {
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public int updateStringCfg(BaseStringCfg baseStringCfg,List<BaseIpCfg> addAreaCfg,List<BaseIpCfg> updateAreaCfg,List<BaseIpCfg> deleteAreaCfgs){
|
||||
if(addAreaCfg!=null&&addAreaCfg.size()>0){
|
||||
this.saveIpBatch(addAreaCfg);
|
||||
// this.saveIpBatch(addAreaCfg);
|
||||
}
|
||||
if(updateAreaCfg!=null&&updateAreaCfg.size()>0){
|
||||
this.updateIpBatch(updateAreaCfg);
|
||||
|
||||
@@ -120,15 +120,23 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||
function doAll(checkboxes,url){
|
||||
// var url = $(this).attr('data-url');
|
||||
var str="";
|
||||
var compileIdStr="";
|
||||
var ids="";
|
||||
var compileIds="";
|
||||
checkboxes.each(function(){
|
||||
if(true == $(this).is(':checked')){
|
||||
str+=$(this).attr("id")+",";
|
||||
if($(this).attr("compileId")){
|
||||
compileIdStr +=$(this).attr("compileId")+",";
|
||||
}
|
||||
}
|
||||
});
|
||||
if(str.substr(str.length-1)== ','){
|
||||
ids = str.substr(0,str.length-1);
|
||||
}
|
||||
if(compileIdStr.substr(str.length-1)== ','){
|
||||
compileIds = compileIdStr.substr(0,compileIdStr.length-1);
|
||||
}
|
||||
if(ids == ""){
|
||||
//top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。");
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
|
||||
@@ -138,9 +146,9 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox");
|
||||
|
||||
if(v=="ok"){
|
||||
if(url.indexOf("?")>0){
|
||||
window.location = url+"&ids="+ids;
|
||||
window.location = url+"&ids="+ids+"&compileIds"+compileIds;
|
||||
}else{
|
||||
window.location = url+"?ids="+ids;
|
||||
window.location = url+"?ids="+ids+"&compileIds"+compileIds;
|
||||
}
|
||||
|
||||
//$("#searchForm").submit();
|
||||
|
||||
119
src/main/webapp/WEB-INF/views/cfg/iplist/form.jsp
Normal file
119
src/main/webapp/WEB-INF/views/cfg/iplist/form.jsp
Normal file
@@ -0,0 +1,119 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#cancel").on("click",function(){
|
||||
window.history.back();
|
||||
});
|
||||
$(".action").on("change", function() {
|
||||
$("#serviceId").val($(this).attr("serviceId"));
|
||||
$("#protocolId").val($(this).attr("protocolId"));
|
||||
});
|
||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||
$("#ipCfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
//loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page-content">
|
||||
<h3 class="page-title">
|
||||
<spring:message code="${cfgName}"></spring:message>
|
||||
</h3>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>
|
||||
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
|
||||
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="ipCfgFrom" action="${ctx}/ntc/iplist/saveOrUpdate" method="post" class="form-horizontal">
|
||||
<div class="form-body row">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="action"/></label>
|
||||
<div class="col-md-6">
|
||||
<c:forEach items="${serviceList}" var="service"
|
||||
varStatus="satus">
|
||||
<label class="radio-inline"> <c:if
|
||||
test="${_cfg.functionId eq service.functionId}">
|
||||
<input type="radio" name="action"
|
||||
serviceId="${service.serviceId }"
|
||||
protocolId="${service.protocolId }"
|
||||
value="${service.action }" class="required action"
|
||||
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
||||
<spring:message code="${service.actionCode }" />
|
||||
</c:if>
|
||||
</label>
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div for="action"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- desc and action -->
|
||||
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
|
||||
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
|
||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
322
src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp
Normal file
322
src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp
Normal file
@@ -0,0 +1,322 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.srcIpAddress}"){
|
||||
$("#intype").val("${cfg.srcIpAddress}");
|
||||
} else if("${cfg.destIpAddress}"){
|
||||
$("#intype").val("${cfg.destIpAddress}");
|
||||
} else if("${cfg.srcPort}"){
|
||||
$("#intype").val("${cfg.srcPort}");
|
||||
} else if("${cfg.destPort}"){
|
||||
$("#intype").val("${cfg.destPort}");
|
||||
} else if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
} else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
$("#isAudit").change(function(){
|
||||
page();
|
||||
});
|
||||
//reset
|
||||
$("#resetBtn").on("click",function(){
|
||||
$("select.selectpicker").each(function(){
|
||||
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||
$(this).find("option").attr("selected",false);
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
});
|
||||
var edit=function(url){
|
||||
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||
if(cked.val()==1){
|
||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
if(cked.length==1){
|
||||
window.location = url+"&compileId="+cked.attr("id");
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<shiro:hasPermission name="iplist:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/ntc/iplist/form?functionId=${cfg.functionId}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message></button>
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
<h3 class="page-title">
|
||||
<spring:message code="${cfgName}"></spring:message>
|
||||
<small><spring:message code="date_list"/></small>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/ntc/iplist/list" method="post" class="form-search">
|
||||
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<form:select path="isAudit" class="selectpicker select2 input-small">
|
||||
<form:option value=""><spring:message code="all_states"/></form:option>
|
||||
<form:option value="0"><spring:message code="created"></spring:message></form:option>
|
||||
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
|
||||
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
|
||||
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="srcIpAddress"><spring:message code="client_ip"></spring:message></form:option>
|
||||
<form:option value="destIpAddress"><spring:message code="server_ip"></spring:message></form:option>
|
||||
<form:option value="srcPort"><spring:message code="client_port"></spring:message></form:option>
|
||||
<form:option value="destPort"><spring:message code="server_port"></spring:message></form:option>
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
|
||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn" > <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/><i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<shiro:hasPermission name="iplist:config">
|
||||
<sys:delRow url="${ctx}/ntc/iplist/form?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/ntc/iplist/delete?functionId=${cfg.functionId}" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
<shiro:hasPermission name="iplist:config">
|
||||
<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="examine"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li><sys:delRow url="${ctx}/ntc/iplist/audit?isAudit=1&isValid=1&functionId=${cfg.functionId}" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/iplist/audit?isAudit=2&isValid=0&functionId=${cfg.functionId}" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/ntc/iplist/audit?isAudit=3&isValid=0&functionId=${cfg.functionId}" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
|
||||
<!-- 筛选搜索内容栏默认隐藏-->
|
||||
<div class="col-md-12 filter-action-select-panle hide" >
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="config_time"/>:</label>
|
||||
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="edit_time"/>:</label>
|
||||
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="audit_time"/>:</label>
|
||||
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /筛选搜索内容栏 结束-->
|
||||
</form:form>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<sys:message content="${message}"/>
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th><spring:message code="config_describe"/></th>
|
||||
<th>ip<spring:message code="type"/></th>
|
||||
<th><spring:message code="client_ip"/></th>
|
||||
<th><spring:message code="client_port"/></th>
|
||||
<th><spring:message code="server_ip"/></th>
|
||||
<th><spring:message code="server_port"/></th>
|
||||
<th><spring:message code="block_type"/></th>
|
||||
<th><spring:message code="direction"/></th>
|
||||
<th><spring:message code="protocol"/></th>
|
||||
<th><spring:message code="whether_area_block"/></th>
|
||||
<th><spring:message code="letter"/></th>
|
||||
<th><spring:message code="type"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th><spring:message code="valid_identifier"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th><spring:message code="creator"/></th>
|
||||
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th><spring:message code="editor"/></th>
|
||||
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr pId="${status.index}">
|
||||
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" value="${cfg.isAudit}"></td>
|
||||
<%-- <td>${status.index+1 }</td> --%>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td><c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipType">
|
||||
<c:if test="${ipType.itemCode==cfg.ipType}">${ipType.itemValue}</c:if>
|
||||
</c:forEach></td>
|
||||
<td>${cfg.srcIpAddress }</td>
|
||||
<td>${cfg.srcPort }</td>
|
||||
<td>${cfg.destIpAddress }</td>
|
||||
<td>${cfg.destPort }</td>
|
||||
<td>
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<c:if test="${cfg.action eq service.action}"><spring:message code="${service.actionCode }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.direction==0}"><spring:message code="twoway"/></c:if>
|
||||
<c:if test="${cfg.direction==1}"><spring:message code="oneway"/></c:if>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.protocol==6}"><spring:message code="TCP"/></c:if>
|
||||
<c:if test="${cfg.protocol==17}"><spring:message code="UDP"/></c:if>
|
||||
<c:if test="${cfg.protocol==0}"><spring:message code="arbitrary"/></c:if>
|
||||
</td>
|
||||
<td>
|
||||
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
|
||||
<c:if test="${cfg.isAreaEffective==1}"><spring:message code="yes"/></c:if>
|
||||
</td>
|
||||
<td>${cfg.requestName }</td>
|
||||
<td>
|
||||
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId">
|
||||
<c:forEach items="${fls}" var="fl">
|
||||
<c:if test="${fn:trim(fl.serviceDictId) eq classifyId}">
|
||||
${fl.itemValue},
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId">
|
||||
<c:forEach items="${xzs}" var="xz">
|
||||
<c:if test="${fn:trim(xz.serviceDictId) eq attributeId}">${xz.itemValue},</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId">
|
||||
<c:forEach items="${lables}" var="lable">
|
||||
<c:if test="${fn:trim(lable.serviceDictId) eq lableId}">${lable.itemValue},</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<%-- <td>${cfg.areaEffectiveIds }</td> --%>
|
||||
<td>
|
||||
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||
</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${cfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.editorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.auditorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -185,7 +185,7 @@ $(function(){
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
|
||||
<input class="form-control required ipCheck" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
|
||||
</div>
|
||||
<div for="destIpAddress"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user