@@ -169,7 +187,8 @@ Vue.component("http-cond-url-not-eq", {
param: "${requestPath}",
operator: "eq",
value: "",
- isReverse: true
+ isReverse: true,
+ isCaseInsensitive: false
}
if (this.vCond != null && typeof this.vCond.value == "string") {
cond.value = this.vCond.value
@@ -178,6 +197,11 @@ Vue.component("http-cond-url-not-eq", {
cond: cond
}
},
+ methods: {
+ changeCaseInsensitive: function (isCaseInsensitive) {
+ this.cond.isCaseInsensitive = isCaseInsensitive
+ }
+ },
template: `
@@ -193,7 +217,8 @@ Vue.component("http-cond-url-regexp", {
isRequest: true,
param: "${requestPath}",
operator: "regexp",
- value: ""
+ value: "",
+ isCaseInsensitive: false
}
if (this.vCond != null && typeof this.vCond.value == "string") {
cond.value = this.vCond.value
@@ -202,6 +227,11 @@ Vue.component("http-cond-url-regexp", {
cond: cond
}
},
+ methods: {
+ changeCaseInsensitive: function (isCaseInsensitive) {
+ this.cond.isCaseInsensitive = isCaseInsensitive
+ }
+ },
template: `
@@ -217,7 +247,8 @@ Vue.component("http-cond-url-not-regexp", {
isRequest: true,
param: "${requestPath}",
operator: "not regexp",
- value: ""
+ value: "",
+ isCaseInsensitive: false
}
if (this.vCond != null && typeof this.vCond.value == "string") {
cond.value = this.vCond.value
@@ -226,6 +257,11 @@ Vue.component("http-cond-url-not-regexp", {
cond: cond
}
},
+ methods: {
+ changeCaseInsensitive: function (isCaseInsensitive) {
+ this.cond.isCaseInsensitive = isCaseInsensitive
+ }
+ },
template: `
@@ -233,6 +269,67 @@ Vue.component("http-cond-url-not-regexp", {
`
})
+
+// User-Agent正则匹配
+Vue.component("http-cond-user-agent-regexp", {
+ props: ["v-cond"],
+ data: function () {
+ let cond = {
+ isRequest: true,
+ param: "${userAgent}",
+ operator: "regexp",
+ 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: `
+
+
+
+
`
+})
+
+// User-Agent正则不匹配
+Vue.component("http-cond-user-agent-not-regexp", {
+ props: ["v-cond"],
+ data: function () {
+ let cond = {
+ isRequest: true,
+ param: "${userAgent}",
+ operator: "not regexp",
+ 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: `
+
+
+
+
`
+})
+
// 根据MimeType
Vue.component("http-cond-mime-type", {
props: ["v-cond"],
@@ -376,7 +473,8 @@ Vue.component("http-cond-params", {
isRequest: true,
param: "",
operator: window.REQUEST_COND_OPERATORS[0].op,
- value: ""
+ value: "",
+ isCaseInsensitive: false
}
if (this.vCond != null) {
cond = this.vCond
@@ -582,5 +680,15 @@ Vue.component("http-cond-params", {
+
+ | 不区分大小写 |
+
+
+
+
+
+
+ |
+
`
})
\ No newline at end of file
diff --git a/web/public/js/components/server/http-request-conds-box.js b/web/public/js/components/server/http-request-conds-box.js
index 5bb7de25..cbed7e9a 100644
--- a/web/public/js/components/server/http-request-conds-box.js
+++ b/web/public/js/components/server/http-request-conds-box.js
@@ -70,6 +70,7 @@ Vue.component("http-request-conds-box", {
{{cond.param}} {{cond.operator}}
{{typeName(cond)}}:
{{cond.value}}
+
{{group.connector}}
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 77214b3f..cc86c6c7 100644
--- a/web/public/js/components/server/http-request-conds-view.js
+++ b/web/public/js/components/server/http-request-conds-view.js
@@ -58,6 +58,7 @@ Vue.component("http-request-conds-view", {
{{cond.param}} {{cond.operator}}
{{cond.typeName}}:
{{cond.value}}
+
{{group.connector}}
diff --git a/web/public/js/conds/official.json b/web/public/js/conds/official.json
index 0d505f76..1ae89cb7 100644
--- a/web/public/js/conds/official.json
+++ b/web/public/js/conds/official.json
@@ -13,7 +13,8 @@
"description": "根据URL中的文件路径前缀进行过滤",
"component": "http-cond-url-prefix",
"paramsTitle": "URL前缀",
- "isRequest": true
+ "isRequest": true,
+ "caseInsensitive": true
},
{
"type": "url-eq",
@@ -21,7 +22,8 @@
"description": "检查URL中的文件路径是否一致",
"component": "http-cond-url-eq",
"paramsTitle": "URL完整路径",
- "isRequest": true
+ "isRequest": true,
+ "caseInsensitive": true
},
{
"type": "url-regexp",
@@ -29,7 +31,17 @@
"description": "使用正则表达式检查URL中的文件路径是否一致",
"component": "http-cond-url-regexp",
"paramsTitle": "正则表达式",
- "isRequest": true
+ "isRequest": true,
+ "caseInsensitive": true
+ },
+ {
+ "type": "user-agent-regexp",
+ "name": "User-Agent正则匹配",
+ "description": "使用正则表达式检查User-Agent中是否含有某些浏览器和系统标识",
+ "component": "http-cond-user-agent-regexp",
+ "paramsTitle": "正则表达式",
+ "isRequest": true,
+ "caseInsensitive": true
},
{
"type": "params",
@@ -45,7 +57,8 @@
"description": "根据URL中的文件路径前缀进行过滤",
"component": "http-cond-url-not-prefix",
"paramsTitle": "URL前缀",
- "isRequest": true
+ "isRequest": true,
+ "caseInsensitive": true
},
{
"type": "url-not-eq",
@@ -53,7 +66,8 @@
"description": "检查URL中的文件路径是否一致",
"component": "http-cond-url-not-eq",
"paramsTitle": "URL完整路径",
- "isRequest": true
+ "isRequest": true,
+ "caseInsensitive": true
},
{
"type": "url-not-regexp",
@@ -61,7 +75,17 @@
"description": "使用正则表达式检查URL中的文件路径是否一致,如果一致,则不匹配",
"component": "http-cond-url-not-regexp",
"paramsTitle": "正则表达式",
- "isRequest": true
+ "isRequest": true,
+ "caseInsensitive": true
+ },
+ {
+ "type": "user-agent-not-regexp",
+ "name": "排除:User-Agent正则匹配",
+ "description": "使用正则表达式检查User-Agent中是否含有某些浏览器和系统标识,如果含有,则不匹配",
+ "component": "http-cond-user-agent-not-regexp",
+ "paramsTitle": "正则表达式",
+ "isRequest": true,
+ "caseInsensitive": true
},
{
"type": "mime-type",
diff --git a/web/views/@default/servers/server/settings/conds/addCondPopup.html b/web/views/@default/servers/server/settings/conds/addCondPopup.html
index 525d8dc6..9f844d02 100644
--- a/web/views/@default/servers/server/settings/conds/addCondPopup.html
+++ b/web/views/@default/servers/server/settings/conds/addCondPopup.html
@@ -20,11 +20,21 @@
{$ range .components}
{$if not (eq .Type "params") }
- <{$ .Component} v-if="condType == '{$ .Type}'" :v-cond="cond">{$ .Component}>
+ <{$ .Component} v-if="condType == '{$ .Type}'" :v-cond="cond" ref="component">{$ .Component}>
{$end}
{$ end}
|
+
+ | 不区分大小写 |
+
+
+
+
+
+
+ |
+
diff --git a/web/views/@default/servers/server/settings/conds/addCondPopup.js b/web/views/@default/servers/server/settings/conds/addCondPopup.js
index 3afab029..c115d62f 100644
--- a/web/views/@default/servers/server/settings/conds/addCondPopup.js
+++ b/web/views/@default/servers/server/settings/conds/addCondPopup.js
@@ -2,6 +2,8 @@ Tea.context(function () {
this.isUpdating = false
this.cond = null
this.paramsTitle = ""
+ this.paramsCaseInsensitive = false
+ this.isCaseInsensitive = false
this.success = NotifyPopup
this.condType = (this.components.length > 0) ? this.components[0].type : ""
@@ -11,6 +13,9 @@ Tea.context(function () {
this.isUpdating = true
this.condType = window.parent.UPDATING_COND.type
this.cond = window.parent.UPDATING_COND
+ if (typeof (this.cond.isCaseInsensitive) == "boolean") {
+ this.isCaseInsensitive = this.cond.isCaseInsensitive
+ }
}
this.changeCondType = function () {
@@ -20,12 +25,31 @@ Tea.context(function () {
})
if (c == null || c.paramsTitle.length == 0) {
that.paramsTitle = "条件参数"
+ that.paramsCaseInsensitive = false
} else {
that.paramsTitle = c.paramsTitle
+ if (typeof (c.caseInsensitive) != "undefined") {
+ that.paramsCaseInsensitive = c.caseInsensitive
+ that.$delay(function () {
+ that.changeCaseInsensitive()
+ })
+ } else {
+ that.paramsCaseInsensitive = false
+ }
}
}
this.$delay(function () {
this.changeCondType()
})
+
+ this.changeCaseInsensitive = function () {
+ let componentRef = this.$refs.component
+ if (componentRef == null) {
+ return
+ }
+ if (typeof (componentRef.changeCaseInsensitive) == "function") {
+ componentRef.changeCaseInsensitive(this.isCaseInsensitive)
+ }
+ }
})
\ No newline at end of file
diff --git a/web/views/@default/servers/server/settings/conds/addGroupPopup.html b/web/views/@default/servers/server/settings/conds/addGroupPopup.html
index 46504aaa..f167f5ef 100644
--- a/web/views/@default/servers/server/settings/conds/addGroupPopup.html
+++ b/web/views/@default/servers/server/settings/conds/addGroupPopup.html
@@ -14,6 +14,7 @@
{{cond.param}} {{cond.operator}}
{{typeName(cond)}}:
{{cond.value}}
+
{{group.connector}}