Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop

Conflicts:
	src/main/resources/messages/message_en.properties
	src/main/resources/messages/message_zh_CN.properties
This commit is contained in:
duandongmei
2018-08-24 15:39:21 +08:00
74 changed files with 5494 additions and 1002 deletions

View File

@@ -129,6 +129,8 @@ public class AppPolicyCfg extends BaseCfg<AppPolicyCfg> {
// TODO Auto-generated method stub
super.initDefaultValue();
this.isHexbin = 0;
this.exprType=0;
this.matchMethod=0;
}

View File

@@ -0,0 +1,176 @@
/**
*@Title: BaseStringConfig.java
*@Package com.nis.domain.restful
*@Description TODO
*@author dell
*@date 2018年2月5日 下午5:26:02
*@version 版本号
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.util.excel.ExcelField;
/**
* APP TCP会话字节数特征
* @author dell
*
*/
public class AppTcpCfg extends BaseCfg<AppTcpCfg> {
/**
*
*/
private static final long serialVersionUID = -4366457794248757698L;
private static final String tableName="app_session_cfg";
@Expose
private Integer compileId;
@Expose
private Integer ratelimit;
private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String district;
private String cfgKeywords;
private String appName;
/**
* 数值下界
*/
protected Integer lowBoundary;
/**
* 数值上界
*/
protected Integer upBoundary;
@Expose
@ExcelField(title="expression_type")
@SerializedName("exprType")
protected Integer exprType ;
@Expose
@ExcelField(title="match_method")
@SerializedName("matchMethod")
protected Integer matchMethod ;
@Expose
@ExcelField(title="whether_hexbinary")
@SerializedName("isHexbin")
protected Integer isHexbin;
public Integer getLowBoundary() {
return lowBoundary;
}
public void setLowBoundary(Integer lowBoundary) {
this.lowBoundary = lowBoundary;
}
public Integer getUpBoundary() {
return upBoundary;
}
public void setUpBoundary(Integer upBoundary) {
this.upBoundary = upBoundary;
}
public Integer getExprType() {
return exprType;
}
public void setExprType(Integer exprType) {
this.exprType = exprType;
}
public Integer getMatchMethod() {
return matchMethod;
}
public void setMatchMethod(Integer matchMethod) {
this.matchMethod = matchMethod;
}
public Integer getIsHexbin() {
return isHexbin;
}
public void setIsHexbin(Integer isHexbin) {
this.isHexbin = isHexbin;
}
@Override
public void initDefaultValue() {
// TODO Auto-generated method stub
super.initDefaultValue();
this.isHexbin = 0;
}
public Integer getCompileId() {
return compileId;
}
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
public static String getTablename() {
return tableName;
}
public Integer getRatelimit() {
return ratelimit;
}
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
public Integer getAppCode() {
return appCode;
}
public void setAppCode(Integer appCode) {
this.appCode = appCode;
}
public Integer getSpecServiceId() {
return specServiceId;
}
public void setSpecServiceId(Integer specServiceId) {
this.specServiceId = specServiceId;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getCfgKeywords() {
return cfgKeywords;
}
public void setCfgKeywords(String cfgKeywords) {
this.cfgKeywords = cfgKeywords;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -0,0 +1,153 @@
/**
*@Title: BaseStringConfig.java
*@Package com.nis.domain.restful
*@Description TODO
*@author dell
*@date 2018年2月5日 下午5:26:02
*@version 版本号
*/
package com.nis.domain.configuration;
import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import com.nis.util.excel.ExcelField;
/**
* @Description: 主题网站配置
* @author (dell)
* @date 2018年2月5日 下午5:26:02
* @version V1.0
*/
public class AppTopicDomainCfg extends BaseCfg<AppTopicDomainCfg> {
private static final long serialVersionUID = -442502179959427340L;
private static final String tableName="app_topic_domain_cfg";
@Expose
private Integer compileId;
@Expose
private Integer ratelimit;
// private Integer appCode;//specific_service_cfg表一级节点的spec_service_code
private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code
private Integer specServiceId;
private String domain;
private String cfgKeywords;
private String appName;
private String topic;
@Expose
@ExcelField(title="expression_type")
@SerializedName("exprType")
protected Integer exprType ;
@Expose
@ExcelField(title="match_method")
@SerializedName("matchMethod")
protected Integer matchMethod ;
@Expose
@ExcelField(title="whether_hexbinary")
@SerializedName("isHexbin")
protected Integer isHexbin;
public String getTopic() {
return topic;
}
public void setTopic(String topic) {
this.topic = topic;
}
public Integer getExprType() {
return exprType;
}
public void setExprType(Integer exprType) {
this.exprType = exprType;
}
public Integer getMatchMethod() {
return matchMethod;
}
public void setMatchMethod(Integer matchMethod) {
this.matchMethod = matchMethod;
}
public Integer getIsHexbin() {
return isHexbin;
}
public void setIsHexbin(Integer isHexbin) {
this.isHexbin = isHexbin;
}
@Override
public void initDefaultValue() {
super.initDefaultValue();
this.isHexbin = 0;
this.doLog = 0;//app特征域不记录日志
}
public Integer getCompileId() {
return compileId;
}
public void setCompileId(Integer compileId) {
this.compileId = compileId;
}
public static String getTablename() {
return tableName;
}
public Integer getRatelimit() {
return ratelimit;
}
public void setRatelimit(Integer ratelimit) {
this.ratelimit = ratelimit;
}
// public Integer getAppCode() {
// return appCode;
// }
// public void setAppCode(Integer appCode) {
// this.appCode = appCode;
// }
public Integer getSpecServiceId() {
return specServiceId;
}
public void setSpecServiceId(Integer specServiceId) {
this.specServiceId = specServiceId;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public String getCfgKeywords() {
return cfgKeywords;
}
public void setCfgKeywords(String cfgKeywords) {
this.cfgKeywords = cfgKeywords;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public Integer getBehavCode() {
return behavCode;
}
public void setBehavCode(Integer behavCode) {
this.behavCode = behavCode;
}
}

View File

@@ -30,7 +30,10 @@ public class FileDigestCfg extends BaseCfg<FileDigestCfg> {
private String digest;
private Integer cfdsLevel;
private String fileUrl;
private NtcSubscribeIdCfg ntcSubscribeIdCfg;
private List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList;
public static String getTablename() {
return tableName;
}
@@ -61,5 +64,17 @@ public class FileDigestCfg extends BaseCfg<FileDigestCfg> {
public void setFileUrl(String fileUrl) {
this.fileUrl = fileUrl;
}
public NtcSubscribeIdCfg getNtcSubscribeIdCfg() {
return ntcSubscribeIdCfg;
}
public void setNtcSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg) {
this.ntcSubscribeIdCfg = ntcSubscribeIdCfg;
}
public List<NtcSubscribeIdCfg> getNtcSubscribeIdCfgList() {
return ntcSubscribeIdCfgList;
}
public void setNtcSubscribeIdCfgList(List<NtcSubscribeIdCfg> ntcSubscribeIdCfgList) {
this.ntcSubscribeIdCfgList = ntcSubscribeIdCfgList;
}
}

View File

@@ -31,7 +31,14 @@ public class SpecificServiceCfg extends BaseEntity<SpecificServiceCfg>{
private Date endDate; // 结束日期
private String showSequence; //显示序号
private String businessType;
private Integer addFlag;//app界面添加标记
public Integer getAddFlag() {
return addFlag;
}
public void setAddFlag(Integer addFlag) {
this.addFlag = addFlag;
}
public String getBusinessType() {
return businessType;
}

View File

@@ -7,6 +7,8 @@ import java.util.Map;
import com.google.gson.GsonBuilder;
public final class Constants {
public static Integer APP_SPEC_SERVICE_CODE_MIN_VAL=Configurations.getIntProperty("app_spec_service_code_min_val", 300001);
public static Integer APP_SPEC_SERVICE_CODE_MAX_VAL=Configurations.getIntProperty("app_spec_service_code_max_val", 268435455);
public static String APP_CFG_USERREGION_SPLITOR=Configurations.getStringProperty("app_cfg_userregion_splitor", "&");
/**
* MaatConfig 默认值
@@ -494,6 +496,7 @@ public final class Constants {
public static final String P2P_HASH_BIN_REGION = Configurations.getStringProperty("p2p_hash_bin_region","NTC_P2P_HASH_BIN");
public static final String P2P_KEYWORDS_REGION = Configurations.getStringProperty("p2p_keywords_region","NTC_P2P_KEYWORDS");
public static final String NTC_SUBSCRIBE_ID_REGION = Configurations.getStringProperty("ntc_subscribe_id_region","NTC_SUBSCRIBE_ID");
public static final String PXY_CRTL_SUBSCRIBE_ID_REGION = Configurations.getStringProperty("pxy_crtl_subscribe_id_region","PXY_CRTL_SUBSCRIBE_ID");
/**
* 样例文件URL关键字
*/

View File

@@ -7,6 +7,8 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/tag")
@@ -26,7 +28,9 @@ public class TagController extends BaseController {
model.addAttribute("selectIds", request.getParameter("selectIds")); // 指定默认选中的ID
model.addAttribute("isAll", request.getParameter("isAll")); // 是否读取全部数据,不进行权限过滤
model.addAttribute("module", request.getParameter("module")); // 过滤栏目模型仅针对CMS的Category树
model.addAttribute("title", request.getParameter("title"));
model.addAttribute("title", request.getParameter("title"));//根节点替换文本
model.addAttribute("enableAddBtn", request.getParameter("enableAddBtn"));//节点是否可编辑
model.addAttribute("userId", UserUtils.getUser().getId());//如果启用了addBtn,则使用userId判断是否是用户自己创建的用户自己创建的节点可删除
return "/sys/tagTreeselect";
}

View File

@@ -24,13 +24,18 @@ import com.nis.domain.configuration.AppHttpCfg;
import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.CallExternalProceduresException;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.CodeDicUtils;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.web.controller.BaseController;
import com.nis.web.dao.dashboard.codedic.CodeResult;
import com.nis.web.security.UserUtils;
/**
@@ -755,6 +760,126 @@ public class AppCfgController extends BaseController {
appCfgService.updateAppSslCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId;
}
/**
* APP TCP会话字节数特征 列表
* @param model
* @param cfg
* @param request
* @param response
* @return
*/
@RequestMapping(value = {"tcpCfgList"})
public String tcpCfgList(Model model,@ModelAttribute("cfg")AppTcpCfg cfg,HttpServletRequest request,HttpServletResponse response) {
Page<AppTcpCfg> searchPage=new Page<AppTcpCfg>(request,response,"r");
Page<AppTcpCfg> page = appCfgService.findAppTcpList(searchPage, cfg);
for(AppTcpCfg entity:page.getList()){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
entity.setAppName(app.getSpecServiceName());
}
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/app/appTcpCfgList";
}
/**
* APP TCP会话字节数特征表单新增/修改)
* @param model
* @param ids
* @param entity
* @return
*/
@RequestMapping(value = {"tcpCfgForm"})
@RequiresPermissions(value={"app:tcp:config"})
public String tcpCfgForm(Model model,String ids,AppTcpCfg entity) {
if(StringUtils.isNotBlank(ids)){
entity = appCfgService.getAppTcpCfg(Long.parseLong(ids));
initUpdateFormCondition(model,entity);
}else{
initFormCondition(model,entity);
}
model.addAttribute("_cfg", entity);
return "/cfg/app/appTcpCfgForm";
}
/**
* APP TCP会话字节数特征配置新增/修改)提交
* @param model
* @param request
* @param response
* @param entity
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"saveAppTcpCfg"})
@RequiresPermissions(value={"app:tcp:config"})
public String saveAppTcpCfg(Model model,HttpServletRequest request,HttpServletResponse response,
AppTcpCfg entity,RedirectAttributes redirectAttributes) {
try {
SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
if(specificService!=null){
entity.setAppCode(specificService.getSpecServiceCode());
}
appCfgService.saveOrUpdateAppTcpeCfg(entity);
} catch (Exception e) {
e.printStackTrace();
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+entity.getFunctionId();
}
/**
* APP TCP会话字节数特征配置删除
* @param isValid
* @param ids
* @param functionId
* @return
*/
@RequestMapping(value = {"updateAppTcpCfgValid"})
@RequiresPermissions(value={"app:tcp:config"})
public String updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId) {
appCfgService.updateAppTcpCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
}
/**
* APP TCP会话字节数特征配置 审核
* @param isAudit
* @param isValid
* @param ids
* @param functionId
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"auditAppTcpCfg"})
@RequiresPermissions(value={"app:tcp:confirm"})
public String auditAppTcpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
AppTcpCfg entity = new AppTcpCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity = appCfgService.getAppTcpCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
appCfgService.auditAppTcpCfg(entity,isAudit);
} catch (MaatConvertException e) {
e.printStackTrace();
logger.info("app SSL配置下发失败"+e.getMessage());
addMessage(redirectAttributes, e.getMessage());
}
}
return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId;
}
/**
* APP header特征配置 列表
* @param model
@@ -864,4 +989,150 @@ public class AppCfgController extends BaseController {
appCfgService.updateAppHeaderCfgValid(isValid,ids,functionId);
return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId;
}
/**
* 主题网站配置列表
* @param model
* @param cfg
* @param request
* @param response
* @return
*/
@RequestMapping(value = {"topicDomainCfgList"})
public String TopicDomainCfgList(Model model,@ModelAttribute("cfg")AppTopicDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) {
Page<AppTopicDomainCfg> searchPage=new Page<AppTopicDomainCfg>(request,response,"r");
Page<AppTopicDomainCfg> page = appCfgService.findAppTopicDomainList(searchPage, cfg);
// for(AppTopicDomainCfg entity:page.getList()){
// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
// entity.setAppName(app.getSpecServiceName());
// }
//设置topic主题
for (AppTopicDomainCfg entity:page.getList()) {
List<CodeResult> codeList = CodeDicUtils.getCodeList("serviceCode");
for (CodeResult codeResult : codeList) {
if(null!=entity.getTopic()&&codeResult.getCode().equals(entity.getTopic())){
entity.setAppName(codeResult.getItem());
}
}
}
model.addAttribute("page", page);
initPageCondition(model,cfg);
return "/cfg/app/appTopicDomainCfgList";
}
/**
* app主题网站配置表单
* @param model
* @param ids
* @param entity
* @return
*/
@RequestMapping(value = {"topicDomainCfgForm"})
@RequiresPermissions(value={"app:topic:config"})
public String topicDomainCfgForm(Model model,String ids,@ModelAttribute("_cfg")AppTopicDomainCfg entity) {
if(StringUtils.isNotBlank(ids)){
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(ids));
initUpdateFormCondition(model,entity);
}else{
initFormCondition(model,entity);
}
model.addAttribute("_cfg", entity);
return "/cfg/app/appTopicDomainCfgForm";
}
/**
* app主题网站配置新增修改
* @param model
* @param request
* @param response
* @param entity
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"saveAppTopicDomainCfg"})
@RequiresPermissions(value={"app:topic:config"})
public String saveAppTopicDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response,
AppTopicDomainCfg entity,RedirectAttributes redirectAttributes) {
try {
// SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId());
// if(specificService!=null){
// entity.setAppCode(specificService.getSpecServiceCode());
// }
appCfgService.saveOrUpdateAppTopicDomainCfg(entity);
addMessage(redirectAttributes,"save_success");
} catch (Exception e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("app主题网站配置下发失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("app主题网站配置下发失败",e);
addMessage(redirectAttributes,"save_failed");
}
}
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+entity.getFunctionId();
}
/**
* domain配置审核
* @param isAudit
* @param isValid
* @param ids
* @param functionId
* @param redirectAttributes
* @return
*/
@RequestMapping(value = {"auditAppTopicDomainCfg"})
// @RequiresPermissions(value={"app:domain:confirm"})
public String auditAppTopicDomainCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
AppTopicDomainCfg entity = new AppTopicDomainCfg();
String[] idArray = ids.split(",");
for(String id :idArray){
entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id));
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
try {
appCfgService.auditAppTopicDomainCfg(entity,isAudit);
addMessage(redirectAttributes,"audit_success");
} catch (MaatConvertException e) {
if(e instanceof MaatConvertException) {
e.printStackTrace();
logger.info("app主题网站配置下发失败"+e.getMessage());;
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
logger.error("app主题网站配置下发失败",e);
addMessage(redirectAttributes,"audit_failed");
}
}
}
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId;
}
/**
* 网站主题配置删除
* @param isValid
* @param ids
* @param functionId
* @return
*/
@RequestMapping(value = {"updateAppTopicDomainCfgValid"})
@RequiresPermissions(value={"app:topic:config"})
public String updateAppTopicDomainCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
try {
appCfgService.updateAppTopicDomainCfgValid(isValid,ids,functionId);
addMessage(redirectAttributes,"delete_success");
} catch (Exception e) {
logger.error("app主题网站删除失败",e);
if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) {
e.printStackTrace();
addMessage(redirectAttributes,"request_service_failed");
}else {
e.printStackTrace();
addMessage(redirectAttributes,"delete_failed");
}
}
return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId;
}
}

