This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git
The following commit(s) were added to refs/heads/master by this push:
new fd3cca6 feat: support IN operator (vars) when creating Route (#1385)
fd3cca6 is described below
commit fd3cca601cc174c741d85985426b4ac90acfa2bf
Author: guoqqqi <[email protected]>
AuthorDate: Fri Jan 29 16:46:38 2021 +0800
feat: support IN operator (vars) when creating Route (#1385)
---
web/src/pages/Route/components/Step1/MatchingRulesView.tsx | 4 ++++
web/src/pages/Route/locales/en-US.ts | 1 +
web/src/pages/Route/locales/zh-CN.ts | 1 +
web/src/pages/Route/typing.d.ts | 2 +-
4 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/web/src/pages/Route/components/Step1/MatchingRulesView.tsx
b/web/src/pages/Route/components/Step1/MatchingRulesView.tsx
index 43a64a1..fdc4985 100644
--- a/web/src/pages/Route/components/Step1/MatchingRulesView.tsx
+++ b/web/src/pages/Route/components/Step1/MatchingRulesView.tsx
@@ -122,6 +122,9 @@ const MatchingRulesView:
React.FC<RouteModule.Step1PassProps> = ({
case '~~':
renderText = formatMessage({ id: 'page.route.regexMatch' });
break;
+ case 'IN':
+ renderText = formatMessage({ id: 'page.route.in' });
+ break;
default:
renderText = '';
}
@@ -239,6 +242,7 @@ const MatchingRulesView:
React.FC<RouteModule.Step1PassProps> = ({
<Option value=">">{formatMessage({ id: 'page.route.greaterThan'
})}</Option>
<Option value="<">{formatMessage({ id: 'page.route.lessThan'
})}</Option>
<Option value="~~">{formatMessage({ id: 'page.route.regexMatch'
})}</Option>
+ <Option value="IN">{formatMessage({ id: 'page.route.in'
})}</Option>
</Select>
</Form.Item>
<Form.Item
diff --git a/web/src/pages/Route/locales/en-US.ts
b/web/src/pages/Route/locales/en-US.ts
index 025c4b3..82044ed 100644
--- a/web/src/pages/Route/locales/en-US.ts
+++ b/web/src/pages/Route/locales/en-US.ts
@@ -29,6 +29,7 @@ export default {
'page.route.greaterThan': 'Greater Than',
'page.route.lessThan': 'Less Than',
'page.route.regexMatch': 'Regex Match',
+ 'page.route.in': 'IN',
'page.route.rule': 'Rule',
'page.route.httpHeaderName': 'HTTP Request Header Name',
'page.route.service': 'Service',
diff --git a/web/src/pages/Route/locales/zh-CN.ts
b/web/src/pages/Route/locales/zh-CN.ts
index 82a3350..371f0fd 100644
--- a/web/src/pages/Route/locales/zh-CN.ts
+++ b/web/src/pages/Route/locales/zh-CN.ts
@@ -26,6 +26,7 @@ export default {
'page.route.greaterThan': '大于',
'page.route.lessThan': '小于',
'page.route.regexMatch': '正则匹配',
+ 'page.route.in': 'IN',
'page.route.rule': '规则',
'page.route.domainName': '域名',
'page.route.path': '路径',
diff --git a/web/src/pages/Route/typing.d.ts b/web/src/pages/Route/typing.d.ts
index 342d7c1..03a3c3a 100644
--- a/web/src/pages/Route/typing.d.ts
+++ b/web/src/pages/Route/typing.d.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
declare namespace RouteModule {
- type Operator = '==' | '~=' | '>' | '<' | '~~';
+ type Operator = '==' | '~=' | '>' | '<' | '~~' | 'IN';
type VarPosition = 'arg' | 'http' | 'cookie';