diff --git a/web/public/js/components.js b/web/public/js/components.js
index 9737a6c8..d7bd5a21 100644
--- a/web/public/js/components.js
+++ b/web/public/js/components.js
@@ -427,6 +427,66 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
+`}),Vue.component("ns-node-ddos-protection-config-box",{props:["v-ddos-protection-config","v-default-configs","v-is-node","v-cluster-is-on"],data:function(){let e=this.vDdosProtectionConfig;return null==(e=null==e?{tcp:{isPrior:!1,isOn:!1,maxConnections:0,maxConnectionsPerIP:0,newConnectionsRate:0,allowIPList:[],ports:[]}}:e).tcp&&(e.tcp={isPrior:!1,isOn:!1,maxConnections:0,maxConnectionsPerIP:0,newConnectionsRate:0,allowIPList:[],ports:[]}),{config:e,defaultConfigs:this.vDefaultConfigs,isNode:this.vIsNode,isAddingPort:!1}},methods:{changeTCPPorts:function(e){this.config.tcp.ports=e},changeTCPAllowIPList:function(e){this.config.tcp.allowIPList=e}},template:`
+
+
+
+
+
当前节点所在集群已设置DDoS防护。
+
+
TCP设置
+
+
+
+
+ | 启用 |
+
+
+ |
+
+
+
+
+ | 单节点TCP最大连接数 |
+
+
+
+ |
+
+
+ | 单IP TCP最大连接数 |
+
+
+
+ |
+
+
+ | 单IP TCP新连接速率 |
+
+
+
+ 个新连接/每分钟
+
+
+ |
+
+
+ | TCP端口列表 |
+
+
+
+ |
+
+
+ | IP白名单 |
+
+
+
+ |
+
+
+
+
`}),Vue.component("ns-route-ranges-box",{props:["v-ranges"],data:function(){let e=this.vRanges;return{ranges:e=null==e?[]:e,isAdding:!1,isAddingBatch:!1,rangeType:"ipRange",isReverse:!1,ipRangeFrom:"",ipRangeTo:"",batchIPRange:"",ipCIDR:"",batchIPCIDR:"",regions:[],regionType:"country"}},methods:{addIPRange:function(){this.isAdding=!0;let e=this;setTimeout(function(){e.$refs.ipRangeFrom.focus()},100)},addCIDR:function(){this.isAdding=!0;let e=this;setTimeout(function(){e.$refs.ipCIDR.focus()},100)},addRegions:function(){this.isAdding=!0},addRegion:function(e){this.regionType=e},remove:function(e){this.ranges.$remove(e)},cancelIPRange:function(){this.isAdding=!1,this.ipRangeFrom="",this.ipRangeTo="",this.isReverse=!1},cancelIPCIDR:function(){this.isAdding=!1,this.ipCIDR="",this.isReverse=!1},cancelRegions:function(){this.isAdding=!1,this.regions=[],this.regionType="country",this.isReverse=!1},confirmIPRange:function(){let e=this;this.ipRangeFrom=this.ipRangeFrom.trim(),this.validateIP(this.ipRangeFrom)?(this.ipRangeTo=this.ipRangeTo.trim(),this.validateIP(this.ipRangeTo)?(this.ranges.push({type:"ipRange",params:{ipFrom:this.ipRangeFrom,ipTo:this.ipRangeTo,isReverse:this.isReverse}}),this.cancelIPRange()):teaweb.warn("结束IP填写错误",function(){e.$refs.ipRangeTo.focus()})):teaweb.warn("开始IP填写错误",function(){e.$refs.ipRangeFrom.focus()})},confirmIPCIDR:function(){let e=this;0==this.ipCIDR.length?teaweb.warn("请填写CIDR",function(){e.$refs.ipCIDR.focus()}):this.validateCIDR(this.ipCIDR)?(this.ranges.push({type:"cidr",params:{cidr:this.ipCIDR,isReverse:this.isReverse}}),this.cancelIPCIDR()):teaweb.warn("请输入正确的CIDR",function(){e.$refs.ipCIDR.focus()})},confirmRegions:function(){0==this.regions.length||this.ranges.push({type:"region",params:{regions:this.regions,isReverse:this.isReverse}}),this.cancelRegions()},addBatchIPRange:function(){this.isAddingBatch=!0;let e=this;setTimeout(function(){e.$refs.batchIPRange.focus()},100)},addBatchCIDR:function(){this.isAddingBatch=!0;let e=this;setTimeout(function(){e.$refs.batchIPCIDR.focus()},100)},cancelBatchIPRange:function(){this.isAddingBatch=!1,this.batchIPRange="",this.isReverse=!1},cancelBatchIPCIDR:function(){this.isAddingBatch=!1,this.batchIPCIDR="",this.isReverse=!1},confirmBatchIPRange:function(){let a=this,e=this.batchIPRange;if(0==e.length)teaweb.warn("请填写要加入的IP范围",function(){a.$refs.batchIPRange.focus()});else{let n=[],o="";e.split("\n").forEach(function(t){if(0!=(t=t.trim()).length){let e=(t=t.replace(",",",")).split(",");var i,s;2!=e.length?o=t:(i=e[0].trim(),s=e[1].trim(),a.validateIP(i)&&a.validateIP(s)?n.push({type:"ipRange",params:{ipFrom:i,ipTo:s,isReverse:a.isReverse}}):o=t)}}),0
diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js
index fd3c11c9..576de298 100755
--- a/web/public/js/components.src.js
+++ b/web/public/js/components.src.js
@@ -1476,6 +1476,117 @@ Vue.component("ns-access-log-ref-box", {
`
})
+Vue.component("ns-node-ddos-protection-config-box", {
+ props: ["v-ddos-protection-config", "v-default-configs", "v-is-node", "v-cluster-is-on"],
+ data: function () {
+ let config = this.vDdosProtectionConfig
+ if (config == null) {
+ config = {
+ tcp: {
+ isPrior: false,
+ isOn: false,
+ maxConnections: 0,
+ maxConnectionsPerIP: 0,
+ newConnectionsRate: 0,
+ allowIPList: [],
+ ports: []
+ }
+ }
+ }
+
+ // initialize
+ if (config.tcp == null) {
+ config.tcp = {
+ isPrior: false,
+ isOn: false,
+ maxConnections: 0,
+ maxConnectionsPerIP: 0,
+ newConnectionsRate: 0,
+ allowIPList: [],
+ ports: []
+ }
+ }
+
+
+ return {
+ config: config,
+ defaultConfigs: this.vDefaultConfigs,
+ isNode: this.vIsNode,
+
+ isAddingPort: false
+ }
+ },
+ methods: {
+ changeTCPPorts: function (ports) {
+ this.config.tcp.ports = ports
+ },
+ changeTCPAllowIPList: function (ipList) {
+ this.config.tcp.allowIPList = ipList
+ }
+ },
+ template: `
+
+
+
+
+
当前节点所在集群已设置DDoS防护。
+
+
TCP设置
+
+
+
+
+ | 启用 |
+
+
+ |
+
+
+
+
+ | 单节点TCP最大连接数 |
+
+
+
+ |
+
+
+ | 单IP TCP最大连接数 |
+
+
+
+ |
+
+
+ | 单IP TCP新连接速率 |
+
+
+
+ 个新连接/每分钟
+
+
+ |
+
+
+ | TCP端口列表 |
+
+
+
+ |
+
+
+ | IP白名单 |
+
+
+
+ |
+
+
+
+
+
`
+})
+
Vue.component("ns-route-ranges-box", {
props: ["v-ranges"],
data: function () {
diff --git a/web/public/js/components/ns/ns-node-ddos-protection-config-box.js b/web/public/js/components/ns/ns-node-ddos-protection-config-box.js
new file mode 100644
index 00000000..da24d1be
--- /dev/null
+++ b/web/public/js/components/ns/ns-node-ddos-protection-config-box.js
@@ -0,0 +1,110 @@
+Vue.component("ns-node-ddos-protection-config-box", {
+ props: ["v-ddos-protection-config", "v-default-configs", "v-is-node", "v-cluster-is-on"],
+ data: function () {
+ let config = this.vDdosProtectionConfig
+ if (config == null) {
+ config = {
+ tcp: {
+ isPrior: false,
+ isOn: false,
+ maxConnections: 0,
+ maxConnectionsPerIP: 0,
+ newConnectionsRate: 0,
+ allowIPList: [],
+ ports: []
+ }
+ }
+ }
+
+ // initialize
+ if (config.tcp == null) {
+ config.tcp = {
+ isPrior: false,
+ isOn: false,
+ maxConnections: 0,
+ maxConnectionsPerIP: 0,
+ newConnectionsRate: 0,
+ allowIPList: [],
+ ports: []
+ }
+ }
+
+
+ return {
+ config: config,
+ defaultConfigs: this.vDefaultConfigs,
+ isNode: this.vIsNode,
+
+ isAddingPort: false
+ }
+ },
+ methods: {
+ changeTCPPorts: function (ports) {
+ this.config.tcp.ports = ports
+ },
+ changeTCPAllowIPList: function (ipList) {
+ this.config.tcp.allowIPList = ipList
+ }
+ },
+ template: `
+
+
+
+
+
当前节点所在集群已设置DDoS防护。
+
+
TCP设置
+
+
+
+
+ | 启用 |
+
+
+ |
+
+
+
+
+ | 单节点TCP最大连接数 |
+
+
+
+ |
+
+
+ | 单IP TCP最大连接数 |
+
+
+
+ |
+
+
+ | 单IP TCP新连接速率 |
+
+
+
+ 个新连接/每分钟
+
+
+ |
+
+
+ | TCP端口列表 |
+
+
+
+ |
+
+
+ | IP白名单 |
+
+
+
+ |
+
+
+
+
+
`
+})
\ No newline at end of file