View File

@@ -225,7 +225,7 @@ public class FileTransferCfgController extends BaseController{
entity.setCreateTime(date);
fileTime=entity.getCreateTime();
}
ToMaatResult result = null;
ToMaatResult result = new ToMaatResult();
if(file!=null && file.getSize()>0 && entity!=null){
String sep = System.getProperty("file.separator");
String digestFilePath = request.getRealPath("/")+"digestFile";
@@ -245,6 +245,10 @@ public class FileTransferCfgController extends BaseController{
String md5 = DigestUtils.md5Hex(file.getBytes());
fileMap.put("checksum", md5);
result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap));
if((result.getData().getRawLen() == null) || (result.getData().getDigest() == null)) {
logger.info("文件摘要信息获取有误!");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+null);
}
logger.info("获取文件摘要响应信息:"+result);
}
fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds);
@@ -282,6 +286,25 @@ public class FileTransferCfgController extends BaseController{
}
return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId;
}
@RequestMapping(value = {"ajaxFileDigestSubIdList"})
public String ajaxFileDigestSubIdList(Model model,Long cfgId,Integer index) {
FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId);
List<String[]> tabList = new ArrayList();
//查询SubscribeId域配置
if(cfg.getNtcSubscribeIdCfgList()!=null){
String cfgType = null;
for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){
if(!ntc.getCfgType().equals(cfgType)){
tabList.add(new String[]{"2",ntc.getCfgType()});
cfgType = ntc.getCfgType();
}
}
}
model.addAttribute("_cfg", cfg);
model.addAttribute("index", index);
model.addAttribute("tabList", tabList);
return "/cfg/fileTransfer/fileDigestSubList";
}
@RequestMapping(value = {"p2pList"})
public String p2pList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {

View File

@@ -27,6 +27,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@@ -104,6 +105,15 @@ public class XmppController extends BaseController {
}
}
}
if(cfg.getNtcSubscribeIdCfgList()!=null){
String cfgType = null;
for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){
if(!keyword.getCfgType().equals(cfgType)){
tabList.add(new String[]{"2",keyword.getCfgType()});
cfgType = keyword.getCfgType();
}
}
}
model.addAttribute("_cfg", cfg);
model.addAttribute("index", index);
model.addAttribute("tabList", tabList);

View File

