You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2020/06/04 09:22:41 UTC
[incubator-apisix-dashboard] branch next updated: feat: update
(#242)
This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git
The following commit(s) were added to refs/heads/next by this push:
new 49c6246 feat: update (#242)
49c6246 is described below
commit 49c6246803f82a9ac192ea94adb630d478de06d7
Author: litesun <31...@users.noreply.github.com>
AuthorDate: Thu Jun 4 17:22:32 2020 +0800
feat: update (#242)
* feat: limit upload file
* feat: intercept default upload api request
* feat: limit upload file type
* fix: show file when parse SSL file fail
* feat: add search feature
* feat: format code
* fix: remove list item not work
* feat: remove relatedRouting
* feat: add routes step1 page
* feat: update route
* feat: format code
* feat: update
* feat: update
* feat: add checkbox rule
* feat: handle Modal close event
* feat: format code
* feat: add page skip
* feat: format code
* merge
* feat: clean code
* fix: step4 error
* feat: add edit modal
* feat: add form validation
* fix: step4 lose data
* fix: step4 edit
* add: WebSocket switch
* feat: https methods list Validation
* fix: timeout
* clean code
* add: redirect
* fix: force https
* add: redirect
* fix: wrong redirectURI typing
* Update RequestConfigView.tsx
* Update RequestConfigView.tsx
* feat: change refirect
* feat: operator to chinese
* feat:change init timeout to 6000ms
* fix: advancedMatchingRules data loss when edit
* fix: advancedMatchingRules data loss when edit
Co-authored-by: 琚致远 <ju...@apache.org>
---
src/pages/Routes/Create.tsx | 4 +---
.../Routes/components/Step1/MatchingRulesView.tsx | 24 +++++++++++++++++++++-
.../Routes/components/Step1/RequestConfigView.tsx | 2 +-
src/pages/Routes/components/Step1/index.tsx | 9 ++------
src/pages/Routes/constants.ts | 6 +++---
5 files changed, 30 insertions(+), 15 deletions(-)
diff --git a/src/pages/Routes/Create.tsx b/src/pages/Routes/Create.tsx
index 71d0cd8..147e329 100644
--- a/src/pages/Routes/Create.tsx
+++ b/src/pages/Routes/Create.tsx
@@ -65,9 +65,7 @@ const Create: React.FC = (props) => {
data={routeData}
form={form1}
onChange={(params: RouteModule.Step1Data) => {
- requestAnimationFrame(() => {
- setStep1Data(params);
- });
+ setStep1Data({ ...step1Data, ...params });
}}
/>
);
diff --git a/src/pages/Routes/components/Step1/MatchingRulesView.tsx b/src/pages/Routes/components/Step1/MatchingRulesView.tsx
index 9bbda2c..7cf1c06 100644
--- a/src/pages/Routes/components/Step1/MatchingRulesView.tsx
+++ b/src/pages/Routes/components/Step1/MatchingRulesView.tsx
@@ -66,8 +66,30 @@ const MatchingRulesView: React.FC<Props> = ({ data, disabled, onChange }) => {
},
{
title: '运算符',
- dataIndex: 'operator',
key: 'operator',
+ render: (text: RouteModule.MatchingRule) => {
+ let renderText;
+ switch (text.operator) {
+ case '==':
+ renderText = '等于';
+ break;
+ case '~=':
+ renderText = '不等于';
+ break;
+ case '>':
+ renderText = '大于';
+ break;
+ case '<':
+ renderText = '小于';
+ break;
+ case '~~':
+ renderText = '正则匹配';
+ break;
+ default:
+ renderText = '';
+ }
+ return renderText;
+ },
},
{
title: '参数值',
diff --git a/src/pages/Routes/components/Step1/RequestConfigView.tsx b/src/pages/Routes/components/Step1/RequestConfigView.tsx
index 7c74f4a..78b2dc5 100644
--- a/src/pages/Routes/components/Step1/RequestConfigView.tsx
+++ b/src/pages/Routes/components/Step1/RequestConfigView.tsx
@@ -19,7 +19,7 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
const { protocols } = step1Data;
const onProtocolChange = (e: CheckboxValueType[]) => {
if (!e.includes('http') && !e.includes('https')) return;
- onChange({ ...step1Data, protocols: e });
+ onChange({ ...data.step1Data, protocols: e });
};
const renderHosts = () => (
<Form.List name="hosts">
diff --git a/src/pages/Routes/components/Step1/index.tsx b/src/pages/Routes/components/Step1/index.tsx
index 150708f..e69bd9f 100644
--- a/src/pages/Routes/components/Step1/index.tsx
+++ b/src/pages/Routes/components/Step1/index.tsx
@@ -23,13 +23,8 @@ const Step1: React.FC<Props> = (props) => {
form={form}
layout="horizontal"
className={styles.stepForm}
- onValuesChange={(field, value) => {
- if (field.protocols?.includes('HTTPS')) {
- form.setFieldsValue({ forceHttps: false });
- onChange({ ...data.step1Data, ...value, forceHttps: false });
- return;
- }
- onChange({ ...data.step1Data, ...value });
+ onValuesChange={(field) => {
+ onChange({ ...data.step1Data, ...field });
}}
initialValues={data.step1Data}
>
diff --git a/src/pages/Routes/constants.ts b/src/pages/Routes/constants.ts
index f784d1b..a45dd6b 100644
--- a/src/pages/Routes/constants.ts
+++ b/src/pages/Routes/constants.ts
@@ -44,9 +44,9 @@ export const DEFAULT_STEP_2_DATA: RouteModule.Step2Data = {
upstreamHeaderList: [],
upstreamPath: undefined,
timeout: {
- connect: 10000,
- send: 10000,
- read: 10000,
+ connect: 6000,
+ send: 6000,
+ read: 6000,
},
};