// 请求限制 Vue.component("http-request-limit-config-box", { props: ["v-request-limit-config", "v-is-group", "v-is-location"], data: function () { let config = this.vRequestLimitConfig if (config == null) { config = { isPrior: false, isOn: false, maxConns: 0, maxConnsPerIP: 0, maxBodySize: { count: -1, unit: "kb" }, outBandwidthPerConn: { count: -1, unit: "kb" } } } return { config: config, maxConns: config.maxConns, maxConnsPerIP: config.maxConnsPerIP } }, watch: { maxConns: function (v) { let conns = parseInt(v, 10) if (isNaN(conns)) { this.config.maxConns = 0 return } if (conns < 0) { this.config.maxConns = 0 } else { this.config.maxConns = conns } }, maxConnsPerIP: function (v) { let conns = parseInt(v, 10) if (isNaN(conns)) { this.config.maxConnsPerIP = 0 return } if (conns < 0) { this.config.maxConnsPerIP = 0 } else { this.config.maxConnsPerIP = conns } } }, methods: { isOn: function () { return ((!this.vIsLocation && !this.vIsGroup) || this.config.isPrior) && this.config.isOn } }, template: `
| 启用请求限制 |
|
| 最大并发连接数 |
当前网站最大并发连接数,超出此限制则响应用户 |
| 单IP最大并发连接数 |
单IP最大连接数,统计单个IP总连接数时不区分网站,超出此限制则响应用户 |
| 单连接带宽限制 |
客户端单个请求每秒可以读取的下行流量。 |
| 单请求最大尺寸 |
单个请求能发送的最大内容尺寸。 |