@@ -24,11 +24,14 @@ import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg;
import com.nis.domain.configuration.HttpUrlCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
import jersey.repackaged.com.google.common.collect.Lists;
/**
* http重定向策略
* @author zhangwei
@@ -78,6 +81,9 @@ public class HttpRedirectPolicyController extends BaseController{
IpPortCfg ipPortCfg = new IpPortCfg();
ipPortCfg.setCfgType(Constants.HTTP_REDIRECT_IP_REGION);
entity.setIpPort(ipPortCfg);
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
if(entity.getHttpUrlList().size()==0){
entity.getHttpUrlList().add(urlCfg);
@@ -97,6 +103,9 @@ public class HttpRedirectPolicyController extends BaseController{
if(entity.getIpPortList().size()==0){
entity.getIpPortList().add(ipPortCfg);
}
if(entity.getNtcSubscribeIdCfgList().size()==0){
entity.getNtcSubscribeIdCfgList().add(subscribeIdCfg);
}
initUpdateFormCondition(model,entity);
}else{
//设置http各类配置的配置域类型
@@ -118,6 +127,10 @@ public class HttpRedirectPolicyController extends BaseController{
IpPortCfg ipPortCfg = new IpPortCfg();
ipPortCfg.setCfgType(Constants.HTTP_IP_REGION);
entity.setIpPort(ipPortCfg);
//subscribeId
NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg();
subscribeIdCfg.setCfgType(Constants.PXY_CRTL_SUBSCRIBE_ID_REGION);
entity.setNtcSubscribeIdCfg(subscribeIdCfg);
List<HttpUrlCfg> urlList=new ArrayList<HttpUrlCfg>();
urlList.add(urlCfg);
@@ -138,6 +151,11 @@ public class HttpRedirectPolicyController extends BaseController{
List<IpPortCfg> ipPortList=new ArrayList<IpPortCfg>();
ipPortList.add(ipPortCfg);
entity.setIpPortList(ipPortList);
List<NtcSubscribeIdCfg> subscribeCfgList = Lists.newArrayList();
subscribeCfgList.add(subscribeIdCfg);
entity.setNtcSubscribeIdCfgList(subscribeCfgList);
initFormCondition(model,entity);
}
//获取所有的响应文件内容,阻断,或重定向时可以选择

View File

@@ -19,6 +19,7 @@ import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.nis.domain.Page;
import com.nis.domain.PageLog;
import com.nis.util.CodeDicUtils;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
@@ -408,16 +409,19 @@ public class DashboardController extends BaseController{
@RequestMapping(value="ipActiveList")
public String ipActiveList( HttpServletRequest request, HttpServletResponse response, Model model){
Page<TrafficIpActiveStatistic> page = new Page<TrafficIpActiveStatistic>(request, response);
TrafficIpActiveStatistic ip = new TrafficIpActiveStatistic();
ip.setIpAddr("1.1.1.1");
ip.setAreaId("11");
ip.setLinkNum(1212);
PageLog<TrafficIpActiveStatistic> page = new PageLog<TrafficIpActiveStatistic>(request, response);
List list = new ArrayList();
list.add(ip);
for (int i = 1; i < 10; i++) {
TrafficIpActiveStatistic ip = new TrafficIpActiveStatistic();
ip.setId(i);
ip.setIpAddr(3+i+".1.1."+i);
ip.setAreaId("11");
ip.setLinkNum(1212);
list.add(ip);
}
page.setList(list);
model.addAttribute("page", page);
return "/dashboard/trafficIpActiveList";
return "/dashboard/trafficConnList";
}
@@ -450,6 +454,7 @@ public class DashboardController extends BaseController{
return "/dashboard/trafficIpActiveChart";
}
public class TrafficIpActiveStatistic{
Integer id=1;
String ipAddr="10.1.1.2";
String areaId="1045";
Integer linkNum=3121;
@@ -459,6 +464,12 @@ public class DashboardController extends BaseController{
Integer s2cByteLen=23323;
String statTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getStatTime() {
return statTime;
}

View File

@@ -1,6 +1,5 @@
package com.nis.web.controller.specific;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
@@ -13,6 +12,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
@@ -22,6 +22,8 @@ import com.google.common.collect.Maps;
import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtils;
import com.nis.web.controller.BaseController;
@@ -201,8 +203,9 @@ public class SpecificServiceCfgController extends BaseController {
Map<String, Object> map2 = Maps.newHashMap();
map2.put("id", 0);
map2.put("pId", 0);
map2.put("type",0);
map2.put("serviceType",0);
map2.put("business",-2);
map2.put("groupId",0);
map2.put("name","root_node");
//map2.put("placeholder","0");
mapList.add(map2);
@@ -222,6 +225,7 @@ public class SpecificServiceCfgController extends BaseController {
map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue()));
map.put("serviceType",cfgType);
map.put("businessType","-1");
map.put("groupId",0);
businessList.add(map);
}
mapList.addAll(businessList);
@@ -242,7 +246,12 @@ public class SpecificServiceCfgController extends BaseController {
map.put("pId", "businessType"+business.getItemCode());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("serviceType",specificServiceCfg.getCfgType());
map.put("serviceCode",specificServiceCfg.getSpecServiceCode());
map.put("businessType",specificServiceCfg.getBusinessType());
map.put("groupId",specificServiceCfg.getGroupId());
if(specificServiceCfg.getAddFlag()!=null) {
map.put("user",specificServiceCfg.getAddFlag());
}
mapList.add(map);
break;
}
@@ -253,6 +262,7 @@ public class SpecificServiceCfgController extends BaseController {
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("serviceType",specificServiceCfg.getCfgType());
map.put("groupId",specificServiceCfg.getGroupId());
mapList.add(map);
}
}
@@ -272,6 +282,10 @@ public class SpecificServiceCfgController extends BaseController {
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
map.put("name",specificServiceCfg.getSpecServiceName());
map.put("type",specificServiceCfg.getCfgType());
map.put("groupId",specificServiceCfg.getGroupId());
if(specificServiceCfg.getAddFlag()!=null) {
map.put("user",specificServiceCfg.getAddFlag());
}
mapList.add(map);
}
}
@@ -380,5 +394,70 @@ public class SpecificServiceCfgController extends BaseController {
}
return false;
}
@ResponseBody
@RequestMapping(value = "ajaxSaveOrUpdateApp",method=RequestMethod.POST )
public Map<String,Object> ajaxSaveOrUpdateApp(@RequestParam(required=true,value="specServiceId")String specServiceId,@RequestParam(required=false,value="specServiceCode")String specServiceCode,@RequestParam(required=true,value="specServiceName") String specServiceName,
@RequestParam(required=true,value="cfgType") String cfgType, @RequestParam(required=true,value="businessType")String businessType,@RequestParam(required=false,value="addFlag")String addFlag,
@RequestParam(required=false,value="groupId")String groupId){
Map<String, Object> map = Maps.newHashMap();
//校验是真ID还是假ID假的Id以manual开头无法转换成数字
boolean isTrueId=false;
try {
Long.parseLong(specServiceId);
isTrueId=true;
}catch (Exception e) {
// TODO: handle exception
}
try{
SpecificServiceCfg cfg=new SpecificServiceCfg();
if(isTrueId) {
cfg.setSpecServiceId(Integer.parseInt(specServiceId));
}
if(StringUtils.isNotBlank(specServiceCode)) {
cfg.setSpecServiceCode(Integer.parseInt(specServiceCode));
}
cfg.setAddFlag(Integer.parseInt(addFlag));
cfg.setSpecServiceName(specServiceName);
cfg.setBusinessType(businessType);
cfg.setCfgType(Integer.parseInt(cfgType));
cfg.setIsValid(Constants.VALID_YES);
if(StringUtils.isNotBlank(groupId)) {
cfg.setGroupId(Integer.parseInt(groupId));
}
SpecificServiceCfg parent=new SpecificServiceCfg();
parent.setSpecServiceId(0);
cfg.setParent(parent);
specificServiceCfgService.saveOrUpdate(cfg);
cfg=specificServiceCfgService.getBySpecServiceId(cfg.getSpecServiceId());
map.put("id", cfg.getSpecServiceId());
map.put("pId", "businessType"+cfg.getBusinessType());
map.put("name",cfg.getSpecServiceName());
map.put("serviceType",cfg.getCfgType());
map.put("businessType",cfg.getBusinessType());
map.put("groupId",cfg.getGroupId());
return map;
}catch (Exception e) {
e.printStackTrace();
if(e instanceof MaatConvertException) {
map.put("errTip", "request_service_failed");
}else {
map.put("errTip", "save_failed");
}
}
return map;
}
@ResponseBody
@RequestMapping(value = "ajaxRemoveApp",method=RequestMethod.POST )
public boolean ajaxRemoveApp(@RequestParam(required=true,value="specServiceId")Integer specServiceId){
try{
specificServiceCfgService.delete(String.valueOf(specServiceId));
return true;
}catch (Exception e) {
e.printStackTrace();
}
return false;
}
}

View File

@@ -17,6 +17,8 @@ import com.nis.domain.configuration.AppIpCfg;
import com.nis.domain.configuration.AppPolicyCfg;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.AppStringCfg;
import com.nis.domain.configuration.AppTcpCfg;
import com.nis.domain.configuration.AppTopicDomainCfg;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.ComplexkeywordCfg;
@@ -57,6 +59,11 @@ public interface AppCfgDao {
public AppDomainCfg getAppDomainCfg(Long cfgId) ;
public int insertAppDomainCfg(AppDomainCfg entity);
public int updateAppDomainCfg(AppDomainCfg entity);
//app 主题网站配置增删改查
public List<AppTopicDomainCfg> findAppTopicDomainList(AppTopicDomainCfg entity) ;
public AppTopicDomainCfg getAppTopicDomainCfg(Long cfgId) ;
public int insertAppTopicDomainCfg(AppTopicDomainCfg entity);
public int updateAppTopicDomainCfg(AppTopicDomainCfg entity);
//app 字节特征增删改查
public List<AppByteCfg> findAppByteList(AppByteCfg entity) ;
public AppByteCfg getAppByteCfg(Long cfgId) ;
@@ -77,7 +84,11 @@ public interface AppCfgDao {
public AppHeaderCfg getAppHeaderCfg(Long cfgId);
public int insertAppHeaderCfg(AppHeaderCfg entity);
public int updateAppHeaderCfg(AppHeaderCfg entity);
//APP TCP会话字节数特征
public List<AppTcpCfg> findAppTcpList(AppTcpCfg entity);
public AppTcpCfg getAppTcpCfg(Long cfgId);
public int insertAppTcpCfg(AppTcpCfg entity);
public int updateAppTcpCfg(AppTcpCfg entity);
//审核配置
public void auditCfg(BaseCfg entity);
//修改配置状态

View File

@@ -137,6 +137,37 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="AppTopicDomainCfgMap" type="com.nis.domain.configuration.AppTopicDomainCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="topic" property="topic" jdbcType="VARCHAR" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="domain" property="domain" jdbcType="VARCHAR" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="AppByteCfgMap" type="com.nis.domain.configuration.AppByteCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
@@ -297,6 +328,47 @@
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="AppTcpCfgMap" type="com.nis.domain.configuration.AppTcpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="spec_service_id" property="specServiceId" jdbcType="INTEGER" />
<result column="app_code" property="appCode" jdbcType="INTEGER" />
<result column="behav_code" property="behavCode" jdbcType="INTEGER" />
<result column="low_boundary" property="lowBoundary" jdbcType="BIGINT" />
<result column="up_boundary" property="upBoundary" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="ratelimit" property="ratelimit" jdbcType="INTEGER" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<sql id="AppTcpCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.low_boundary,r.up_boundary as upBoundary,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.do_log
</sql>
<sql id="AppPolicyCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
@@ -332,6 +404,14 @@
r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG
</sql>
<sql id="AppTopicDomainCfg_Column" >
r.CFG_ID, r.TOPIC,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY,
r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID,r.CFG_TYPE,r.CFG_REGION_CODE,
r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG
</sql>
<sql id="AppByteCfg_Column" >
r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT,
r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME,
@@ -358,6 +438,17 @@
#{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}
</sql>
<sql id="AppTopicCommonCfg_Value_List" >
#{topic,jdbcType=VARCHAR},#{behavCode,jdbcType=INTEGER},#{specServiceId,jdbcType=INTEGER},
#{cfgDesc,jdbcType=VARCHAR},#{action,jdbcType=INTEGER},
#{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},#{auditTime,jdbcType=TIMESTAMP},#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER},
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER}
</sql>
<sql id="IpCfg_Column" >
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
@@ -438,6 +529,13 @@
FROM app_domain_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<!-- 主题网站 -->
<select id="getAppTopicDomainCfg" resultMap="AppTopicDomainCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppTopicDomainCfg_Column" />
FROM app_topic_domain_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="getAppByteCfg" resultMap="AppByteCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppByteCfg_Column" />
@@ -462,6 +560,113 @@
FROM app_layer_header_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="getAppTcpCfg" resultMap="AppTcpCfgMap" parameterType="java.lang.Long" >
SELECT
<include refid="AppTcpCfg_Column" />
FROM app_session_cfg r
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="findAppTcpList" resultMap="AppTcpCfgMap">
select
<include refid="AppTcpCfg_Column"/>
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
from app_session_cfg r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="lowBoundary != null">
AND r.low_boundary=#{lowBoundary,jdbcType=INTEGER}
</if>
<if test="upBoundary != null">
AND r.up_boundary=#{upBoundary,jdbcType=INTEGER}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="specServiceId != null">
AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER}
</if>
<if test="cfgType != null and cfgType != ''">
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null and createTime != ''">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null and editorName != ''">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null and editTime != ''">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null and auditTime != ''">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY CFG_ID desc
</otherwise>
</choose>
</select>
<select id="findAppPolicyList" resultMap="AppPolicyCfgMap" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
select
@@ -476,6 +681,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -616,7 +824,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -738,7 +948,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -839,6 +1051,110 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="specServiceId != null">
AND r.spec_service_id=#{specServiceId,jdbcType=INTEGER}
</if>
<if test="cfgType != null and cfgType != ''">
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
</if>
<if test="domain != null and domain != ''">
AND r.DOMAIN like concat(concat('%',#{domain,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null and createTime != ''">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null and editorName != ''">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null and editTime != ''">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null and auditTime != ''">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY CFG_ID desc
</otherwise>
</choose>
</select>
<!-- 主题网站列表 -->
<select id="findAppTopicDomainList" resultMap="AppTopicDomainCfgMap">
select
<include refid="AppTopicDomainCfg_Column"/>
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
from app_topic_domain_cfg r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -936,6 +1252,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1033,6 +1352,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1125,7 +1447,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1226,7 +1550,9 @@
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
@@ -1315,6 +1641,22 @@
</choose>
</select>
<insert id="insertAppTcpCfg" parameterType="com.nis.domain.configuration.AppTcpCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_session_cfg (
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
low_boundary,up_boundary,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
)values (
<include refid="AppCommonCfg_Value_List" />,
#{lowBoundary,jdbcType=INTEGER},#{upBoundary,jdbcType=INTEGER},
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
)
</insert>
<insert id="insertAppPolicyCfg" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
@@ -1330,7 +1672,7 @@
<include refid="AppCommonCfg_Value_List" />,
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER}
,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR}
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR}
,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ,#{doLog,jdbcType=INTEGER}
)
</insert>
<insert id="insertAppIpCfg" parameterType="com.nis.domain.configuration.AppIpCfg" >
@@ -1383,6 +1725,23 @@
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
)
</insert>
<!-- 主题网站新增 -->
<insert id="insertAppTopicDomainCfg" parameterType="com.nis.domain.configuration.AppTopicDomainCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into app_topic_domain_cfg (
TOPIC,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT,
CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME,
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG
)values (
<include refid="AppTopicCommonCfg_Value_List" />,
#{domain,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},
#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER}
)
</insert>
<insert id="insertAppByteCfg" parameterType="com.nis.domain.configuration.AppByteCfg" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
@@ -1615,7 +1974,16 @@
<if test="userRegion5 != null and userRegion5 != ''"> -->
USER_REGION1 =#{userRegion5,jdbcType=VARCHAR},
<!-- </if> -->
DO_LOG=#{doLog,jdbcType=INTEGER}
DO_LOG=#{doLog,jdbcType=INTEGER},
<if test="exprType != null">
expr_type=#{exprType,jdbcType=INTEGER},
</if>
<if test="matchMethod != null">
match_method=#{matchMethod,jdbcType=INTEGER},
</if>
<if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if>
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
@@ -1933,6 +2301,106 @@
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<!-- 主题网站 -->
<update id="updateAppTopicDomainCfg" parameterType="com.nis.domain.configuration.AppTopicDomainCfg" >
update app_topic_domain_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="topic != null">
TOPIC = #{topic,jdbcType=VARCHAR},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="compileId != null" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null">
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null and cfgType != ''">
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
</if>
<if test="domain != null and domain != ''">
domain=#{domain,jdbcType=VARCHAR},
</if>
<if test="exprType != null">
expr_type=#{exprType,jdbcType=INTEGER},
</if>
<if test="matchMethod != null">
match_method=#{matchMethod,jdbcType=INTEGER},
</if>
<if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if>
<!-- <if test="doLog != null" >
do_log = #{doLog,jdbcType=INTEGER},
</if> -->
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<update id="updateAppByteCfg" parameterType="com.nis.domain.configuration.AppByteCfg" >
update app_byte_cfg
<set >
@@ -2267,6 +2735,108 @@
</update>
<update id="updateAppTcpCfg" parameterType="com.nis.domain.configuration.AppTcpCfg" >
update app_session_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="appCode != null">
APP_CODE = #{appCode,jdbcType=INTEGER},
</if>
<if test="behavCode != null">
BEHAV_CODE = #{behavCode,jdbcType=INTEGER},
</if>
<if test="specServiceId != null">
SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="creatorId != null" >
creator_id = #{creatorId,jdbcType=INTEGER},
</if>
<if test="createTime != null and createTime != ''" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="auditorId != null" >
auditor_id = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
audit_time = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="compileId != null" >
compile_id = #{compileId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="ratelimit != null">
RATELIMIT=#{ratelimit,jdbcType=INTEGER},
</if>
<if test="cfgRegionCode != null">
CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="cfgType != null and cfgType != ''">
CFG_TYPE =#{cfgType,jdbcType=VARCHAR},
</if>
<if test="lowBoundary != null and lowBoundary != ''">
low_boundary=#{lowBoundary,jdbcType=INTEGER},
</if>
<if test="upBoundary != null and upBoundary != ''">
up_boundary=#{upBoundary,jdbcType=INTEGER},
</if>
<if test="exprType != null">
expr_type=#{exprType,jdbcType=INTEGER},
</if>
<if test="matchMethod != null">
match_method=#{matchMethod,jdbcType=INTEGER},
</if>
<if test="isHexbin != null">
is_hexbin=#{isHexbin,jdbcType=INTEGER},
</if>
<if test="doLog != null">
do_log=#{doLog,jdbcType=INTEGER},
</if>
</trim>
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<!-- 删除APP策略IP子配置 -->
<delete id="deleteAppPolicyIpCfg" >
delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId}

View File

@@ -41,6 +41,7 @@ public interface BgpCfgDao extends CrudDao<CfgIndexInfo>{
public void saveIpPortCfg(IpPortCfg entity);
public void updateBgpAsCfg(CfgIndexInfo entity);
public void updateSubscribeIdCfg(CfgIndexInfo entity);
public void deleteSubscribeIdCfg(CfgIndexInfo entity);
//public void saveHttpUrlCfg(HttpUrlCfg entity);
public void deleteHttpIpCfg(CfgIndexInfo entity);
//public void deleteHttpUrlCfg(CfgIndexInfo entity);

View File

@@ -639,6 +639,10 @@
delete from ntc_bgp_as_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<delete id="deleteSubscribeIdCfg" >
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<update id="updateCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER},
editor_id = #{editorId,jdbcType=INTEGER} ,

View File

@@ -38,6 +38,8 @@ public interface FileTransferCfgDao extends CrudDao<CfgIndexInfo> {
public void auditCfg(BaseCfg entity);
public FileDigestCfg getFileDigest(Long id);
public void updateFileDigestCfg(FileDigestCfg entity);
public void deleteFileDigestSubscribeIdCfg(FileDigestCfg entity);
public List<NtcSubscribeIdCfg> getFileDigestSubscribeidList(FileDigestCfg entity);
// P2P域配置新增
public void saveP2pHashCfg(BaseStringCfg cfg);
@@ -53,4 +55,5 @@ public interface FileTransferCfgDao extends CrudDao<CfgIndexInfo> {
public void deleteP2pHashCfg(CfgIndexInfo entity);
public void deleteP2pKeywordCfg(CfgIndexInfo entity);
public void deleteP2pSubscribeIdCfg(CfgIndexInfo entity);
}

View File

@@ -1051,11 +1051,14 @@
<delete id="deleteP2pKeywordCfg">
delete from p2p_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<!-- 删除p2pSubscribeId配置 -->
<!-- 删除p2pSubscribeId配置 -->
<delete id="deleteP2pSubscribeIdCfg">
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<!-- 删除FileDigest SubscribeId配置 -->
<delete id="deleteFileDigestSubscribeIdCfg">
delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId}
</delete>
<!-- File Digest Cfg -->
<select id="getFileDigestList" resultMap="digestCfgMap" parameterType="com.nis.domain.configuration.FileDigestCfg" >
@@ -1151,6 +1154,15 @@
FROM file_digest_cfg a where cfg_id=#{cfgId}
</select>
<select id="getFileDigestSubscribeidList" resultMap="stringCfgMap" parameterType="com.nis.domain.configuration.FileDigestCfg">
SELECT
<include refid="StrCfg_Column" />
FROM ntc_subscribe_id_cfg a where compile_id=#{compileId} and function_id=#{functionId}
<!-- <if test="cfgType != null and cfgType != ''">
and a.cfg_type =#{cfgType,jdbcType=VARCHAR}
</if> -->
</select>
<update id="updateFileDigestCfg" parameterType="com.nis.domain.configuration.FileDigestCfg" >
update file_digest_cfg
<set >

View File

@@ -705,14 +705,14 @@
<if test="compileId != null">
and r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<choose>
<!-- <choose>
<when test="isValid != null">
and r.is_valid=#{isValid,jdbcType=INTEGER}
</when>
<otherwise>
and r.is_valid != -1
</otherwise>
</choose>
</choose> -->
</where>
</select>

View File

@@ -23,6 +23,7 @@
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="function_id" property="functionId" jdbcType="INTEGER" />
<result column="do_log" property="doLog" jdbcType="INTEGER" />
</resultMap>
<resultMap id="ipPortMap" type="com.nis.domain.configuration.IpPortCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
@@ -121,7 +122,7 @@
a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT,
a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME,
a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id
a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,do_log
</sql>
<sql id="IpCfg_Column" >
a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port
@@ -301,7 +302,8 @@
ATTRIBUTE,
LABLE,
AREA_EFFECTIVE_IDS,
function_id
function_id,
do_log
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
@@ -321,7 +323,8 @@
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER}
#{functionId,jdbcType=INTEGER},
#{doLog,jdbcType=INTEGER}
)
</insert>
<!-- insert ip_port_cfg表信息 -->
@@ -445,6 +448,9 @@
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="doLog != null" >
do_log = #{doLog,jdbcType=INTEGER},
</if>
</trim>
</set>

View File

@@ -50,5 +50,6 @@ public interface SpecificServiceCfgDao extends CrudDao<SpecificServiceCfg> {
Integer getParentType(Integer specServiceId);
Integer getParentCode(Integer specServiceId);
SpecificServiceCfg getRepeat(@Param("specServiceCode")Integer code, @Param("cfgType")Integer cfgType,@Param("parentId")Integer parentId);
Integer getMaxServiceCode(@Param("maxCode")Integer code, @Param("cfgType")Integer cfgType,@Param("addFlag")Integer addFlag);
}

View File

@@ -12,6 +12,7 @@
<result column="is_leaf" property="isLeaf" jdbcType="INTEGER" />
<result column="group_id" property="groupId" jdbcType="INTEGER" />
<result column="cfg_type" property="cfgType" jdbcType="INTEGER" />
<result column="add_flag" property="addFlag" jdbcType="INTEGER" />
<result column="business_type" property="businessType" jdbcType="VARCHAR" />
<!-- 父id -->
<association property="parent" javaType="com.nis.domain.specific.SpecificServiceCfg">
@@ -30,7 +31,8 @@
s.is_leaf AS isLeaf,
s.group_id AS groupId,
s.cfg_type AS cfgType,
s.business_type AS businessType
s.business_type AS businessType,
s.add_flag AS addFlag
</sql>
@@ -152,6 +154,9 @@
<if test="specificServiceCfg.endDate != null" >
AND op_time &lt; #{specificServiceCfg.endDate}
</if>
<if test="specificServiceCfg.addFlag != null and specificServiceCfg.addFlag != '' ">
AND add_flag = #{specificServiceCfg.addFlag}
</if>
<choose>
<when test="orderBy != null and orderBy != '' ">
ORDER BY ${orderBy}
@@ -161,11 +166,23 @@
</otherwise>
</choose>
</select>
<select id="getMaxServiceCode" resultType="java.lang.Integer" >
SELECT MAX(spec_service_code) FROM specific_service_cfg WHERE is_valid=1 AND spec_service_code &lt; #{maxCode}
<if test="cfgType != null and cfgType != '' ">
AND cfg_type = #{cfgType}
</if>
<if test="addFlag != null and addFlag != '' ">
AND add_flag = #{addFlag}
</if>
</select>
<!-- 新增 -->
<insert id="insert" parameterType="com.nis.domain.specific.SpecificServiceCfg" useGeneratedKeys="true">
insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id,cfg_type,business_type)
values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType},#{businessType})
<selectKey resultType="java.lang.Integer" order="AFTER" keyProperty="specServiceId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id,cfg_type,business_type,add_flag)
values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType},
#{businessType},#{addFlag})
</insert>
<!-- 修改 -->

View File

@@ -135,10 +135,10 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
} catch (MaatConvertException e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
}else{
@@ -146,9 +146,7 @@ public class BgpCfgService extends CrudService<BgpCfgDao,CfgIndexInfo> {
//无效子配置后,再新增子配置
bgpCfgDao.deleteIpCfg(entity);
bgpCfgDao.deleteBgpAsCfg(entity);
if(entity.getNtcSubscribeIdCfg()!=null){
stringCfgDao.deleteSubscribeIdCfg(entity.getNtcSubscribeIdCfg());
}
bgpCfgDao.deleteSubscribeIdCfg(entity);
//TODO
//bgpCfgDao.deleteDnsDomainCfg(entity);
AreaIpCfg area = new AreaIpCfg();

View File

@@ -378,6 +378,8 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
public FileDigestCfg getFileDigestCfg(Long cfgId){
FileDigestCfg entity = fileTransferCfgDao.getFileDigest(cfgId);
List<NtcSubscribeIdCfg> subscribeidList = fileTransferCfgDao.getFileDigestSubscribeidList(entity);
entity.setNtcSubscribeIdCfgList(subscribeidList);
return entity;
}
@@ -402,18 +404,21 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
entity.setCompileId(compileId);
entity.setCreatorId(entity.getCurrentUser().getId());
Long rawLen = result.getData().getRawLen();
String digest = result.getData().getDigest();
if((result!=null && result.getData()!=null) && (rawLen != null && digest!= null)){
entity.setRawLen(rawLen);
entity.setDigest(digest);
entity.setFileUrl(result.getData().getAccessUrl());
}else {
logger.info("获取文件摘要属性有误");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+null);
}
entity.setRawLen(result.getData().getRawLen());
entity.setDigest(result.getData().getDigest());
entity.setFileUrl(result.getData().getAccessUrl());
mailCfgDao.saveMailFileDigestCfg(entity);
// 保存SubscribeId域配置信息
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
fileTransferCfgDao.saveP2pSubscribeIdCfg(cfg);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
@@ -427,12 +432,26 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
entity.setEditorId(entity.getCurrentUser().getId());
entity.setEditTime(new Date());
if(result!=null && result.getData()!=null){
if(result.getData() !=null ) {
entity.setRawLen(result.getData().getRawLen());
entity.setDigest(result.getData().getDigest());
entity.setFileUrl(result.getData().getAccessUrl());
}
fileTransferCfgDao.updateFileDigestCfg(entity);
entity.setCreatorId(entity.getCurrentUser().getId());
entity.setCreateTime(new Date());
// SubscribeId域配置 先删后加
fileTransferCfgDao.deleteFileDigestSubscribeIdCfg(entity);
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
fileTransferCfgDao.saveP2pSubscribeIdCfg(cfg);
}
}
}
areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:"";
if(!StringUtil.isEmpty(entity.getAreaCfg())){
@@ -592,6 +611,17 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
}
public FileDigestCfg getFileDigestSubIdCfg(Long cfgId) {
FileDigestCfg entity = fileTransferCfgDao.getFileDigest(cfgId);
if(entity.getCompileId()!=null){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
List<NtcSubscribeIdCfg> ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
entity.setNtcSubscribeIdCfgList(ntcList);
}
return entity;
}
public Page<CfgIndexInfo> getP2pList(Page<CfgIndexInfo> page, CfgIndexInfo entity){
// 生成数据权限过滤条件dsf为dataScopeFilter的简写在xml中使用 ${sqlMap.dsf}调用权限SQL
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a"));
@@ -943,4 +973,5 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
}
}
}

View File

@@ -1,56 +1,37 @@
package com.nis.web.service.configuration;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeansException;
import org.springframework.beans.FatalBeanException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
import com.nis.domain.Page;
import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.AvFileSampleCfg;
import com.nis.domain.configuration.AvSignSampleCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.DnsDomainCfg;
import com.nis.domain.configuration.HttpBodyCfg;
import com.nis.domain.configuration.HttpReqHeadCfg;
import com.nis.domain.configuration.HttpResHeadCfg;
import com.nis.domain.configuration.HttpUrlCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.SslKeywordCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.maat.MaatCfg;
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
import com.nis.domain.maat.ToMaatBean;
import com.nis.domain.maat.ToMaatResult;
import com.nis.domain.maat.MaatCfg.DigestCfg;
import com.nis.domain.maat.MaatCfg.GroupCfg;
import com.nis.domain.maat.MaatCfg.IpCfg;
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
import com.nis.domain.maat.MaatCfg.StringCfg;
import com.nis.domain.maat.ToMaatBean;
import com.nis.domain.maat.ToMaatResult;
import com.nis.exceptions.MaatConvertException;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.IpUtil;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.IpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.dao.configuration.WebsiteCfgDao;
import com.nis.web.security.UserUtils;
@@ -68,6 +49,8 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
protected WebsiteCfgDao websiteCfgDao;
@Autowired
protected AreaIpCfgDao areaIpCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
public CfgIndexInfo getHttpCfg(Long cfgId){
CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId);
@@ -79,12 +62,14 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
List<HttpBodyCfg> httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity);
entity.setCfgType(Constants.HTTP_REDIRECT_RES_BODY_REGION);
List<HttpBodyCfg> httpResBodyList = websiteCfgDao.getHttpResBodyList(entity);
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
entity.setHttpReqBodyList(httpReqBodyList);
entity.setHttpReqHdrList(httpReqHdrList);
entity.setHttpResBodyList(httpResBodyList);
entity.setHttpResHdrList(httpResHdrList);
entity.setHttpUrlList(httpUrlList);
entity.setIpPortList(ipPortCfgList);
entity.setNtcSubscribeIdCfgList(subscribeIdList);
return entity;
}
@@ -152,6 +137,12 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
websiteCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringCfgDao.saveSubscribeIdCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -167,6 +158,8 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
}
}else{
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
websiteCfgDao.updateCfgIndex(entity);
//无效子配置后,再新增子配置
websiteCfgDao.deleteHttpUrlCfg(entity);
@@ -174,6 +167,8 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
websiteCfgDao.deleteHttpResHdrCfg(entity);
websiteCfgDao.deleteHttpBodyCfg(entity);
websiteCfgDao.deleteHttpIpCfg(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
@@ -222,6 +217,12 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
websiteCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringCfgDao.saveSubscribeIdCfg(cfg);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -277,6 +278,12 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
cfg.setTableName(HttpBodyCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
if((entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)){
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
websiteCfgDao.updateCfgValid(cfg);
}
//保存区域IP信息
if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){
AreaIpCfg cfg = new AreaIpCfg();
@@ -372,6 +379,19 @@ public class HttpRedirectCfgService extends CrudService<WebsiteCfgDao,CfgIndexIn
}
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
websiteCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){

View File

@@ -15,6 +15,7 @@ import com.nis.domain.configuration.AreaIpCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.ComplexkeywordCfg;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.maat.MaatCfg;
import com.nis.domain.maat.MaatCfg.DigestCfg;
import com.nis.domain.maat.MaatCfg.GroupCfg;
@@ -28,6 +29,7 @@ import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.dao.configuration.XmppCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.CrudService;
@@ -43,10 +45,19 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
protected XmppCfgDao xmppCfgDao;
@Autowired
protected AreaIpCfgDao areaIpCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
public CfgIndexInfo getXmppCfg(Long cfgId){
CfgIndexInfo entity = xmppCfgDao.getCfgIndexInfo(cfgId);
List<IpPortCfg> ipPortList = xmppCfgDao.getIpPortList(entity);
//设置关键字
if(entity.getCompileId()!=null){
NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg();
ntcSubscribeIdCfg.setCompileId(entity.getCompileId());
List<NtcSubscribeIdCfg> ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg);
entity.setNtcSubscribeIdCfgList(ntcList);
}
entity.setIpPortList(ipPortList);
return entity;
}
@@ -68,6 +79,10 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
} catch (MaatConvertException e) {
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
@@ -78,6 +93,14 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
xmppCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringCfgDao.saveSubscribeIdCfg(cfg);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -86,16 +109,13 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
}else{
xmppCfgDao.updateCfgIndex(entity);
//无效子配置后,再新增子配置
xmppCfgDao.deleteXmppIpCfg(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
@@ -108,6 +128,14 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
xmppCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
stringCfgDao.saveSubscribeIdCfg(cfg);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -137,6 +165,13 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
cfg.setTableName(IpPortCfg.getTablename());
xmppCfgDao.updateCfgValid(cfg);
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0)
{
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
xmppCfgDao.updateCfgValid(cfg);
}
// if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
// HttpUrlCfg cfg = new HttpUrlCfg();
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
@@ -185,6 +220,17 @@ public class XmppCfgService extends CrudService<XmppCfgDao,CfgIndexInfo> {
}
}
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
xmppCfgDao.auditCfg(cfg);
if(isAudit==1){
Map<String,List> map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
// if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){
// HttpUrlCfg cfg = new HttpUrlCfg();
// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});

View File

@@ -12,6 +12,7 @@ import com.nis.domain.Page;
import com.nis.domain.specific.ConfigGroupInfo;
import com.nis.domain.specific.SpecificServiceCfg;
import com.nis.util.ConfigServiceUtil;
import com.nis.util.Constants;
import com.nis.web.dao.specific.SpecificServiceCfgDao;
import com.nis.web.service.BaseService;
@@ -89,6 +90,21 @@ public class SpecificServiceCfgService extends BaseService{
specificServiceCfg.setIsValid(1);
specificServiceCfg.setOpTime(new Date());
//用户添加的需要自增
if(specificServiceCfg.getAddFlag()!=null) {
Integer serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),specificServiceCfg.getAddFlag());
if(serviceCode==null) {//用户没有添加标签,获取最大的
serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),null);
}
if(serviceCode==null) {//没有标签,取开始值
serviceCode=Constants.APP_SPEC_SERVICE_CODE_MIN_VAL;
}else if(serviceCode>Constants.APP_SPEC_SERVICE_CODE_MAX_VAL){
throw new RuntimeException("Get specific service code failed,specific service code is beyond the scope of application");
}else if(serviceCode<Constants.APP_SPEC_SERVICE_CODE_MIN_VAL) {
serviceCode=Constants.APP_SPEC_SERVICE_CODE_MIN_VAL;
}
specificServiceCfg.setSpecServiceCode(serviceCode.intValue()+1);
}
specificServiceCfgDao.insert(specificServiceCfg);
}else{//修改
if(specificServiceCfg.getIsLeaf()==null){
@@ -145,5 +161,8 @@ public class SpecificServiceCfgService extends BaseService{
public SpecificServiceCfg getRepeat (Integer code,Integer cfgType,Integer parentId) {
return specificServiceCfgDao.getRepeat(code,cfgType,parentId);
}
public Integer getMaxServiceCode (Integer code, Integer cfgType,Integer addFlag) {
return specificServiceCfgDao.getMaxServiceCode(code,cfgType,addFlag);
}
}

View File

@@ -1109,4 +1109,4 @@ pxy_intercept_monit_keyring=Certificate Strategy
intercept_file_strategy=Intercept Certificate Strategy
root=Root Certificate
intermediate=Intermediate Certificate
end_entity=End-entity Certificate
end_entity=End-entity Certificate

View File

@@ -1105,4 +1105,4 @@ pxy_intercept_monit_keyring=\u8BC1\u4E66\u7B56\u7565
intercept_file_strategy=\u62E6\u622A\u8BC1\u4E66\u7B56\u7565
root=\u6839\u8BC1\u4E66
intermediate=\u4E2D\u95F4\u8BC1\u4E66
end_entity=\u5B9E\u4F53\u8BC1\u4E66
end_entity=\u5B9E\u4F53\u8BC1\u4E66

View File

@@ -461,4 +461,7 @@ maat_cfg_dolog_configpercent_default=100
maat_cfg_dolog_configoption_default=1
#app\uff0c\u57fa\u7840\u534f\u8bae\uff0c\u7279\u5b9a\u670d\u52a1\u7684userregion\u5206\u9694\u7b26
app_cfg_userregion_splitor=&
app_id_region=APP_ID
app_id_region=APP_ID
#application spec service code scope
app_spec_service_code_max_val=310000
app_spec_service_code_min_val=300001

View File

@@ -0,0 +1 @@
ALTER TABLE specific_service_cfg ADD add_flag INT(11) NULL COMMENT '添加标记APP特征界面上添加的为用户自己添加的';

View File

@@ -26,6 +26,7 @@
<%@ attribute name="showParentName" type="java.lang.String" required="false" description="显示父类名称"%>
<%@ attribute name="checkedPS" type="java.lang.String" required="false" description="复选框选中时是否关联父子节点ps关联父子p关联父s关联子,都不关联为空"%>
<%@ attribute name="unCheckedPS" type="java.lang.String" required="false" description="复选框取消选中时是否关联父子节点ps关联父子p关联父s关联子,都不关联为空"%>
<%@ attribute name="enableAddBtn" type="java.lang.Boolean" required="false" description="节点是否可编辑"%>
<div class="input-group">
<input id="${id}Id" name="${name}" class="${cssClass} singleClass" type="hidden" value="${value}" />
<input id="${id}Name" name="${labelName}" ${allowInput?'':'readonly="readonly"'} type="text" value="<spring:message code='${empty value?"":labelValue}'/>" data-msg-required="${dataMsgRequired}" placeholder="${empty value?labelValue:value}"
@@ -45,7 +46,7 @@
return true;
}
// 正常打开
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&selectIds="+$("#${id}Id").val()+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&title=${title}", "<spring:message code='choose'/> <spring:message code='${title}'/>", 320, 420, {
top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&selectIds="+$("#${id}Id").val()+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&title=${title}&enableAddBtn=${enableAddBtn}", "<spring:message code='choose'/> <spring:message code='${title}'/>", 320, 420, {
ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"<spring:message code='ok'/>":"ok", "<spring:message code='clear'/>":"clear","<spring:message code='close'/>":true}, submit:function(v, h, f){
if (v == "ok"){
var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents();
@@ -57,6 +58,7 @@
}
//wx提示c:if标签前加了//注释,c:if标签的判断条件仍会生效
for(var i=0; i<nodes.length; i++) {
console.log(nodes[i]);
//<c:if test="${checked && notAllowSelectParent}">
if (nodes[i].isParent && "${checkedPS}"!=''){
continue; // 如果为复选框选择,并且父子节点有关联,则过滤掉父节点

View File

@@ -82,7 +82,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true" enableAddBtn="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
@@ -142,22 +142,13 @@ $(function(){
<div for="bytes"></div>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
<c:if test="${dict.itemCode eq 0}">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</div>
</div>

View File

@@ -142,22 +142,13 @@ $(function(){
<div for="domain"></div>
</div>
</div>
<div class="col-md-6">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
<c:if test="${dict.itemCode eq 0}">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</div>
</div>

View File

@@ -171,22 +171,13 @@ $(function(){
</div>
</c:if>
<!-- doLog -->
<div class="col-md-6">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
<c:if test="${dict.itemCode eq 0}">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</div>
</div>

View File

@@ -170,22 +170,13 @@ $(function(){
</div>
</div>
</c:if>
<div class="col-md-6">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
<c:if test="${dict.itemCode eq 0}">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</div>
</div>

View File

@@ -78,7 +78,7 @@ $(function(){
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true" enableAddBtn="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
@@ -185,23 +185,14 @@ $(function(){
</div>
</div>
<!-- doLog -->
<div class="row">
<div class="row hidden">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
<c:if test="${dict.itemCode eq 0}">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</c:if>
</c:forEach>
</div>
</div>

View File

@@ -13,6 +13,11 @@ $(function(){
}else{
$("#ratelimit").hide();
}
if(($(".action:checked").val()==1) || ($(".action:checked").val()==16)){
$(".subscribeId").show();
}else{
$(".subscribeId").hide();
}
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
@@ -21,6 +26,11 @@ $(function(){
}else{
$("#ratelimit").hide();
}
if(($(".action:checked").val()==1) || ($(".action:checked").val()==16)){
$(".subscribeId").show();
}else{
$(".subscribeId").hide();
}
$("#cfgFrom").validate({
errorPlacement: function(error,element){
if($(element).parents().hasClass("tagsinput")){
@@ -31,7 +41,12 @@ $(function(){
},
submitHandler: function(form){
var flag = true;
$("input[name$='cfgKeywords']").each(function(){
//代表所有业务都隐藏了,提示必须增加一种业务数据
if($(".boxSolid").length ==$(".boxSolid.hidden").length){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
@@ -39,7 +54,7 @@ $(function(){
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}
})
});
$("select[name$='isHexbin']").each(function(){
var isHexbin=$(this).val();
if(isHexbin == 1){ //十六进制
@@ -65,7 +80,6 @@ $(function(){
if($("input[name='ratelimit']").is(":hidden")){
$("input[name='ratelimit']").val("");
}
/* $("#appCode").val($("#specServiceIdId").val()); */
loading('onloading...');
form.submit();
}else{
@@ -141,7 +155,8 @@ var delContent = function(contentClassName, addBtnClassName) {
</script>
</head>
<body>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
@@ -166,17 +181,14 @@ var delContent = function(contentClassName, addBtnClassName) {
<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}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%>
<input type="hidden" id="exprType" name="exprType" value="0">
<input type="hidden" id="matchMethod" name="matchMethod" value="0">
<input type="hidden" id="isHexbin" name="isHexbin" value="0">
<div class="form-body">
<!-- desc and action -->
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="subscribeIdCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType eq 'app_policy' }">
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
<input type="hidden" name="cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
@@ -273,6 +285,49 @@ var delContent = function(contentClassName, addBtnClassName) {
</div>
</c:if>
<!-- subscribeId配置 -->
<div class="subscribeId" >
<c:if test="${region.configServiceType eq 'subscribe_id'}">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIdCfgIndex}]"></c:set>
<c:set var="regionValue" value="${region.configRegionValue}"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0 and (!empty _cfg.ntcSubscribeIdCfgList[subscribeIdCfgIndex].cfgId)}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIdCfgIndex" value="${subscribeIdCfgIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIdCfgIndex" value="${subscribeIdCfgIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIdCfgIndex" value="${subscribeIdCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
</div>
<!-- IP配置 -->
<c:if test="${region.regionType eq 1 }">
<h4 class="form-section">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
@@ -301,6 +356,7 @@ var delContent = function(contentClassName, addBtnClassName) {
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>

View File

@@ -170,11 +170,14 @@ $(function(){
</div>
</c:if>
<!-- doLog -->
<div class="col-md-6">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:if test="${dict.itemCode eq 0}">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</c:if>
<%-- <c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
@@ -185,7 +188,7 @@ $(function(){
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:choose> --%>
</c:forEach>
</div>
</div>

View File

@@ -0,0 +1,400 @@
<%@ 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(){
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
}
},
submitHandler: function(form){
var flag = true;
if(flag){
var maxTtl=$("[name=upBoundary]").val();
maxTtl = parseInt(maxTtl);
var minTtl=$("[name=lowBoundary]").val();
minTtl = parseInt(minTtl);
if(maxTtl > 4294967295){
message="<spring:message code='app_tcp_max_min'/>";
$("div[for=upBoundary]").html("<label for=\"upBoundary\" class=\"error\" id=\"upBoundary-error\">"+message+"</label>");
flag=false;
}
if(minTtl>maxTtl){
message="<spring:message code='max_shouldnot_less_than_min'/>";
$("div[for=upBoundary]").html("<label for=\"upBoundary\" class=\"error\" id=\"upBoundary-error\">"+message+"</label>");
flag=false;
}
}
if(flag){
$("input[name$='exprType']").attr("disabled",false);
$("#appCode").val($("#specServiceIdId").val());
loading('onloading...');
form.submit();
}else{
return;
}
},
errorContainer: "#messageBox",
});
});
</script>
</head>
<body>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
</c:forEach>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<spring:message code="app_tcp_config"></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="cfgFrom" action="${ctx}/app/saveAppTcpCfg" method="post" class="form-horizontal">
<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}">
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
<!-- 配置域类型 -->
<div class="form-body">
<div class="row">
<!-- desc and action -->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
</div>
<div for="parent.specServiceName"></div>
</div>
</div>
<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 for="cfgDesc"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><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>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="min_tcp"/></label>
<div class="col-md-6">
<input class="form-control required number" placeholder="<spring:message code="tcp_unit" />" type="text" name="lowBoundary" value="${_cfg.lowBoundary}" min="0">
</div>
<div for="lowBoundary"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="max_tcp"/></label>
<div class="col-md-6">
<input class="form-control required number" placeholder="<spring:message code="tcp_unit" />" type="text" name="upBoundary" value="${_cfg.upBoundary}" min="0">
</div>
<div for="upBoundary"></div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<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}">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="expression_type" /></label>
<div class="col-md-6">
<c:if test="${!empty region.configExprType}">
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq exprType}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprType }"
class="required"
<c:if test="${_cfg.exprType eq exprType || (empty _cfg.exprType && exprType eq 0)}">
checked
</c:if>
>
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configExprType}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq 0}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprTypeC.itemCode }"
class="required" checked >
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:if>
</div>
<div for="exprType"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="match_method" /></label>
<div class="col-md-6">
<select name="matchMethod"
class="selectpicker select2 form-control required">
<c:if test="${!empty region.configMatchMethod}">
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${matchMethodC.itemCode eq matchMethod}">
<option value="${matchMethodC.itemCode}"
<c:if test="${_cfg.matchMethod eq matchMethod || (empty _cfg.matchMethod && matchMethod eq 0)}">
selected
</c:if>
>
<spring:message code="${matchMethodC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configMatchMethod}">
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${matchMethodC.itemCode eq 0}">
<option value="${matchMethodC.itemCode}"
selected
>
<spring:message code="${matchMethodC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:if>
</select>
</div>
<div for="matchMethod"></div>
</div>
</div>
</div>
<div class="row">
<c:if test="${!empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isHex" value="1" class="required"
><spring:message code="hex"/>
</label>
<label class="radio-inline">
<input type="radio" name="isHex" value="0" class="required"
><spring:message code="not_hex"/>
</label>
</div>
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="1" class="required"
><spring:message code="case_senstive"/>
</label>
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
<c:if test="${empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isHex" value="0" class="required" checked
><spring:message code="not_hex"/>
</label>
</div>
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
checked
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
</div>
<div class="row hidden">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="whether_hexbinary" /></label>
<div class="col-md-6">
<select name="isHexbin"
class="selectpicker select2 form-control required">
<c:if test="${!empty region.configHex}">
<c:forEach var="isHexbin" items="${fn:split(region.configHex,',')}">
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${isHexbinC.itemCode eq isHexbin}">
<option value="${isHexbinC.itemCode}"
<c:if test="${_cfg.isHexbin eq isHexbin || (empty _cfg.isHexbin && isHexbin eq 0)}">
selected
</c:if>
>
<spring:message code="${isHexbinC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configHex}">
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${isHexbinC.itemCode eq 0}">
<option value="${isHexbinC.itemCode}" selected >
<spring:message code="${isHexbinC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:if>
</select>
</div>
<div for="isHexbin"></div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</div>
<input name="isAreaEffective" type="hidden" value="0">
<input name="requestId" value="0" type="hidden">
</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>

