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

commit 4cf0ce706a21ea618a2a97cb9f32902b8d25d83c
Author: juzhiyuan <jjzhiy...@gmail.com>
AuthorDate: Wed Jun 3 17:55:32 2020 +0800

    fix some actions
---
 src/components/PluginModal/index.tsx                    |  2 ++
 src/pages/Routes/components/Step1/MatchingRulesView.tsx |  2 ++
 src/pages/Routes/components/Step1/RequestConfigView.tsx | 17 +++++++++--------
 .../Routes/components/Step2/HttpHeaderRewriteView.tsx   |  2 ++
 .../Routes/components/Step2/RequestRewriteView.tsx      |  8 ++++----
 src/pages/Routes/constants.ts                           |  2 +-
 6 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/src/components/PluginModal/index.tsx 
b/src/components/PluginModal/index.tsx
index 25347d1..9f4882c 100644
--- a/src/components/PluginModal/index.tsx
+++ b/src/components/PluginModal/index.tsx
@@ -21,6 +21,8 @@ const PluginModal: React.FC<Props> = (props) => {
       destroyOnClose
       visible={visible}
       title={`${useIntl().formatMessage({ id: 'component.global.edit.plugin' 
})} ${name}`}
+      okText="确定"
+      cancelText="取消"
     >
       <PluginForm form={form} {...props} />
     </Modal>
diff --git a/src/pages/Routes/components/Step1/MatchingRulesView.tsx 
b/src/pages/Routes/components/Step1/MatchingRulesView.tsx
index ee13c2a..dc0522b 100644
--- a/src/pages/Routes/components/Step1/MatchingRulesView.tsx
+++ b/src/pages/Routes/components/Step1/MatchingRulesView.tsx
@@ -99,6 +99,8 @@ const MatchingRulesView: React.FC<Props> = ({ data, disabled, 
onChange }) => {
           setVisible(false);
           modalForm.resetFields();
         }}
+        okText="确定"
+        cancelText="取消"
         destroyOnClose
       >
         <Form form={modalForm} labelCol={{ span: 4 }} wrapperCol={{ span: 20 
}}>
diff --git a/src/pages/Routes/components/Step1/RequestConfigView.tsx 
b/src/pages/Routes/components/Step1/RequestConfigView.tsx
index a52e647..cae126f 100644
--- a/src/pages/Routes/components/Step1/RequestConfigView.tsx
+++ b/src/pages/Routes/components/Step1/RequestConfigView.tsx
@@ -59,8 +59,8 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, 
onChange }) => {
                 ) : null}
               </Form.Item>
             ))}
-            <Form.Item {...FORM_ITEM_WITHOUT_LABEL}>
-              {!disabled && (
+            {!disabled && (
+              <Form.Item {...FORM_ITEM_WITHOUT_LABEL}>
                 <Button
                   type="dashed"
                   onClick={() => {
@@ -69,8 +69,8 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, 
onChange }) => {
                 >
                   <PlusOutlined /> 增加
                 </Button>
-              )}
-            </Form.Item>
+              </Form.Item>
+            )}
           </div>
         );
       }}
@@ -98,8 +98,9 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, 
onChange }) => {
                 )}
               </Form.Item>
             ))}
-            <Form.Item>
-              {!disabled && (
+            {fields.length === 0 && <span>无</span>}
+            {!disabled && (
+              <Form.Item>
                 <Button
                   type="dashed"
                   onClick={() => {
@@ -108,8 +109,8 @@ const RequestConfigView: React.FC<Props> = ({ data, 
disabled, onChange }) => {
                 >
                   <PlusOutlined /> 增加
                 </Button>
-              )}
-            </Form.Item>
+              </Form.Item>
+            )}
           </div>
         );
       }}
diff --git a/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx 
b/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx
index 3baff95..fa41e81 100644
--- a/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx
+++ b/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx
@@ -95,6 +95,8 @@ const HttpHeaderRewriteView: React.FC<Props> = ({ data, 
disabled, onChange }) =>
           setVisible(false);
           modalForm.resetFields();
         }}
+        okText="确定"
+        cancelText="取消"
         destroyOnClose
       >
         <Form form={modalForm} labelCol={{ span: 4 }} wrapperCol={{ span: 20 
}}>
diff --git a/src/pages/Routes/components/Step2/RequestRewriteView.tsx 
b/src/pages/Routes/components/Step2/RequestRewriteView.tsx
index 4e338e5..ca04444 100644
--- a/src/pages/Routes/components/Step2/RequestRewriteView.tsx
+++ b/src/pages/Routes/components/Step2/RequestRewriteView.tsx
@@ -71,8 +71,8 @@ const RequestRewriteView: React.FC<Props> = ({ data, form, 
disabled, onChange })
               </Row>
             </Form.Item>
           ))}
-          <Form.Item {...FORM_ITEM_WITHOUT_LABEL}>
-            {!disabled && (
+          {!disabled && (
+            <Form.Item {...FORM_ITEM_WITHOUT_LABEL}>
               <Button
                 type="dashed"
                 onClick={() => {
@@ -81,8 +81,8 @@ const RequestRewriteView: React.FC<Props> = ({ data, form, 
disabled, onChange })
               >
                 <PlusOutlined /> 增加
               </Button>
-            )}
-          </Form.Item>
+            </Form.Item>
+          )}
         </>
       )}
     </Form.List>
diff --git a/src/pages/Routes/constants.ts b/src/pages/Routes/constants.ts
index 6ccce6a..294ebb6 100644
--- a/src/pages/Routes/constants.ts
+++ b/src/pages/Routes/constants.ts
@@ -36,7 +36,7 @@ export const DEFAULT_STEP_1_DATA: RouteModule.Step1Data = {
 
 export const DEFAULT_STEP_2_DATA: RouteModule.Step2Data = {
   upstreamProtocol: 'originalRequest',
-  upstreamHostList: [{ host: '', port: 0, weight: 0 }],
+  upstreamHostList: [{ host: '', port: 80, weight: 0 }],
   upstreamHeaderList: [],
   upstreamPath: '',
   timeout: {

Reply via email to