[GitHub] [incubator-apisix] qiujiayu opened a new pull request #1629: check `instance_id`

2020-05-31 Thread GitBox


qiujiayu opened a new pull request #1629:
URL: https://github.com/apache/incubator-apisix/pull/1629


   `if service_id and service_id then`
   
   to 
   
   `if service_id and instance_id then`



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-route created (now ae66ac1)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


  at ae66ac1  feat: added mapper

This branch includes the following new commits:

 new ae66ac1  feat: added mapper

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-dashboard] 01/01: feat: added mapper

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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

commit ae66ac1ca5529c4ef2109473468037a4de7771c1
Author: juzhiyuan 
AuthorDate: Sun May 31 18:34:50 2020 +0800

feat: added mapper
---
 src/components/PluginForm/data.ts  | 10 +
 src/components/PluginForm/index.ts |  3 ++-
 src/components/PluginForm/service.ts   |  4 
 .../PluginForm/{typingd.d.ts => typing.d.ts}   |  6 ++
 src/pages/Routes/Create.tsx|  2 +-
 .../Routes/components/CreateStep3/CreateStep3.tsx  | 25 +-
 .../Routes/components/CreateStep3/PluginCard.tsx   | 12 +--
 .../Routes/components/CreateStep3/PluginDrawer.tsx |  2 +-
 8 files changed, 49 insertions(+), 15 deletions(-)

diff --git a/src/components/PluginForm/data.ts 
b/src/components/PluginForm/data.ts
new file mode 100644
index 000..ca53550
--- /dev/null
+++ b/src/components/PluginForm/data.ts
@@ -0,0 +1,10 @@
+interface Props extends PluginForm.PluginMeta {
+  name: PluginForm.PluginName;
+}
+
+export const list: Props[] = [
+  {
+name: 'limit-req',
+desc: '限流限制请求速度的插件,使用的是漏桶算法。',
+  },
+];
diff --git a/src/components/PluginForm/index.ts 
b/src/components/PluginForm/index.ts
index 2f23710..927447e 100644
--- a/src/components/PluginForm/index.ts
+++ b/src/components/PluginForm/index.ts
@@ -1,2 +1,3 @@
 export { default } from './PluginForm';
-export { fetchList as fetchPluginList } from './service';
+export { fetchList as fetchPluginList, getPluginMeta } from './service';
+export { list as pluginList } from './data';
diff --git a/src/components/PluginForm/service.ts 
b/src/components/PluginForm/service.ts
index 447bd9a..cd2711d 100644
--- a/src/components/PluginForm/service.ts
+++ b/src/components/PluginForm/service.ts
@@ -1,7 +1,11 @@
 import { request } from 'umi';
 import { transformSchemaFromAPI } from './transformer';
+import { list } from './data';
 
 export const fetchList = () => request('/plugins/list');
 
 export const fetchPluginSchema = (name: string): 
Promise =>
   request(`/schema/plugins/${name}`).then((data) => 
transformSchemaFromAPI(data, name));
+
+export const getPluginMeta = (name: PluginForm.PluginName): 
PluginForm.PluginMeta | undefined =>
+  list.find((item) => item.name === name);
diff --git a/src/components/PluginForm/typingd.d.ts 
b/src/components/PluginForm/typing.d.ts
similarity index 92%
rename from src/components/PluginForm/typingd.d.ts
rename to src/components/PluginForm/typing.d.ts
index 72a872f..db29275 100644
--- a/src/components/PluginForm/typingd.d.ts
+++ b/src/components/PluginForm/typing.d.ts
@@ -1,4 +1,6 @@
 declare namespace PluginForm {
+  type PluginName = 'limit-req';
+
   interface Props {
 name?: string;
 initialData?: PluginSchema;
@@ -47,4 +49,8 @@ declare namespace PluginForm {
   }>;
 };
   }
+
+  interface PluginMeta {
+desc?: string;
+  }
 }
diff --git a/src/pages/Routes/Create.tsx b/src/pages/Routes/Create.tsx
index d4f9e3c..28e2b89 100644
--- a/src/pages/Routes/Create.tsx
+++ b/src/pages/Routes/Create.tsx
@@ -17,7 +17,7 @@ const Create: React.FC = () => {
 advancedMatchingRules: [],
   });
 
