You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2021/04/07 10:52:52 UTC

[GitHub] [apisix-dashboard] LiteSun opened a new pull request #1714: feat: Basic plugin UI From

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


   Please answer these questions before submitting a pull request, **or your PR will get closed**.
   
   **Why submit this pull request?**
   
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   **What changes will this PR take into?**
   
   Please update this section with detailed description.
   
   **Related issues**
   
   fix/resolve #0001
   
   **Checklist:**
   
   - [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   - [ ] Have you added corresponding test cases?
   - [ ] Have you modified the corresponding document?
   - [ ] Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first
   


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815433665


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=h1) Report
   > Merging [#1714](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=desc) (60b0fdb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `4.39%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1714      +/-   ##
   ==========================================
   - Coverage   72.08%   67.69%   -4.40%     
   ==========================================
     Files         130       47      -83     
     Lines        5649     3126    -2523     
     Branches      648        0     -648     
   ==========================================
   - Hits         4072     2116    -1956     
   + Misses       1333      766     -567     
     Partials      244      244              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `48.43% <ø> (-0.07%)` | :arrow_down: |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `35.08% <0.00%> (-29.84%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `75.00% <0.00%> (-25.00%)` | :arrow_down: |
   | [api/internal/handler/global\_rule/global\_rule.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZ2xvYmFsX3J1bGUvZ2xvYmFsX3J1bGUuZ28=) | `66.12% <0.00%> (-17.75%)` | :arrow_down: |
   | [api/internal/utils/utils.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3V0aWxzLmdv) | `54.11% <0.00%> (-11.77%)` | :arrow_down: |
   | [api/internal/route.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3JvdXRlLmdv) | `76.47% <0.00%> (-8.83%)` | :arrow_down: |
   | [api/cmd/managerapi.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2NtZC9tYW5hZ2VyYXBpLmdv) | `54.05% <0.00%> (-5.41%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `67.28% <0.00%> (-3.74%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `52.10% <0.00%> (-3.37%)` | :arrow_down: |
   | [api/internal/core/store/validate.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvdmFsaWRhdGUuZ28=) | `67.03% <0.00%> (-2.24%)` | :arrow_down: |
   | [api/internal/handler/label/label.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvbGFiZWwvbGFiZWwuZ28=) | `80.18% <0.00%> (-1.89%)` | :arrow_down: |
   | ... and [84 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=footer). Last update [2c158a1...60b0fdb](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#discussion_r608791757



##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+import React from 'react';
+import { FormInstance } from 'antd/es/form';
+
+import { default as BasicAuth } from './basic-auth'
+import { default as LimitConn } from './limit-conn'
+import { default as RefererRestriction } from './referer-restriction'
+import { default as ProxyMirror } from './proxy-mirror'
+import { default as ApiBreaker } from './api-breaker'
+
+type Props = {
+  name: string,
+  form: FormInstance
+}
+
+export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];
+
+export const PLUGIN_UI_FORM: React.FC<Props> = ({ name, form }) => {
+  switch (name) {
+    case 'limit-conn':
+      return <LimitConn form={form} />
+    case 'basic-auth':
+      return <BasicAuth form={form} />
+    case 'referer-restriction':
+      return <RefererRestriction form={form} />
+    case 'proxy-mirror':
+      return <ProxyMirror form={form} />
+    case 'api-breaker':
+      return <ApiBreaker form={form} />
+    default:
+      return <></>
+  }
+}

Review comment:
       note here




-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#discussion_r608794206



##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+import React from 'react';
+import { FormInstance } from 'antd/es/form';
+
+import { default as BasicAuth } from './basic-auth'
+import { default as LimitConn } from './limit-conn'
+import { default as RefererRestriction } from './referer-restriction'
+import { default as ProxyMirror } from './proxy-mirror'
+import { default as ApiBreaker } from './api-breaker'
+
+type Props = {
+  name: string,
+  form: FormInstance
+}
+
+export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];

Review comment:
       ```suggestion
   export const PLUGIN_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];
   ```




-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#discussion_r608791621



##########
File path: web/src/components/Plugin/UI/basic-auth.tsx
##########
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import React, { forwardRef } from 'react';
+import type { FormInstance } from 'antd/es/form';
+import { Form, Input } from 'antd';
+
+type Props = {
+  form: FormInstance;
+  ref?: any;
+};
+
+const BasicAuth: React.FC<Props> = forwardRef(

Review comment:
       Why we need `forwardRef`?




-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815032741


   fine, due to this PR will get larger, @LiteSun Please resolve this one first. For other plugins, please send new PRs.


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io commented on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815433665


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=h1) Report
   > Merging [#1714](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=desc) (60b0fdb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `19.79%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #1714       +/-   ##
   ===========================================
   - Coverage   72.08%   52.29%   -19.80%     
   ===========================================
     Files         130       38       -92     
     Lines        5649     2660     -2989     
     Branches      648        0      -648     
   ===========================================
   - Hits         4072     1391     -2681     
   + Misses       1333     1081      -252     
   + Partials      244      188       -56     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `?` | |
   | backend-e2e-test-ginkgo | `?` | |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/utils/version.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL3ZlcnNpb24uZ28=) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/filter/request\_id.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9yZXF1ZXN0X2lkLmdv) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/entity/entity.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvZW50aXR5L2VudGl0eS5nbw==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [api/internal/core/store/storehub.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmVodWIuZ28=) | `0.00% <0.00%> (-71.03%)` | :arrow_down: |
   | [api/internal/filter/cors.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9jb3JzLmdv) | `0.00% <0.00%> (-66.67%)` | :arrow_down: |
   | [api/internal/filter/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2ZpbHRlci9zY2hlbWEuZ28=) | `0.00% <0.00%> (-55.47%)` | :arrow_down: |
   | [api/internal/utils/consts/api\_error.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL3V0aWxzL2NvbnN0cy9hcGlfZXJyb3IuZ28=) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [api/internal/handler/data\_loader/route\_import.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvZGF0YV9sb2FkZXIvcm91dGVfaW1wb3J0Lmdv) | `27.41% <0.00%> (-37.50%)` | :arrow_down: |
   | [api/internal/handler/handler.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvaGFuZGxlci5nbw==) | `42.59% <0.00%> (-35.19%)` | :arrow_down: |
   | [api/internal/handler/schema/schema.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2hhbmRsZXIvc2NoZW1hL3NjaGVtYS5nbw==) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | ... and [115 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=footer). Last update [2c158a1...60b0fdb](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] moonming commented on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
