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/06 02:15:59 UTC

[incubator-apisix-dashboard] branch feat-ssl updated: feat: update some text

This is an automated email from the ASF dual-hosted git repository.

juzhiyuan pushed a commit to branch feat-ssl
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-dashboard.git


The following commit(s) were added to refs/heads/feat-ssl by this push:
     new 28db449  feat: update some text
28db449 is described below

commit 28db4499995d34a8bd6f9661abb16f50a2cac9b4
Author: juzhiyuan <jj...@gmail.com>
AuthorDate: Sat Jun 6 10:15:21 2020 +0800

    feat: update some text
---
 src/locales/zh-CN/component.ts                     |  2 +-
 .../Routes/components/Step1/MatchingRulesView.tsx  |  4 +--
 .../Routes/components/Step1/RequestConfigView.tsx  | 39 +++++++++++++++++-----
 .../components/Step2/HttpHeaderRewriteView.tsx     |  2 +-
 .../Routes/components/Step2/RequestRewriteView.tsx |  5 +--
 src/pages/Routes/constants.ts                      |  2 +-
 6 files changed, 38 insertions(+), 16 deletions(-)

diff --git a/src/locales/zh-CN/component.ts b/src/locales/zh-CN/component.ts
index 88f167b..048190e 100644
--- a/src/locales/zh-CN/component.ts
+++ b/src/locales/zh-CN/component.ts
@@ -6,7 +6,7 @@ export default {
   'component.global.cancel': '取消',
   'component.global.submit': '提交',
   'component.global.create': '创建',
-  'component.global.add': '增加',
+  'component.global.add': '新建',
   'component.global.save': '保存',
   'component.global.edit': '编辑',
   'component.global.action': '操作',
diff --git a/src/pages/Routes/components/Step1/MatchingRulesView.tsx b/src/pages/Routes/components/Step1/MatchingRulesView.tsx
index 5d0d991..183d86b 100644
--- a/src/pages/Routes/components/Step1/MatchingRulesView.tsx
+++ b/src/pages/Routes/components/Step1/MatchingRulesView.tsx
@@ -129,7 +129,7 @@ const MatchingRulesView: React.FC<Props> = ({ data, disabled, onChange }) => {
   const renderModal = () => {
     return (
       <Modal
-        title={mode === 'EDIT' ? '编辑规则' : '增加规则'}
+        title={mode === 'EDIT' ? '编辑规则' : '新建规则'}
         centered
         visible={visible}
         onOk={onOk}
@@ -203,7 +203,7 @@ const MatchingRulesView: React.FC<Props> = ({ data, disabled, onChange }) => {
             marginBottom: 16,
           }}
         >
-          增加
+          新建
         </Button>
       )}
       <Table key="table" bordered dataSource={advancedMatchingRules} columns={columns} />
diff --git a/src/pages/Routes/components/Step1/RequestConfigView.tsx b/src/pages/Routes/components/Step1/RequestConfigView.tsx
index 65f4403..57ea740 100644
--- a/src/pages/Routes/components/Step1/RequestConfigView.tsx
+++ b/src/pages/Routes/components/Step1/RequestConfigView.tsx
@@ -67,7 +67,7 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
                     add();
                   }}
                 >
-                  <PlusOutlined /> 增加
+                  <PlusOutlined /> 新建
                 </Button>
               </Form.Item>
             )}