View File

@@ -0,0 +1,353 @@
<%@ 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() {
$(".tooltips").tooltip();
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}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",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
});
});
</script>
</head>
<body>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
</c:forEach>
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="app:tcp:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/app/tcpCfgForm?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="app_tcp_config"></spring:message>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/app/tcpCfgList?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<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">
<c:set var="state"><spring:message code='state'/></c:set>
<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">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
</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="bytes"><spring:message code="bytes"></spring:message></form:option>
--%> <form:option value="compileId"><spring:message code="cfg_id"></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="app:tcp:config">
<sys:delRow url="${ctx}/app/tcpCfgForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/app/updateAppTcpCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="app:tcp:confirm">
<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}/app/auditAppTcpCfg?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/app/auditAppTcpCfg?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/app/auditAppTcpCfg?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 hidden">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='request_number'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='type'/></label>
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fls}" var="fl" >
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='attribute'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${xzs}" var="xz" >
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='label'/></label>
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${lables}" var="lable" >
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<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>&nbsp;</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>&nbsp;</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>&nbsp;</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">
<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 class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="social_app"/></th>
<th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th>
<th><spring:message code="do_log"/></th>
<%-- <th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th> --%>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></th>
<th><spring:message code="creator"/></th>
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
<th><spring:message code="editor"/></th>
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"/></th>
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr>
<td>
<input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.appName }</td>
<td>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.exprType==1}"><spring:message code="and_expression"/></c:if>
<c:if test="${cfg.exprType==0}"><spring:message code="null_expression"/></c:if>
</td>
<td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach>
</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 functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}"><div class="loading-total"></div></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" style="margin-top:40px">${page}</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,402 @@
<%@ 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(){
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
}
},
submitHandler: function(form){
var flag = true;
$("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}
})
if(flag){
$("input[name$='exprType']").attr("disabled",false);
// $("#appCode").val($("#specServiceIdId").val());
loading('onloading...');
form.submit();
}else{
return;
}
},
errorContainer: "#messageBox",
});
});
</script>
</head>
<body>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
</c:forEach>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<h3 class="page-title">
<spring:message code="app_topic_domain_cfg"></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="cfgFrom" action="${ctx}/app/saveAppTopicDomainCfg" method="post" class="form-horizontal">
<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}">
<%-- <input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}"> --%>
<%-- <input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}"> --%>
<div class="form-body">
<!-- desc and action -->
<div class="row">
<%-- <div class="col-md-6">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
<div class="col-md-6">
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control required"/>
</div>
<div for="parent.specServiceName"></div>
</div>
</div> --%>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">
<spring:message code="app_topic_domain_cfg" /></label>
<div class="col-md-6">
<%-- <c:if test="${empty _cfg.topic}"> --%>
<form:select path="_cfg.topic" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<c:forEach items="${fns:getCodeList('serviceCode')}" var="dict">
<form:option value="${dict.code}"><spring:message code="${dict.item}"/></form:option>
</c:forEach>
</form:select>
<%-- </c:if> --%>
</div>
<div for="topic"></div>
</div>
</div>
<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 for="cfgDesc"></div>
</div>
</div>
</div>
<div class="row">
<div class="row">
<div class="col-md-6 hidden">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><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>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="domain" /></label>
<div class="col-md-6">
<input class="form-control required domainCheck" type="text"
name="domain"
value="${_cfg.domain}">
</div>
<div for="domain"></div>
</div>
</div>
<div class="col-md-6" hidden="true">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="0" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<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}">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="expression_type" /></label>
<div class="col-md-6">
<c:if test="${!empty region.configExprType}">
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq exprType}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprType }"
class="required"
<c:if test="${_cfg.exprType eq exprType || (empty _cfg.exprType && exprType eq 0)}">
checked
</c:if>
>
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configExprType}">
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
<c:if test="${exprTypeC.itemCode eq 0}">
<label class="radio-inline">
<input type="radio"
name="exprType" value="${exprTypeC.itemCode }"
class="required" checked >
<spring:message code="${exprTypeC.itemValue }" />
</label>
</c:if>
</c:forEach>
</c:if>
</div>
<div for="exprType"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="match_method" /></label>
<div class="col-md-6">
<select name="matchMethod"
class="selectpicker select2 form-control required">
<c:if test="${!empty region.configMatchMethod}">
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${matchMethodC.itemCode eq matchMethod}">
<option value="${matchMethodC.itemCode}"
<c:if test="${_cfg.matchMethod eq matchMethod || (empty _cfg.matchMethod && matchMethod eq 0)}">
selected
</c:if>
>
<spring:message code="${matchMethodC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configMatchMethod}">
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${matchMethodC.itemCode eq 0}">
<option value="${matchMethodC.itemCode}"
selected
>
<spring:message code="${matchMethodC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:if>
</select>
</div>
<div for="matchMethod"></div>
</div>
</div>
</div>
<div class="row">
<c:if test="${!empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isHex" value="1" class="required"
><spring:message code="hex"/>
</label>
<label class="radio-inline">
<input type="radio" name="isHex" value="0" class="required"
><spring:message code="not_hex"/>
</label>
</div>
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="1" class="required"
><spring:message code="case_senstive"/>
</label>
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
<c:if test="${empty region.configHex}">
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_hex"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isHex" value="0" class="required" checked
><spring:message code="not_hex"/>
</label>
</div>
<div for="isHex"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="is_case_insenstive"/></label>
<div class="col-md-6">
<label class="radio-inline">
<input type="radio" name="isCaseSenstive" value="0" class="required"
checked
><spring:message code="case_insenstive"/>
</label>
</div>
<div for="isCaseInsenstive"></div>
</div>
</div>
</c:if>
</div>
<div class="row hidden">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font>
<spring:message code="whether_hexbinary" /></label>
<div class="col-md-6">
<select name="isHexbin"
class="selectpicker select2 form-control required">
<c:if test="${!empty region.configHex}">
<c:forEach var="isHexbin" items="${fn:split(region.configHex,',')}">
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${isHexbinC.itemCode eq isHexbin}">
<option value="${isHexbinC.itemCode}"
<c:if test="${_cfg.isHexbin eq isHexbin || (empty _cfg.isHexbin && isHexbin eq 0)}">
selected
</c:if>
>
<spring:message code="${isHexbinC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:forEach>
</c:if>
<c:if test="${empty region.configHex}">
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${isHexbinC.itemCode eq 0}">
<option value="${isHexbinC.itemCode}" selected >
<spring:message code="${isHexbinC.itemValue}"/>
</option>
</c:if>
</c:forEach>
</c:if>
</select>
</div>
<div for="isHexbin"></div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</div>
<input name="isAreaEffective" type="hidden" value="0">
<%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%>
<input name="requestId" value="0" type="hidden">
<%-- <%@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>