moonming commented on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815346396


   One PR only does one feature


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun closed pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
LiteSun closed pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714


   


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815366059


   > One PR only does one feature
   
   ok


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] codecov-io edited a comment on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815433665


   # [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=h1) Report
   > Merging [#1714](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=desc) (60b0fdb) into [master](https://codecov.io/gh/apache/apisix-dashboard/commit/2c158a18f31d944fdf7f28727553bbf72f3198ce?el=desc) (2c158a1) will **decrease** coverage by `0.55%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/graphs/tree.svg?width=650&height=150&src=pr&token=Q1HERXN96P)](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1714      +/-   ##
   ==========================================
   - Coverage   72.08%   71.52%   -0.56%     
   ==========================================
     Files         130       47      -83     
     Lines        5649     3126    -2523     
     Branches      648        0     -648     
   ==========================================
   - Hits         4072     2236    -1836     
   + Misses       1333      647     -686     
   + Partials      244      243       -1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | backend-e2e-test | `62.28% <ø> (ø)` | |
   | backend-e2e-test-ginkgo | `48.43% <ø> (-0.07%)` | :arrow_down: |
   | backend-unit-test | `52.29% <ø> (ø)` | |
   | frontend-e2e-test | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [api/internal/core/store/store.go](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-YXBpL2ludGVybmFsL2NvcmUvc3RvcmUvc3RvcmUuZ28=) | `87.95% <0.00%> (ø)` | |
   | [web/src/pages/Upstream/transform.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS90cmFuc2Zvcm0udHM=) | | |
   | [...src/pages/SSL/components/CertificateForm/index.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9TU0wvY29tcG9uZW50cy9DZXJ0aWZpY2F0ZUZvcm0vaW5kZXgudHN4) | | |
   | [web/src/services/user.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9zZXJ2aWNlcy91c2VyLnRz) | | |
   | [web/src/pages/Consumer/components/Step1.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Db25zdW1lci9jb21wb25lbnRzL1N0ZXAxLnRzeA==) | | |
   | [web/src/pages/Upstream/service.ts](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS9zZXJ2aWNlLnRz) | | |
   | [...ages/Route/components/DebugViews/DebugDrawView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL0RlYnVnVmlld3MvRGVidWdEcmF3Vmlldy50c3g=) | | |
   | [web/src/pages/Upstream/Create.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9VcHN0cmVhbS9DcmVhdGUudHN4) | | |
   | [...pages/Route/components/Step1/RequestConfigView.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Sb3V0ZS9jb21wb25lbnRzL1N0ZXAxL1JlcXVlc3RDb25maWdWaWV3LnRzeA==) | | |
   | [web/src/pages/User/Logout.tsx](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree#diff-d2ViL3NyYy9wYWdlcy9Vc2VyL0xvZ291dC50c3g=) | | |
   | ... and [73 more](https://codecov.io/gh/apache/apisix-dashboard/pull/1714/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=footer). Last update [2c158a1...60b0fdb](https://codecov.io/gh/apache/apisix-dashboard/pull/1714?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815547227


   This pr is too big and difficult to review, I'll break it down into smaller pr. Thanks for the reviewers.


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#discussion_r608794009



##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+import React from 'react';
+import { FormInstance } from 'antd/es/form';
+
+import { default as BasicAuth } from './basic-auth'
+import { default as LimitConn } from './limit-conn'
+import { default as RefererRestriction } from './referer-restriction'
+import { default as ProxyMirror } from './proxy-mirror'
+import { default as ApiBreaker } from './api-breaker'
+
+type Props = {
+  name: string,
+  form: FormInstance
+}
+
+export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];
+
+export const PLUGIN_UI_FORM: React.FC<Props> = ({ name, form }) => {

Review comment:
       ```suggestion
   export const PluginForm: React.FC<Props> = ({ name, form }) => {
   ```




-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
LiteSun commented on pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#issuecomment-815340296


   > fine, due to this PR will get larger, @LiteSun Please resolve this one first. For other plugins, please send new PRs.
   
   OK


-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] LiteSun commented on a change in pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
LiteSun commented on a change in pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#discussion_r609173360



##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+import React from 'react';
+import { FormInstance } from 'antd/es/form';
+
+import { default as BasicAuth } from './basic-auth'
+import { default as LimitConn } from './limit-conn'
+import { default as RefererRestriction } from './referer-restriction'
+import { default as ProxyMirror } from './proxy-mirror'
+import { default as ApiBreaker } from './api-breaker'
+
+type Props = {
+  name: string,
+  form: FormInstance
+}
+
+export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];

Review comment:
       `PLUGIN_UI_LIST ` variable names are more intuitive imo 🤔




-- 
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:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1714: feat: Basic plugin UI From

Posted by GitBox <gi...@apache.org>.
juzhiyuan commented on a change in pull request #1714:
URL: https://github.com/apache/apisix-dashboard/pull/1714#discussion_r608792222



##########
File path: web/src/components/Plugin/UI/plugin.tsx
##########
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+*/
+import React from 'react';
+import { FormInstance } from 'antd/es/form';
+
+import { default as BasicAuth } from './basic-auth'
+import { default as LimitConn } from './limit-conn'
+import { default as RefererRestriction } from './referer-restriction'
+import { default as ProxyMirror } from './proxy-mirror'
+import { default as ApiBreaker } from './api-breaker'
+
+type Props = {
+  name: string,
+  form: FormInstance
+}
+
+export const PLUGIN_UI_LIST = ['basic-auth', 'limit-conn', 'referer-restriction', 'proxy-mirror', 'api-breaker'];
+
+export const PLUGIN_UI_FORM: React.FC<Props> = ({ name, form }) => {
+  switch (name) {
+    case 'limit-conn':
+      return <LimitConn form={form} />
+    case 'basic-auth':
+      return <BasicAuth form={form} />
+    case 'referer-restriction':
+      return <RefererRestriction form={form} />
+    case 'proxy-mirror':
+      return <ProxyMirror form={form} />
+    case 'api-breaker':
+      return <ApiBreaker form={form} />
+    default:
+      return <></>

Review comment:
       ```suggestion
         return null
   ```




-- 
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:
users@infra.apache.org