ddos下发配置动作参协议默认为空,阈值默认为0,协议不为空则阈值至少一个大于0,用户列表查询注释跟机构关联

This commit is contained in:
zhanghongqing
2018-11-30 14:07:06 +08:00
parent a4cea80688
commit 15ec139701
3 changed files with 51 additions and 27 deletions

View File

@@ -229,32 +229,32 @@
u.identity, u.identity,
u.email, u.email,
u.create_time, u.create_time,
u.status, u.status
u.company_id AS "company.id", <!-- ,u.company_id AS "company.id", -->
c.name AS "company.name", <!-- c.name AS "company.name", -->
c.parent_id AS "company.parent.id", <!-- c.parent_id AS "company.parent.id", -->
c.parent_ids AS "company.parentIds", <!-- c.parent_ids AS "company.parentIds", -->
c.type AS "company.type", <!-- c.type AS "company.type", -->
c.grade AS "company.grade", <!-- c.grade AS "company.grade", -->
c.job_type AS "company.job_type", <!-- c.job_type AS "company.job_type", -->
u.entity_id AS "entity.id", <!-- u.entity_id AS "entity.id", -->
e.name AS "entity.name", <!-- e.name AS "entity.name", -->
e.parent_id AS "entity.parent.id", <!-- e.parent_id AS "entity.parent.id", -->
e.parent_ids AS "entity.parentIds", <!-- e.parent_ids AS "entity.parentIds", -->
e.type AS "entity.type", <!-- e.type AS "entity.type", -->
e.grade AS "entity.grade", <!-- e.grade AS "entity.grade", -->
e.job_type AS "entity.job_type", <!-- e.job_type AS "entity.job_type", -->
u.office_id AS "office.id", <!-- u.office_id AS "office.id", -->
o.name AS "office.name", <!-- o.name AS "office.name", -->
o.parent_id AS "office.parent.id", <!-- o.parent_id AS "office.parent.id", -->
o.parent_ids AS "office.parentIds", <!-- o.parent_ids AS "office.parentIds", -->
o.type AS "office.type", <!-- o.type AS "office.type", -->
o.grade AS "office.grade", <!-- o.grade AS "office.grade", -->
o.job_type AS "office.job_type" <!-- o.job_type AS "office.job_type" -->
from sys_user u from sys_user u
LEFT JOIN sys_office c ON c.id = u.company_id AND c.useable=1 <!-- LEFT JOIN sys_office c ON c.id = u.company_id AND c.useable=1 -->
LEFT JOIN sys_office e ON e.id=u.entity_id AND e.useable=1 <!-- LEFT JOIN sys_office e ON e.id=u.entity_id AND e.useable=1 -->
LEFT JOIN sys_office o ON o.id=u.office_id AND o.useable=1 <!-- LEFT JOIN sys_office o ON o.id=u.office_id AND o.useable=1 -->
WHERE u.status=#{DEL_FLAG_NORMAL} WHERE u.status=#{DEL_FLAG_NORMAL}

View File

@@ -75,12 +75,14 @@ public class DdosCfgService extends BaseService{
Long ppsThreadshold = entity.getPpsThreadshold(); Long ppsThreadshold = entity.getPpsThreadshold();
if(StringUtil.isBlank(antiddosProtocol)) { if(StringUtil.isBlank(antiddosProtocol)) {
entity.setAntiddosProtocol(""); entity.setAntiddosProtocol("");
entity.setBpsThreadshold(0l);
entity.setBpsThreadshold(0l);
} }
if(bpsThreadshold==null) { if(bpsThreadshold==null) {
entity.setBpsThreadshold(0l); entity.setBpsThreadshold(0l);
} }
if(ppsThreadshold==null) { if(ppsThreadshold==null) {
entity.setPpsThreadshold(0l); entity.setBpsThreadshold(0l);
} }
//新增 //新增
if(entity.getCfgId()==null){ if(entity.getCfgId()==null){
@@ -242,12 +244,14 @@ public class DdosCfgService extends BaseService{
Map umap= new HashMap(); Map umap= new HashMap();
if(StringUtil.isBlank(antiddosProtocol)) { if(StringUtil.isBlank(antiddosProtocol)) {
antiddosProtocol=""; antiddosProtocol="";
bpsThreadshold=0l;
bpsThreadshold=0l;
} }
if(bpsThreadshold==null) { if(bpsThreadshold==null) {
bpsThreadshold=0l; bpsThreadshold=0l;
} }
if(ppsThreadshold==null) { if(ppsThreadshold==null) {
ppsThreadshold=0l; bpsThreadshold=0l;
} }
umap.put("protocol", antiddosProtocol); umap.put("protocol", antiddosProtocol);
umap.put("bps_threadshold", bpsThreadshold); umap.put("bps_threadshold", bpsThreadshold);

View File

@@ -9,6 +9,26 @@ $(function(){
/* $("#cancel").on("click",function(){ /* $("#cancel").on("click",function(){
window.history.back(); window.history.back();
});*/ });*/
var ddosProtocol=$("#antiddosProtocol").val();
if(ddosProtocol==null||ddosProtocol==""){
$("#bpsThreadshold").attr("disabled","true");
$("#ppsThreadshold").attr("disabled","true");
}
$("#antiddosProtocol").on("change",function(){
var ddosProtocol=$("#antiddosProtocol").val();
if(ddosProtocol==null||ddosProtocol==""){
$("#bpsThreadshold").attr("disabled","true");
$("#ppsThreadshold").attr("disabled","true");
$("#bpsThreadshold").val("");
$("#bpsThreadshold").attr("placeholder","Bit Per Second");
$("#ppsThreadshold").val("");
$("#ppsThreadshold").attr("placeholder","Packet Per Second");
}else{
$("#bpsThreadshold").removeAttr("disabled");
$("#ppsThreadshold").removeAttr("disabled");
}
})
$(".action").on("change", function() { $(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId")); $("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId")); $("#protocolId").val($(this).attr("protocolId"));