From e52ba4211887362a3b4489b4148e5b09d91a3bd9 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Fri, 16 Jun 2023 11:34:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=9D=A1=E4=BB=B6=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=A2=9E=E5=8A=A0=E2=80=9CURL=E9=80=9A=E9=85=8D?= =?UTF-8?q?=E7=AC=A6=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/server/http-cache-ref-box.js | 3 +- .../server/http-cond-definitions.js | 32 +++++++++++++++++++ web/public/js/conds/official.json | 9 ++++++ 3 files changed, 43 insertions(+), 1 deletion(-) 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 0e8f7419..bb7fb2ec 100644 --- a/web/public/js/components/server/http-cache-ref-box.js +++ b/web/public/js/components/server/http-cache-ref-box.js @@ -179,10 +179,11 @@ Vue.component("http-cache-ref-box", { diff --git a/web/public/js/components/server/http-cond-definitions.js b/web/public/js/components/server/http-cond-definitions.js index 2566fb95..9a21c6bf 100644 --- a/web/public/js/components/server/http-cond-definitions.js +++ b/web/public/js/components/server/http-cond-definitions.js @@ -438,6 +438,38 @@ Vue.component("http-cond-url-not-regexp", { ` }) +// URL通配符 +Vue.component("http-cond-url-wildcard-match", { + props: ["v-cond"], + mounted: function () { + this.$refs.valueInput.focus() + }, + data: function () { + let cond = { + isRequest: true, + param: "${requestPath}", + operator: "wildcard match", + value: "", + isCaseInsensitive: false + } + if (this.vCond != null && typeof this.vCond.value == "string") { + cond.value = this.vCond.value + } + return { + cond: cond + } + }, + methods: { + changeCaseInsensitive: function (isCaseInsensitive) { + this.cond.isCaseInsensitive = isCaseInsensitive + } + }, + template: `
+ + +

匹配URL的通配符,用星号(*)表示任意字符,比如(/images/*.png/static/*,不需要带域名。

+
` +}) // User-Agent正则匹配 Vue.component("http-cond-user-agent-regexp", { diff --git a/web/public/js/conds/official.json b/web/public/js/conds/official.json index a76a63af..0de75a65 100644 --- a/web/public/js/conds/official.json +++ b/web/public/js/conds/official.json @@ -52,6 +52,15 @@ "isRequest": true, "caseInsensitive": true }, + { + "type": "url-wildcard-match", + "name": "URL通配符", + "description": "使用通配符检查URL中的文件路径是否一致", + "component": "http-cond-url-wildcard-match", + "paramsTitle": "通配符", + "isRequest": true, + "caseInsensitive": true + }, { "type": "user-agent-regexp", "name": "User-Agent正则匹配",