diff --git a/web/public/js/components.js b/web/public/js/components.js index c6b04298..1f66e2d7 100755 --- a/web/public/js/components.js +++ b/web/public/js/components.js @@ -2866,6 +2866,7 @@ Vue.component("http-cache-ref-box", { enableRequestCachePragma: false, conds: null, allowChunkedEncoding: true, + allowPartialContent: false, isReverse: this.vIsReverse, methods: [], expiresTime: { @@ -2993,7 +2994,14 @@ Vue.component("http-cache-ref-box", { 支持分片内容 -

选中后,Gzip和Chunked内容可以直接缓存,无需检查内容长度。

+

选中后,Gzip等压缩后的Chunked内容可以直接缓存,无需检查内容长度。

+ + + + 支持缓存区间内容 + + +

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

@@ -3771,15 +3779,23 @@ Vue.component("http-cache-config-box", { enableCacheControlMaxAge: false, cacheRefs: [], purgeIsOn: false, - purgeKey: "" + purgeKey: "", + disablePolicyRefs: false } } if (cacheConfig.cacheRefs == null) { cacheConfig.cacheRefs = [] } + return { cacheConfig: cacheConfig, - moreOptionsVisible: false + moreOptionsVisible: false, + enablePolicyRefs: !cacheConfig.disablePolicyRefs + } + }, + watch: { + enablePolicyRefs: function (v) { + this.cacheConfig.disablePolicyRefs = !v } }, methods: { @@ -3821,7 +3837,7 @@ Vue.component("http-cache-config-box", { - 是否开启缓存 + 开启缓存
@@ -3838,6 +3854,13 @@ Vue.component("http-cache-config-box", { + + 使用默认缓存条件 + + +

选中后使用系统中已经定义的默认缓存条件。

+ + 添加X-Cache Header @@ -12226,17 +12249,39 @@ Vue.component("keyword", { if (word == null) { word = "" } else { - 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, "\\$") + word = word.replace(/\?/, "\\?") + word = word.replace(/\*/, "\\*") + word = word.replace(/\[/, "\\[") + word = word.replace(/{/, "\\{") + word = word.replace(/\./, "\\.") } let slot = this.$slots["default"][0] - let text = this.encodeHTML(slot.text) + let text = slot.text if (word.length > 0) { - text = text.replace(new RegExp("(" + word + ")", "ig"), "$1") + let that = this + let m = [] // replacement => tmp + let tmpIndex = 0 + text = text.replaceAll(new RegExp("(" + word + ")", "ig"), function (replacement) { + tmpIndex++ + let s = "" + that.encodeHTML(replacement) + "" + let tmpKey = "$TMP__KEY__" + tmpIndex.toString() + "$" + m.push([tmpKey, s]) + return tmpKey + }) + text = this.encodeHTML(text) + + m.forEach(function (r) { + text = text.replace(r[0], r[1]) + }) + + } else { + text = this.encodeHTML(text) } return { 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 8efd1950..e8a2d82e 100644 --- a/web/public/js/components/server/http-cache-ref-box.js +++ b/web/public/js/components/server/http-cache-ref-box.js @@ -20,6 +20,7 @@ Vue.component("http-cache-ref-box", { enableRequestCachePragma: false, conds: null, allowChunkedEncoding: true, + allowPartialContent: false, isReverse: this.vIsReverse, methods: [], expiresTime: { @@ -147,7 +148,14 @@ Vue.component("http-cache-ref-box", { 支持分片内容 -

选中后,Gzip和Chunked内容可以直接缓存,无需检查内容长度。

+

选中后,Gzip等压缩后的Chunked内容可以直接缓存,无需检查内容长度。

+ + + + 支持缓存区间内容 + + +

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