From b7501d8a923962a7520698bc6cbcd76346b9f997 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Thu, 22 Sep 2022 17:55:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=98=B2=E7=9B=97=E9=93=BE?= =?UTF-8?q?=E9=80=89=E9=A1=B9=E8=AF=B4=E6=98=8E=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/public/js/components.js | 47 +++++++++- web/public/js/components.src.js | 85 +++++++++++++++++-- .../server/http-referers-config-box.js | 6 +- 3 files changed, 125 insertions(+), 13 deletions(-) diff --git a/web/public/js/components.js b/web/public/js/components.js index 781c1e7f..ee29e460 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -2176,6 +2176,47 @@ 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:`
+ + + + + + + + + + + + + + + + + + + + + + + +
启用 +
+ + +
+

选中后表示开启防盗链。

+
允许直接访问网站 + +

允许用户直接访问网站,用户第一次访问网站时来源域名通常为空。

+
来源域名允许一致 + +

允许来源域名和当前访问的域名一致,相当于在站内访问。

+
允许的来源域名 + +

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

+
+
`}),Vue.component("http-redirect-to-https-box",{props:["v-redirect-to-https-config","v-is-location"],data:function(){let e=this.vRedirectToHttpsConfig;return null==e?e={isPrior:!1,isOn:!1,host:"",port:0,status:0,onlyDomains:[],exceptDomains:[]}:(null==e.onlyDomains&&(e.onlyDomains=[]),null==e.exceptDomains&&(e.exceptDomains=[])),{redirectToHttpsConfig:e,portString:0 @@ -3231,7 +3272,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 文档根目录 - 反向代理 + 源站 @@ -3363,7 +3404,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio - 启用反向代理 + 启用源站
@@ -4828,7 +4869,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
-
`}),Vue.component("digit-input",{props:["value","maxlength","size","min","max","required","placeholder"],mounted:function(){let e=this;setTimeout(function(){e.check()})},data:function(){let e=this.maxlength,t=(null==e&&(e=20),this.size);return null==t&&(t=6),{realValue:this.value,realMaxLength:e,realSize:t,isValid:!0}},watch:{realValue:function(e){this.notifyChange()}},methods:{notifyChange:function(){let e=parseInt(this.realValue.toString(),10);isNaN(e)&&(e=0),this.check(),this.$emit("input",e)},check:function(){var e;null!=this.realValue&&(e=this.realValue.toString(),/^\d+$/.test(e)?(e=parseInt(e,10),isNaN(e)?this.isValid=!1:this.required?this.isValid=(null==this.min||this.min<=e)&&(null==this.max||this.max>=e):this.isValid=0==e||(null==this.min||this.min<=e)&&(null==this.max||this.max>=e)):this.isValid=!1)}},template:''}),Vue.component("keyword",{props:["v-word"],data:function(){let e=this.vWord;e=null==e?"":(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/\)/g,"\\)")).replace(/\(/g,"\\(")).replace(/\+/g,"\\+")).replace(/\^/g,"\\^")).replace(/\$/g,"\\$")).replace(/\?/,"\\?")).replace(/\*/,"\\*")).replace(/\[/,"\\[")).replace(/{/,"\\{")).replace(/\./,"\\.");let t=this.$slots.default[0].text;if(0",t="$TMP__KEY__"+n.toString()+"$";return s.push([t,e]),t}),t=this.encodeHTML(t),s.forEach(function(e){t=t.replace(e[0],e[1])})}else t=this.encodeHTML(t);return{word:e,text:t}},methods:{encodeHTML:function(e){return e=(e=(e=(e=e.replace(/&/g,"&")).replace(//g,">")).replace(/"/g,""")}},template:''}),Vue.component("node-log-row",{props:["v-log","v-keyword"],data:function(){return{log:this.vLog,keyword:this.vKeyword}},template:`
+
`}),Vue.component("digit-input",{props:["value","maxlength","size","min","max","required","placeholder"],mounted:function(){let e=this;setTimeout(function(){e.check()})},data:function(){let e=this.maxlength,t=(null==e&&(e=20),this.size);return null==t&&(t=6),{realValue:this.value,realMaxLength:e,realSize:t,isValid:!0}},watch:{realValue:function(e){this.notifyChange()}},methods:{notifyChange:function(){let e=parseInt(this.realValue.toString(),10);isNaN(e)&&(e=0),this.check(),this.$emit("input",e)},check:function(){var e;null!=this.realValue&&(e=this.realValue.toString(),/^\d+$/.test(e)?(e=parseInt(e,10),isNaN(e)?this.isValid=!1:this.required?this.isValid=(null==this.min||this.min<=e)&&(null==this.max||this.max>=e):this.isValid=0==e||(null==this.min||this.min<=e)&&(null==this.max||this.max>=e)):this.isValid=!1)}},template:''}),Vue.component("keyword",{props:["v-word"],data:function(){let e=this.vWord;e=null==e?"":(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/\)/g,"\\)")).replace(/\(/g,"\\(")).replace(/\+/g,"\\+")).replace(/\^/g,"\\^")).replace(/\$/g,"\\$")).replace(/\?/g,"\\?")).replace(/\*/g,"\\*")).replace(/\[/g,"\\[")).replace(/{/g,"\\{")).replace(/\./g,"\\.");let t=this.$slots.default[0].text;if(0",t="$TMP__KEY__"+n.toString()+"$";return s.push([t,e]),t}),t=this.encodeHTML(t),s.forEach(function(e){t=t.replace(e[0],e[1])})}else t=this.encodeHTML(t);return{word:e,text:t}},methods:{encodeHTML:function(e){return e=(e=(e=(e=e.replace(/&/g,"&")).replace(//g,">")).replace(/"/g,""")}},template:''}),Vue.component("node-log-row",{props:["v-log","v-keyword"],data:function(){return{log:this.vLog,keyword:this.vKeyword}},template:`
[{{log.createdTime}}][{{log.createdTime}}][{{log.tag}}]{{log.description}}   共{{log.count}}条 {{log.server.name}}
`}),Vue.component("provinces-selector",{props:["v-provinces"],data:function(){let e=this.vProvinces;var t=(e=null==e?[]:e).$map(function(e,t){return t.id});return{provinces:e,provinceIds:t}},methods:{add:function(){let e=this.provinceIds.map(function(e){return e.toString()}),t=this;teaweb.popup("/ui/selectProvincesPopup?provinceIds="+e.join(","),{width:"48em",height:"23em",callback:function(e){t.provinces=e.data.provinces,t.change()}})},remove:function(e){this.provinces.$remove(e),this.change()},change:function(){this.provinceIds=this.provinces.$map(function(e,t){return t.id})}},template:`
diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js index f45952b7..9093523e 100755 --- a/web/public/js/components.src.js +++ b/web/public/js/components.src.js @@ -6557,6 +6557,77 @@ Vue.component("domains-box", {
` }) +Vue.component("http-referers-config-box", { + props: ["v-referers-config", "v-is-location", "v-is-group"], + data: function () { + let config = this.vReferersConfig + if (config == null) { + config = { + isPrior: false, + isOn: false, + allowEmpty: true, + allowSameDomain: true, + allowDomains: [] + } + } + if (config.allowDomains == null) { + config.allowDomains = [] + } + return { + config: config + } + }, + methods: { + isOn: function () { + return ((!this.vIsLocation && !this.vIsGroup) || this.config.isPrior) && this.config.isOn + }, + changeAllowDomains: function (domains) { + } + }, + template: `
+ + + + + + + + + + + + + + + + + + + + + + + +
启用 +
+ + +
+

选中后表示开启防盗链。

+
允许直接访问网站 + +

允许用户直接访问网站,用户第一次访问网站时来源域名通常为空。

+
来源域名允许一致 + +

允许来源域名和当前访问的域名一致,相当于在站内访问。

+
允许的来源域名 + +

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

+
+
+
` +}) + Vue.component("http-redirect-to-https-box", { props: ["v-redirect-to-https-config", "v-is-location"], data: function () { @@ -9496,7 +9567,7 @@ Vue.component("http-location-labels", { 文档根目录 - 反向代理 + 源站 @@ -9943,7 +10014,7 @@ Vue.component("reverse-proxy-box", { - 启用反向代理 + 启用源站
@@ -14990,11 +15061,11 @@ Vue.component("keyword", { word = word.replace(/\+/g, "\\+") word = word.replace(/\^/g, "\\^") word = word.replace(/\$/g, "\\$") - word = word.replace(/\?/, "\\?") - word = word.replace(/\*/, "\\*") - word = word.replace(/\[/, "\\[") - word = word.replace(/{/, "\\{") - word = word.replace(/\./, "\\.") + word = word.replace(/\?/g, "\\?") + word = word.replace(/\*/g, "\\*") + word = word.replace(/\[/g, "\\[") + word = word.replace(/{/g, "\\{") + word = word.replace(/\./g, "\\.") } let slot = this.$slots["default"][0] diff --git a/web/public/js/components/server/http-referers-config-box.js b/web/public/js/components/server/http-referers-config-box.js index d1ba32f5..65f6c488 100644 --- a/web/public/js/components/server/http-referers-config-box.js +++ b/web/public/js/components/server/http-referers-config-box.js @@ -43,10 +43,10 @@ Vue.component("http-referers-config-box", { - 来源域名允许为空 + 允许直接访问网站 -

允许不带来源的访问,用户第一次访问网站时来源域名通常为空。

+

允许用户直接访问网站,用户第一次访问网站时来源域名通常为空。

@@ -60,7 +60,7 @@ Vue.component("http-referers-config-box", { 允许的来源域名 -

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

+

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