View File

@@ -0,0 +1,434 @@
<%@ 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() {
$(".tooltips").tooltip();
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.domain}"){
$("#intype").val("${cfg.domain}");
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
}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",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
});
</script>
</head>
<body>
<div class="page-content">
<c:forEach items="${fns:getDictList('SPECIFIC_SERVICE_CFG_TYPE') }" var="dict">
<c:if test="${dict.itemValue eq 'social_app'}"><c:set var="app" value="${dict.itemCode}"/></c:if>
</c:forEach>
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="app:topic:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/app/topicDomainCfgForm?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="app_topic_domain_cfg"></spring:message>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<sys:message content="${message}"/>
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/app/topicDomainCfgList?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<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">
<c:set var="state"><spring:message code='state'/></c:set>
<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">
<c:set var="spec_service_id"><spring:message code="social_app"/></c:set>
<sys:treeselect id="specServiceId" name="specServiceId" value="${cfg.specServiceId}"
labelName="parent.specServiceName" notAllowSelectRoot="true" notAllowSelectParent="true"
labelValue="${empty cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(cfg.specServiceId).specServiceName}"
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId=""
cssClass="form-control input-small"/>
</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="domain"><spring:message code="domain"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></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="app:topic:config">
<sys:delRow url="${ctx}/app/topicDomainCfgForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/app/updateAppTopicDomainCfgValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<shiro:hasPermission name="app:domain:confirm">
<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}/app/auditAppTopicDomainCfg?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/app/auditAppTopicDomainCfg?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/app/auditAppTopicDomainCfg?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 hidden">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='request_number'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='type'/></label>
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fls}" var="fl" >
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='attribute'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${xzs}" var="xz" >
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='label'/></label>
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${lables}" var="lable" >
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<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>&nbsp;</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>&nbsp;</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>&nbsp;</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">
<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 style="display: none;"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="app_topic_domain_cfg"/></th>
<th><spring:message code="domain"/></th>
<th><spring:message code="whether_hexbinary"/></th>
<th><spring:message code="expression_type"/></th>
<th><spring:message code="match_method"/></th>
<%-- <th><spring:message code="do_log"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th> --%>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></th>
<th><spring:message code="creator"/></th>
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
<th><spring:message code="editor"/></th>
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"/></th>
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
<tr>
<td>
<input type="checkbox" class="i-checks child-checks" id="${cfg.cfgId}" value="${cfg.isAudit}">
</td>
<td>${cfg.compileId }</td>
<td>${cfg.cfgDesc }</td>
<td>${cfg.appName }</td>
<td>${cfg.domain }</td>
<td>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.exprType==1}"><spring:message code="and_expression"/></c:if>
<c:if test="${cfg.exprType==0}"><spring:message code="null_expression"/></c:if>
</td>
<td>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</td>
<%-- <td>
<c:forEach items="${fns:getDictList('DO_LOG')}" var="dict">
<c:if test="${cfg.doLog==dict.itemCode }"><spring:message code="${dict.itemValue}"/></c:if>
</c:forEach>
</td> --%>
<%-- <td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq cfg.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${cfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${cfg.isAreaEffective==1}">
<a href="javascript:viewAreaInfo('${ctx}','${cfg.areaEffectiveIds }','${cfg.compileId }')" >
<spring:message code="yes"/>
</a>
</c:if>
</td>
<td>${cfg.requestName }</td>
<td>
<c:set var="classify"></c:set>
<c:forEach items="${fn:split(cfg.classify,',')}" var="classifyId" varStatus="status">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId eq fn:trim(fl.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="classify" value="${fl.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="classify" value="${classify},${fl.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${classify}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(classify,20)}
</a>
</td>
<td>
<c:set var="attribute"></c:set>
<c:forEach items="${fn:split(cfg.attribute,',')}" var="attributeId" varStatus="status">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId eq fn:trim(xz.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="attribute" value="${xz.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="attribute" value="${attribute},${xz.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${attribute}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(attribute,20)}
</a>
</td>
<td>
<c:set var="lableInfo"></c:set>
<c:forEach items="${fn:split(cfg.lable,',')}" var="lableId" varStatus="status">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId eq fn:trim(lable.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="lableInfo" value="${lable.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="lableInfo" value="${lableInfo},${lable.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${lableInfo}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(lableInfo,20)}
</a>
</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 functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}"><div class="loading-total"></div></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" style="margin-top:40px">${page}</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -603,8 +603,8 @@
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th>

View File

@@ -13,34 +13,89 @@
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate(
{
submitHandler : function(form) {
/* var srcFile = $("#srcFile").val();
var srcUrl = $("#srcUrl").val();
if((srcUrl==null||srcUrl=="") && (srcFile==null || srcFile=="")){
$("div[for='srcFile']").append("<label id='level-error' class='error' for='srcFile'><spring:message code='required'></spring:message></label>");
return false;
}else{
} */
loading('onloading...');
form.submit();
},
errorContainer : "#messageBox",
errorPlacement : function(error, element) {
$(element).parents(".form-group").find(
"div[for='" + element.attr("name") + "']")
.append(error);
},
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
}
},
submitHandler : function(form) {
var flag = true;
//代表所有业务都隐藏了,提示必须增加一种业务数据
if($(".boxSolid").length ==$(".boxSolid.hidden").length){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
$("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}
})
$("select[name$='isHexbin']").each(function(){
var isHexbin=$(this).val();
if(isHexbin == 1){ //十六进制
var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
$(this).parents(".form-body").find(
"div[for='"
+ $(this).attr("name").replace("isHexbin","cfgKeywords")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
flag = false;
}
}
});
if(flag){
//将disable属性的元素删除
$(".disabled").each(function(){
$(this).remove();
});
$("input[name$='exprType']").attr("disabled",false);
if($("[name='behavCode']")&&$("[name='behavCode']").val()!=""){
$("input[name$='exprType']").val(1);
}
loading('onloading...');
form.submit();
}else{
return;
}
},
errorContainer : "#messageBox",
errorPlacement : function(error, element) {
$(element).parents(".form-group").find(
"div[for='" + element.attr("name") + "']")
.append(error);
},
});
});
//业务窗口打开
var addContent = function(obj, contentClassName) {
var showDiv = $(obj).parent().parent().next();
$(showDiv).removeClass("hidden").removeClass(
"disabled");
$(obj).addClass("hidden");
}
//业务窗口关闭
var delContent = function(contentClassName, addBtnClassName) {
$("." + contentClassName).addClass("hidden").addClass("disabled");
$("." + addBtnClassName).removeClass("hidden");
}
</script>
</head>
<body>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
@@ -183,6 +238,49 @@
</div>
</div>
</div>
<!-- subscribeId配置 -->
<c:set var="subscribeIdCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.configServiceType eq 'subscribe_id'}">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${subscribeIdCfgIndex}]"></c:set>
<c:set var="regionValue" value="${region.configRegionValue}"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0 and (!empty _cfg.ntcSubscribeIdCfgList[subscribeIdCfgIndex].cfgId)}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="subscribeIdCfgIndex" value="${subscribeIdCfgIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIdCfgIndex" value="${subscribeIdCfgIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="subscribeIdCfgIndex" value="${subscribeIdCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
</div>

View File

@@ -36,6 +36,51 @@
$("#level").attr("value",'');
$("#searchForm")[0].reset();
});
//异步获取voip相关信息
$("span[id^=open]").click(function(){
var openId=$(this).attr("id");
var closeId=$(this).attr("id").replace("open","close");
var index=$(this).attr("id").replace("open","");
$("#"+openId).hide();
$("#"+closeId).show();
//var compileId=$(this).attr("compileId");
var cfgId=$(this).attr("cfgId");
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
$("#"+openId).parent().parent().next("tr").show();
}else{
$.ajax({
type:'post',
async:false,
url:'${ctx}/ntc/fileTransfer/ajaxFileDigestSubIdList',
data:{"cfgId":cfgId,"index":index},
dataType:"html",
success:function(data){
var subTab="<tr class='child'>"+
"<td style='border-right: 1px solid #FFFFFF;'>"+
"<input type='checkbox' hidden='hidden'/>"+
"</td>"+
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var html="";
html+="<div class='row'>";
html = html+data;
subTab=subTab+html;
subTab+="</td>";
subTab+="</tr>";
$("#"+openId).parent().parent().after(subTab);
$("div[name='tabTitle"+index+"']").get(0).click();
}
});
}
});
$("span[id^=close]").on("click",function(){
var closeId=$(this).attr("id");
var openId=$(this).attr("id").replace("close","open");
$("#"+closeId).hide();
$("#"+openId).show();
$("#"+closeId).parent().parent().next("tr").hide();
});
});
</script>
@@ -289,6 +334,7 @@
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr>
<td>
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.cfgDesc }</td>

