diff --git a/web/public/js/components.js b/web/public/js/components.js index 89e8e5c5..a35b327e 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -2330,14 +2330,14 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 允许的来源域名 -

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

+

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

禁止的来源域名 -

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

+

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

@@ -2442,6 +2442,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 证书 主机名: {{origin.host}} 端口跟随 + HTTP/2 匹配: {{domain}} 匹配: 所有域名 @@ -2465,7 +2466,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 启用CORS自适应跨域 -

启用后,自动在响应Header中增加对应的Access-Control-*相关内容。

+

启用后,自动在响应报头中增加对应的Access-Control-*相关内容。

@@ -2493,10 +2494,10 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio - 允许服务器暴露的Header + 允许服务器暴露的报头 -

Access-Control-Expose-Headers值设置。允许服务器暴露的Header,请注意Header的大小写。

+

Access-Control-Expose-Headers值设置。允许服务器暴露的报头,请注意报头的大小写。

@@ -2557,8 +2558,8 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 允许的来源域列表(Origin)
-
- {{origin}} +
+ {{origin}}
@@ -2798,6 +2799,16 @@ example2.com
+
`}),Vue.component("http-firewall-province-selector",{props:["v-type","v-provinces"],data:function(){let e=this.vProvinces;return null==e&&(e=[]),{listType:this.vType,provinces:e}},methods:{addProvince:function(){let e=this.provinces.map(function(e){return e.id}),t=this;teaweb.popup("/servers/server/settings/waf/ipadmin/selectProvincesPopup?type="+this.listType+"&selectedProvinceIds="+e.join(","),{width:"50em",height:"26em",callback:function(e){t.provinces=e.data.selectedProvinces,t.$forceUpdate(),t.notifyChange()}})},removeProvince:function(e){this.provinces.$remove(e),this.notifyChange()},resetProvinces:function(){this.provinces=[],this.notifyChange()},notifyChange:function(){this.$emit("change",{provinces:this.provinces})}},template:`
+ 暂时没有选择允许封禁的省份。 +
+
+ + {{province.name}} +
+
+
+  
`}),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:[],checkOrigin:!0}: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){"object"==typeof e&&(this.config.allowDomains=e,this.$forceUpdate())},changeDenyDomains:function(e){"object"==typeof e&&(this.config.denyDomains=e,this.$forceUpdate())}},template:`
@@ -2950,14 +2961,14 @@ example2.com
-`}),Vue.component("http-firewall-actions-box",{props:["v-actions","v-firewall-policy","v-action-configs"],mounted:function(){let o=this;Tea.action("/servers/iplists/levelOptions").success(function(e){o.ipListLevels=e.data.levels}).post(),this.loadJS(function(){let s=document.getElementById("actions-box");Sortable.create(s,{draggable:".label",handle:".icon.handle",onStart:function(){o.cancel()},onUpdate:function(e){let t=s.getElementsByClassName("label"),i=[];for(let e=0;e +`}),Vue.component("http-firewall-actions-box",{props:["v-actions","v-firewall-policy","v-action-configs","v-group-type"],mounted:function(){let o=this;Tea.action("/servers/iplists/levelOptions").success(function(e){o.ipListLevels=e.data.levels}).post(),this.loadJS(function(){let s=document.getElementById("actions-box");Sortable.create(s,{draggable:".label",handle:".icon.handle",onStart:function(){o.cancel()},onUpdate:function(e){let t=s.getElementsByClassName("label"),i=[];for(let e=0;e 403 Forbidden

403 Forbidden

Request ID: \${requestId}.
-`;return{id:t,actions:this.vActions,configs:e,isAdding:!1,editingIndex:-1,action:null,actionCode:"",actionOptions:{},ipListLevels:[],blockTimeout:"",blockTimeoutMax:"",blockScope:"global",captchaLife:"",captchaMaxFails:"",captchaFailBlockTimeout:"",get302Life:"",post307Life:"",recordIPType:"black",recordIPLevel:"critical",recordIPTimeout:"",recordIPListId:0,recordIPListName:"",tagTags:[],pageStatus:403,pageBody:i,defaultPageBody:i,redirectStatus:307,redirectURL:"",goGroupName:"",goGroupId:0,goGroup:null,goSetId:0,goSetName:"",jsCookieLife:"",jsCookieMaxFails:"",jsCookieFailBlockTimeout:"",statusOptions:[{code:301,text:"Moved Permanently"},{code:308,text:"Permanent Redirect"},{code:302,text:"Found"},{code:303,text:"See Other"},{code:307,text:"Temporary Redirect"}]}},watch:{actionCode:function(i){this.action=this.actions.$find(function(e,t){return t.code==i}),this.actionOptions={}},blockTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.timeout=0:this.actionOptions.timeout=e},blockTimeoutMax:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.timeoutMax=0:this.actionOptions.timeoutMax=e},blockScope:function(e){this.actionOptions.scope=e},captchaLife:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},captchaMaxFails:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.maxFails=0:this.actionOptions.maxFails=e},captchaFailBlockTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.failBlockTimeout=0:this.actionOptions.failBlockTimeout=e},get302Life:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},post307Life:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},recordIPType:function(e){this.recordIPListId=0},recordIPTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.timeout=0:this.actionOptions.timeout=e},goGroupId:function(i){var e=this.vFirewallPolicy.inbound.groups.$find(function(e,t){return t.id==i});this.goGroup=e,this.goGroupName=null==e?"":e.name,this.goSetId=0,this.goSetName=""},goSetId:function(i){var e;null!=this.goGroup&&(null==(e=this.goGroup.sets.$find(function(e,t){return t.id==i}))?(this.goSetId=0,this.goSetName=""):this.goSetName=e.name)},jsCookieLife:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},jsCookieMaxFails:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.maxFails=0:this.actionOptions.maxFails=e},jsCookieFailBlockTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.failBlockTimeout=0:this.actionOptions.failBlockTimeout=e}},methods:{add:function(){this.action=null,this.actionCode="block",this.isAdding=!0,this.actionOptions={},this.blockTimeout="",this.blockTimeoutMax="",this.blockScope="global",this.captchaLife="",this.captchaMaxFails="",this.captchaFailBlockTimeout="",this.jsCookieLife="",this.jsCookieMaxFails="",this.jsCookieFailBlockTimeout="",this.get302Life="",this.post307Life="",this.recordIPLevel="critical",this.recordIPType="black",this.recordIPTimeout="",this.recordIPListId=0,this.recordIPListName="",this.tagTags=[],this.pageStatus=403,this.pageBody=this.defaultPageBody,this.redirectStatus=307,this.redirectURL="",this.goGroupName="",this.goGroupId=0,this.goGroup=null,this.goSetId=0,this.goSetName="";let i=this;this.action=this.vActions.$find(function(e,t){return t.code==i.actionCode}),this.scroll()},remove:function(e){this.isAdding=!1,this.editingIndex=-1,this.configs.$remove(e)},update:function(e,i){if(this.isAdding&&this.editingIndex==e)this.cancel();else{switch(this.add(),this.isAdding=!0,this.editingIndex=e,this.actionCode=i.code,i.code){case"block":this.blockTimeout="",this.blockTimeoutMax="",(null!=i.options.timeout||0 +`;return{id:t,actions:this.vActions,configs:e,isAdding:!1,editingIndex:-1,action:null,actionCode:"",actionOptions:{},ipListLevels:[],blockTimeout:"",blockTimeoutMax:"",blockScope:"global",captchaLife:"",captchaMaxFails:"",captchaFailBlockTimeout:"",get302Life:"",post307Life:"",recordIPType:"black",recordIPLevel:"critical",recordIPTimeout:"",recordIPListId:0,recordIPListName:"",tagTags:[],pageStatus:403,pageBody:i,defaultPageBody:i,redirectStatus:307,redirectURL:"",goGroupName:"",goGroupId:0,goGroup:null,goSetId:0,goSetName:"",jsCookieLife:"",jsCookieMaxFails:"",jsCookieFailBlockTimeout:"",statusOptions:[{code:301,text:"Moved Permanently"},{code:308,text:"Permanent Redirect"},{code:302,text:"Found"},{code:303,text:"See Other"},{code:307,text:"Temporary Redirect"}]}},watch:{actionCode:function(i){this.action=this.actions.$find(function(e,t){return t.code==i}),this.actionOptions={}},blockTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.timeout=0:this.actionOptions.timeout=e},blockTimeoutMax:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.timeoutMax=0:this.actionOptions.timeoutMax=e},blockScope:function(e){this.actionOptions.scope=e},captchaLife:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},captchaMaxFails:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.maxFails=0:this.actionOptions.maxFails=e},captchaFailBlockTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.failBlockTimeout=0:this.actionOptions.failBlockTimeout=e},get302Life:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},post307Life:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},recordIPType:function(e){this.recordIPListId=0},recordIPTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.timeout=0:this.actionOptions.timeout=e},goGroupId:function(i){let e=this.vFirewallPolicy.inbound.groups.$find(function(e,t){return t.id==i});null==(this.goGroup=e)?null==(e=this.vFirewallPolicy.outbound.groups.$find(function(e,t){return t.id==i}))?this.goGroupName="":(this.goGroup=e,this.goGroupName=e.name):this.goGroupName=e.name,this.goSetId=0,this.goSetName=""},goSetId:function(i){var e;null!=this.goGroup&&(null==(e=this.goGroup.sets.$find(function(e,t){return t.id==i}))?(this.goSetId=0,this.goSetName=""):this.goSetName=e.name)},jsCookieLife:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.life=0:this.actionOptions.life=e},jsCookieMaxFails:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.maxFails=0:this.actionOptions.maxFails=e},jsCookieFailBlockTimeout:function(e){e=parseInt(e),isNaN(e)?this.actionOptions.failBlockTimeout=0:this.actionOptions.failBlockTimeout=e}},methods:{add:function(){this.action=null,this.actionCode="block",this.isAdding=!0,this.actionOptions={},this.blockTimeout="",this.blockTimeoutMax="",this.blockScope="global",this.captchaLife="",this.captchaMaxFails="",this.captchaFailBlockTimeout="",this.jsCookieLife="",this.jsCookieMaxFails="",this.jsCookieFailBlockTimeout="",this.get302Life="",this.post307Life="",this.recordIPLevel="critical",this.recordIPType="black",this.recordIPTimeout="",this.recordIPListId=0,this.recordIPListName="",this.tagTags=[],this.pageStatus=403,this.pageBody=this.defaultPageBody,this.redirectStatus=307,this.redirectURL="",this.goGroupName="",this.goGroupId=0,this.goGroup=null,this.goSetId=0,this.goSetName="";let i=this;this.action=this.vActions.$find(function(e,t){return t.code==i.actionCode}),this.scroll()},remove:function(e){this.isAdding=!1,this.editingIndex=-1,this.configs.$remove(e)},update:function(e,i){if(this.isAdding&&this.editingIndex==e)this.cancel();else{switch(this.add(),this.isAdding=!0,this.editingIndex=e,this.actionCode=i.code,i.code){case"block":this.blockTimeout="",this.blockTimeoutMax="",(null!=i.options.timeout||0
@@ -3003,8 +3014,8 @@ example2.com   - [所有服务] - [当前服务] + [所有网站] + [当前网站] @@ -3029,8 +3040,8 @@ example2.com 封禁范围

只封禁用户对当前网站的访问,其他服务不受影响。

封禁用户对所有网站的访问。

@@ -3223,7 +3234,8 @@ example2.com @@ -3234,7 +3246,8 @@ example2.com @@ -3322,10 +3335,10 @@ example2.com
`}),Vue.component("user-selector",{props:["v-user-id","data-url"],data:function(){let e=this.vUserId,t=(null==e&&(e=0),this.dataUrl);return null!=t&&0!=t.length||(t="/servers/users/options"),{users:[],userId:e,dataURL:t}},methods:{change:function(e){null!=e?this.$emit("change",e.id):this.$emit("change",0)},clear:function(){this.$refs.comboBox.clear()}},template:`
-
`}),Vue.component("http-header-policy-box",{props:["v-request-header-policy","v-request-header-ref","v-response-header-policy","v-response-header-ref","v-params","v-is-location","v-is-group","v-has-group-request-config","v-has-group-response-config","v-group-setting-url"],data:function(){let e="response";"#request"==window.location.hash&&(e="request");let t=this.vRequestHeaderRef,i=(null==t&&(t={isPrior:!1,isOn:!0,headerPolicyId:0}),this.vResponseHeaderRef),n=(null==i&&(i={isPrior:!1,isOn:!0,headerPolicyId:0}),[]),s=[],o=[];var a=this.vRequestHeaderPolicy;null!=a&&(null!=a.setHeaders&&(n=a.setHeaders),null!=a.deleteHeaders&&(s=a.deleteHeaders),null!=a.nonStandardHeaders&&(o=a.nonStandardHeaders));let l=[],c=[],r=[];a=this.vResponseHeaderPolicy;null!=a&&(null!=a.setHeaders&&(l=a.setHeaders),null!=a.deleteHeaders&&(c=a.deleteHeaders),null!=a.nonStandardHeaders&&(r=a.nonStandardHeaders));let d={isOn:!1};return null!=a.cors&&(d=a.cors),{type:e,typeName:"request"==e?"请求":"响应",requestHeaderRef:t,responseHeaderRef:i,requestSettingHeaders:n,requestDeletingHeaders:s,requestNonStandardHeaders:o,responseSettingHeaders:l,responseDeletingHeaders:c,responseNonStandardHeaders:r,responseCORS:d}},methods:{selectType:function(e){this.type=e,window.location.hash="#"+e,window.location.reload()},addSettingHeader:function(e){teaweb.popup("/servers/server/settings/headers/createSetPopup?"+this.vParams+"&headerPolicyId="+e+"&type="+this.type,{callback:function(){teaweb.successRefresh("保存成功")}})},addDeletingHeader:function(e,t){teaweb.popup("/servers/server/settings/headers/createDeletePopup?"+this.vParams+"&headerPolicyId="+e+"&type="+t,{callback:function(){teaweb.successRefresh("保存成功")}})},addNonStandardHeader:function(e,t){teaweb.popup("/servers/server/settings/headers/createNonStandardPopup?"+this.vParams+"&headerPolicyId="+e+"&type="+t,{callback:function(){teaweb.successRefresh("保存成功")}})},updateSettingPopup:function(e,t){teaweb.popup("/servers/server/settings/headers/updateSetPopup?"+this.vParams+"&headerPolicyId="+e+"&headerId="+t+"&type="+this.type,{callback:function(){teaweb.successRefresh("保存成功")}})},deleteDeletingHeader:function(e,t){teaweb.confirm("确定要删除'"+t+"'吗?",function(){Tea.action("/servers/server/settings/headers/deleteDeletingHeader").params({headerPolicyId:e,headerName:t}).post().refresh()})},deleteNonStandardHeader:function(e,t){teaweb.confirm("确定要删除'"+t+"'吗?",function(){Tea.action("/servers/server/settings/headers/deleteNonStandardHeader").params({headerPolicyId:e,headerName:t}).post().refresh()})},deleteHeader:function(e,t,i){teaweb.confirm("确定要删除此Header吗?",function(){this.$post("/servers/server/settings/headers/delete").params({headerPolicyId:e,type:t,headerId:i}).refresh()})},updateCORS:function(e){teaweb.popup("/servers/server/settings/headers/updateCORSPopup?"+this.vParams+"&headerPolicyId="+e+"&type="+this.type,{height:"30em",callback:function(){teaweb.successRefresh("保存成功")}})}},template:`
+
`}),Vue.component("http-header-policy-box",{props:["v-request-header-policy","v-request-header-ref","v-response-header-policy","v-response-header-ref","v-params","v-is-location","v-is-group","v-has-group-request-config","v-has-group-response-config","v-group-setting-url"],data:function(){let e="response";"#request"==window.location.hash&&(e="request");let t=this.vRequestHeaderRef,i=(null==t&&(t={isPrior:!1,isOn:!0,headerPolicyId:0}),this.vResponseHeaderRef),n=(null==i&&(i={isPrior:!1,isOn:!0,headerPolicyId:0}),[]),s=[],o=[];var a=this.vRequestHeaderPolicy;null!=a&&(null!=a.setHeaders&&(n=a.setHeaders),null!=a.deleteHeaders&&(s=a.deleteHeaders),null!=a.nonStandardHeaders&&(o=a.nonStandardHeaders));let l=[],c=[],r=[];a=this.vResponseHeaderPolicy;null!=a&&(null!=a.setHeaders&&(l=a.setHeaders),null!=a.deleteHeaders&&(c=a.deleteHeaders),null!=a.nonStandardHeaders&&(r=a.nonStandardHeaders));let d={isOn:!1};return null!=a.cors&&(d=a.cors),{type:e,typeName:"request"==e?"请求":"响应",requestHeaderRef:t,responseHeaderRef:i,requestSettingHeaders:n,requestDeletingHeaders:s,requestNonStandardHeaders:o,responseSettingHeaders:l,responseDeletingHeaders:c,responseNonStandardHeaders:r,responseCORS:d}},methods:{selectType:function(e){this.type=e,window.location.hash="#"+e,window.location.reload()},addSettingHeader:function(e){teaweb.popup("/servers/server/settings/headers/createSetPopup?"+this.vParams+"&headerPolicyId="+e+"&type="+this.type,{callback:function(){teaweb.successRefresh("保存成功")}})},addDeletingHeader:function(e,t){teaweb.popup("/servers/server/settings/headers/createDeletePopup?"+this.vParams+"&headerPolicyId="+e+"&type="+t,{callback:function(){teaweb.successRefresh("保存成功")}})},addNonStandardHeader:function(e,t){teaweb.popup("/servers/server/settings/headers/createNonStandardPopup?"+this.vParams+"&headerPolicyId="+e+"&type="+t,{callback:function(){teaweb.successRefresh("保存成功")}})},updateSettingPopup:function(e,t){teaweb.popup("/servers/server/settings/headers/updateSetPopup?"+this.vParams+"&headerPolicyId="+e+"&headerId="+t+"&type="+this.type,{callback:function(){teaweb.successRefresh("保存成功")}})},deleteDeletingHeader:function(e,t){teaweb.confirm("确定要删除'"+t+"'吗?",function(){Tea.action("/servers/server/settings/headers/deleteDeletingHeader").params({headerPolicyId:e,headerName:t}).post().refresh()})},deleteNonStandardHeader:function(e,t){teaweb.confirm("确定要删除'"+t+"'吗?",function(){Tea.action("/servers/server/settings/headers/deleteNonStandardHeader").params({headerPolicyId:e,headerName:t}).post().refresh()})},deleteHeader:function(e,t,i){teaweb.confirm("确定要删除此报头吗?",function(){this.$post("/servers/server/settings/headers/delete").params({headerPolicyId:e,type:t,headerId:i}).refresh()})},updateCORS:function(e){teaweb.popup("/servers/server/settings/headers/updateCORSPopup?"+this.vParams+"&headerPolicyId="+e+"&type="+this.type,{height:"30em",callback:function(){teaweb.successRefresh("保存成功")}})}},template:`
@@ -3347,8 +3360,8 @@ example2.com 由于已经在当前网站分组中进行了对应的配置,在这里的配置将不会生效。
-

设置请求Header   [添加新Header]

-

暂时还没有Header。

+

设置请求报头   [添加新报头]

+

暂时还没有自定义报头。

@@ -3360,7 +3373,7 @@ example2.com
- {{header.name}} + {{header.name}}
{{code}} {{method}} @@ -3381,7 +3394,7 @@ example2.com - + - + @@ -7105,6 +7105,7 @@ Vue.component("origin-list-table", { 证书主机名: {{origin.host}}端口跟随 + HTTP/2匹配: {{domain}}匹配: 所有域名 @@ -7191,7 +7192,7 @@ Vue.component("http-cors-header-config-box", { @@ -7219,10 +7220,10 @@ Vue.component("http-cors-header-config-box", { - + @@ -7403,8 +7404,8 @@ Vue.component("http-websocket-box", { @@ -9253,7 +9327,8 @@ Vue.component("http-firewall-actions-box", { @@ -9597,7 +9672,7 @@ Vue.component("http-header-policy-box", { }) }, deleteHeader: function (policyId, type, headerId) { - teaweb.confirm("确定要删除此Header吗?", function () { + teaweb.confirm("确定要删除此报头吗?", function () { this.$post("/servers/server/settings/headers/delete") .params({ headerPolicyId: policyId, @@ -9619,8 +9694,8 @@ Vue.component("http-header-policy-box", { }, template: `
@@ -9642,8 +9717,8 @@ Vue.component("http-header-policy-box", { 由于已经在当前网站分组中进行了对应的配置,在这里的配置将不会生效。
-

设置请求Header   [添加新Header]

-

暂时还没有Header。

+

设置请求报头   [添加新报头]

+

暂时还没有自定义报头。

删除Header 删除报头
{{headerName}}
@@ -3391,7 +3404,7 @@ example2.com
非标Header 非标报头
{{headerName}}
@@ -3420,9 +3433,9 @@ example2.com 由于已经在当前网站分组中进行了对应的配置,在这里的配置将不会生效。
-

设置响应Header   [添加新Header]

-

将会覆盖已有的同名Header。

-

暂时还没有Header。

+

设置响应报头   [添加新报头]

+

将会覆盖已有的同名报头。

+

暂时还没有自定义报头。

@@ -3434,7 +3447,7 @@ example2.com @@ -3460,7 +3473,7 @@ example2.com
- {{header.name}} + {{header.name}}
{{code}} {{method}} @@ -3446,7 +3459,7 @@ example2.com
- 建议使用当前页面下方的"CORS自适应跨域"功能代替Access-Control-*-*相关Header。 + 建议使用当前页面下方的"CORS自适应跨域"功能代替Access-Control-*-*相关报头。
{{header.value}}
- + - + @@ -3554,18 +3567,19 @@ example2.com - + - + - + - +
删除Header 删除报头
{{headerName}}  
@@ -3470,7 +3483,7 @@ example2.com
非标Header 非标报头
{{headerName}}  
@@ -3483,7 +3496,7 @@ example2.com
CORS自适应跨域 已启用未启用   [修改] -

启用后,服务器可以服务器会自动生成Access-Control-*-*相关的Header。

+

启用后,服务器可以服务器会自动生成Access-Control-*-*相关的报头。

开启临时关闭网站
+

选中后,表示临时关闭当前网站,并显示自定义内容。

内容类型 *显示内容类型 *
页面URL *显示页面URL * - -

页面文件是相对于节点安装目录的页面文件比如pages/40x.html,或者一个完整的URL。

+ +

将从此URL中读取内容。

HTML *显示页面HTML *

[使用模板]。填写页面的HTML内容,支持请求变量。

@@ -3884,7 +3898,7 @@ example2.com - 耗时:{{formatCost(accessLog.requestTime)}} ms   ({{accessLog.humanTime}})   -`});var punycode=new function(){this.utf16={decode:function(e){for(var t,i,n=[],s=0,o=e.length;s>>10&1023|55296)),t=56320|1023&t),i.push(String.fromCharCode(t))}return i.join("")}};var b=2147483647;function y(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function x(e,t,i){var n;for(e=i?Math.floor(e/700):e>>1,e+=Math.floor(e/t),n=0;455= 0x80");d.push(e.charCodeAt(n))}for(s=0Math.floor((b-v)/a))throw RangeError("punycode_overflow(1)");if(v+=r*a,r<(r=l<=m?1:m+26<=l?26:l-m))break;if(a>Math.floor(b/(36-r)))throw RangeError("punycode_overflow(2)");a*=36-r}if(m=x(v-o,i=d.length+1,0===o),Math.floor(v/i)>b-h)throw RangeError("punycode_overflow(3)");h+=Math.floor(v/i),v%=i,t&&p.splice(v,0,e.charCodeAt(s-1)-65<26),d.splice(v,0,h),v++}if(t)for(v=0,c=d.length;vMath.floor((b-m)/(i+1)))throw RangeError("punycode_overflow (1)");for(m+=(s-v)*(i+1),v=s,g=0;gb)return Error("punycode_overflow(2)");if(c==v){for(o=m,a=36;!(o<(l=a<=f?1:f+26<=a?26:a-f));a+=36)h.push(String.fromCharCode(y(l+(o-l)%(36-l),0))),o=Math.floor((o-l)/(36-l));h.push(String.fromCharCode(y(o,t&&r[g]?1:0))),f=x(m,i+1,i==n),m=0,++i}}++m,++v}return h.join("")},this.ToASCII=function(e){for(var t=e.split("."),i=[],n=0;n +`});var punycode=new function(){this.utf16={decode:function(e){for(var t,i,n=[],s=0,o=e.length;s>>10&1023|55296)),t=56320|1023&t),i.push(String.fromCharCode(t))}return i.join("")}};var b=2147483647;function y(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,i){var n;for(e=i?Math.floor(e/700):e>>1,e+=Math.floor(e/t),n=0;455= 0x80");d.push(e.charCodeAt(n))}for(s=0Math.floor((b-v)/a))throw RangeError("punycode_overflow(1)");if(v+=r*a,r<(r=l<=m?1:m+26<=l?26:l-m))break;if(a>Math.floor(b/(36-r)))throw RangeError("punycode_overflow(2)");a*=36-r}if(m=w(v-o,i=d.length+1,0===o),Math.floor(v/i)>b-h)throw RangeError("punycode_overflow(3)");h+=Math.floor(v/i),v%=i,t&&p.splice(v,0,e.charCodeAt(s-1)-65<26),d.splice(v,0,h),v++}if(t)for(v=0,c=d.length;vMath.floor((b-m)/(i+1)))throw RangeError("punycode_overflow (1)");for(m+=(s-v)*(i+1),v=s,g=0;gb)return Error("punycode_overflow(2)");if(c==v){for(o=m,a=36;!(o<(l=a<=f?1:f+26<=a?26:a-f));a+=36)h.push(String.fromCharCode(y(l+(o-l)%(36-l),0))),o=Math.floor((o-l)/(36-l));h.push(String.fromCharCode(y(o,t&&r[g]?1:0))),f=w(m,i+1,i==n),m=0,++i}}++m,++v}return h.join("")},this.ToASCII=function(e){for(var t=e.split("."),i=[],n=0;n 默认设置
状态码:{{options.statusCode}} / 提示内容:[{{options.body.length}}字符][无] / 超时时间:{{options.timeout}}秒 / 最大封禁时长:{{options.timeoutMax}}秒 @@ -5355,6 +5369,16 @@ example2.com
+
`}),Vue.component("http-firewall-region-selector",{props:["v-type","v-countries"],data:function(){let e=this.vCountries;return null==e&&(e=[]),{listType:this.vType,countries:e}},methods:{addCountry:function(){let e=this.countries.map(function(e){return e.id}),t=this;teaweb.popup("/servers/server/settings/waf/ipadmin/selectCountriesPopup?type="+this.listType+"&selectedCountryIds="+e.join(","),{width:"52em",height:"30em",callback:function(e){t.countries=e.data.selectedCountries,t.$forceUpdate(),t.notifyChange()}})},removeCountry:function(e){this.countries.$remove(e),this.notifyChange()},resetCountries:function(){this.countries=[],this.notifyChange()},notifyChange:function(){this.$emit("change",{countries:this.countries})}},template:`
+ 暂时没有选择允许封禁的区域。 +
+
+ + ({{country.letter}}){{country.name}} +
+
+
+  
`}),Vue.component("admin-selector",{props:["v-admin-id"],mounted:function(){let t=this;Tea.action("/admins/options").post().success(function(e){t.admins=e.data.admins})},data:function(){let e=this.vAdminId;return{admins:[],adminId:e=null==e?0:e}},template:`
+ +
`}),Vue.component("dot",{template:''}),Vue.component("time-duration-box",{props:["name","v-name","v-value","v-count","v-unit"],mounted:function(){this.change()},data:function(){let e=this.vValue,t=("number"!=typeof(e=null==e?{count:this.vCount,unit:this.vUnit}:e).count&&(e.count=-1),"");return"string"==typeof this.name&&0
diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js index d51c4cb5..764f7249 100755 --- a/web/public/js/components.src.js +++ b/web/public/js/components.src.js @@ -6653,14 +6653,14 @@ Vue.component("http-firewall-checkpoint-referer-block", {
允许的来源域名 -

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

+

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

禁止的来源域名 -

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

+

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

启用CORS自适应跨域 -

启用后,自动在响应Header中增加对应的Access-Control-*相关内容。

+

启用后,自动在响应报头中增加对应的Access-Control-*相关内容。

允许服务器暴露的Header允许服务器暴露的报头 -

Access-Control-Expose-Headers值设置。允许服务器暴露的Header,请注意Header的大小写。

+

Access-Control-Expose-Headers值设置。允许服务器暴露的报头,请注意报头的大小写。

允许的来源域列表(Origin)
-
- {{origin}} +
+ {{origin}}
@@ -8082,6 +8083,62 @@ Vue.component("domains-box", {
` }) +Vue.component("http-firewall-province-selector", { + props: ["v-type", "v-provinces"], + data: function () { + let provinces = this.vProvinces + if (provinces == null) { + provinces = [] + } + + return { + listType: this.vType, + provinces: provinces + } + }, + methods: { + addProvince: function () { + let selectedProvinceIds = this.provinces.map(function (province) { + return province.id + }) + let that = this + teaweb.popup("/servers/server/settings/waf/ipadmin/selectProvincesPopup?type=" + this.listType + "&selectedProvinceIds=" + selectedProvinceIds.join(","), { + width: "50em", + height: "26em", + callback: function (resp) { + that.provinces = resp.data.selectedProvinces + that.$forceUpdate() + that.notifyChange() + } + }) + }, + removeProvince: function (index) { + this.provinces.$remove(index) + this.notifyChange() + }, + resetProvinces: function () { + this.provinces = [] + this.notifyChange() + }, + notifyChange: function () { + this.$emit("change", { + "provinces": this.provinces + }) + } + }, + template: `
+ 暂时没有选择允许封禁的省份。 +
+
+ + {{province.name}} +
+
+
+   +
` +}) + Vue.component("http-referers-config-box", { props: ["v-referers-config", "v-is-location", "v-is-group"], data: function () { @@ -8345,7 +8402,7 @@ Vue.component("http-redirect-to-https-box", { // 动作选择 Vue.component("http-firewall-actions-box", { - props: ["v-actions", "v-firewall-policy", "v-action-configs"], + props: ["v-actions", "v-firewall-policy", "v-action-configs", "v-group-type"], mounted: function () { let that = this Tea.action("/servers/iplists/levelOptions") @@ -8382,6 +8439,13 @@ Vue.component("http-firewall-actions-box", { this.vFirewallPolicy.inbound.groups = [] } + if (this.vFirewallPolicy.outbound == null) { + this.vFirewallPolicy.outbound = {} + } + if (this.vFirewallPolicy.outbound.groups == null) { + this.vFirewallPolicy.outbound.groups = [] + } + let id = 0 let configs = [] if (this.vActionConfigs != null) { @@ -8547,7 +8611,16 @@ Vue.component("http-firewall-actions-box", { }) this.goGroup = group if (group == null) { - this.goGroupName = "" + // search outbound groups + group = this.vFirewallPolicy.outbound.groups.$find(function (k, v) { + return v.id == groupId + }) + if (group == null) { + this.goGroupName = "" + } else { + this.goGroup = group + this.goGroupName = group.name + } } else { this.goGroupName = group.name } @@ -9022,8 +9095,8 @@ Vue.component("http-firewall-actions-box", {   - [所有服务] - [当前服务] + [所有网站] + [当前网站] @@ -9048,8 +9121,8 @@ Vue.component("http-firewall-actions-box", {
封禁范围

只封禁用户对当前网站的访问,其他服务不受影响。

封禁用户对所有网站的访问。

@@ -9242,7 +9315,8 @@ Vue.component("http-firewall-actions-box", {
@@ -9655,7 +9730,7 @@ Vue.component("http-header-policy-box", {
- {{header.name}} + {{header.name}}
{{code}} {{method}} @@ -9676,7 +9751,7 @@ Vue.component("http-header-policy-box", { - + - +
删除Header 删除报头
{{headerName}}
@@ -9686,7 +9761,7 @@ Vue.component("http-header-policy-box", {
非标Header 非标报头
{{headerName}}
@@ -9715,9 +9790,9 @@ Vue.component("http-header-policy-box", { 由于已经在当前网站分组中进行了对应的配置,在这里的配置将不会生效。
-

设置响应Header   [添加新Header]

-

将会覆盖已有的同名Header。

-

暂时还没有Header。

+

设置响应报头   [添加新报头]

+

将会覆盖已有的同名报头。

+

暂时还没有自定义报头。

@@ -9729,7 +9804,7 @@ Vue.component("http-header-policy-box", { @@ -9755,7 +9830,7 @@ Vue.component("http-header-policy-box", {
- {{header.name}} + {{header.name}}
{{code}} {{method}} @@ -9741,7 +9816,7 @@ Vue.component("http-header-policy-box", {
- 建议使用当前页面下方的"CORS自适应跨域"功能代替Access-Control-*-*相关Header。 + 建议使用当前页面下方的"CORS自适应跨域"功能代替Access-Control-*-*相关报头。
{{header.value}}
- + - + @@ -9988,18 +10063,19 @@ Vue.component("http-pages-and-shutdown-box", { - + - + - + - +
删除Header 删除报头
{{headerName}}  
@@ -9765,7 +9840,7 @@ Vue.component("http-header-policy-box", {
非标Header 非标报头
{{headerName}}  
@@ -9778,7 +9853,7 @@ Vue.component("http-header-policy-box", {
CORS自适应跨域 已启用未启用   [修改] -

启用后,服务器可以服务器会自动生成Access-Control-*-*相关的Header。

+

启用后,服务器可以服务器会自动生成Access-Control-*-*相关的报头。

开启临时关闭网站
+

选中后,表示临时关闭当前网站,并显示自定义内容。

内容类型 *显示内容类型 *
页面URL *显示页面URL * - -

页面文件是相对于节点安装目录的页面文件比如pages/40x.html,或者一个完整的URL。

+ +

将从此URL中读取内容。

HTML *显示页面HTML *

[使用模板]。填写页面的HTML内容,支持请求变量。

@@ -15030,6 +15106,62 @@ Vue.component("firewall-syn-flood-config-box", { ` }) +Vue.component("http-firewall-region-selector", { + props: ["v-type", "v-countries"], + data: function () { + let countries = this.vCountries + if (countries == null) { + countries = [] + } + + return { + listType: this.vType, + countries: countries + } + }, + methods: { + addCountry: function () { + let selectedCountryIds = this.countries.map(function (country) { + return country.id + }) + let that = this + teaweb.popup("/servers/server/settings/waf/ipadmin/selectCountriesPopup?type=" + this.listType + "&selectedCountryIds=" + selectedCountryIds.join(","), { + width: "52em", + height: "30em", + callback: function (resp) { + that.countries = resp.data.selectedCountries + that.$forceUpdate() + that.notifyChange() + } + }) + }, + removeCountry: function (index) { + this.countries.$remove(index) + this.notifyChange() + }, + resetCountries: function () { + this.countries = [] + this.notifyChange() + }, + notifyChange: function () { + this.$emit("change", { + "countries": this.countries + }) + } + }, + template: `
+ 暂时没有选择允许封禁的区域。 +
+
+ + ({{country.letter}}){{country.name}} +
+
+
+   +
` +}) + // TODO 支持关键词搜索 // TODO 改成弹窗选择 Vue.component("admin-selector", { @@ -17326,6 +17458,40 @@ Vue.component("combo-box", { ` }) +Vue.component("search-box", { + props: ["placeholder", "width"], + data: function () { + let width = this.width + if (width == null) { + width = "10em" + } + return { + realWidth: width, + realValue: "" + } + }, + methods: { + onInput: function () { + this.$emit("input", { value: this.realValue}) + this.$emit("change", { value: this.realValue}) + }, + clearValue: function () { + this.realValue = "" + this.focus() + this.onInput() + }, + focus: function () { + this.$refs.valueRef.focus() + } + }, + template: `
+
+ + +
+
` +}) + Vue.component("dot", { template: '' })