diff --git a/web/public/js/components.js b/web/public/js/components.js index 64e48944..3195e1f0 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -1467,7 +1467,8 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio - {{rule.checkpointOptions.allowDomains}} + 允许{{rule.checkpointOptions.allowDomains}} + 禁止{{rule.checkpointOptions.denyDomains}} @@ -2029,7 +2030,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio -`}),Vue.component("http-firewall-checkpoint-referer-block",{props:["v-checkpoint"],data:function(){let e=!0,t=!0,i=[],s={},n=("boolean"==typeof(s=null==(s=null!=window.parent.UPDATING_RULE?window.parent.UPDATING_RULE.checkpointOptions:s)?{}:s).allowEmpty&&(e=s.allowEmpty),"boolean"==typeof s.allowSameDomain&&(t=s.allowSameDomain),null!=s.allowDomains&&"object"==typeof s.allowDomains&&(i=s.allowDomains),this);return setTimeout(function(){n.change()},100),{allowEmpty:e,allowSameDomain:t,allowDomains:i,options:{},value:0}},watch:{allowEmpty:function(){this.change()},allowSameDomain:function(){this.change()}},methods:{changeAllowDomains:function(e){this.allowDomains=e,this.change()},change:function(){this.vCheckpoint.options=[{code:"allowEmpty",value:this.allowEmpty},{code:"allowSameDomain",value:this.allowSameDomain},{code:"allowDomains",value:this.allowDomains}]}},template:`
+
`}),Vue.component("http-firewall-checkpoint-referer-block",{props:["v-checkpoint"],data:function(){let e=!0,t=!0,i=[],s=[],n={},o=("boolean"==typeof(n=null==(n=null!=window.parent.UPDATING_RULE?window.parent.UPDATING_RULE.checkpointOptions:n)?{}:n).allowEmpty&&(e=n.allowEmpty),"boolean"==typeof n.allowSameDomain&&(t=n.allowSameDomain),null!=n.allowDomains&&"object"==typeof n.allowDomains&&(i=n.allowDomains),null!=n.denyDomains&&"object"==typeof n.denyDomains&&(s=n.denyDomains),this);return setTimeout(function(){o.change()},100),{allowEmpty:e,allowSameDomain:t,allowDomains:i,denyDomains:s,options:{},value:0}},watch:{allowEmpty:function(){this.change()},allowSameDomain:function(){this.change()}},methods:{changeAllowDomains:function(e){this.allowDomains=e,this.change()},changeDenyDomains:function(e){this.denyDomains=e,this.change()},change:function(){this.vCheckpoint.options=[{code:"allowEmpty",value:this.allowEmpty},{code:"allowSameDomain",value:this.allowSameDomain},{code:"allowDomains",value:this.allowDomains},{code:"denyDomains",value:this.denyDomains}]}},template:`
@@ -2054,6 +2055,13 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio

允许的来源域名列表,比如example.com*.example.com。单个星号*表示允许所有域名。

+ + + +
禁止的来源域名 + +

禁止的来源域名列表,比如example.org*.example.org;除了这些禁止的来源域名外,其他域名都会被允许,除非限定了允许的来源域名。

+
`}),Vue.component("http-access-log-partitions-box",{props:["v-partition","v-day","v-query"],mounted:function(){let t=this;Tea.action("/servers/logs/partitionData").params({day:this.vDay}).success(function(e){t.partitions=[],e.data.partitions.reverse().forEach(function(e){t.partitions.push({code:e,isDisabled:!1,hasLogs:!1})}),0=t.partitions.length||(t.checkingPartition=i,t.checkLogs())}))}},template:`
@@ -2376,7 +2384,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
-
`}),Vue.component("http-referers-config-box",{props:["v-referers-config","v-is-location","v-is-group"],data:function(){let e=this.vReferersConfig;return null==(e=null==e?{isPrior:!1,isOn:!1,allowEmpty:!0,allowSameDomain:!0,allowDomains:[]}:e).allowDomains&&(e.allowDomains=[]),{config:e}},methods:{isOn:function(){return(!this.vIsLocation&&!this.vIsGroup||this.config.isPrior)&&this.config.isOn},changeAllowDomains:function(e){}},template:`
+
`}),Vue.component("http-referers-config-box",{props:["v-referers-config","v-is-location","v-is-group"],data:function(){let e=this.vReferersConfig;return null==(e=null==e?{isPrior:!1,isOn:!1,allowEmpty:!0,allowSameDomain:!0,allowDomains:[],denyDomains:[]}:e).allowDomains&&(e.allowDomains=[]),null==e.denyDomains&&(e.denyDomains=[]),{config:e}},methods:{isOn:function(){return(!this.vIsLocation&&!this.vIsGroup||this.config.isPrior)&&this.config.isOn},changeAllowDomains:function(e){},changeDenyDomains:function(e){}},template:`
@@ -2414,6 +2422,13 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio

允许的其他来源域名列表,比如example.com*.example.com。单个星号*表示允许所有域名。

+ + + +
禁止的来源域名 + +

禁止的来源域名列表,比如example.org*.example.org;除了这些禁止的来源域名外,其他域名都会被允许,除非限定了允许的来源域名。

+
@@ -4087,7 +4102,10 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio {{cond.value}} -
`}),Vue.component("http-firewall-rules-box",{props:["v-rules","v-type"],data:function(){let e=this.vRules;return{rules:e=null==e?[]:e}},methods:{addRule:function(){window.UPDATING_RULE=null;let t=this;teaweb.popup("/servers/components/waf/createRulePopup?type="+this.vType,{callback:function(e){t.rules.push(e.data.rule)}})},updateRule:function(t,e){window.UPDATING_RULE=e;let i=this;teaweb.popup("/servers/components/waf/createRulePopup?type="+this.vType,{callback:function(e){Vue.set(i.rules,t,e.data.rule)}})},removeRule:function(e){let t=this;teaweb.confirm("确定要删除此规则吗?",function(){t.rules.$remove(e)})}},template:`
+
`}),Vue.component("http-header-assistant",{props:["v-type","v-value"],mounted:function(){let t=this;Tea.action("/servers/headers/options?type="+this.vType).post().success(function(e){t.allHeaders=e.data.headers})},data:function(){return{allHeaders:[],matchedHeaders:[],selectedHeaderName:""}},watch:{vValue:function(t){t!=this.selectedHeaderName&&(this.selectedHeaderName=""),0==t.length?this.matchedHeaders=[]:this.matchedHeaders=this.allHeaders.filter(function(e){return teaweb.match(e,t)}).slice(0,5)}},methods:{select:function(e){this.$emit("select",e),this.selectedHeaderName=e}},template:` + {{header}} +     +`}),Vue.component("http-firewall-rules-box",{props:["v-rules","v-type"],data:function(){let e=this.vRules;return{rules:e=null==e?[]:e}},methods:{addRule:function(){window.UPDATING_RULE=null;let t=this;teaweb.popup("/servers/components/waf/createRulePopup?type="+this.vType,{callback:function(e){t.rules.push(e.data.rule)}})},updateRule:function(t,e){window.UPDATING_RULE=e;let i=this;teaweb.popup("/servers/components/waf/createRulePopup?type="+this.vType,{callback:function(e){Vue.set(i.rules,t,e.data.rule)}})},removeRule:function(e){let t=this;teaweb.confirm("确定要删除此规则吗?",function(){t.rules.$remove(e)})}},template:`
@@ -4100,7 +4118,8 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio - {{rule.checkpointOptions.allowDomains}} + 允许{{rule.checkpointOptions.allowDomains}} + 禁止{{rule.checkpointOptions.denyDomains}} diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js index c0f30d9e..be85b788 100755 --- a/web/public/js/components.src.js +++ b/web/public/js/components.src.js @@ -4158,7 +4158,6 @@ Vue.component("http-firewall-rule-label", { }, methods: { showErr: function (err) { - teaweb.popupTip("规则校验错误,请修正:" + teaweb.encodeHTML(err) + "") }, @@ -4174,7 +4173,8 @@ Vue.component("http-firewall-rule-label", { - {{rule.checkpointOptions.allowDomains}} + 允许{{rule.checkpointOptions.allowDomains}} + 禁止{{rule.checkpointOptions.denyDomains}} @@ -5975,6 +5975,7 @@ Vue.component("http-firewall-checkpoint-referer-block", { let allowEmpty = true let allowSameDomain = true let allowDomains = [] + let denyDomains = [] let options = {} if (window.parent.UPDATING_RULE != null) { @@ -5993,6 +5994,9 @@ Vue.component("http-firewall-checkpoint-referer-block", { if (options.allowDomains != null && typeof (options.allowDomains) == "object") { allowDomains = options.allowDomains } + if (options.denyDomains != null && typeof (options.denyDomains) == "object") { + denyDomains = options.denyDomains + } let that = this setTimeout(function () { @@ -6003,6 +6007,7 @@ Vue.component("http-firewall-checkpoint-referer-block", { allowEmpty: allowEmpty, allowSameDomain: allowSameDomain, allowDomains: allowDomains, + denyDomains: denyDomains, options: {}, value: 0 } @@ -6020,6 +6025,10 @@ Vue.component("http-firewall-checkpoint-referer-block", { this.allowDomains = values this.change() }, + changeDenyDomains: function (values) { + this.denyDomains = values + this.change() + }, change: function () { this.vCheckpoint.options = [ { @@ -6033,7 +6042,11 @@ Vue.component("http-firewall-checkpoint-referer-block", { { code: "allowDomains", value: this.allowDomains - } + }, + { + code: "denyDomains", + value: this.denyDomains + }, ] } }, @@ -6062,6 +6075,13 @@ Vue.component("http-firewall-checkpoint-referer-block", {

允许的来源域名列表,比如example.com*.example.com。单个星号*表示允许所有域名。

+ + 禁止的来源域名 + + +

禁止的来源域名列表,比如example.org*.example.org;除了这些禁止的来源域名外,其他域名都会被允许,除非限定了允许的来源域名。

+ +
` }) @@ -7101,12 +7121,16 @@ Vue.component("http-referers-config-box", { isOn: false, allowEmpty: true, allowSameDomain: true, - allowDomains: [] + allowDomains: [], + denyDomains: [] } } if (config.allowDomains == null) { config.allowDomains = [] } + if (config.denyDomains == null) { + config.denyDomains = [] + } return { config: config } @@ -7116,6 +7140,8 @@ Vue.component("http-referers-config-box", { return ((!this.vIsLocation && !this.vIsGroup) || this.config.isPrior) && this.config.isOn }, changeAllowDomains: function (domains) { + }, + changeDenyDomains: function (domains) { } }, template: `
@@ -7156,6 +7182,13 @@ Vue.component("http-referers-config-box", {

允许的其他来源域名列表,比如example.com*.example.com。单个星号*表示允许所有域名。

+ + 禁止的来源域名 + + +

禁止的来源域名列表,比如example.org*.example.org;除了这些禁止的来源域名外,其他域名都会被允许,除非限定了允许的来源域名。

+ +
@@ -11580,6 +11613,51 @@ Vue.component("http-request-cond-view", {
` }) +Vue.component("http-header-assistant", { + props: ["v-type", "v-value"], + mounted: function () { + let that = this + Tea.action("/servers/headers/options?type=" + this.vType) + .post() + .success(function (resp) { + that.allHeaders = resp.data.headers + }) + }, + data: function () { + return { + allHeaders: [], + matchedHeaders: [], + + selectedHeaderName: "" + } + }, + watch: { + vValue: function (v) { + if (v != this.selectedHeaderName) { + this.selectedHeaderName = "" + } + + if (v.length == 0) { + this.matchedHeaders = [] + return + } + this.matchedHeaders = this.allHeaders.filter(function (header) { + return teaweb.match(header, v) + }).slice(0, 5) + } + }, + methods: { + select: function (header) { + this.$emit("select", header) + this.selectedHeaderName = header + } + }, + template: ` + {{header}} +     +` +}) + Vue.component("http-firewall-rules-box", { props: ["v-rules", "v-type"], data: function () { @@ -11630,7 +11708,8 @@ Vue.component("http-firewall-rules-box", { - {{rule.checkpointOptions.allowDomains}} + 允许{{rule.checkpointOptions.allowDomains}} + 禁止{{rule.checkpointOptions.denyDomains}}