View File

@@ -0,0 +1,79 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<script>
$(document).ready(function() {
//$("div[name='tabTitle"+index+"']").get(0).click();
})
</script>
<style type="text/css">
</style>
</head>
<c:forEach items="${tabList}" var="region" varStatus="regionStatus">
<div id="${region[1]}Title${index}" onclick="switchSubCfgTabInfo('${region[1]}',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='${region[1]}' />
<i id="${region[1]}${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:forEach>
</div>
<c:forEach items="${tabList}" var="region">
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
</c:forEach>
</html>

View File

@@ -32,6 +32,7 @@
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
//异步获取voip相关信息
$("span[id^=open]").click(function(){

View File

@@ -178,7 +178,33 @@
</div>
</div>
</div>
<!-- dolog begin-->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<!-- dolog end-->
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:set var="complexCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 1 }">
@@ -212,6 +238,48 @@
</c:choose>
<!--/ip info-->
</c:if>
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configServiceType == 'subscribe_id'}">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${strCfgIndex}]"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
</c:if>
<c:if test="${region.regionType eq 3 }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">

View File

@@ -9,7 +9,9 @@
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else{
}else if("${cfg.compileId}"){
$("#intype").val("${cfg.compileId}");
} else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
$("#seltype").change(function(){
@@ -30,6 +32,7 @@
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
//异步获取voip相关信息
$("span[id^=open]").click(function(){
@@ -132,6 +135,7 @@
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
<%-- <form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="key_word"/></form:option>
@@ -305,8 +309,10 @@
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th style="display: none"><spring:message code="cfg_id"/></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="do_log"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
@@ -329,6 +335,7 @@
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none;" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.compileId }</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
@@ -337,6 +344,13 @@
</c:if>
</c:forEach>
</td>
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq indexCfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}">

View File

@@ -120,6 +120,60 @@
</c:if>
</c:forEach>
</c:if>
<c:if test="${region[0] eq 2 }">
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">
<div id="${region[1]}Info${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>
${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:if>
</c:forEach>
</c:if>
<c:if test="${region[0] eq 3 }">
<c:forEach items="${_cfg.domainList}" var="cfg">
<c:if test="${region[1] eq cfg.cfgType }">

View File

@@ -195,6 +195,31 @@
</div>
</div>
</div>
<c:if test="${action != 128 }">
<!-- 记录日志begin -->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="do_log" /></label>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:choose>
<c:when test="${dict.itemCode eq _cfg.doLog}">
<label class="radio-inline">
<input type="radio" name="doLog" checked value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:when>
<c:otherwise>
<label class="radio-inline">
<input type="radio" name="doLog" value="${dict.itemCode}" ><spring:message code="${dict.itemValue}"/>
</label>
</c:otherwise>
</c:choose>
</c:forEach>
</div>
</div>
</div>
<!-- 记录日志end -->
</c:if>
<%@include file="/WEB-INF/views/cfg/actionRegionForm.jsp"%>
<br>
<c:forEach items="${regionList}" var="region" varStatus="status">
@@ -289,6 +314,26 @@
</c:forEach>
</div>
</c:if>
<c:if test="${region.configRegionValue eq _cfg.ntcSubscribeIdCfg.cfgType }">
<!--response body info-->
<div class="ntcSubscribeIdCfgCfg">
<c:set var="tabName" value="ntcSubscribeIdCfgTab"></c:set>
<h4 class="form-section">
<spring:message code="NTC_SUBSCRIBE_ID" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<%-- <c:set var="regionValue" value="${_cfg.httpResBody.cfgType}"></c:set> --%>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg" varStatus="status">
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${status.index}]"></c:set>
<div class="row boxSolid ${tabName}${status.index} <c:if test="${empty cfg.cfgId}">hidden disabled </c:if>" >
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
</c:forEach>
</div>
</c:if>
</c:if>
<c:if test="${region.regionType eq 3 }">
<c:if test="${region.configRegionValue eq _cfg.httpReqHdr.cfgType }">

View File

@@ -516,7 +516,9 @@
<th><spring:message code="replaced_content"/></th>
<th><spring:message code="replace_content"/></th>
</c:if>
<c:if test="${action ne 128}">
<th><spring:message code="do_log"/></th>
</c:if>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
@@ -601,7 +603,15 @@
<td>${indexCfg.userRegion2 }</td>
<td>${indexCfg.userRegion3 }</td>
</c:if>
<c:if test="${action ne 128}">
<td>
<c:forEach items="${fns:getDictList('DO_LOG') }" var="dict">
<c:if test="${dict.itemCode eq indexCfg.doLog }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
</c:if>
<td>
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}">

View File

@@ -53,6 +53,14 @@
<i id="resBody${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
<c:if test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<div id="subscribeIdTitle${index}" onclick="switchSubCfgTabInfo('subscribeId',${index})"
class="col-md-1 tabInfo" name="tabTitle${index }">
<spring:message code='NTC_SUBSCRIBE_ID' />
<i id="resBody${index}" class="fa" name="tabFlag${index}"></i>
</div>
</c:if>
</div>
</div>
<c:forEach items="${_cfg.ipPortList}" var="cfg">
@@ -406,5 +414,53 @@
</div>
</c:forEach>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<div id="subscribeIdInfo${index}" class="content" name="subCfg${index}">
<div class="row">
<div class="col-md-8">
<div class="form-group">
<label><spring:message code='keywords' />:</label><label>${fn:replace(cfg.cfgKeywords, "***and***", " ")}</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='expression_type' />:</label>
<label>
<c:choose>
<c:when test="${cfg.exprType eq 1}"><spring:message code='and_expression'/></c:when>
<c:when test="${cfg.exprType eq 0}"><spring:message code='null_expression'/></c:when>
</c:choose>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='match_method' />:</label>
<label>
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<c:if test="${cfg.matchMethod==matchMethodC.itemCode }"><spring:message code="${matchMethodC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="form-group">
<label><spring:message code='whether_hexbinary' />:</label>
<label>
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<c:if test="${cfg.isHexbin==isHexbinC.itemCode }"><spring:message code="${isHexbinC.itemValue}"/></c:if>
</c:forEach>
</label>
</div>
</div>
</div>
</div>
</c:forEach>
</html>

View File

@@ -8,6 +8,9 @@
<title>数据概览</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/global/plugins/highcharts/css/common.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/global/plugins/highcharts/css/data_text.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/dashboard.css">
<script src="${pageContext.request.contextPath}/static/pages/scripts/dashboard.js"></script>
<!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script>
@@ -24,80 +27,88 @@
<div class="title-center fl"><a href="javascript:window.location.reload()"><i class="fa fa-line-chart"></i>&nbsp;网络流量分析</a></div>
<div class="title-right fr"></div>
</div> -->
<div class="header">
<div class="data_info">
<div class="info_1 fl">
<div class="info_1 fl_fc">
<div class="text_1">
<div class="fr">
<div class="fl">
<div class="fr_fc">
<div class="fl_fc">
<a href="#">
<span>
<p>业务总量</p>
<p>15802</p>
<p><i class="fa fa-ban"> </i> 阻断链接数</p>
<p class="numberRun">15802</p>
</span>
</a>
</div>
</div>
<div class="fr">
<div class="fl">
<div class="fr_fc">
<div class="fl_fc">
<a href="#">
<span>
<p>异常IP</p>
<p>15802</p>
</span>
</a>
</div>
</div>
<div class="fr">
<!-- <i class="fa fa-bar-chart"></i> -->
<div class="fl">
<a href="#">
<span>
<p>丢包数</p>
<p>15802</p>
<p><i class="fa fa-external-link"></i> 新建链接数</p>
<p class="numberRun1">15802</p>
</span>
</a>
</div>
</div>
</div>
</div>
<div class="info_2 fl">
<div class="info_2 fl_fc">
<div class="text_2">
<div class="fr">
<div class="fl">
<p>活跃网站流量</p>
<p>15802</p>
<div class="fr_fc">
<!-- <i class="fa fa-bar-chart"></i> -->
<div class="fl_fc">
<a href="#">
<span>
<p><i class="fa fa-trash"> </i> 丢弃链接数</p>
<p class="numberRun2">15802</p>
</span>
</a>
</div>
</div>
<div class="fr">
<div class="fl">
<p>境外IP流量</p>
<p>15802</p>
<div class="fr_fc">
<div class="fl_fc">
<a href="${ctx}/dashboard/ipActiveList">
<span>
<p><i class="fa fa-heartbeat"> </i> 活跃链接数</p>
<p class="numberRun3">15802</p>
</span>
</a>
</div>
</div>
<div class="fr_fc">
<div class="fl_fc">
<a href="${ctx}/dashboard/ipActiveList">
<span>
<p><i class="fa fa-cloud-download"></i> 网络带宽</p>
<p clas="csNum">c2s 83%<i class="fa fa-arrow-up" style="color: green"></i> | s2c 17%<i class="fa fa-arrow-down" style="color: red"></i></p>
<p class="numberRun4">15802</p>
</span>
</a>
</div>
</div>
</div>
</div>
<div class="info_3 fl">
<%-- <div class="info_3 fl_fc">
<div class="text_3">
<div class="fr">
<div class="fl">
<p>热门网站流量</p>
<p>15802</p>
</div>
</div>
<div class="fr">
<div class="fl">
<p>互联网流量包数</p>
<p>15802</p>
<div class="fr_fc">
<div class="fl_fc">
<a href="${ctx}/dashboard/ipActiveList">
<span>
<p>网络带宽</p>
<p class="numberRun5">15802</p>
</span>
</a>
</div>
</div>
</div>
</div>
</div> --%>
</div>
</div>
<!--header结束-->
<div class="data_main">
@@ -175,41 +186,6 @@
<td>Linux</td>
<td>0</td>
</tr>
<tr>
<td>4</td>
<td>DOS</td>
<td>0</td>
</tr>
<tr>
<td>5</td>
<td>windows</td>
<td>0</td>
</tr>
<tr>
<td>6</td>
<td>iOS</td>
<td>0</td>
</tr>
<tr>
<td>7</td>
<td>windows</td>
<td>0</td>
</tr>
<tr>
<td>8</td>
<td>windows</td>
<td>0</td>
</tr>
<tr>
<td>9</td>
<td>windows</td>
<td>0</td>
</tr>
<tr>
<td>10</td>
<td>windows</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
@@ -254,41 +230,6 @@
<td>Google</td>
<td>0</td>
</tr>
<tr>
<td>4</td>
<td>Yahoo</td>
<td>0</td>
</tr>
<tr>
<td>5</td>
<td>qq</td>
<td>0</td>
</tr>
<tr>
<td>6</td>
<td>Googleusercontent</td>
<td>0</td>
</tr>
<tr>
<td>7</td>
<td>Microsoftonline</td>
<td>0</td>
</tr>
<tr>
<td>8</td>
<td>Pornhub</td>
<td>0</td>
</tr>
<tr>
<td>9</td>
<td>Youtube</td>
<td>0</td>
</tr>
<tr>
<td>10</td>
<td>Facebook</td>
<td>0</td>
</tr>
</tbody>
</table>
</div>
@@ -313,27 +254,15 @@
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/echart.js"></script>
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
<!-- <style type="text/css">
a:link {
color:#fff !important;
text-decoration:none
}
a:visited {
background-color:yellow !important;
text-decoration:none
}
a:hover {
color:green !important;
text-decoration:none
}
a:active {
color:green !important;
text-decoration:none;
}
</style> -->
<script type="text/javascript">
$(document).ready(function(){
//动态显示数据
dataScroll(".numberRun",43113);
dataScroll(".numberRun1",13414);
dataScroll(".numberRun2",1235137653);
dataScroll(".numberRun3",2134634);
dataScroll(".numberRun4",1234656);
protocolList();//协议统计
ipActiveList();//活跃IP
@@ -348,7 +277,17 @@ $(document).ready(function(){
uaSelectChange($('#uaSelect').val());
});
})
});
//动态显示数据
function dataScroll(index,num){
var numRun = $(index).numberAnimate({num:num, speed:2000, symbol:","});
var nums = 1000;
setInterval(function(){
nums-= 1000;
numRun.resetData(nums);
},2000);
}
//切换下拉列表-操作系统与浏览器
function uaSelectChange(ua){

View File

@@ -0,0 +1,180 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title>
<spring:message code="traffic_ip_active"></spring:message>
</title>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onClick="javascript:window.location='${ctx}/dashboard/ipActiveList'"><spring:message code="refresh"/></button>
<button type="button" class="btn btn-default" onClick="javascript:window.location='${ctx}/dashboard/logChart'"><spring:message code="back"/></button>
</div>
<h3 class="page-title">
<spring:message code="网络带宽"></spring:message>
</h3>
<h5 class="page-header"></h5>
<ul class="nav nav-tabs">
<li class="active"><a href="${ctx}/dashboard/ipActiveList">发送</a></li>
<li><a href="${ctx}/dashboard/ipActiveList">接收</a></li>
<li><a href="${ctx}/dashboard/ipActiveList">总计</a></li>
</ul>
<div id="chart" style="width:100%;height:400px;"></div>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="entry" action="${ctx}/traffic/ipActiveList" method="post" class="form-search">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
</form:form>
</div>
<style>
.show-two{
display: inline-block;
}
.title-num{
margin-right:8px;
border-radius:40px !important;
background-color: #f34b60;
color:#fff;
width:40px;
text-align: center;
font-size: 20px;
}
</style>
<script type="text/javascript">
$(function(){
$("#contentTable tbody tr").bind('click',function(){
$("tbody tr").removeClass("active");
$(this).addClass("active");
$("span[class='title-num']").html('&nbsp;'+($(this).index()+1)+'&nbsp;')
});
});
</script>
<div class="table-responsive show-two">
<sys:message content="${message}"/>
<table id="contentTable" style="width: 40%;" class="table table-hover table-active table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><spring:message code="sort"/></th>
<th><spring:message code="ip_addr"/></th>
<th><spring:message code="area_id"/></th>
<th><spring:message code="link_num"/></th>
<th><spring:message code="c2s_pkt_num"/></th>
<th><spring:message code="s2c_pkt_num"/></th>
<th><spring:message code="c2s_byte_len"/></th>
<th><spring:message code="s2c_byte_len"/></th>
<th><spring:message code="stat_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach var="entry" items="${page.list }" varStatus="status">
<tr>
<td>${entry.id }</td>
<td>${entry.ipAddr }</td>
<td>${entry.areaId }</td>
<td>${entry.linkNum }</td>
<td>${entry.c2sPktNum }</td>
<td>${entry.s2cPktNum }</td>
<td>${entry.c2sByteLen }</td>
<td>${entry.s2cByteLen }</td>
<td><fmt:formatDate value="${entry.statTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
<div class="right-table" style="width: 32%;float: right;" >
<h3>
<span class="title-num">&nbsp;1 </span>
<label>详细性质</label>
</h3>
<table id="contentTable2" class="table table-striped table-bordered table-condensed text-nowrap">
<tbody>
<tr><td><spring:message code="chart"/></td><td>12131</td></tr>
<tr><td><spring:message code="ip_addr"/></td><td>241241</td></tr>
<tr><td><spring:message code="area_id"/></td><td>31412</td></tr>
<tr><td><spring:message code="link_num"/></td><td>34655</td></tr>
<tr><td><spring:message code="c2s_pkt_num"/></td><td>37457</td></tr>
<tr><td><spring:message code="s2c_pkt_num"/></td><td>33457</td></tr>
<tr><td><spring:message code="c2s_byte_len"/></td><td>38468</td></tr>
<tr><td><spring:message code="s2c_byte_len"/></td><td>3367</td></tr>
<tr><td><spring:message code="stat_time"/></td><td>33456</td></tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var chart = Highcharts.chart('chart', {
title: {
text: '网络带宽'
},
yAxis: {
title: {
text: 'Pkt'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
xAxis:{
type:'datetime',
dateTimeLabelFormats:{
day:'%Y-%m-%d %h'
}
},
plotOptions: {
series: {
pointStart: Date.UTC(2018, 8, 16,1),
pointInterval: 3600*1000,
// pointIntervalUnit:'day'
}
},
series: [{
name: 'Installation',
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
}],
responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom'
}
}
}]
}
});
});
function showIpActiveChart(){
}
</script>
</body>
</html>

