diff --git a/web/public/js/components.js b/web/public/js/components.js index 686fa75e..db13ce90 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -1107,8 +1107,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
-`}),Vue.component("http-request-conds-view",{props:["v-conds"],data:function(){let e=this.vConds,t=(null==e&&(e={isOn:!0,connector:"or",groups:[]}),this);return e.groups.forEach(function(e){e.conds.forEach(function(e){e.typeName=t.typeName(e)})}),{initConds:e,version:0}},computed:{conds:function(){return this.initConds}},methods:{typeName:function(i){var e=window.REQUEST_COND_COMPONENTS.$find(function(e,t){return t.type==i.type});return null!=e?e.name:i.param+" "+i.operator},notifyChange:function(){this.version++;let t=this;this.initConds.groups.forEach(function(e){e.conds.forEach(function(e){e.typeName=t.typeName(e)})})}},template:`
- {{version}} +
`}),Vue.component("http-request-conds-view",{props:["v-conds"],data:function(){let e=this.vConds,t=(null==e&&(e={isOn:!0,connector:"or",groups:[]}),this);return e.groups.forEach(function(e){e.conds.forEach(function(e){e.typeName=t.typeName(e)})}),{initConds:e}},computed:{conds:function(){return this.initConds}},methods:{typeName:function(i){var e=window.REQUEST_COND_COMPONENTS.$find(function(e,t){return t.type==i.type});return null!=e?e.name:i.param+" "+i.operator},updateConds:function(e){this.initConds=e},notifyChange:function(){let t=this;this.initConds.groups.forEach(function(e){e.conds.forEach(function(e){e.typeName=t.typeName(e)})}),this.$forceUpdate()}},template:`
@@ -1331,7 +1330,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 分表{{p.code+1}}     |
-
`}),Vue.component("http-cache-refs-config-box",{props:["v-cache-refs","v-cache-config","v-cache-policy-id","v-web-id"],mounted:function(){let s=this;sortTable(function(e){let i=[];e.forEach(function(t){s.refs.forEach(function(e){e.id==t&&i.push(e)})}),s.updateRefs(i),s.change()})},data:function(){let e=this.vCacheRefs,t=(null==e&&(e=[]),0);return e.forEach(function(e){t++,e.id=t}),{refs:e,id:t}},methods:{addRef:function(e){window.UPDATING_CACHE_REF=null;let t=window.innerWidth,i=(1024 +
`}),Vue.component("http-cache-refs-config-box",{props:["v-cache-refs","v-cache-config","v-cache-policy-id","v-web-id"],mounted:function(){let s=this;sortTable(function(e){let i=[];e.forEach(function(t){s.refs.forEach(function(e){e.id==t&&i.push(e)})}),s.updateRefs(i),s.change()})},data:function(){let e=this.vCacheRefs,t=(null==e&&(e=[]),0);return e.forEach(function(e){t++,e.id=t}),{refs:e,id:t}},methods:{addRef:function(e){window.UPDATING_CACHE_REF=null;let t=window.innerWidth,i=(1024
@@ -2025,16 +2024,19 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio -
`}),Vue.component("uam-config-box",{props:["v-uam-config"],data:function(){let e=this.vUamConfig;return{config:e=null==e?{isOn:!1}:e}},template:`
+
`}),Vue.component("uam-config-box",{props:["v-uam-config","v-is-location","v-is-group"],data:function(){let e=this.vUamConfig;return{config:e=null==e?{isPrior:!1,isOn:!1}:e}},template:`
- - - - + + + + + + +
启用5秒盾 - -

启用后,访问网站时,自动检查浏览器环境,阻止非正常访问。

-
启用5秒盾 + +

启用后,访问网站时,自动检查浏览器环境,阻止非正常访问。

+
`}),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),s=(null==i&&(i={isPrior:!1,isOn:!0,headerPolicyId:0}),[]),n=[];var o=this.vRequestHeaderPolicy;null!=o&&(null!=o.setHeaders&&(s=o.setHeaders),null!=o.deleteHeaders&&(n=o.deleteHeaders));let a=[],l=[];o=this.vResponseHeaderPolicy;return null!=o&&(null!=o.setHeaders&&(a=o.setHeaders),null!=o.deleteHeaders&&(l=o.deleteHeaders)),{type:e,typeName:"request"==e?"请求":"响应",requestHeaderRef:t,responseHeaderRef:i,requestSettingHeaders:s,requestDeletingHeaders:n,responseSettingHeaders:a,responseDeletingHeaders:l}},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("保存成功")}})},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()})},deleteHeader:function(e,t,i){teaweb.confirm("确定要删除此Header吗?",function(){this.$post("/servers/server/settings/headers/delete").params({headerPolicyId:e,type:t,headerId:i}).refresh()})}},template:`
@@ -2725,8 +2727,8 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio
`}),Vue.component("ssl-certs-view",{props:["v-certs"],data:function(){let e=this.vCerts;return{certs:e=null==e?[]:e}},methods:{formatTime:function(e){return new Date(1e3*e).format("Y-m-d")},viewCert:function(e){teaweb.popup("/servers/certs/certPopup?certId="+e,{height:"28em",width:"48em"})}},template:`
-
- {{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}   +
+ {{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}  
`}),Vue.component("reverse-proxy-box",{props:["v-reverse-proxy-ref","v-reverse-proxy-config","v-is-location","v-is-group","v-family"],data:function(){let e=this.vReverseProxyRef,t=(null==e&&(e={isPrior:!1,isOn:!1,reverseProxyId:0}),this.vReverseProxyConfig),i=(null==(t=null==t?{requestPath:"",stripPrefix:"",requestURI:"",requestHost:"",requestHostType:0,addHeaders:[],connTimeout:{count:0,unit:"second"},readTimeout:{count:0,unit:"second"},idleTimeout:{count:0,unit:"second"},maxConns:0,maxIdleConns:0,followRedirects:!1}:t).addHeaders&&(t.addHeaders=[]),null==t.connTimeout&&(t.connTimeout={count:0,unit:"second"}),null==t.readTimeout&&(t.readTimeout={count:0,unit:"second"}),null==t.idleTimeout&&(t.idleTimeout={count:0,unit:"second"}),null==t.proxyProtocol&&Vue.set(t,"proxyProtocol",{isOn:!1,version:1}),[{name:"X-Real-IP",isChecked:!1},{name:"X-Forwarded-For",isChecked:!1},{name:"X-Forwarded-By",isChecked:!1},{name:"X-Forwarded-Host",isChecked:!1},{name:"X-Forwarded-Proto",isChecked:!1}]);return i.forEach(function(e){e.isChecked=t.addHeaders.$contains(e.name)}),{reverseProxyRef:e,reverseProxyConfig:t,advancedVisible:!1,family:this.vFamily,forwardHeaders:i}},watch:{"reverseProxyConfig.requestHostType":function(e){let t=parseInt(e);isNaN(t)&&(t=0),this.reverseProxyConfig.requestHostType=t},"reverseProxyConfig.connTimeout.count":function(e){let t=parseInt(e);(isNaN(t)||t<0)&&(t=0),this.reverseProxyConfig.connTimeout.count=t},"reverseProxyConfig.readTimeout.count":function(e){let t=parseInt(e);(isNaN(t)||t<0)&&(t=0),this.reverseProxyConfig.readTimeout.count=t},"reverseProxyConfig.idleTimeout.count":function(e){let t=parseInt(e);(isNaN(t)||t<0)&&(t=0),this.reverseProxyConfig.idleTimeout.count=t},"reverseProxyConfig.maxConns":function(e){let t=parseInt(e);(isNaN(t)||t<0)&&(t=0),this.reverseProxyConfig.maxConns=t},"reverseProxyConfig.maxIdleConns":function(e){let t=parseInt(e);(isNaN(t)||t<0)&&(t=0),this.reverseProxyConfig.maxIdleConns=t},"reverseProxyConfig.proxyProtocol.version":function(e){let t=parseInt(e);isNaN(t)&&(t=1),this.reverseProxyConfig.proxyProtocol.version=t}},methods:{isOn:function(){return(!this.vIsLocation&&!this.vIsGroup||this.reverseProxyRef.isPrior)&&this.reverseProxyRef.isOn},changeAdvancedVisible:function(e){this.advancedVisible=e},changeAddHeader:function(){this.reverseProxyConfig.addHeaders=this.forwardHeaders.filter(function(e){return e.isChecked}).map(function(e){return e.name})}},template:`
diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js index 82bb0115..cbee772c 100755 --- a/web/public/js/components.src.js +++ b/web/public/js/components.src.js @@ -3255,8 +3255,7 @@ Vue.component("http-request-conds-view", { }) return { - initConds: conds, - version: 0 // 为了让组件能及时更新加入此变量 + initConds: conds } }, computed: { @@ -3275,18 +3274,20 @@ Vue.component("http-request-conds-view", { } return cond.param + " " + cond.operator }, + updateConds: function (conds) { + this.initConds = conds + }, notifyChange: function () { - this.version++ let that = this this.initConds.groups.forEach(function (group) { group.conds.forEach(function (cond) { cond.typeName = that.typeName(cond) }) }) + this.$forceUpdate() } }, template: `
- {{version}}
@@ -4386,6 +4387,8 @@ Vue.component("http-cache-refs-config-box", { resp.data.cacheRef.id = that.refs[index].id Vue.set(that.refs, index, resp.data.cacheRef) that.change() + that.$refs.cacheRef[index].updateConds(resp.data.cacheRef.conds) + that.$refs.cacheRef[index].notifyChange() } }) }, @@ -4428,6 +4431,8 @@ Vue.component("http-cache-refs-config-box", { return unit }, change: function () { + this.$forceUpdate() + // 自动保存 if (this.vCachePolicyId != null && this.vCachePolicyId > 0) { // 缓存策略 Tea.action("/servers/components/cache/updateRefs") @@ -6249,11 +6254,12 @@ Vue.component("user-selector", { // UAM模式配置 Vue.component("uam-config-box", { - props: ["v-uam-config"], + props: ["v-uam-config", "v-is-location", "v-is-group"], data: function () { let config = this.vUamConfig if (config == null) { config = { + isPrior: false, isOn: false } } @@ -6264,13 +6270,16 @@ Vue.component("uam-config-box", { template: `
- - - - + + + + + + +
启用5秒盾 - -

启用后,访问网站时,自动检查浏览器环境,阻止非正常访问。

-
启用5秒盾 + +

启用后,访问网站时,自动检查浏览器环境,阻止非正常访问。

+
` @@ -7809,8 +7818,8 @@ Vue.component("ssl-certs-view", { }, template: `
-
- {{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}   +
+ {{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}  
` diff --git a/web/public/js/components/server/http-cache-refs-config-box.js b/web/public/js/components/server/http-cache-refs-config-box.js index 03e11652..a982f3b3 100644 --- a/web/public/js/components/server/http-cache-refs-config-box.js +++ b/web/public/js/components/server/http-cache-refs-config-box.js @@ -98,6 +98,8 @@ Vue.component("http-cache-refs-config-box", { resp.data.cacheRef.id = that.refs[index].id Vue.set(that.refs, index, resp.data.cacheRef) that.change() + that.$refs.cacheRef[index].updateConds(resp.data.cacheRef.conds) + that.$refs.cacheRef[index].notifyChange() } }) }, @@ -140,6 +142,8 @@ Vue.component("http-cache-refs-config-box", { return unit }, change: function () { + this.$forceUpdate() + // 自动保存 if (this.vCachePolicyId != null && this.vCachePolicyId > 0) { // 缓存策略 Tea.action("/servers/components/cache/updateRefs") diff --git a/web/public/js/components/server/http-request-conds-view.js b/web/public/js/components/server/http-request-conds-view.js index cc86c6c7..d3c362b7 100644 --- a/web/public/js/components/server/http-request-conds-view.js +++ b/web/public/js/components/server/http-request-conds-view.js @@ -19,8 +19,7 @@ Vue.component("http-request-conds-view", { }) return { - initConds: conds, - version: 0 // 为了让组件能及时更新加入此变量 + initConds: conds } }, computed: { @@ -39,18 +38,20 @@ Vue.component("http-request-conds-view", { } return cond.param + " " + cond.operator }, + updateConds: function (conds) { + this.initConds = conds + }, notifyChange: function () { - this.version++ let that = this this.initConds.groups.forEach(function (group) { group.conds.forEach(function (cond) { cond.typeName = that.typeName(cond) }) }) + this.$forceUpdate() } }, template: `
- {{version}}
diff --git a/web/public/js/components/server/ssl-certs-view.js b/web/public/js/components/server/ssl-certs-view.js index 87e33427..562ab8f3 100644 --- a/web/public/js/components/server/ssl-certs-view.js +++ b/web/public/js/components/server/ssl-certs-view.js @@ -25,8 +25,8 @@ Vue.component("ssl-certs-view", { }, template: `
-
- {{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}   +
+ {{cert.name}} / {{cert.dnsNames}} / 有效至{{formatTime(cert.timeEndAt)}}  
`