@@ -82,20 +82,42 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
       {(fields, { add, remove }) => {
         return (
           <div>
-            {fields.map((field) => (
+            {fields.map((field, index) => (
               <Form.Item
+                {...(index === 0 ? FORM_ITEM_LAYOUT : FORM_ITEM_WITHOUT_LABEL)}
+                label={index === 0 ? '路径' : ''}
                 required
                 key={field.key}
-                extra='请求路径,如 "/foo/index.html",支持请求路径前缀 "/foo/\*"'
+                extra={
+                  index === 0 ? (
+                    <div>
+                      1. 请求路径,如 &quot;/foo/index.html&quot;,支持请求路径前缀
+                      &quot;/foo/*&quot;;
+                      <br />
+                      2. &quot;/*&quot; 代表所有路径
+                    </div>
+                  ) : null
+                }
               >
-                <Form.Item {...field} validateTrigger={['onChange', 'onBlur']} noStyle>
+                <Form.Item
+                  {...field}
+                  validateTrigger={['onChange', 'onBlur']}
+                  rules={[
+                    {
+                      required: true,
+                      whitespace: true,
+                      message: '请输入请求路径',
+                    },
+                  ]}
+                  noStyle
+                >
                   <Input
                     placeholder="请输入请求路径"
                     style={{ width: '60%' }}
                     disabled={disabled}
                   />
                 </Form.Item>
-                {!disabled && (
+                {!disabled && fields.length > 1 && (
                   <MinusCircleOutlined
                     className="dynamic-delete-button"
                     style={{ margin: '0 8px' }}
@@ -106,16 +128,15 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
                 )}
               </Form.Item>
             ))}
-            {fields.length === 0 && disabled && <span>无</span>}
             {!disabled && (
-              <Form.Item>
+              <Form.Item {...FORM_ITEM_WITHOUT_LABEL}>
                 <Button
                   type="dashed"
                   onClick={() => {
                     add();
                   }}
                 >
-                  <PlusOutlined /> 增加
+                  <PlusOutlined /> 新建
                 </Button>
               </Form.Item>
             )}
@@ -139,7 +160,7 @@ const RequestConfigView: React.FC<Props> = ({ data, disabled, onChange }) => {
         <Switch disabled={disabled} />
       </Form.Item>
       {renderHosts()}
-      <Form.Item label="路径">{renderPaths()}</Form.Item>
+      {renderPaths()}
       <Form.Item
         label="HTTP 方法"
         name="methods"
diff --git a/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx b/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx
index 48a6981..bce870e 100644
--- a/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx
+++ b/src/pages/Routes/components/Step2/HttpHeaderRewriteView.tsx
@@ -33,7 +33,7 @@ const HttpHeaderRewriteView: React.FC<Props> = ({ data, disabled, onChange }) =>
       dataIndex: 'header_action',
       key: 'header_action',
       render: (action: 'override' | 'remove') => {
-        return action === 'override' ? '重写/新建' : '删除';
+        return action === 'override' ? '重写/添加' : '删除';
       },
     },
     {
diff --git a/src/pages/Routes/components/Step2/RequestRewriteView.tsx b/src/pages/Routes/components/Step2/RequestRewriteView.tsx
index eea2a43..f53cf32 100644
--- a/src/pages/Routes/components/Step2/RequestRewriteView.tsx
+++ b/src/pages/Routes/components/Step2/RequestRewriteView.tsx
@@ -24,7 +24,8 @@ const RequestRewriteView: React.FC<Props> = ({ data, form, disabled, onChange })
               required
               key={field.key}
               {...(index === 0 ? FORM_ITEM_LAYOUT : FORM_ITEM_WITHOUT_LABEL)}
-              label={index === 0 ? '域名/IP' : ''}
+              label={index === 0 ? '后端服务域名/IP' : ''}
+              extra={index === 0 ? '使用域名时,默认解析本地 /etc/resolv.conf' : ''}
             >
               <Row style={{ marginBottom: '10px' }} gutter={16}>
                 <Col span={9}>
@@ -76,7 +77,7 @@ const RequestRewriteView: React.FC<Props> = ({ data, form, disabled, onChange })
                   add();
                 }}
               >
-                <PlusOutlined /> 增加
+                <PlusOutlined /> 新建
               </Button>
             </Form.Item>
           )}
diff --git a/src/pages/Routes/constants.ts b/src/pages/Routes/constants.ts
index ced7e0d..c0ef624 100644
--- a/src/pages/Routes/constants.ts
+++ b/src/pages/Routes/constants.ts
@@ -30,7 +30,7 @@ export const DEFAULT_STEP_1_DATA: RouteModule.Step1Data = {
   protocols: ['http', 'https'],
   websocket: false,
   hosts: [''],
-  paths: [],
+  paths: ['/*'],
   forceHttps: false,
   redirectURI: '',
   redirectCode: 302,