diff --git a/web/public/js/components.js b/web/public/js/components.js index ee29e460..da3e2443 100644 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -456,10 +456,17 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio - 记录所有访问 + 只记录失败查询 + + +

选中后,表示只记录查询失败的日志。

+ + + + 包含未添加的域名 -

包括对没有在系统里创建的域名访问。

+

选中后,表示日志中包含对没有在系统里创建的域名访问。

@@ -798,7 +805,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio `}),Vue.component("ns-user-selector",{props:["v-user-id"],data:function(){return{}},methods:{change:function(e){this.$emit("change",e)}},template:`
-
`}),Vue.component("ns-access-log-box",{props:["v-access-log","v-keyword"],data:function(){return{accessLog:this.vAccessLog}},methods:{showLog:function(){let e=this;var t=this.accessLog.requestId;this.$parent.$children.forEach(function(e){null!=e.deselect&&e.deselect()}),this.select(),teaweb.popup("/ns/clusters/accessLogs/viewPopup?requestId="+t,{width:"50em",height:"24em",onClose:function(){e.deselect()}})},select:function(){this.$refs.box.parentNode.style.cssText="background: rgba(0, 0, 0, 0.1)"},deselect:function(){this.$refs.box.parentNode.style.cssText=""}},template:`
+
`}),Vue.component("ns-access-log-box",{props:["v-access-log","v-keyword"],data:function(){var e=this.vAccessLog;let t=!1;return e.isRecursive||"SOA"==e.recordType||"NS"==e.recordType?null!=e.recordValue&&0!=e.recordValue.length||(t=!0):null!=e.nsRecordId&&0!=e.nsRecordId||(t=!0),{accessLog:e,isFailure:t}},methods:{showLog:function(){let e=this;var t=this.accessLog.requestId;this.$parent.$children.forEach(function(e){null!=e.deselect&&e.deselect()}),this.select(),teaweb.popup("/ns/clusters/accessLogs/viewPopup?requestId="+t,{width:"50em",height:"24em",onClose:function(){e.deselect()}})},select:function(){this.$refs.box.parentNode.style.cssText="background: rgba(0, 0, 0, 0.1)"},deselect:function(){this.$refs.box.parentNode.style.cssText=""}},template:`
[{{accessLog.region}}] {{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] [{{accessLog.networking}}] {{accessLog.questionType}} {{accessLog.questionName}} -> {{accessLog.recordType}} {{accessLog.recordValue}} @@ -1314,6 +1321,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio + 忽略URI参数 {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} @@ -1410,7 +1418,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio

所有规则匹配顺序为从上到下,可以拖动左侧的排序。

-`}),Vue.component("http-cache-ref-box",{props:["v-cache-ref","v-is-reverse"],mounted:function(){this.$refs.variablesDescriber.update(this.ref.key),null!=this.ref.simpleCond?(this.condType=this.ref.simpleCond.type,this.changeCondType(this.ref.simpleCond.type,!0),this.condCategory="simple"):null!=this.ref.conds&&null!=this.ref.conds.groups&&(this.condCategory="complex"),this.changeCondCategory(this.condCategory)},data:function(){let e=this.vCacheRef;null==(e=null==e?{isOn:!0,cachePolicyId:0,key:"${scheme}://${host}${requestPath}${isArgs}${args}",life:{count:2,unit:"hour"},status:[200],maxSize:{count:32,unit:"mb"},minSize:{count:0,unit:"kb"},skipCacheControlValues:["private","no-cache","no-store"],skipSetCookie:!0,enableRequestCachePragma:!1,conds:null,simpleCond:null,allowChunkedEncoding:!0,allowPartialContent:!1,enableIfNoneMatch:!1,enableIfModifiedSince:!1,isReverse:this.vIsReverse,methods:[],expiresTime:{isPrior:!1,isOn:!1,overwrite:!0,autoCalculate:!0,duration:{count:-1,unit:"hour"}}}:e).key&&(e.key=""),null==e.methods&&(e.methods=[]),null==e.life&&(e.life={count:2,unit:"hour"}),null==e.maxSize&&(e.maxSize={count:32,unit:"mb"}),null==e.minSize&&(e.minSize={count:0,unit:"kb"});var t=window.REQUEST_COND_COMPONENTS.$find(function(e,t){return"url-extension"==t.type});return{ref:e,moreOptionsVisible:!1,condCategory:"simple",condType:"url-extension",condComponent:t,condIsCaseInsensitive:null==e.simpleCond||e.simpleCond.isCaseInsensitive,components:window.REQUEST_COND_COMPONENTS}},methods:{changeOptionsVisible:function(e){this.moreOptionsVisible=e},changeLife:function(e){this.ref.life=e},changeMaxSize:function(e){this.ref.maxSize=e},changeMinSize:function(e){this.ref.minSize=e},changeConds:function(e){this.ref.conds=e,this.ref.simpleCond=null},changeStatusList:function(e){let t=[];e.forEach(function(e){e=parseInt(e);isNaN(e)||e<100||999 +`}),Vue.component("http-cache-ref-box",{props:["v-cache-ref","v-is-reverse"],mounted:function(){this.$refs.variablesDescriber.update(this.ref.key),null!=this.ref.simpleCond?(this.condType=this.ref.simpleCond.type,this.changeCondType(this.ref.simpleCond.type,!0),this.condCategory="simple"):null!=this.ref.conds&&null!=this.ref.conds.groups&&(this.condCategory="complex"),this.changeCondCategory(this.condCategory)},data:function(){let e=this.vCacheRef;null==(e=null==e?{isOn:!0,cachePolicyId:0,key:"${scheme}://${host}${requestPath}${isArgs}${args}",life:{count:2,unit:"hour"},status:[200],maxSize:{count:32,unit:"mb"},minSize:{count:0,unit:"kb"},skipCacheControlValues:["private","no-cache","no-store"],skipSetCookie:!0,enableRequestCachePragma:!1,conds:null,simpleCond:null,allowChunkedEncoding:!0,allowPartialContent:!0,enableIfNoneMatch:!1,enableIfModifiedSince:!1,isReverse:this.vIsReverse,methods:[],expiresTime:{isPrior:!1,isOn:!1,overwrite:!0,autoCalculate:!0,duration:{count:-1,unit:"hour"}}}:e).key&&(e.key=""),null==e.methods&&(e.methods=[]),null==e.life&&(e.life={count:2,unit:"hour"}),null==e.maxSize&&(e.maxSize={count:32,unit:"mb"}),null==e.minSize&&(e.minSize={count:0,unit:"kb"});var t=window.REQUEST_COND_COMPONENTS.$find(function(e,t){return"url-extension"==t.type});return{ref:e,keyIgnoreArgs:"string"==typeof e.key&&e.key.indexOf("${args}")<0,moreOptionsVisible:!1,condCategory:"simple",condType:"url-extension",condComponent:t,condIsCaseInsensitive:null==e.simpleCond||e.simpleCond.isCaseInsensitive,components:window.REQUEST_COND_COMPONENTS}},watch:{keyIgnoreArgs:function(e){"string"==typeof this.ref.key&&(e?this.ref.key=this.ref.key.replace("${isArgs}${args}",""):(this.ref.key.indexOf("${isArgs}")<0&&(this.ref.key=this.ref.key+"${isArgs}"),this.ref.key.indexOf("${args}")<0&&(this.ref.key=this.ref.key+"${args}")))}},methods:{changeOptionsVisible:function(e){this.moreOptionsVisible=e},changeLife:function(e){this.ref.life=e},changeMaxSize:function(e){this.ref.maxSize=e},changeMinSize:function(e){this.ref.minSize=e},changeConds:function(e){this.ref.conds=e,this.ref.simpleCond=null},changeStatusList:function(e){let t=[];e.forEach(function(e){e=parseInt(e);isNaN(e)||e<100||999 条件类型 * @@ -1455,12 +1463,19 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio - 缓存Key * + 缓存Key *

用来区分不同缓存内容的唯一Key。

+ + 忽略URI参数 + + +

选中后,表示缓存Key中不包含URI参数(即问号(?))后面的内容。

+ + @@ -1502,7 +1517,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio 支持缓存区间内容 -

选中后,支持缓存源站返回的某个区间的内容,该内容通过206 Partial Content状态码返回。此功能目前为试验性质

+

选中后,支持缓存源站返回的某个区间的内容,该内容通过206 Partial Content状态码返回。

@@ -1888,6 +1903,7 @@ Vue.component("traffic-map-box",{props:["v-stats","v-is-attack"],mounted:functio + 忽略URI参数 {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} diff --git a/web/public/js/components.src.js b/web/public/js/components.src.js index 9093523e..4d399fc4 100755 --- a/web/public/js/components.src.js +++ b/web/public/js/components.src.js @@ -1508,10 +1508,17 @@ Vue.component("ns-access-log-ref-box", { - 记录所有访问 + 只记录失败查询 + + +

选中后,表示只记录查询失败的日志。

+ + + + 包含未添加的域名 -

包括对没有在系统里创建的域名访问。

+

选中后,表示日志中包含对没有在系统里创建的域名访问。

@@ -2374,8 +2381,25 @@ Vue.component("ns-access-log-box", { props: ["v-access-log", "v-keyword"], data: function () { let accessLog = this.vAccessLog + let isFailure = false + + if (accessLog.isRecursive) { + if (accessLog.recordValue == null || accessLog.recordValue.length == 0) { + isFailure = true + } + } else { + if (accessLog.recordType == "SOA" || accessLog.recordType == "NS") { + if (accessLog.recordValue == null || accessLog.recordValue.length == 0) { + isFailure = true + } + } else if (accessLog.nsRecordId == null || accessLog.nsRecordId == 0) { + isFailure = true + } + } + return { - accessLog: accessLog + accessLog: accessLog, + isFailure: isFailure } }, methods: { @@ -2404,7 +2428,7 @@ Vue.component("ns-access-log-box", { this.$refs.box.parentNode.style.cssText = "" } }, - template: `
+ template: `
[{{accessLog.region}}] {{accessLog.remoteAddr}} [{{accessLog.timeLocal}}] [{{accessLog.networking}}] {{accessLog.questionType}} {{accessLog.questionName}} -> {{accessLog.recordType}} {{accessLog.recordValue}} @@ -3744,6 +3768,7 @@ Vue.component("http-cache-refs-box", { + 忽略URI参数 {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} @@ -4055,7 +4080,7 @@ Vue.component("http-cache-ref-box", { conds: null, // 复杂条件 simpleCond: null, // 简单条件 allowChunkedEncoding: true, - allowPartialContent: false, + allowPartialContent: true, enableIfNoneMatch: false, enableIfModifiedSince: false, isReverse: this.vIsReverse, @@ -4093,6 +4118,9 @@ Vue.component("http-cache-ref-box", { return { ref: ref, + + keyIgnoreArgs: typeof ref.key == "string" && ref.key.indexOf("${args}") < 0, + moreOptionsVisible: false, condCategory: "simple", // 条件分类:simple|complex @@ -4103,6 +4131,23 @@ Vue.component("http-cache-ref-box", { components: window.REQUEST_COND_COMPONENTS } }, + watch: { + keyIgnoreArgs: function (b) { + if (typeof this.ref.key != "string") { + return + } + if (b) { + this.ref.key = this.ref.key.replace("${isArgs}${args}", "") + return; + } + if (this.ref.key.indexOf("${isArgs}") < 0) { + this.ref.key = this.ref.key + "${isArgs}" + } + if (this.ref.key.indexOf("${args}") < 0) { + this.ref.key = this.ref.key + "${args}" + } + } + }, methods: { changeOptionsVisible: function (v) { this.moreOptionsVisible = v @@ -4149,6 +4194,9 @@ Vue.component("http-cache-ref-box", { // resize window let dialog = window.parent.document.querySelector("*[role='dialog']") + if (dialog == null) { + return + } switch (condCategory) { case "simple": dialog.style.width = "40em" @@ -4220,12 +4268,19 @@ Vue.component("http-cache-ref-box", { - 缓存Key * + 缓存Key *

用来区分不同缓存内容的唯一Key。

+ + 忽略URI参数 + + +

选中后,表示缓存Key中不包含URI参数(即问号(?))后面的内容。

+ + @@ -4267,7 +4322,7 @@ Vue.component("http-cache-ref-box", { 支持缓存区间内容 -

选中后,支持缓存源站返回的某个区间的内容,该内容通过206 Partial Content状态码返回。此功能目前为试验性质

+

选中后,支持缓存源站返回的某个区间的内容,该内容通过206 Partial Content状态码返回。

@@ -5816,6 +5871,7 @@ Vue.component("http-cache-refs-config-box", { + 忽略URI参数 {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} diff --git a/web/public/js/components/server/http-cache-ref-box.js b/web/public/js/components/server/http-cache-ref-box.js index dff558a1..cfd266a8 100644 --- a/web/public/js/components/server/http-cache-ref-box.js +++ b/web/public/js/components/server/http-cache-ref-box.js @@ -67,6 +67,9 @@ Vue.component("http-cache-ref-box", { return { ref: ref, + + keyIgnoreArgs: typeof ref.key == "string" && ref.key.indexOf("${args}") < 0, + moreOptionsVisible: false, condCategory: "simple", // 条件分类:simple|complex @@ -77,6 +80,23 @@ Vue.component("http-cache-ref-box", { components: window.REQUEST_COND_COMPONENTS } }, + watch: { + keyIgnoreArgs: function (b) { + if (typeof this.ref.key != "string") { + return + } + if (b) { + this.ref.key = this.ref.key.replace("${isArgs}${args}", "") + return; + } + if (this.ref.key.indexOf("${isArgs}") < 0) { + this.ref.key = this.ref.key + "${isArgs}" + } + if (this.ref.key.indexOf("${args}") < 0) { + this.ref.key = this.ref.key + "${args}" + } + } + }, methods: { changeOptionsVisible: function (v) { this.moreOptionsVisible = v @@ -123,6 +143,9 @@ Vue.component("http-cache-ref-box", { // resize window let dialog = window.parent.document.querySelector("*[role='dialog']") + if (dialog == null) { + return + } switch (condCategory) { case "simple": dialog.style.width = "40em" @@ -194,12 +217,19 @@ Vue.component("http-cache-ref-box", { - 缓存Key * + 缓存Key *

用来区分不同缓存内容的唯一Key。

+ + 忽略URI参数 + + +

选中后,表示缓存Key中不包含URI参数(即问号(?))后面的内容。

+ + diff --git a/web/public/js/components/server/http-cache-refs-box.js b/web/public/js/components/server/http-cache-refs-box.js index 21f02ccf..c594ecd9 100644 --- a/web/public/js/components/server/http-cache-refs-box.js +++ b/web/public/js/components/server/http-cache-refs-box.js @@ -47,6 +47,7 @@ Vue.component("http-cache-refs-box", { + 忽略URI参数 {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}} 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 11a49a38..51ac3684 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 @@ -180,6 +180,7 @@ Vue.component("http-cache-refs-config-box", { + 忽略URI参数 {{cacheRef.minSize.count}}{{cacheRef.minSize.unit}} - {{cacheRef.maxSize.count}}{{cacheRef.maxSize.unit}}