-  const [currentStep] = useState(0);
+  const [currentStep] = useState(2);
   const [stepHeader] = useState(['定义 API 请求', '定义 API 后端服务', '插件配置', '预览']);
   const data = {
 step1Data,
diff --git a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx 
b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
index 38647b3..fe21686 100644
--- a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
+++ b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
@@ -1,8 +1,8 @@
-import React, { useState, useEffect } from 'react';
+import React, { useState } from 'react';
 import { Card } from 'antd';
-import { SettingOutlined } from '@ant-design/icons';
+import { SettingOutlined, LinkOutlined } from '@ant-design/icons';
 
-import { fetchPluginList } from '@/components/PluginForm';
+import { pluginList } from '@/components/PluginForm';
 import PanelSection from '../PanelSection';
 import PluginDrawer from './PluginDrawer';
 import PluginCard from './PluginCard';
@@ -14,13 +14,8 @@ const sectionStyle = {
 };
 
 const CreateStep3: React.FC = () => {
-  const [pluginList, setPluginList] = useState([]);
   const [currentPlugin, setCurrentPlugin] = useState();
 
-  useEffect(() => {
-fetchPluginList().then((data) => setPluginList(data));
-  }, []);
-
   // TODO: 设置插件黑名单(不展示的插件)
   // TODO: 获取 Route 已启用插件
   // TODO: 拆分已启用、未启用插件
@@ -36,10 +31,20 @@ const CreateStep3: React.FC = () => {
 
   
   
-{pluginList.map((name) => (
+{pluginList.map(({ name }) => (
setCurrentPlugin(name)} 
/>]}
+actions={[
+   setCurrentPlugin(name)} />,
+  
+  window.open(
+ 

[incubator-apisix] branch master updated: bugfix: fix typo of `instance_id` in skywalking plugin. (#1629)

2020-05-31 Thread wenming
This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
 new 25e608c  bugfix: fix typo of `instance_id` in skywalking plugin. 
(#1629)
25e608c is described below

commit 25e608c94666c6028aa47c6e02c9c16bdfdc234a
Author: qiujiayu <153163...@qq.com>
AuthorDate: Sun May 31 20:39:15 2020 +0800

bugfix: fix typo of `instance_id` in skywalking plugin. (#1629)
---
 apisix/plugins/skywalking/tracer.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apisix/plugins/skywalking/tracer.lua 
b/apisix/plugins/skywalking/tracer.lua
index edc4bfe..187b941 100644
--- a/apisix/plugins/skywalking/tracer.lua
+++ b/apisix/plugins/skywalking/tracer.lua
@@ -36,7 +36,7 @@ function _M.start(ctx, endpoint, upstream_name)
 local instance_id = tracing_buffer:get(endpoint .. '_instance_id')
 local service_id = tracing_buffer:get(endpoint .. '_service_id')
 
-if service_id and service_id then
+if service_id and instance_id then
 context = tracing_context.new(service_id, instance_id)
 else
 context = tracing_context.newNoOP()



[GitHub] [incubator-apisix] moonming merged pull request #1629: check `instance_id`

2020-05-31 Thread GitBox


moonming merged pull request #1629:
URL: https://github.com/apache/incubator-apisix/pull/1629


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-route updated: feat: added locale

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/feat-route by this push:
 new 2f8767b  feat: added locale
2f8767b is described below

commit 2f8767b94c096dc23227a0ecdc62cb72c14618d5
Author: juzhiyuan 
AuthorDate: Sun May 31 20:57:18 2020 +0800

feat: added locale
---
 src/components/PluginForm/READMD.md|  9 +
 src/components/PluginForm/data.ts  | 10 --
 src/components/PluginForm/index.ts |  4 +++-
 src/components/PluginForm/locales/en-US.ts | 22 +
 src/components/PluginForm/locales/zh-CN.ts | 23 ++
 src/components/PluginForm/service.ts   | 13 +---
 src/components/PluginForm/typing.d.ts  | 11 +++
 src/locales/en-US.ts   |  3 +++
 src/locales/zh-CN.ts   |  3 +++
 .../Routes/components/CreateStep3/PluginCard.tsx   | 16 +++
 10 files changed, 91 insertions(+), 23 deletions(-)

diff --git a/src/components/PluginForm/READMD.md 
b/src/components/PluginForm/READMD.md
new file mode 100644
index 000..68d4686
--- /dev/null
+++ b/src/components/PluginForm/READMD.md
@@ -0,0 +1,9 @@
+# PluginForm
+
+> The PluginForm component aims to build UI according to the plugin schema.
+
+## Usage
+
+1. Modify `list` variable in `data.ts` file.
+2. Modify filds under `/locales` folder to have a good translation.
+3. Import files under `/locales` folder to `/src/locales` to be localization.
diff --git a/src/components/PluginForm/data.ts 
b/src/components/PluginForm/data.ts
index ca53550..ab0e0ac 100644
--- a/src/components/PluginForm/data.ts
+++ b/src/components/PluginForm/data.ts
@@ -1,10 +1,8 @@
-interface Props extends PluginForm.PluginMeta {
-  name: PluginForm.PluginName;
-}
-
-export const list: Props[] = [
+export const list: PluginForm.PluginProps[] = [
   {
 name: 'limit-req',
-desc: '限流限制请求速度的插件,使用的是漏桶算法。',
+  },
+  {
+name: 'key-auth',
   },
 ];
diff --git a/src/components/PluginForm/index.ts 
b/src/components/PluginForm/index.ts
index 927447e..4872268 100644
--- a/src/components/PluginForm/index.ts
+++ b/src/components/PluginForm/index.ts
@@ -1,3 +1,5 @@
 export { default } from './PluginForm';
-export { fetchList as fetchPluginList, getPluginMeta } from './service';
+export { fetchList as fetchPluginList } from './service';
 export { list as pluginList } from './data';
+export { default as PluginFormZhCN } from './locales/zh-CN';
+export { default as PluginFormEnUS } from './locales/en-US';
diff --git a/src/components/PluginForm/locales/en-US.ts 
b/src/components/PluginForm/locales/en-US.ts
new file mode 100644
index 000..47caee9
--- /dev/null
+++ b/src/components/PluginForm/locales/en-US.ts
@@ -0,0 +1,22 @@
+import { list2locale } from '../service';
+
+const prefix = 'PluginForm';
+
+const pluginList: PluginForm.PluginLocaleProps[] = [
+  {
+name: 'limit-req',
+desc: '',
+  },
+  {
+name: 'limit-req',
+desc: 'limit request rate using the "leaky bucket" method.',
+  },
+  {
+name: 'key-auth',
+desc: 'key-auth is an authentication plugin, it should work with consumer 
together.',
+  },
+];
+
+export default {
+  ...list2locale(pluginList, prefix),
+};
diff --git a/src/components/PluginForm/locales/zh-CN.ts 
b/src/components/PluginForm/locales/zh-CN.ts
new file mode 100644
index 000..0140aa8
--- /dev/null
+++ b/src/components/PluginForm/locales/zh-CN.ts
@@ -0,0 +1,23 @@
+import { list2locale } from '../service';
+
+const prefix = 'PluginForm';
+
+const pluginList: PluginForm.PluginLocaleProps[] = [
+  // BUG: list2locale
+  {
+name: 'limit-req',
+desc: '',
+  },
+  {
+name: 'limit-req',
+desc: '限流限制请求速度的插件,使用的是漏桶算法。',
+  },
+  {
+name: 'key-auth',
+desc: 'basic-auth 是一个认证插件,它需要与 consumer 一起配合才能工作。',
+  },
+];
+
+export default {
+  ...list2locale(pluginList, prefix),
+};
diff --git a/src/components/PluginForm/service.ts 
b/src/components/PluginForm/service.ts
index cd2711d..2272eb5 100644
--- a/src/components/PluginForm/service.ts
+++ b/src/components/PluginForm/service.ts
@@ -1,11 +1,18 @@
 import { request } from 'umi';
 import { transformSchemaFromAPI } from './transformer';
-import { list } from './data';
 
 export const fetchList = () => request('/plugins/list');
 
 export const fetchPluginSchema = (name: string): 
Promise =>
   request(`/schema/plugins/${name}`).then((data) => 
transformSchemaFromAPI(data, name));
 
-export const getPluginMeta = (name: PluginForm.PluginName): 
PluginForm.PluginMeta | undefined =>
-  list.find((item) => item.name === name);
+export const list2locale = (list: PluginForm.PluginLocaleProps[], prefix = '') 
=> {
+  return list.reduce((prev, current) => {
+const data = {};
+Object.e

[GitHub] [incubator-apisix-dashboard] juzhiyuan opened a new pull request #222: Feat route

2020-05-31 Thread GitBox


juzhiyuan opened a new pull request #222:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/222


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-route updated (2f8767b -> 77c2d8f)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


from 2f8767b  feat: added locale
 add 77c2d8f  feat: update locale

No new revisions were added by this update.

Summary of changes:
 src/components/PluginForm/locales/en-US.ts | 23 +++
 src/components/PluginForm/locales/zh-CN.ts | 24 +++-
 src/components/PluginForm/service.ts   | 11 ---
 src/components/PluginForm/typing.d.ts  |  5 -
 4 files changed, 6 insertions(+), 57 deletions(-)



[GitHub] [incubator-apisix] juzhiyuan opened a new issue #1630: request help: Documentation for OAuth plugin in Chinese

2020-05-31 Thread GitBox


juzhiyuan opened a new issue #1630:
URL: https://github.com/apache/incubator-apisix/issues/1630


   ### Issue description
   Documentation for OAuth plugin[1] in Chinese 
   
   ### Environment
   None
   
   [1] 
https://github.com/apache/incubator-apisix/blob/master/doc/plugins/oauth.md



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix] qiujiayu opened a new pull request #1631: add the link to discovery.md

2020-05-31 Thread GitBox


qiujiayu opened a new pull request #1631:
URL: https://github.com/apache/incubator-apisix/pull/1631


   add the link to discovery.md



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-route updated (77c2d8f -> 92bbd03)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


from 77c2d8f  feat: update locale
 add 92bbd03  feat: update locale

No new revisions were added by this update.

Summary of changes:
 src/components/PluginForm/data.ts  | 77 +-
 src/components/PluginForm/locales/en-US.ts | 46 -
 src/components/PluginForm/locales/zh-CN.ts | 42 +++-
 src/locales/en-US/menu.ts  |  2 +
 src/pages/Routes/Create.less   | 11 
 .../Routes/components/CreateStep3/CreateStep3.tsx  |  1 +
 .../Routes/components/CreateStep3/PluginCard.tsx   |  7 +-
 7 files changed, 180 insertions(+), 6 deletions(-)



[GitHub] [incubator-apisix-dashboard] juzhiyuan merged pull request #222: Feat route

2020-05-31 Thread GitBox


juzhiyuan merged pull request #222:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/222


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch next updated: Feat route (#222)

2020-05-31 Thread juzhiyuan
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 c6fd84f  Feat route (#222)
c6fd84f is described below

commit c6fd84f2e36ae5ca3b1b9962fe2b35078b31ad05
Author: 琚致远 
AuthorDate: Sun May 31 22:18:30 2020 +0800

Feat route (#222)

* feat: added mapper

* feat: added locale

* feat: update locale

* feat: update locale
---
 src/components/PluginForm/READMD.md|  9 +++
 src/components/PluginForm/data.ts  | 83 ++
 src/components/PluginForm/index.ts |  3 +
 src/components/PluginForm/locales/en-US.ts | 49 +
 src/components/PluginForm/locales/zh-CN.ts | 43 +++
 .../PluginForm/{typingd.d.ts => typing.d.ts}   |  4 ++
 src/locales/en-US.ts   |  3 +
 src/locales/en-US/menu.ts  |  2 +
 src/locales/zh-CN.ts   |  3 +
 src/pages/Routes/Create.less   | 11 +++
 src/pages/Routes/Create.tsx|  2 +-
 .../Routes/components/CreateStep3/CreateStep3.tsx  | 26 ---
 .../Routes/components/CreateStep3/PluginCard.tsx   | 13 +++-
 .../Routes/components/CreateStep3/PluginDrawer.tsx |  2 +-
 14 files changed, 239 insertions(+), 14 deletions(-)

diff --git a/src/components/PluginForm/READMD.md 
b/src/components/PluginForm/READMD.md
new file mode 100644
index 000..68d4686
--- /dev/null
+++ b/src/components/PluginForm/READMD.md
@@ -0,0 +1,9 @@
+# PluginForm
+
+> The PluginForm component aims to build UI according to the plugin schema.
+
+## Usage
+
+1. Modify `list` variable in `data.ts` file.
+2. Modify filds under `/locales` folder to have a good translation.
+3. Import files under `/locales` folder to `/src/locales` to be localization.
diff --git a/src/components/PluginForm/data.ts 
b/src/components/PluginForm/data.ts
new file mode 100644
index 000..f4d6afa
--- /dev/null
+++ b/src/components/PluginForm/data.ts
@@ -0,0 +1,83 @@
+export const list: PluginForm.PluginProps[] = [
+  {
+name: 'basic-auth',
+  },
+  {
+name: 'batch-requests',
+  },
+  {
+name: 'cors',
+  },
+  {
+name: 'fault-injection',
+  },
+  {
+name: 'grpc-transcoding',
+  },
+  {
+name: 'http-logger',
+  },
+  {
+name: 'ip-restriction',
+  },
+  {
+name: 'jwt-auth',
+  },
+  {
+name: 'kafka-logger',
+  },
+  {
+name: 'key-auth',
+  },
+  {
+name: 'limit-conn',
+  },
+  {
+name: 'limit-count',
+  },
+  {
+name: 'limit-req',
+  },
+  {
+name: 'mqtt-proxy',
+  },
+  {
+name: 'oauth',
+  },
+  {
+name: 'prometheus',
+  },
+  {
+name: 'proxy-cache',
+  },
+  {
+name: 'proxy-mirror',
+  },
+  {
+name: 'proxy-rewrite',
+  },
+  {
+name: 'redirect',
+  },
+  {
+name: 'response-rewrite',
+  },
+  {
+name: 'serverless',
+  },
+  {
+name: 'syslog',
+  },
+  {
+name: 'tcp-logger',
+  },
+  {
+name: 'udp-logger',
+  },
+  {
+name: 'wolf-rbac',
+  },
+  {
+name: 'zipkin',
+  },
+];
diff --git a/src/components/PluginForm/index.ts 
b/src/components/PluginForm/index.ts
index 2f23710..4872268 100644
--- a/src/components/PluginForm/index.ts
+++ b/src/components/PluginForm/index.ts
@@ -1,2 +1,5 @@
 export { default } from './PluginForm';
 export { fetchList as fetchPluginList } from './service';
+export { list as pluginList } from './data';
+export { default as PluginFormZhCN } from './locales/zh-CN';
+export { default as PluginFormEnUS } from './locales/en-US';
diff --git a/src/components/PluginForm/locales/en-US.ts 
b/src/components/PluginForm/locales/en-US.ts
new file mode 100644
index 000..9f57841
--- /dev/null
+++ b/src/components/PluginForm/locales/en-US.ts
@@ -0,0 +1,49 @@
+export default {
+  'PluginForm.plugin.basic-auth.desc':
+'basic-auth is an authentication plugin that need to work with consumer.',
+  'PluginForm.plugin.batch-requests.desc':
+'batch-requests can accept mutiple request and send them from apisix via 
http pipeline,and return a aggregated response to client,this can significantly 
improve performance when the client needs to access multiple APIs.',
+  'PluginForm.plugin.cors.desc': 'cors plugin can help you enable CORS 
easily.',
+  'PluginForm.plugin.fault-injection.desc':
+'Fault injection plugin, this plugin can be used with other plugins and 
will be executed before other plugins.',
+  'PluginForm.plugin.grpc-transcoding.desc': 'HTTP(s) -> APISIX -> gRPC 
server',
+  'PluginForm.plugin.http-logger.desc':
+'http-logger is a plugin which push Log data requests to HTTP/HTTPS 
servers.',
+  'PluginForm.plugin.ip-restriction.desc':
+'The ip-restriction can restrict access to a Service or a Route by either 
whitelisting or blacklisting IP addresses. 

[incubator-apisix-dashboard] branch feat-route created (now 92bbd03)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


  at 92bbd03  feat: update locale

No new revisions were added by this update.



[incubator-apisix-dashboard] branch next updated: Rename READMD.md to README.md

2020-05-31 Thread juzhiyuan
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 ab097fd  Rename READMD.md to README.md
ab097fd is described below

commit ab097fd1ca25b6f14a992e92daf6c7932e2e29cb
Author: 琚致远 
AuthorDate: Sun May 31 22:20:29 2020 +0800

Rename READMD.md to README.md
---
 src/components/PluginForm/{READMD.md => README.md} | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/src/components/PluginForm/READMD.md 
b/src/components/PluginForm/README.md
similarity index 100%
rename from src/components/PluginForm/READMD.md
rename to src/components/PluginForm/README.md



[GitHub] [incubator-apisix-dashboard] juzhiyuan closed issue #201: Auto import block Routes

2020-05-31 Thread GitBox


juzhiyuan closed issue #201:
URL: https://github.com/apache/incubator-apisix-dashboard/issues/201


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-website] branch master updated: Update config.yaml

2020-05-31 Thread juzhiyuan
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/incubator-apisix-website.git


The following commit(s) were added to refs/heads/master by this push:
 new a6dad72  Update config.yaml
a6dad72 is described below

commit a6dad72b68a074a3c11f78bbbad60eaa1e5f2c90
Author: 琚致远 
AuthorDate: Sun May 31 22:40:21 2020 +0800

Update config.yaml
---
 config.yaml | 4 
 1 file changed, 4 insertions(+)

diff --git a/config.yaml b/config.yaml
index f32a2d3..9b913a6 100644
--- a/config.yaml
+++ b/config.yaml
@@ -45,6 +45,8 @@ languages:
   url: /contribute/subscribe
 - title: Contributor Guide
   url: /contribute/contributor
+- title: GitHub Issue Tracker
+  url: https://github.com/apache/incubator-apisix/issues
 - title: Committer Guide
   url: /contribute/committer
 - title: Release Guide
@@ -140,6 +142,8 @@ languages:
 url: /zh/contribute/subscribe
   - title: 贡献者指南
 url: /zh/contribute/contributor
+  - title: GitHub Issue Tracker
+url: https://github.com/apache/incubator-apisix/issues
   - title: 提交者指南
 url: /zh/contribute/committer
   - title: 发布指南



[incubator-apisix-website] branch asf-site updated: Deploy to GitHub pages

2020-05-31 Thread github-bot
This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/incubator-apisix-website.git


The following commit(s) were added to refs/heads/asf-site by this push:
 new c573173  Deploy to GitHub pages
c573173 is described below

commit c573173e18c1d180a9869a8108b72b078f91e829
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sun May 31 14:40:38 2020 +

Deploy to GitHub pages
---
 contribute/2fa/index.html| 6 ++
 contribute/committer/index.html  | 6 ++
 contribute/contributor/index.html| 6 ++
 contribute/release/index.html| 6 ++
 contribute/security/index.html   | 6 ++
 contribute/subscribe/index.html  | 6 ++
 downloads/index.html | 6 ++
 index.html   | 6 ++
 team/index.html  | 6 ++
 zh/contribute/2fa/index.html | 6 ++
 zh/contribute/committer/index.html   | 6 ++
 zh/contribute/contributor/index.html | 6 ++
 zh/contribute/release/index.html | 6 ++
 zh/contribute/security/index.html| 6 ++
 zh/contribute/subscribe/index.html   | 6 ++
 zh/downloads/index.html  | 6 ++
 zh/index.html| 6 ++
 zh/team/index.html   | 6 ++
 18 files changed, 108 insertions(+)

diff --git a/contribute/2fa/index.html b/contribute/2fa/index.html
index 3e1cf20..ec1f4ef 100644
--- a/contribute/2fa/index.html
+++ b/contribute/2fa/index.html
@@ -69,6 +69,9 @@ Note:If you do not enable 2FA, you will be removed from the 
project and unable t
   
 Contributor Guide
   
+  https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+GitHub Issue Tracker
+  
   
 Committer Guide
   
@@ -158,6 +161,9 @@ Note:If you do not enable 2FA, you will be removed from the 
project and unable t
 
   Contributor Guide
 
+https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+  GitHub Issue Tracker
+
 
   Committer Guide
 
diff --git a/contribute/committer/index.html b/contribute/committer/index.html
index 16ecb8f..766363f 100644
--- a/contribute/committer/index.html
+++ b/contribute/committer/index.html
@@ -76,6 +76,9 @@
   
 Contributor Guide
   
+  https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+GitHub Issue Tracker
+  
   
 Committer Guide
   
@@ -165,6 +168,9 @@
 
   Contributor Guide
 
+https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+  GitHub Issue Tracker
+
 
   Committer Guide
 
diff --git a/contribute/contributor/index.html 
b/contribute/contributor/index.html
index 3418ff3..36391c5 100644
--- a/contribute/contributor/index.html
+++ b/contribute/contributor/index.html
@@ -72,6 +72,9 @@ Submit an issue 1. Before submitting your issues, please go 
through a comprehens
   
 Contributor Guide
   
+  https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+GitHub Issue Tracker
+  
   
 Committer Guide
   
@@ -161,6 +164,9 @@ Submit an issue 1. Before submitting your issues, please go 
through a comprehens
 
   Contributor Guide
 
+https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+  GitHub Issue Tracker
+
 
   Committer Guide
 
diff --git a/contribute/release/index.html b/contribute/release/index.html
index ff642e8..deb07fd 100644
--- a/contribute/release/index.html
+++ b/contribute/release/index.html
@@ -75,6 +75,9 @@ GnuPG-2.x可使用:
   
 Contributor Guide
   
+  https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+GitHub Issue Tracker
+  
   
 Committer Guide
   
@@ -164,6 +167,9 @@ GnuPG-2.x可使用:
 
   Contributor Guide
 
+https://github.com/apache/incubator-apisix/issues"; 
class="navbar-item">
+  GitHub Issue Tracker
+
 
   Committer Guide
 
diff --git a/contribute/security/index.html b/contribute/security/index.html
index 8b7f5ef..c995f30 100644
--- a/contribute/security/index.html
+++ b/contribute/security/index.html

[GitHub] [incubator-apisix-dashboard] LiteSun opened a new pull request #223: feat: handle Modal close event

2020-05-31 Thread GitBox


LiteSun opened a new pull request #223:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/223


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] 01/01: feat: update naming

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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

commit 18ff83ed907fd5d841ef6b933d85d95f0f89bac0
Author: juzhiyuan 
AuthorDate: Sun May 31 23:00:35 2020 +0800

feat: update naming
---
 src/pages/Routes/Create.tsx |  8 
 src/pages/Routes/components/CreateStep3/CreateStep3.tsx | 11 ---
 src/pages/Routes/components/Step1/index.tsx | 10 +-
 src/pages/Routes/typing.d.ts|  8 
 4 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/src/pages/Routes/Create.tsx b/src/pages/Routes/Create.tsx
index 28e2b89..ac9127c 100644
--- a/src/pages/Routes/Create.tsx
+++ b/src/pages/Routes/Create.tsx
@@ -8,7 +8,7 @@ import CreateStep3 from './components/CreateStep3';
 const { Step } = Steps;
 
 const Create: React.FC = () => {
-  const [step1Data, setStep1Data] = useState({
+  const [step1Data, setStep1Data] = useState({
 name: '',
 protocol: [],
 hosts: [''],
@@ -23,7 +23,7 @@ const Create: React.FC = () => {
 step1Data,
   };
 
-  const handleChange = (step: number, params: RoutesModule.Step1DataProps) => {
+  const handleChange = (step: number, params: RouteModule.Step1Data) => {
 switch (step) {
   case 0:
 setStep1Data({ ...step1Data, ...params });
@@ -38,11 +38,11 @@ const Create: React.FC = () => {
 return (

handleChange(currentStep, params)}
+onChange={(params: RouteModule.Step1Data) => 
handleChange(currentStep, params)}
   />
 );
   case 2:
-return ;
+return  {}} />;
   default:
 return null;
 }
diff --git a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx 
b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
index 8526b34..4e9a30a 100644
--- a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
+++ b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
@@ -7,6 +7,8 @@ import PanelSection from '../PanelSection';
 import PluginDrawer from './PluginDrawer';
 import PluginCard from './PluginCard';
 
+interface Props extends RouteModule.Data {}
+
 const sectionStyle = {
   display: 'grid',
   gridTemplateColumns: 'repeat(3, 33.333%)',
@@ -14,10 +16,13 @@ const sectionStyle = {
   gridColumnGap: 10,
 };
 
-const CreateStep3: React.FC = () => {
+const CreateStep3: React.FC = () => {
   const [currentPlugin, setCurrentPlugin] = useState();
 
-  // TODO: 设置插件黑名单(不展示的插件)
+  // NOTE: Plugin in blacklist WILL NOT be shown on Step3.
+  const pluginBlackList = ['redirect'];
+  const list = pluginList.filter(({ name }) => 
!pluginBlackList.includes(name));
+
   // TODO: 获取 Route 已启用插件
   // TODO: 拆分已启用、未启用插件
 
@@ -32,7 +37,7 @@ const CreateStep3: React.FC = () => {
 
   
   
-{pluginList.map(({ name }) => (
+{list.map(({ name }) => (
= ({ data, onChange }) => {
+const Step1: React.FC = ({ data, onChange }) => {
   const { step1Data } = data;
   const { hosts, paths, advancedMatchingRules } = step1Data;
   const [form] = Form.useForm();
   const [modalVisible, setModalVisible] = useState(false);
-  const [editModalData, setEditModalData] = 
useState({
+  const [editModalData, setEditModalData] = 
useState({
 paramsLocation: 'query',
 paramsName: '',
 paramsExpresstion: '==',
@@ -33,7 +33,7 @@ const Step1: React.FC = ({ data, 
onChange }) => {
 setModalVisible(true);
   };
 
-  const handleEdit = (record: RoutesModule.MatchingRule) => {
+  const handleEdit = (record: RouteModule.MatchingRule) => {
 setEditModalData(record);
 requestAnimationFrame(() => {
   setModalVisible(true);
@@ -69,7 +69,7 @@ const Step1: React.FC = ({ data, 
onChange }) => {
 {
   title: '操作',
   key: 'action',
-  render: (_: any, record: RoutesModule.MatchingRule) => (
+  render: (_: any, record: RouteModule.MatchingRule) => (
 
handleEdit(record)}>编辑
handleRemove(record.key)}>移除
@@ -218,7 +218,7 @@ const Step1: React.FC = ({ data, 
onChange }) => {
 modalForm.validateFields().then((value) => {
   onChange({
 advancedMatchingRules: advancedMatchingRules.concat({
-  ...(value as RoutesModule.MatchingRule),
+  ...(value as RouteModule.MatchingRule),
   key: Math.random().toString(36).slice(2),
 }),
   });
diff --git a/src/pages/Routes/typing.d.ts b/src/pages/Routes/typing.d.ts
index 0f26e6b..b313f36 100644
--- a/src/pages/Routes/typing.d.ts
+++ b/src/pages/Routes/typing.d.ts
@@ -1,4 +1,4 @@
-declare namespace RoutesModule {
+declare namespace RouteModule {
   interface MatchingRule {
 paramsLocation: 'query' | 'params' | 'header' | 'cookie';
 paramsName: string;
@@ -7,7 +7,7 @@ declare namespace RoutesModule {
 key: string;
   }
 
-  interface Step1DataProps {
+  interface Step1Da

[incubator-apisix-dashboard] branch feat-update-route created (now 18ff83e)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


  at 18ff83e  feat: update naming

This branch includes the following new commits:

 new 18ff83e  feat: update naming

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[GitHub] [incubator-apisix] agile6v commented on issue #1225: feature: Support echo plugin

2020-05-31 Thread GitBox


agile6v commented on issue #1225:
URL: 
https://github.com/apache/incubator-apisix/issues/1225#issuecomment-636483692


   Hi @Akayeshmantha 
   
   We can refer to the implementation of the plugin 
[response-rewrite](https://github.com/apache/incubator-apisix/blob/master/apisix/plugins/response-rewrite.lua#L98).
  It has the ability to override the response body.  In the echo plugin we 
implement the function like this:
   
   ```shell
   function _M.body_filter(conf, ctx)
   conf.before_body + response.body + conf.after_body
   end
   ```
   
   FYI: https://github.com/openresty/lua-nginx-module#body_filter_by_lua
   
   Hope I've described it clearly.
   
   Thanks.




This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix-dashboard] juzhiyuan commented on a change in pull request #223: feat: handle Modal close event

2020-05-31 Thread GitBox


juzhiyuan commented on a change in pull request #223:
URL: 
https://github.com/apache/incubator-apisix-dashboard/pull/223#discussion_r432957813



##
File path: src/pages/Routes/components/Step1/index.tsx
##
@@ -155,63 +169,84 @@ const Step1: React.FC = ({ data, 
onChange }) => {
 
   );
 
-  const renderBaseRequestConfig = () => (
-<>
-  
-
-  
-
-  
-{['HTTP', 'HTTPS', 'WebSocket'].map((item) => (
-  
-{item}
-  
-))}
-  
-
-  
-  {/* TODO: name */}
-  
-{renderHosts()}
- {
-addHost();
-  }}
+  const renderBaseRequestConfig = () => {
+const onProtocolChange = (e: CheckboxValueType[]) => {
+  if (!e.includes('HTTP') && !e.includes('HTTPS')) return;
+  setProtocolValueList(e as HttpType[]);
+};
+const onMethodsChange = (checkedList: CheckboxValueType[]) => {
+  setHttpMethodsList({
+checkedList: checkedList as HttpMethodsListType[],
+indeterminate: !!checkedList.length && checkedList.length < 
httpMethodsOptionList.length,
+checkAll: checkedList.length === httpMethodsOptionList.length,
+  });
+};
+const onCheckAllChange = (e: CheckboxChangeEvent) => {
+  setHttpMethodsList({

Review comment:
   ,

##
File path: src/pages/Routes/components/Step1/index.tsx
##
@@ -16,17 +20,27 @@ const formItemLayout = {
   },
 };
 
+const initEditModalData: RoutesModule.MatchingRule = {

Review comment:
   DEFAULT_MODAL_DATA

##
File path: src/pages/Routes/components/Step1/index.tsx
##
@@ -16,17 +20,27 @@ const formItemLayout = {
   },
 };
 
+const initEditModalData: RoutesModule.MatchingRule = {
+  paramsLocation: 'query',
+  paramsName: '',
+  paramsExpresstion: '==',
+  paramsValue: '',
+  key: '',
+};
+
 const Step1: React.FC = ({ data, onChange }) => {
   const { step1Data } = data;
   const { hosts, paths, advancedMatchingRules } = step1Data;
   const [form] = Form.useForm();
   const [modalVisible, setModalVisible] = useState(false);
-  const [editModalData, setEditModalData] = 
useState({
-paramsLocation: 'query',
-paramsName: '',
-paramsExpresstion: '==',
-paramsValue: '',
-key: '',
+  const [editModalData, setEditModalData] = 
useState(initEditModalData);
+  const [protocolValueList, setProtocolValueList] = 
useState(['HTTP', 'HTTPS']);
+  const protocolList = ['HTTP', 'HTTPS', 'WebSocket'];
+  const httpMethodsOptionList = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 
'OPTIONS', 'PATCH'];

Review comment:
   separate them to constants.ts file?

##
File path: src/pages/Routes/components/Step1/index.tsx
##
@@ -16,17 +20,27 @@ const formItemLayout = {
   },
 };
 
+const initEditModalData: RoutesModule.MatchingRule = {
+  paramsLocation: 'query',
+  paramsName: '',
+  paramsExpresstion: '==',
+  paramsValue: '',
+  key: '',
+};
+
 const Step1: React.FC = ({ data, onChange }) => {
   const { step1Data } = data;
   const { hosts, paths, advancedMatchingRules } = step1Data;
   const [form] = Form.useForm();
   const [modalVisible, setModalVisible] = useState(false);
-  const [editModalData, setEditModalData] = 
useState({
-paramsLocation: 'query',
-paramsName: '',
-paramsExpresstion: '==',
-paramsValue: '',
-key: '',
+  const [editModalData, setEditModalData] = 
useState(initEditModalData);
+  const [protocolValueList, setProtocolValueList] = 
useState(['HTTP', 'HTTPS']);
+  const protocolList = ['HTTP', 'HTTPS', 'WebSocket'];
+  const httpMethodsOptionList = ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 
'OPTIONS', 'PATCH'];
+  const [httpMethodsList, setHttpMethodsList] = useState({

Review comment:
   ,

##
File path: src/pages/Routes/components/Step1/index.tsx
##
@@ -1,12 +1,16 @@
 import React, { useState } from 'react';
 import { Form, Button, Input, Checkbox, Row, Col, Table, Space, Modal, Select 
} from 'antd';
+import { CheckboxChangeEvent } from 'antd/lib/checkbox';
+import { CheckboxValueType } from 'antd/lib/checkbox/Group';
 import styles from '../../Create.less';
-
 import PanelSection from '../PanelSection';
 
 const { TextArea } = Input;
 const { Option } = Select;
 
+type HttpMethodsListType = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 
'OPTIONS' | 'PATCH';

Review comment:
   HttpMethod

##
File path: src/pages/Routes/components/Step1/index.tsx
##
@@ -16,17 +20,27 @@ const formItemLayout = {
   },
 };
 
+const initEditModalData: RoutesModule.MatchingRule = {
+  paramsLocation: 'query',
+  paramsName: '',
+  paramsExpresstion: '==',
+  paramsValue: '',
+  key: '',
+};
+
 const Step1: React.FC = ({ data, onChange }) => {
   const { step1Data } = data;
   const { hosts, paths, advancedMatchingRules } = step1Data;
   const [form] = Form.useForm();
   const [modalVi

[GitHub] [incubator-apisix-dashboard] juzhiyuan opened a new pull request #224: feat: update naming

2020-05-31 Thread GitBox


juzhiyuan opened a new pull request #224:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/224


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-update-route updated (18ff83e -> 86c8720)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


from 18ff83e  feat: update naming
 add 86c8720  feat: added Step3Data

No new revisions were added by this update.

Summary of changes:
 src/pages/Routes/Create.tsx| 30 +--
 .../Routes/components/CreateStep3/CreateStep3.tsx  | 43 +++---
 src/pages/Routes/typing.d.ts   | 11 +-
 3 files changed, 57 insertions(+), 27 deletions(-)



[incubator-apisix-dashboard] branch feat-update-route updated (86c8720 -> 878feec)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


from 86c8720  feat: added Step3Data
 add 878feec  feat: set active status

No new revisions were added by this update.

Summary of changes:
 .../Routes/components/CreateStep3/CreateStep3.tsx  |  6 +++-
 .../Routes/components/CreateStep3/PluginDrawer.tsx | 32 ++
 2 files changed, 26 insertions(+), 12 deletions(-)



[incubator-apisix-dashboard] branch next updated: feat: update naming (#224)

2020-05-31 Thread juzhiyuan
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 8fefd80  feat: update naming (#224)
8fefd80 is described below

commit 8fefd8023b04c15643e8c10c30201deeb34b7277
Author: 琚致远 
AuthorDate: Mon Jun 1 00:14:45 2020 +0800

feat: update naming (#224)

* feat: update naming

* feat: added Step3Data

* feat: set active status
---
 src/pages/Routes/Create.tsx| 32 -
 .../Routes/components/CreateStep3/CreateStep3.tsx  | 54 --
 .../Routes/components/CreateStep3/PluginDrawer.tsx | 32 -
 src/pages/Routes/components/Step1/index.tsx| 10 ++--
 src/pages/Routes/typing.d.ts   | 17 +--
 5 files changed, 97 insertions(+), 48 deletions(-)

diff --git a/src/pages/Routes/Create.tsx b/src/pages/Routes/Create.tsx
index 28e2b89..f007825 100644
--- a/src/pages/Routes/Create.tsx
+++ b/src/pages/Routes/Create.tsx
@@ -8,7 +8,7 @@ import CreateStep3 from './components/CreateStep3';
 const { Step } = Steps;
 
 const Create: React.FC = () => {
-  const [step1Data, setStep1Data] = useState({
+  const [step1Data, setStep1Data] = useState({
 name: '',
 protocol: [],
 hosts: [''],
@@ -17,19 +17,22 @@ const Create: React.FC = () => {
 advancedMatchingRules: [],
   });
 
+  const [step3Data, setStep3Data] = useState({
+plugins: {
+  'limit-count': {
+count: 2,
+time_window: 60,
+rejected_code: 503,
+key: 'remote_addr',
+  },
+},
+  });
+
   const [currentStep] = useState(2);
   const [stepHeader] = useState(['定义 API 请求', '定义 API 后端服务', '插件配置', '预览']);
   const data = {
 step1Data,
-  };
-
-  const handleChange = (step: number, params: RoutesModule.Step1DataProps) => {
-switch (step) {
-  case 0:
-setStep1Data({ ...step1Data, ...params });
-break;
-  default:
-}
+step3Data,
   };
 
   const renderStep = () => {
@@ -38,11 +41,16 @@ const Create: React.FC = () => {
 return (

handleChange(currentStep, params)}
+onChange={(params: RouteModule.Step1Data) => setStep1Data({ 
...step1Data, ...params })}
   />
 );
   case 2:
-return ;
+return (
+   setStep3Data({ 
...step3Data, ...params })}
+  />
+);
   default:
 return null;
 }
diff --git a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx 
b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
index 8526b34..199966b 100644
--- a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
+++ b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
@@ -1,5 +1,4 @@
-import React, { useState } from 'react';
-import { Card } from 'antd';
+import React, { useState, useEffect } from 'react';
 import { SettingOutlined, LinkOutlined } from '@ant-design/icons';
 
 import { pluginList } from '@/components/PluginForm';
@@ -7,6 +6,8 @@ import PanelSection from '../PanelSection';
 import PluginDrawer from './PluginDrawer';
 import PluginCard from './PluginCard';
 
+interface Props extends RouteModule.Data {}
+
 const sectionStyle = {
   display: 'grid',
   gridTemplateColumns: 'repeat(3, 33.333%)',
@@ -14,25 +15,44 @@ const sectionStyle = {
   gridColumnGap: 10,
 };
 
-const CreateStep3: React.FC = () => {
-  const [currentPlugin, setCurrentPlugin] = useState();
+const CreateStep3: React.FC = ({ data }) => {
+  // NOTE: Plugin in blacklist WILL NOT be shown on Step3.
+  const pluginBlackList = ['redirect'];
+
+  const list = pluginList.filter(({ name }) => 
!pluginBlackList.includes(name));
+  const [activeList, setActiveList] = useState([]);
+  const [inactiveList, setInactiveList] = 
useState([]);
 
-  // TODO: 设置插件黑名单(不展示的插件)
-  // TODO: 获取 Route 已启用插件
-  // TODO: 拆分已启用、未启用插件
+  useEffect(() => {
+const pluginKeys = Object.keys(data.step3Data.plugins || []);
+setActiveList(list.filter((item) => pluginKeys.includes(item.name)));
+setInactiveList(list.filter((item) => !pluginKeys.includes(item.name)));
+  }, [data.step3Data.plugins]);
+
+  const [currentPlugin, setCurrentPlugin] = useState();
 
   return (
 <>
   
- setCurrentPlugin('')} />]}
->
-  
-
+{activeList.map(({ name }) => (
+   setCurrentPlugin(name)} />,
+  
+  window.open(
+
`https://github.com/apache/incubator-apisix/blob/master/doc/plugins/${name}.md`,
+  )
+}
+  />,
+]}
+key={name}
+  />
+))}
   
   
-{pluginList.map(({ name }) => (
+{inactiveList.map(({ name }) => (
{
   />
 ))}
   
-   {}} />
+   item.name === 
currentPlugin))}
+   

[GitHub] [incubator-apisix-dashboard] juzhiyuan merged pull request #224: feat: update naming

2020-05-31 Thread GitBox


juzhiyuan merged pull request #224:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/224


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix] Akayeshmantha opened a new pull request #1632: Add body filter and header filter plugin drafts.

2020-05-31 Thread GitBox


Akayeshmantha opened a new pull request #1632:
URL: https://github.com/apache/incubator-apisix/pull/1632


   Fix #1225
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix] Akayeshmantha commented on issue #1225: feature: Support echo plugin

2020-05-31 Thread GitBox


Akayeshmantha commented on issue #1225:
URL: 
https://github.com/apache/incubator-apisix/issues/1225#issuecomment-636507311


   @agile6v  I drafted a small sample can you look in the PR ?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix] jevic opened a new issue #1633: request help: 修改默认端口为80以及443后访问报错401

2020-05-31 Thread GitBox


jevic opened a new issue #1633:
URL: https://github.com/apache/incubator-apisix/issues/1633


   ### Issue description
   修改默认端口 9080 9443 为80 443 端口后;访问报错,不修改则正常;
   
   ### Environment
   
   * apisix version (cmd: `apisix version`): 1.3
   * OS: centos7.6
   详细报错如下: 
   
![image](https://user-images.githubusercontent.com/15863939/83368915-1a2db080-a3ed-11ea-8876-f3172578f26f.png)
   
   查看日志后发现报错为token 认证失败;(默认开启了token认证)
   尝试将admin_key 注释掉之后才可以访问;
   但是为什么改了端口后就无法认证通过了呢? 



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix] ShiningRush commented on issue #1633: request help: 修改默认端口为80以及443后访问报错401

2020-05-31 Thread GitBox


ShiningRush commented on issue #1633:
URL: 
https://github.com/apache/incubator-apisix/issues/1633#issuecomment-636593323


   Hi jevic, 
   I did not reproduce your problem, if we set the admin key, apisix should 
always authenticate it no matter what port.
   Can you post your config.yaml which cause error?



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-route-plugin created (now 370f4e8)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


  at 370f4e8  feat: added typing

This branch includes the following new commits:

 new 370f4e8  feat: added typing

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-dashboard] 01/01: feat: added typing

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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

commit 370f4e82793c5cbb86b9402290269dfc30c35393
Author: juzhiyuan 
AuthorDate: Mon Jun 1 12:37:09 2020 +0800

feat: added typing
---
 src/components/PluginForm/PluginForm.tsx   |  4 +---
 src/components/PluginForm/typing.d.ts  |  2 ++
 src/components/PluginModal/index.tsx   |  6 +++--
 .../Routes/components/CreateStep3/CreateStep3.tsx  | 11 -
 .../Routes/components/CreateStep3/PluginDrawer.tsx | 26 --
 5 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/src/components/PluginForm/PluginForm.tsx 
b/src/components/PluginForm/PluginForm.tsx
index 361be91..3bc04f8 100644
--- a/src/components/PluginForm/PluginForm.tsx
+++ b/src/components/PluginForm/PluginForm.tsx
@@ -1,6 +1,5 @@
 import React, { useState, useEffect } from 'react';
 import { Form, Input, Switch, Select, InputNumber, Button } from 'antd';
-import { useForm } from 'antd/es/form/util';
 import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
 import { useIntl } from 'umi';
 
@@ -98,9 +97,8 @@ const ArrayComponent: React.FC = ({
   );
 };
 
-const PluginForm: React.FC = ({ name, initialData = {}, 
onFinish }) => {
+const PluginForm: React.FC = ({ name, form, initialData = 
{}, onFinish }) => {
   const [schema, setSchema] = useState();
-  const [form] = useForm();
 
   useEffect(() => {
 if (name) {
diff --git a/src/components/PluginForm/typing.d.ts 
b/src/components/PluginForm/typing.d.ts
index b59f80e..80ee8ed 100644
--- a/src/components/PluginForm/typing.d.ts
+++ b/src/components/PluginForm/typing.d.ts
@@ -1,6 +1,8 @@
 declare namespace PluginForm {
   interface Props {
 name?: string;
+// FormInstance
+form: any;
 initialData?: PluginSchema;
 onFinish(values: any): void;
   }
diff --git a/src/components/PluginModal/index.tsx 
b/src/components/PluginModal/index.tsx
index 5080080..25347d1 100644
--- a/src/components/PluginModal/index.tsx
+++ b/src/components/PluginModal/index.tsx
@@ -3,16 +3,18 @@ import { Modal } from 'antd';
 import { useIntl } from 'umi';
 
 import PluginForm from '@/components/PluginForm';
+import { useForm } from 'antd/es/form/util';
 
 interface Props {
   visible: boolean;
   name: string;
-  initialData?: PluginSchema;
+  initialData?: PluginForm.PluginSchema;
   onFinish(values: any): void;
 }
 
 const PluginModal: React.FC = (props) => {
   const { name, visible } = props;
+  const [form] = useForm();
 
   return (
  = (props) => {
   visible={visible}
   title={`${useIntl().formatMessage({ id: 'component.global.edit.plugin' 
})} ${name}`}
 >
-  
+  
 
   );
 };
diff --git a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx 
b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
index 199966b..52b95a7 100644
--- a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
+++ b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
@@ -72,7 +72,16 @@ const CreateStep3: React.FC = ({ data }) => {
item.name === 
currentPlugin))}
-onFinish={() => {}}
+onActive={(name: string) => {
+  setInactiveList(inactiveList.filter((item) => item.name !== name));
+  setActiveList(activeList.concat({ name }));
+}}
+onInactive={(name: string) => {
+  setActiveList(activeList.filter((item) => item.name !== name));
+  setInactiveList(inactiveList.concat({ name }));
+  setCurrentPlugin(undefined);
+}}
+onFinish={(value) => console.log('plugin data:', value)}
   />
 
   );
diff --git a/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx 
b/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
index 2656674..59447be 100644
--- a/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
+++ b/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
@@ -1,14 +1,18 @@
 import React, { useState, useEffect } from 'react';
 import { Drawer, Button } from 'antd';
+import { useForm } from 'antd/es/form/util';
 
 import PluginForm from '@/components/PluginForm';
 
-interface Props extends PluginForm.Props {
+interface Props extends Omit {
   active?: boolean;
+  onActive(name: string): void;
+  onInactive(name: string): void;
 }
 
-const PluginDrawer: React.FC = ({ name, active, ...rest }) => {
+const PluginDrawer: React.FC = ({ name, active, onActive, onInactive, 
...rest }) => {
   const [visiable, setVisiable] = useState(false);
+  const [form] = useForm();
 
   useEffect(() => {
 setVisiable(Boolean(name));
@@ -24,29 +28,37 @@ const PluginDrawer: React.FC = ({ name, active, 
...rest }) => {
   width={400}
   visible={visiable}
   destroyOnClose
+  onClose={() => setVisiable(false)}
   footer={
 
   
 {Boolean(active) && (
-  
+

[GitHub] [incubator-apisix-dashboard] juzhiyuan opened a new pull request #225: feat: added typing

2020-05-31 Thread GitBox


juzhiyuan opened a new pull request #225:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/225


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch next updated: feat: added typing (#225)

2020-05-31 Thread juzhiyuan
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 dfad767  feat: added typing (#225)
dfad767 is described below

commit dfad7674997f3b6eb187e1e2b07dbeaf0b9331ba
Author: 琚致远 
AuthorDate: Mon Jun 1 12:39:14 2020 +0800

feat: added typing (#225)
---
 src/components/PluginForm/PluginForm.tsx   |  4 +---
 src/components/PluginForm/typing.d.ts  |  2 ++
 src/components/PluginModal/index.tsx   |  6 +++--
 .../Routes/components/CreateStep3/CreateStep3.tsx  | 11 -
 .../Routes/components/CreateStep3/PluginDrawer.tsx | 26 --
 5 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/src/components/PluginForm/PluginForm.tsx 
b/src/components/PluginForm/PluginForm.tsx
index 361be91..3bc04f8 100644
--- a/src/components/PluginForm/PluginForm.tsx
+++ b/src/components/PluginForm/PluginForm.tsx
@@ -1,6 +1,5 @@
 import React, { useState, useEffect } from 'react';
 import { Form, Input, Switch, Select, InputNumber, Button } from 'antd';
-import { useForm } from 'antd/es/form/util';
 import { PlusOutlined, MinusCircleOutlined } from '@ant-design/icons';
 import { useIntl } from 'umi';
 
@@ -98,9 +97,8 @@ const ArrayComponent: React.FC = ({
   );
 };
 
-const PluginForm: React.FC = ({ name, initialData = {}, 
onFinish }) => {
+const PluginForm: React.FC = ({ name, form, initialData = 
{}, onFinish }) => {
   const [schema, setSchema] = useState();
-  const [form] = useForm();
 
   useEffect(() => {
 if (name) {
diff --git a/src/components/PluginForm/typing.d.ts 
b/src/components/PluginForm/typing.d.ts
index b59f80e..80ee8ed 100644
--- a/src/components/PluginForm/typing.d.ts
+++ b/src/components/PluginForm/typing.d.ts
@@ -1,6 +1,8 @@
 declare namespace PluginForm {
   interface Props {
 name?: string;
+// FormInstance
+form: any;
 initialData?: PluginSchema;
 onFinish(values: any): void;
   }
diff --git a/src/components/PluginModal/index.tsx 
b/src/components/PluginModal/index.tsx
index 5080080..25347d1 100644
--- a/src/components/PluginModal/index.tsx
+++ b/src/components/PluginModal/index.tsx
@@ -3,16 +3,18 @@ import { Modal } from 'antd';
 import { useIntl } from 'umi';
 
 import PluginForm from '@/components/PluginForm';
+import { useForm } from 'antd/es/form/util';
 
 interface Props {
   visible: boolean;
   name: string;
-  initialData?: PluginSchema;
+  initialData?: PluginForm.PluginSchema;
   onFinish(values: any): void;
 }
 
 const PluginModal: React.FC = (props) => {
   const { name, visible } = props;
+  const [form] = useForm();
 
   return (
  = (props) => {
   visible={visible}
   title={`${useIntl().formatMessage({ id: 'component.global.edit.plugin' 
})} ${name}`}
 >
-  
+  
 
   );
 };
diff --git a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx 
b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
index 199966b..52b95a7 100644
--- a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
+++ b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
@@ -72,7 +72,16 @@ const CreateStep3: React.FC = ({ data }) => {
item.name === 
currentPlugin))}
-onFinish={() => {}}
+onActive={(name: string) => {
+  setInactiveList(inactiveList.filter((item) => item.name !== name));
+  setActiveList(activeList.concat({ name }));
+}}
+onInactive={(name: string) => {
+  setActiveList(activeList.filter((item) => item.name !== name));
+  setInactiveList(inactiveList.concat({ name }));
+  setCurrentPlugin(undefined);
+}}
+onFinish={(value) => console.log('plugin data:', value)}
   />
 
   );
diff --git a/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx 
b/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
index 2656674..59447be 100644
--- a/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
+++ b/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
@@ -1,14 +1,18 @@
 import React, { useState, useEffect } from 'react';
 import { Drawer, Button } from 'antd';
+import { useForm } from 'antd/es/form/util';
 
 import PluginForm from '@/components/PluginForm';
 
-interface Props extends PluginForm.Props {
+interface Props extends Omit {
   active?: boolean;
+  onActive(name: string): void;
+  onInactive(name: string): void;
 }
 
-const PluginDrawer: React.FC = ({ name, active, ...rest }) => {
+const PluginDrawer: React.FC = ({ name, active, onActive, onInactive, 
...rest }) => {
   const [visiable, setVisiable] = useState(false);
+  const [form] = useForm();
 
   useEffect(() => {
 setVisiable(Boolean(name));
@@ -24,29 +28,37 @@ const PluginDrawer: React.FC = ({ name, active, 
...rest }) => {
   width={400}
   visible={visiable}
   destroyOnClose
+  

[GitHub] [incubator-apisix-dashboard] juzhiyuan merged pull request #225: feat: added typing

2020-05-31 Thread GitBox


juzhiyuan merged pull request #225:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/225


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-route-plugin created (now 513cb55)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


  at 513cb55  feat: update Plugin

This branch includes the following new commits:

 new 513cb55  feat: update Plugin

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.




[incubator-apisix-dashboard] 01/01: feat: update Plugin

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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

commit 513cb55924521991c7dedc00d274bb9c3f7b49b8
Author: juzhiyuan 
AuthorDate: Mon Jun 1 13:27:02 2020 +0800

feat: update Plugin
---
 src/pages/Routes/Create.tsx | 7 +--
 src/pages/Routes/components/CreateStep3/CreateStep3.tsx | 8 ++--
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/pages/Routes/Create.tsx b/src/pages/Routes/Create.tsx
index f007825..ee6559f 100644
--- a/src/pages/Routes/Create.tsx
+++ b/src/pages/Routes/Create.tsx
@@ -45,12 +45,7 @@ const Create: React.FC = () => {
   />
 );
   case 2:
-return (
-   setStep3Data({ 
...step3Data, ...params })}
-  />
-);
+return ;
   default:
 return null;
 }
diff --git a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx 
b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
index 52b95a7..c2bed02 100644
--- a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
+++ b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
@@ -1,5 +1,6 @@
 import React, { useState, useEffect } from 'react';
 import { SettingOutlined, LinkOutlined } from '@ant-design/icons';
+import { omit, merge } from 'lodash';
 
 import { pluginList } from '@/components/PluginForm';
 import PanelSection from '../PanelSection';
@@ -15,7 +16,7 @@ const sectionStyle = {
   gridColumnGap: 10,
 };
 
-const CreateStep3: React.FC = ({ data }) => {
+const CreateStep3: React.FC = ({ data, onChange }) => {
   // NOTE: Plugin in blacklist WILL NOT be shown on Step3.
   const pluginBlackList = ['redirect'];
 
@@ -79,9 +80,12 @@ const CreateStep3: React.FC = ({ data }) => {
 onInactive={(name: string) => {
   setActiveList(activeList.filter((item) => item.name !== name));
   setInactiveList(inactiveList.concat({ name }));
+  onChange(omit({ ...data.step3Data }, `plugins.${currentPlugin}`));
   setCurrentPlugin(undefined);
 }}
-onFinish={(value) => console.log('plugin data:', value)}
+onFinish={(value) => {
+  onChange(merge(data.step3Data, { plugins: { [currentPlugin as 
string]: value } }));
+}}
   />
 
   );



[GitHub] [incubator-apisix-dashboard] juzhiyuan opened a new pull request #226: feat: update Plugin

2020-05-31 Thread GitBox


juzhiyuan opened a new pull request #226:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/226


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[incubator-apisix-dashboard] branch feat-route-plugin updated (513cb55 -> f9d0bf8)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


from 513cb55  feat: update Plugin
 add f9d0bf8  feat: update PluginDrawer

No new revisions were added by this update.

Summary of changes:
 src/pages/Routes/Create.tsx|  4 
 .../Routes/components/CreateStep3/CreateStep3.tsx  |  2 ++
 .../Routes/components/CreateStep3/PluginDrawer.tsx | 23 --
 3 files changed, 19 insertions(+), 10 deletions(-)



[incubator-apisix-dashboard] branch next updated: feat: update Plugin (#226)

2020-05-31 Thread juzhiyuan
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 fa5ae77  feat: update Plugin (#226)
fa5ae77 is described below

commit fa5ae774778a2593652f9c8173390521090fd966
Author: 琚致远 
AuthorDate: Mon Jun 1 13:43:09 2020 +0800

feat: update Plugin (#226)

* feat: update Plugin

* feat: update PluginDrawer

* codes clean
---
 src/pages/Routes/Create.tsx| 11 +--
 .../Routes/components/CreateStep3/CreateStep3.tsx  | 10 --
 .../Routes/components/CreateStep3/PluginDrawer.tsx | 23 --
 3 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/src/pages/Routes/Create.tsx b/src/pages/Routes/Create.tsx
index f007825..7ed184d 100644
--- a/src/pages/Routes/Create.tsx
+++ b/src/pages/Routes/Create.tsx
@@ -25,6 +25,10 @@ const Create: React.FC = () => {
 rejected_code: 503,
 key: 'remote_addr',
   },
+  'basic-auth': {
+username: 'testuser',
+password: 'pass',
+  },
 },
   });
 
@@ -45,12 +49,7 @@ const Create: React.FC = () => {
   />
 );
   case 2:
-return (
-   setStep3Data({ 
...step3Data, ...params })}
-  />
-);
+return ;
   default:
 return null;
 }
diff --git a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx 
b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
index 52b95a7..eb9c569 100644
--- a/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
+++ b/src/pages/Routes/components/CreateStep3/CreateStep3.tsx
@@ -1,5 +1,6 @@
 import React, { useState, useEffect } from 'react';
 import { SettingOutlined, LinkOutlined } from '@ant-design/icons';
+import { omit, merge } from 'lodash';
 
 import { pluginList } from '@/components/PluginForm';
 import PanelSection from '../PanelSection';
@@ -15,7 +16,7 @@ const sectionStyle = {
   gridColumnGap: 10,
 };
 
-const CreateStep3: React.FC = ({ data }) => {
+const CreateStep3: React.FC = ({ data, onChange }) => {
   // NOTE: Plugin in blacklist WILL NOT be shown on Step3.
   const pluginBlackList = ['redirect'];
 
@@ -71,6 +72,7 @@ const CreateStep3: React.FC = ({ data }) => {
   
item.name === 
currentPlugin))}
 onActive={(name: string) => {
   setInactiveList(inactiveList.filter((item) => item.name !== name));
@@ -79,9 +81,13 @@ const CreateStep3: React.FC = ({ data }) => {
 onInactive={(name: string) => {
   setActiveList(activeList.filter((item) => item.name !== name));
   setInactiveList(inactiveList.concat({ name }));
+  onChange(omit({ ...data.step3Data }, `plugins.${currentPlugin}`));
   setCurrentPlugin(undefined);
 }}
-onFinish={(value) => console.log('plugin data:', value)}
+onClose={() => setCurrentPlugin(undefined)}
+onFinish={(value) =>
+  onChange(merge(data.step3Data, { plugins: { [currentPlugin as 
string]: value } }))
+}
   />
 
   );
diff --git a/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx 
b/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
index 59447be..575bdb2 100644
--- a/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
+++ b/src/pages/Routes/components/CreateStep3/PluginDrawer.tsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect } from 'react';
+import React from 'react';
 import { Drawer, Button } from 'antd';
 import { useForm } from 'antd/es/form/util';
 
@@ -8,16 +8,19 @@ interface Props extends Omit {
   active?: boolean;
   onActive(name: string): void;
   onInactive(name: string): void;
+  onClose(): void;
 }
 
-const PluginDrawer: React.FC = ({ name, active, onActive, onInactive, 
...rest }) => {
-  const [visiable, setVisiable] = useState(false);
+const PluginDrawer: React.FC = ({
+  name,
+  active,
+  onActive,
+  onInactive,
+  onClose,
+  ...rest
+}) => {
   const [form] = useForm();
 
-  useEffect(() => {
-setVisiable(Boolean(name));
-  }, [name]);
-
   if (!name) {
 return null;
   }
@@ -26,9 +29,9 @@ const PluginDrawer: React.FC = ({ name, active, 
onActive, onInactive, ...
  setVisiable(false)}
+  onClose={onClose}
   footer={
 
   
@@ -45,7 +48,7 @@ const PluginDrawer: React.FC = ({ name, active, 
onActive, onInactive, ...
   
   {Boolean(active) && (
 
-   setVisiable(false)}>取消
+  取消
   

[incubator-apisix-dashboard] branch feat-route-plugin updated (f9d0bf8 -> df88104)

2020-05-31 Thread juzhiyuan
This is an automated email from the ASF dual-hosted git repository.

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


from f9d0bf8  feat: update PluginDrawer
 add df88104  codes clean

No new revisions were added by this update.

Summary of changes:
 src/pages/Routes/components/CreateStep3/CreateStep3.tsx | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



[GitHub] [incubator-apisix-dashboard] juzhiyuan merged pull request #226: feat: update Plugin

2020-05-31 Thread GitBox


juzhiyuan merged pull request #226:
URL: https://github.com/apache/incubator-apisix-dashboard/pull/226


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix] Gerrard-YNWA opened a new pull request #1634: doc style for batch-request.HttpResponse section

2020-05-31 Thread GitBox


Gerrard-YNWA opened a new pull request #1634:
URL: https://github.com/apache/incubator-apisix/pull/1634


   #695 # Summary
   
   typo of markdown doc style
   
   ### Full changelog
   update doc style in batch-requests-cn.md and batch-requests.md HttpResponse 
section
   
   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [incubator-apisix] moonming opened a new pull request #1635: add notifications to mailing list.

2020-05-31 Thread GitBox


moonming opened a new pull request #1635:
URL: https://github.com/apache/incubator-apisix/pull/1635


   



This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org