diff --git a/internal/const/const.go b/internal/const/const.go index b4fbba8d..d5e2fe3a 100644 --- a/internal/const/const.go +++ b/internal/const/const.go @@ -1,9 +1,9 @@ package teaconst const ( - Version = "1.3.4.2" + Version = "1.3.4.3" - APINodeVersion = "1.3.4.2" + APINodeVersion = "1.3.4.3" ProductName = "Edge Admin" ProcessName = "edge-admin" diff --git a/web/public/js/components.js b/web/public/js/components.js index 2da8f4ad..185267f2 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -2400,10 +2400,10 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio - 忽略常见文件 + 忽略常用文件 -

忽略js、css、jpg等常见在网页里被引用的文件名。

+

忽略js、css、jpg等常在网页里被引用的文件名,可以减少误判几率。

@@ -2511,22 +2511,22 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio     +添加不缓存条件
-`}),Vue.component("origin-list-box",{props:["v-primary-origins","v-backup-origins","v-server-type","v-params"],data:function(){return{primaryOrigins:this.vPrimaryOrigins,backupOrigins:this.vBackupOrigins}},methods:{createPrimaryOrigin:function(){teaweb.popup("/servers/server/settings/origins/addPopup?originType=primary&"+this.vParams,{width:"45em",height:"27em",callback:function(e){teaweb.success("保存成功",function(){window.location.reload()})}})},createBackupOrigin:function(){teaweb.popup("/servers/server/settings/origins/addPopup?originType=backup&"+this.vParams,{width:"45em",height:"27em",callback:function(e){teaweb.success("保存成功",function(){window.location.reload()})}})},updateOrigin:function(e,t){teaweb.popup("/servers/server/settings/origins/updatePopup?originType="+t+"&"+this.vParams+"&originId="+e,{width:"45em",height:"27em",callback:function(e){teaweb.success("保存成功",function(){window.location.reload()})}})},deleteOrigin:function(e,t){let i=this;teaweb.confirm("确定要删除此源站吗?",function(){Tea.action("/servers/server/settings/origins/delete?"+i.vParams+"&originId="+e+"&originType="+t).post().success(function(){teaweb.success("删除成功",function(){window.location.reload()})})})}},template:`
+
`}),Vue.component("origin-list-box",{props:["v-primary-origins","v-backup-origins","v-server-type","v-params"],data:function(){return{primaryOrigins:this.vPrimaryOrigins,backupOrigins:this.vBackupOrigins}},methods:{createPrimaryOrigin:function(){teaweb.popup("/servers/server/settings/origins/addPopup?originType=primary&"+this.vParams,{width:"45em",height:"27em",callback:function(e){teaweb.success("保存成功",function(){window.location.reload()})}})},createBackupOrigin:function(){teaweb.popup("/servers/server/settings/origins/addPopup?originType=backup&"+this.vParams,{width:"45em",height:"27em",callback:function(e){teaweb.success("保存成功",function(){window.location.reload()})}})},updateOrigin:function(e,t){teaweb.popup("/servers/server/settings/origins/updatePopup?originType="+t+"&"+this.vParams+"&originId="+e,{width:"45em",height:"27em",callback:function(e){teaweb.success("保存成功",function(){window.location.reload()})}})},deleteOrigin:function(e,t,i){let n=this;teaweb.confirm("确定要删除此源站("+t+")吗?",function(){Tea.action("/servers/server/settings/origins/delete?"+n.vParams+"&originId="+e+"&originType="+i).post().success(function(){teaweb.success("删除成功",function(){window.location.reload()})})})},updateOriginIsOn:function(e,t,i){let n,s,o=(s=i?(n="确定要启用此源站("+t+")吗?","启用成功"):(n="确定要停用此源站("+t+")吗?","停用成功"),this);teaweb.confirm(n,function(){Tea.action("/servers/server/settings/origins/updateIsOn?"+o.vParams+"&originId="+e+"&isOn="+(i?1:0)).post().success(function(){teaweb.success(s,function(){window.location.reload()})})})}},template:`

主要源站 [添加主要源站]

暂时还没有主要源站。

- +

备用源站 [添加备用源站]

-

暂时还没有备用源站。

- -
`}),Vue.component("origin-list-table",{props:["v-origins","v-origin-type"],data:function(){let t=!1,e=this.vOrigins;return null!=e&&0暂时还没有备用源站。

+ +`}),Vue.component("origin-list-table",{props:["v-origins","v-origin-type"],data:function(){let t=!1,e=this.vOrigins;return null!=e&&0 源站地址 - 权重 - 状态 - 操作 + 权重 + 状态 + 操作 @@ -2551,7 +2551,8 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 修改   - 删除 + 停用启用   + 删除 @@ -4125,7 +4126,7 @@ example2.com
-`}),Vue.component("http-cc-config-box",{props:["v-cc-config","v-is-location","v-is-group"],data:function(){let e=this.vCcConfig;return null!=(e=null==e?{isPrior:!1,isOn:!1,enableFingerprint:!0,enableGET302:!0,onlyURLPatterns:[],exceptURLPatterns:[],useDefaultThresholds:!0}:e).thresholds&&0!=e.thresholds.length||(e.thresholds=[{maxRequests:0},{maxRequests:0},{maxRequests:0}]),"boolean"!=typeof e.enableFingerprint&&(e.enableFingerprint=!0),"boolean"!=typeof e.enableGET302&&(e.enableGET302=!0),null==e.onlyURLPatterns&&(e.onlyURLPatterns=[]),null==e.exceptURLPatterns&&(e.exceptURLPatterns=[]),{config:e,moreOptionsVisible:!1,minQPSPerIP:e.minQPSPerIP,useCustomThresholds:!e.useDefaultThresholds,thresholdMaxRequests0:this.maxRequestsStringAtThresholdIndex(e,0),thresholdMaxRequests1:this.maxRequestsStringAtThresholdIndex(e,1),thresholdMaxRequests2:this.maxRequestsStringAtThresholdIndex(e,2)}},watch:{minQPSPerIP:function(e){let t=parseInt(e.toString());(isNaN(t)||t<0)&&(t=0),this.config.minQPSPerIP=t},thresholdMaxRequests0:function(e){this.setThresholdMaxRequests(0,e)},thresholdMaxRequests1:function(e){this.setThresholdMaxRequests(1,e)},thresholdMaxRequests2:function(e){this.setThresholdMaxRequests(2,e)},useCustomThresholds:function(e){this.config.useDefaultThresholds=!e}},methods:{maxRequestsStringAtThresholdIndex:function(t,i){if(null==t.thresholds)return"";if(i +`}),Vue.component("http-cc-config-box",{props:["v-cc-config","v-is-location","v-is-group"],data:function(){let e=this.vCcConfig;return null!=(e=null==e?{isPrior:!1,isOn:!1,enableFingerprint:!0,enableGET302:!0,onlyURLPatterns:[],exceptURLPatterns:[],useDefaultThresholds:!0,ignoreCommonFiles:!1}:e).thresholds&&0!=e.thresholds.length||(e.thresholds=[{maxRequests:0},{maxRequests:0},{maxRequests:0}]),"boolean"!=typeof e.enableFingerprint&&(e.enableFingerprint=!0),"boolean"!=typeof e.enableGET302&&(e.enableGET302=!0),null==e.onlyURLPatterns&&(e.onlyURLPatterns=[]),null==e.exceptURLPatterns&&(e.exceptURLPatterns=[]),{config:e,moreOptionsVisible:!1,minQPSPerIP:e.minQPSPerIP,useCustomThresholds:!e.useDefaultThresholds,thresholdMaxRequests0:this.maxRequestsStringAtThresholdIndex(e,0),thresholdMaxRequests1:this.maxRequestsStringAtThresholdIndex(e,1),thresholdMaxRequests2:this.maxRequestsStringAtThresholdIndex(e,2)}},watch:{minQPSPerIP:function(e){let t=parseInt(e.toString());(isNaN(t)||t<0)&&(t=0),this.config.minQPSPerIP=t},thresholdMaxRequests0:function(e){this.setThresholdMaxRequests(0,e)},thresholdMaxRequests1:function(e){this.setThresholdMaxRequests(1,e)},thresholdMaxRequests2:function(e){this.setThresholdMaxRequests(2,e)},useCustomThresholds:function(e){this.config.useDefaultThresholds=!e}},methods:{maxRequestsStringAtThresholdIndex:function(t,i){if(null==t.thresholds)return"";if(i @@ -4157,7 +4158,14 @@ example2.com

如果填写了限制URL,表示只对这些URL进行CC防护处理;如果不填则表示支持所有的URL。

- + + + + +
忽略常用文件 + +

忽略js、css、jpg等常在网页里被引用的文件名,可以减少误判几率。

+
检查请求来源指纹 @@ -6065,8 +6073,12 @@ example2.com - {{item.ipFrom}}  New   - - {{item.ipTo}} + {{item.value}} + + {{item.ipFrom}}  New   + - {{item.ipTo}} + + *
@@ -6144,13 +6156,13 @@ example2.com
`}),Vue.component("ip-item-text",{props:["v-item"],template:` * - - {{vItem.ipFrom}} - - {{vItem.ipTo}} - - {{vItem.ipFrom}} - - {{vItem.ipTo}} - + + {{vItem.value}} + + {{vItem.ipFrom}} + - {{vItem.ipTo}} + +   级别:{{vItem.eventLevelName}} `}),Vue.component("ip-box",{props:["v-ip"],methods:{popup:function(){let e=this.vIp;var t;null!=e&&0!=e.length||(t=this.$refs.container,null==(e=t.innerText)&&(e=t.textContent)),teaweb.popup("/servers/ipbox?ip="+e,{width:"50em",height:"30em"})}},template:''}),Vue.component("sms-sender",{props:["value","name"],mounted:function(){this.initType(this.config.type)},data:function(){let e=this.value;return{config:e=null==e?{isOn:!1,type:"webHook",webHookParams:{url:"",method:"POST"}}:e}},watch:{"config.type":function(e){this.initType(e)}},methods:{initType:function(e){"webHook"===e&&null==this.config.webHookParams&&(this.config.webHookParams={url:"",method:"POST"})},test:function(){window.TESTING_SMS_CONFIG=this.config,teaweb.popup("/users/setting/smsTest",{height:"22em"})}},template:`
@@ -6347,7 +6359,7 @@ example2.com
-`}),Vue.component("datetime-input",{props:["v-name","v-timestamp"],mounted:function(){let t=this;teaweb.datepicker(this.$refs.dayInput,function(e){t.day=e,t.hour="23",t.minute="59",t.second="59",t.change()})},data:function(){let t=this.vTimestamp,i=(null!=t?(t=parseInt(t),isNaN(t)&&(t=0)):t=0,""),n="",s="",o="";if(0 +`}),Vue.component("datetime-input",{props:["v-name","v-timestamp"],mounted:function(){let t=this;teaweb.datepicker(this.$refs.dayInput,function(e){t.day=e,t.hour="23",t.minute="59",t.second="59",t.change()})},data:function(){let t=this.vTimestamp,i=(null!=t?(t=parseInt(t),isNaN(t)&&(t=0)):t=0,""),n="",s="",o="";if(0
@@ -6359,7 +6371,7 @@ example2.com
:
-

常用时间:  1小时  |  1天  |  3天  |  1周  |  30天 

+

常用时间:  1小时  |  1天  |  3天  |  1周  |  30天  |  1年 

`}),Vue.component("label-on",{props:["v-is-on"],template:'
已启用已停用
'}),Vue.component("code-label",{methods:{click:function(e){this.$emit("click",e)}},template:''}),Vue.component("code-label-plain",{template:''}),Vue.component("tiny-label",{template:''}),Vue.component("tiny-basic-label",{template:''}),Vue.component("micro-basic-label",{template:''}),Vue.component("grey-label",{props:["color"],data:function(){let e="grey";return{labelColor:e=null!=this.color&&0'}),Vue.component("optional-label",{template:'(可选)'}),Vue.component("plus-label",{template:'Plus专属功能。'}),Vue.component("pro-warning-label",{template:'注意:通常不需要修改;如要修改,请在专家指导下进行。'}),Vue.component("js-page",{props:["v-max"],data:function(){let e=this.vMax;return{max:e=null==e?0:e,page:1}},methods:{updateMax:function(e){this.max=e},selectPage:function(e){this.page=e,this.$emit("change",e)}},template:`
{{i}} diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js index a67cf6b2..bf33d04e 100755 --- a/web/public/js/components.src.js +++ b/web/public/js/components.src.js @@ -6809,10 +6809,10 @@ Vue.component("http-firewall-checkpoint-cc", { - 忽略常见文件 + 忽略常用文件 -

忽略js、css、jpg等常见在网页里被引用的文件名。

+

忽略js、css、jpg等常在网页里被引用的文件名,可以减少误判几率。

@@ -7374,9 +7374,9 @@ Vue.component("origin-list-box", { } }) }, - deleteOrigin: function (originId, originType) { + deleteOrigin: function (originId, originAddr, originType) { let that = this - teaweb.confirm("确定要删除此源站吗?", function () { + teaweb.confirm("确定要删除此源站(" + originAddr + ")吗?", function () { Tea.action("/servers/server/settings/origins/delete?" + that.vParams + "&originId=" + originId + "&originType=" + originType) .post() .success(function () { @@ -7385,16 +7385,37 @@ Vue.component("origin-list-box", { }) }) }) + }, + updateOriginIsOn: function (originId, originAddr, isOn) { + let message + let resultMessage + if (isOn) { + message = "确定要启用此源站(" + originAddr + ")吗?" + resultMessage = "启用成功" + } else { + message = "确定要停用此源站(" + originAddr + ")吗?" + resultMessage = "停用成功" + } + let that = this + teaweb.confirm(message, function () { + Tea.action("/servers/server/settings/origins/updateIsOn?" + that.vParams + "&originId=" + originId + "&isOn=" + (isOn ? 1 : 0)) + .post() + .success(function () { + teaweb.success(resultMessage, function () { + window.location.reload() + }) + }) + }) } }, template: `

主要源站 [添加主要源站]

暂时还没有主要源站。

- +

备用源站 [添加备用源站]

-

暂时还没有备用源站。

- +

暂时还没有备用源站。

+
` }) @@ -7416,11 +7437,14 @@ Vue.component("origin-list-table", { } }, methods: { - deleteOrigin: function (originId) { - this.$emit("deleteOrigin", originId, this.vOriginType) + deleteOrigin: function (originId, originAddr) { + this.$emit("deleteOrigin", originId, originAddr, this.vOriginType) }, updateOrigin: function (originId) { this.$emit("updateOrigin", originId, this.vOriginType) + }, + updateOriginIsOn: function (originId, originAddr, isOn) { + this.$emit("updateOriginIsOn", originId, originAddr, isOn) } }, template: ` @@ -7428,9 +7452,9 @@ Vue.component("origin-list-table", { 源站地址 - 权重 - 状态 - 操作 + 权重 + 状态 + 操作 @@ -7455,7 +7479,8 @@ Vue.component("origin-list-table", { 修改   - 删除 + 停用启用   + 删除 @@ -11285,7 +11310,8 @@ Vue.component("http-cc-config-box", { enableGET302: true, onlyURLPatterns: [], exceptURLPatterns: [], - useDefaultThresholds: true + useDefaultThresholds: true, + ignoreCommonFiles: false } } @@ -11407,7 +11433,14 @@ Vue.component("http-cc-config-box", {

如果填写了限制URL,表示只对这些URL进行CC防护处理;如果不填则表示支持所有的URL。

- + + + 忽略常用文件 + + +

忽略js、css、jpg等常在网页里被引用的文件名,可以减少误判几率。

+ + 检查请求来源指纹 @@ -16923,8 +16956,12 @@ Vue.component("ip-list-table", { - {{item.ipFrom}}  New   - - {{item.ipTo}} + {{item.value}} + + {{item.ipFrom}}  New   + - {{item.ipTo}} + + *
@@ -17007,13 +17044,13 @@ Vue.component("ip-item-text", { props: ["v-item"], template: ` * - - {{vItem.ipFrom}} - - {{vItem.ipTo}} - - {{vItem.ipFrom}} - - {{vItem.ipTo}} - + + {{vItem.value}} + + {{vItem.ipFrom}} + - {{vItem.ipTo}} + +   级别:{{vItem.eventLevelName}} ` }) @@ -18136,6 +18173,15 @@ Vue.component("datetime-input", { resultTimestamp: function () { return this.timestamp }, + nextYear: function () { + let date = new Date() + date.setFullYear(date.getFullYear()+1) + this.day = date.getFullYear() + "-" + this.leadingZero(date.getMonth() + 1, 2) + "-" + this.leadingZero(date.getDate(), 2) + this.hour = this.leadingZero(date.getHours(), 2) + this.minute = this.leadingZero(date.getMinutes(), 2) + this.second = this.leadingZero(date.getSeconds(), 2) + this.change() + }, nextDays: function (days) { let date = new Date() date.setTime(date.getTime() + days * 86400 * 1000) @@ -18167,7 +18213,7 @@ Vue.component("datetime-input", {
:
-

常用时间:  1小时  |  1天  |  3天  |  1周  |  30天 

+

常用时间:  1小时  |  1天  |  3天  |  1周  |  30天  |  1年 

` })