View File

@@ -17,6 +17,9 @@
<spring:message code="活跃IP实时统计TOP100"></spring:message>
</h3>
<h5 class="page-header"></h5>
<div id="chart" style="width:100%;height:400px;"></div>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
@@ -64,9 +67,72 @@
</div>
</div>
</div>
<script src="${pageContext.request.contextPath}/static/layouts/layout/scripts/layout.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var chart = Highcharts.chart('chart', {
title: {
text: 'Traffic IP Active Total'
},
yAxis: {
title: {
text: 'IP'
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle'
},
plotOptions: {
series: {
label: {
connectorAllowed: false
},
pointStart: 2010
}
},
series: [{
name: 'Installation',
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
}, {
name: 'Manufacturing',
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
}, {
name: 'Sales & Distribution',
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
}, {
name: 'Project Development',
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227]
}, {
name: 'Other',
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
}],
responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom'
}
}
}]
}
});
});
function showIpActiveChart(){
}
function openChart(){
var url = "${ctx}/traffic/showChart";

View File

@@ -32,7 +32,6 @@ $(document).ready(function(){
<spring:message code="av_content_ip_control"/>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="row">
<div class="col-md-12">
@@ -216,11 +215,11 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -215,11 +215,11 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -217,12 +217,12 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
</c:if>
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>
<c:if test="${fn:startsWith(log.logUri, 'http')}">

View File

@@ -217,11 +217,11 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -217,11 +217,11 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -217,11 +217,11 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -275,11 +275,11 @@
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -217,11 +217,11 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -217,11 +217,11 @@ $(document).ready(function(){
<td>${log.pid}</td>
<td>
<c:if test="${fn:startsWith(log.url, 'http')}">
${log.url}
<c:if test="${fn:startsWith(log.url, 'http://')}">
${fn:substring(log.url,7,-1)}
</c:if>
<c:if test="${!fn:startsWith(log.url, 'http') and !empty log.url}">
http://${log.url}
<c:if test="${!fn:startsWith(log.url, 'http://') and !empty log.url}">
${log.url}
</c:if>
</td>
<td>

View File

@@ -6,12 +6,33 @@
<title>数据选择</title>
<link href="${pageContext.request.contextPath}/static/global/plugins/jquery-ztree/3.5.12/css/zTreeStyle/zTreeStyle.min.css" rel="stylesheet" type="text/css"/>
<script src="${pageContext.request.contextPath}/static/global/plugins/jquery-ztree/3.5.12/js/jquery.ztree.all-3.5.min.js" type="text/javascript"></script>
<%--解决ztree add小图标丢失 --%>
<style type="text/css">
.ztree li span.button.add{margin-right:2px;background-position:-144px 0;vertical-align:top;*vertical-align:middle}
</style>
<script type="text/javascript">
var key, lastValue = "", nodeList = [], type = getQueryString("type", "${url}");
var tree, setting = {view:{selectedMulti:false,dblClickExpand:false},check:{enable:"${checked}",chkboxType: { "Y" : "${checkedPS}", "N" : "${unCheckedPS}" },nocheckInherit:true},
var tree, setting = {
view:{
addHoverDom: addHoverDom,
removeHoverDom: removeHoverDom,
selectedMulti:false,
dblClickExpand:false
},
edit: {
enable: true,
showRemoveBtn: showRemoveBtn,
showRenameBtn: showRenameBtn,
removeTitle: "remove",
renameTitle: "rename",
},
check:{enable:"${checked}",chkboxType: { "Y" : "${checkedPS}", "N" : "${unCheckedPS}" },nocheckInherit:true},
async:{enable:(type==6),url:"${ctx}/sys/user/treeData",autoParam:["id=officeId"]},
data:{simpleData:{enable:true}},callback:{
data:{simpleData:{enable:true}},
callback:{
beforeEditName:beforeEditName,
beforeRename:beforeRename,
beforeRemove:beforeRemove,
//beforeClick: function(treeId, treeNode){
//if("${checked}" == "true"){
//tree.checkNode(treeNode, !node.checked, true, true);
@@ -36,7 +57,9 @@
},onDblClick: function(){//<c:if test="${!checked}">
top.$.jBox.getBox().find("button[value='ok']").trigger("click");
//$("input[type='text']", top.mainFrame.document).focus();//</c:if>
}
},
onRename:onRename,
onRemove:onRemove
}
};
function expandNodes(nodes) {
@@ -61,12 +84,15 @@
}else{
map.name="<spring:message code='root_node' />";
}
}
}
tree = $.fn.zTree.init($("#tree"), setting, zNodes);
// 默认展开一级节点
var nodes = tree.getNodesByParam("level", 0);
// 默认展开一级节点
var nodes = tree.getNodesByParam("level", 1);
for(var i=0; i<nodes.length; i++) {
tree.expandNode(nodes[i], true, false, false);
}
nodes=tree.getNodesByParam("level", 0);
for(var i=0; i<nodes.length; i++) {
tree.expandNode(nodes[i], true, false, false);
}
@@ -195,7 +221,145 @@
$("#txt").toggle();
$("#key").focus();
}
function beforeEditName(treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("tree");
zTree.selectNode(treeNode);
return confirm("<spring:message code='edit' />" + treeNode.name + "?");
}
function beforeRename(treeId, treeNode, newName) {
var zTree = $.fn.zTree.getZTreeObj("tree");
if (newName.length == 0) {
var tip="<spring:message code='can_not_null' />";
alert("<spring:message code='${title}' />"+tip.replace("%s"," "));
setTimeout(function(){zTree.editName(treeNode)}, 10);
return false;
}
if(confirm("<spring:message code='save' />" + treeNode.name + "?")){
return true;
}else{
setTimeout(function(){zTree.editName(treeNode)}, 10);
return false;
}
}
function beforeRemove(treeId, treeNode, newName) {
return confirm("<spring:message code='remove' /> " + treeNode.name + "?");
}
//在重命名节点时,调用后台存储,将返回结果更新
function onRename(e, treeId, treeNode) {
loading("<spring:message code='loading' />...");
$.ajax({
type:'post',
async:true,
cache:false,
url:'${ctx}/specific/specificServiceCfg/ajaxSaveOrUpdateApp',
data:{
"specServiceId":treeNode.id,
"specServiceCode":treeNode.serviceCode,
"specServiceName":treeNode.name,
"cfgType":treeNode.serviceType,
"groupId":treeNode.groupId,
"businessType":treeNode.pId.replace("businessType",""),
"addFlag":treeNode.user
},
//dataType:"json",
//contentType:"application/json; charset=utf-8",
success:function(data){
treeNode.groupId=data.data;
treeNode.specServiceCode=data.specServiceCode;
treeNode.user=data.addFlag;
var zTree = $.fn.zTree.getZTreeObj("tree");
zTree.updateNode(treeNode);
closeTip();
}
});
}
function onRemove(e, treeId, treeNode) {
loading("<spring:message code='loading' />...");
if(typeof treeNode=="string"){
var zTree = $.fn.zTree.getZTreeObj("tree");
zTree.removeNode(treeNode,true);
}else{
$.ajax({
type:'post',
async:true,
cache:false,
url:'${ctx}/specific/specificServiceCfg/ajaxRemoveApp',
data:{
"specServiceId":treeNode.id
},
//dataType:"json",
//contentType:"application/json; charset=utf-8",
success:function(data){
if(data){
var zTree = $.fn.zTree.getZTreeObj("tree");
zTree.removeNode(treeNode,false);
}
closeTip();
}
});
}
}
//用户只能rename自己添加的节点
function showRenameBtn(treeId, treeNode) {
if(treeNode.isParent){
return false;
}
if("${enableAddBtn}"&&"${enableAddBtn}"=="true"&&treeNode.user&&treeNode.user=="${userId}"){
return true;
}else{
return false;
}
}
//用户只能remove自己添加的节点
function showRemoveBtn(treeId, treeNode) {
if(treeNode.isParent){
return false;
}
if("${enableAddBtn}"&&"${enableAddBtn}"=="true"&&treeNode.user&&treeNode.user=="${userId}"){
return true;
}else{
return false;
}
}
//只有在配置了enableAddBtn的界面上才会显示添加按钮
function addHoverDom(treeId, treeNode) {
//开启节点增加
if("${enableAddBtn}"&&"${enableAddBtn}"=="true"){
//根节点不需要增加节点
if(treeNode.pId==null||(treeNode.businessType&&treeNode.businessType!=-1)){
return;
}
var sObj = $("#" + treeNode.tId + "_span");
if (treeNode.editNameFlag || $("#addBtn_"+treeNode.id).length>0) return;
var title="<spring:message code='add' /> <spring:message code='${title}' />";
var addStr = "<span class='button add' id='addBtn_" + treeNode.id
+ "' title='"+title+"' onfocus='this.blur();'></span>";
sObj.after(addStr);
var btn = $("#addBtn_"+treeNode.id);
if (btn){
btn.bind("click", function(){
//区别人工添加在ID前加上manual
var id="manual"+new Date().getTime();
var zTree = $.fn.zTree.getZTreeObj("tree"); //addSelectedNode
zTree.addNodes(treeNode, {id:id, pId:treeNode.id, name:"<spring:message code='new' /> <spring:message code='${title}' />",
businessType:treeNode.id.replace("businessType",""),user:"${userId}",serviceType:treeNode.serviceType,groupId:"",
serviceCode:""});
var node = zTree.getNodeByParam("id", id,treeNode);
if(node){
zTree.updateNode(node);
zTree.editName(node);
}
return false;
});
}
}
};
function removeHoverDom(treeId, treeNode) {
$("#addBtn_"+treeNode.id).unbind().remove();
};
</script>
</head>
<body>

View File

@@ -1,7 +1,7 @@
*{
margin: 0;
padding: 0;
font-family: PingFangSC-Light, ;
font-family: PingFangSC-Light, Microsoft YaHei;
}
body,html{
width: 100%;
@@ -45,42 +45,7 @@ a {
.fr{
float: right;
}
/* header开始 */
.header-title {
width: 100%;
height: 115px;
padding: 30px 0 35px 0;
box-sizing: border-box;
}
.header-title>.title-center {
width: 440px;
height: 40px;
box-sizing: border-box;
border-right: 5px solid #333333;
border-left: 5px solid #333333;
/* background: url(../img/title.png) no-repeat; */
}
.header-title>.title-center>a {
margin-top: 1px;
margin-left: 130px;
color: #fff;
font-size: 30px;
font-weight: 600;
position: absolute;
}
.header-title>.title-left, .header-title>.title-right {
width: calc(50% - 220px);
height: 3px;
background: #333333;
margin-top: 10px;
}
.fl {
float: left;
}
.fr {
float: right;
}
td a {
color:#fff

View File

@@ -1,53 +1,65 @@
/* 页面整体布局 */
.data_content{
/*overflow-x: hidden;*/
/* min-width: 1366px; */
background-color: #303030;
padding-top: 40px;
padding-top: 30px;
padding-bottom: 10px;
}
/* */
/******************** info start *************************/
p{
margin: 10px
}
.data_content .data_info{
width: calc(100% - 30px);
width: calc(100% - 20px);
margin-bottom: 40px;
height: 110px;
margin-left: 15px;
text-align: center;
}
.data_content .data_info .info_1{
width: 40%;
.data_content .data_info .info_2{
width: 60%;
height: 110px;
}
.data_content .data_info .fr{
width: 40%;
.data_content .data_info .fr_fc{
width: 155%;
height: 110px;
border: 1px solid #303030;
border-width: 0 1px;
}
.data_content .data_info .fr_fc .fl_fc{
width: 100%;
height: 110px;
border: 1px solid #303030;
border-width: 0 1px;
margin-left: 0px;
}
.data_content .data_info .info_1>.text_1{
width: calc(100% - 15px);
.data_content .data_info .info_2>.text_2{
width: calc(100% - 10px);
background-color: #3D3D3D;
height: 110px;
}
.data_content .data_info .info_2{
width: 31%;
.data_content .data_info .info_1{
width: 40%;
height: 110px;
}
.data_content .data_info .info_1 .fr:first-child{
.data_content .data_info .info_2 .fr_fc:first-child{
border-left: none;
}
.data_content .data_info .info_1 .fr:last-child{
.data_content .data_info .info_2 .fr_fc:last-child{
border-right: none;
}
.data_content .data_info .info_2>.text_2{
width: calc(100% - 15px);
.data_content .data_info .info_1>.text_1{
width: calc(100% - 1px);
background-color: #3D3D3D;
height: 110px;
}
.data_content .data_info .info_3{
/* .data_content .data_info .info_3{
width: 29%;
height: 110px;
}
@@ -56,46 +68,81 @@
background-color: #3D3D3D;
height: 110px;
}
} */
.data_content .data_info>div.info_1>.text_1>div{
.data_content .data_info>div.info_2>.text_2>div{
width: 33.333%;
position: relative;
}
.data_content .data_info>div.info_2>div>div,
.data_content .data_info>div.info_3>div>div{
.data_content .data_info>div.info_1>div>div,
.data_content .data_info>div.info_2>div>div{
width: 50%;
position: relative;
}
.data_content .data_info>div>div>div>div{
margin-left:40px;
margin-left:10px;
margin-top: 1px;
}
.data_content .data_info>div.info_2>div>div>div{
margin-left: 40px;
.data_content .data_info>div.info_1>div>div>div{
margin-left: 10px;
margin-top: 1px;
}
.data_content .data_info p:nth-child(1){
color:#fff;
font-size: 12.8px;
text-align: center;
}
.data_content .data_info p:nth-child(2){
.data_content .data_info>div.info_1 p:nth-child(2){
font-weight: 600;
font-size: 28px;
color:#ffff43;
font-size: 16px;
color:#288dce;
margin-top: 2.1em;
}
.data_content .data_info>div.info_2 p:nth-child(2){
.data_content .data_info .info_2 .fr_fc .numberRun2{
font-weight: 600;
font-size: 28px;
color:#25f3e6;
font-size: 16px;
color:#288dce;
margin-top: 2.1em;
}
.data_content .data_info>div.info_3 p:nth-child(2){
.data_content .data_info .info_2 .fr_fc .numberRun3{
font-weight: 600;
font-size: 28px;
color:#ff4e4e;
font-size: 16px;
color:#288dce;
margin-top: 2.1em;
}
/* info end */
.data_content .data_info>div.info_2 .fl_fc .numberRun4{
font-weight: 600;
font-size: 16px;
color:#288dce;
margin-top: 1px;
}
.data_content .data_info>div.info_2 .fl_fc .csNum{
font-size: 5px;
color:#ff4e4e !important;
margin-top: 1px;
}
/* .data_info{
float: right;
margin-right: 15px;
} */
.fl_fc{
float: left;
}
.fr_fc{
float: left;
}
.clearfix:after,.clearfix:before{
content:".";
display: table;
}
.clearfix:after{
clear: both;
}
.clearfix {
*zoom: 1; /*IE/7/6*/
}
/************** info end ***********************/
.data_content .data_main{
width: calc(100% - 30px);

View File

@@ -28,7 +28,6 @@
});
});
console.log(data)
var chart = Highcharts.chart('chart_1', {
chart: {
type: 'pie',
@@ -41,9 +40,6 @@
},
noData:{
position:{
align:'center'
},
style: {//设置字体颜色
color: '#fff',
},
@@ -118,7 +114,7 @@
type: 'pie',
innerSize: '70%',//圆环的大小
name: 'count',
data: []
data: data
}],
drilldown:{
series:drillData,

View File

@@ -0,0 +1,5 @@
/*数字滚动插件的CSS可调整样式*/
.mt-number-animate{ font-family: 'Microsoft YaHei'; line-height:20px; height: 20px;/*设置数字显示高度*/; /*设置数字大小*/ overflow: hidden; display: inline-block; position: relative; }
.mt-number-animate .mt-number-animate-dot{ width: 10px;/*设置分割符宽度*/ line-height: 20px; float: left; text-align: center;}
.mt-number-animate .mt-number-animate-dom{ width: 10px;/*设置单个数字宽度*/ text-align: center; float: left; position: relative; top: 0;}
.mt-number-animate .mt-number-animate-dom .mt-number-animate-span{ width: 100%; float: left;}

View File

@@ -0,0 +1,129 @@
/**
* 数字滚动插件 v1.0
*/
(function($) {
$.fn.numberAnimate = function(setting) {
var defaults = {
speed : 1000,//动画速度
num : "", //初始化值
iniAnimate : true, //是否要初始化动画效果
symbol : '',//默认的分割符号,千,万,千万
dot : 0 //保留几位小数点
}
//如果setting为空就取default的值
var setting = $.extend(defaults, setting);
//如果对象有多个,提示出错
if($(this).length > 1){
alert("just only one obj!");
return;
}
//如果未设置初始化值。提示出错
if(setting.num == ""){
alert("must set a num!");
return;
}
var nHtml = '<div class="mt-number-animate-dom" data-num="{{num}}">\
<span class="mt-number-animate-span">0</span>\
<span class="mt-number-animate-span">1</span>\
<span class="mt-number-animate-span">2</span>\
<span class="mt-number-animate-span">3</span>\
<span class="mt-number-animate-span">4</span>\
<span class="mt-number-animate-span">5</span>\
<span class="mt-number-animate-span">6</span>\
<span class="mt-number-animate-span">7</span>\
<span class="mt-number-animate-span">8</span>\
<span class="mt-number-animate-span">9</span>\
<span class="mt-number-animate-span">.</span>\
</div>';
//数字处理
var numToArr = function(num){
num = parseFloat(num).toFixed(setting.dot);
if(typeof(num) == 'number'){
var arrStr = num.toString().split("");
}else{
var arrStr = num.split("");
}
//console.log(arrStr);
return arrStr;
}
//设置DOM symbol:分割符号
var setNumDom = function(arrStr){
var shtml = '<div class="mt-number-animate">';
for(var i=0,len=arrStr.length; i<len; i++){
if(i != 0 && (len-i)%3 == 0 && setting.symbol != "" && arrStr[i]!="."){
shtml += '<div class="mt-number-animate-dot">'+setting.symbol+'</div>'+nHtml.replace("{{num}}",arrStr[i]);
}else{
shtml += nHtml.replace("{{num}}",arrStr[i]);
}
}
shtml += '</div>';
return shtml;
}
//执行动画
var runAnimate = function($parent){
$parent.find(".mt-number-animate-dom").each(function() {
var num = $(this).attr("data-num");
num = (num=="."?10:num);
var spanHei = $(this).height()/11; //11为元素个数
var thisTop = -num*spanHei+"px";
if(thisTop != $(this).css("top")){
if(setting.iniAnimate){
//HTML5不支持
if(!window.applicationCache){
$(this).animate({
top : thisTop
}, setting.speed);
}else{
$(this).css({
'transform':'translateY('+thisTop+')',
'-ms-transform':'translateY('+thisTop+')', /* IE 9 */
'-moz-transform':'translateY('+thisTop+')', /* Firefox */
'-webkit-transform':'translateY('+thisTop+')', /* Safari 和 Chrome */
'-o-transform':'translateY('+thisTop+')',
'-ms-transition':setting.speed/1000+'s',
'-moz-transition':setting.speed/1000+'s',
'-webkit-transition':setting.speed/1000+'s',
'-o-transition':setting.speed/1000+'s',
'transition':setting.speed/1000+'s'
});
}
}else{
setting.iniAnimate = true;
$(this).css({
top : thisTop
});
}
}
});
}
//初始化
var init = function($parent){
//初始化
$parent.html(setNumDom(numToArr(setting.num)));
runAnimate($parent);
};
//重置参数
this.resetData = function(num){
var newArr = numToArr(num);
var $dom = $(this).find(".mt-number-animate-dom");
if($dom.length < newArr.length){
$(this).html(setNumDom(numToArr(num)));
}else{
$dom.each(function(index, el) {
$(this).attr("data-num",newArr[index]);
});
}
runAnimate($(this));
}
//init
init($(this));
return this;
}
})(jQuery);