[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1730: feat: add api-breaker plugin form

2021-04-14 Thread GitBox


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



##
File path: web/src/components/Plugin/UI/api-breaker.tsx
##
@@ -0,0 +1,186 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Button, Form, InputNumber } from 'antd';
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+
+type Props = {
+  form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+  labelCol: {
+span: 7,
+  },
+  wrapperCol: {
+span: 7
+  },
+};
+
+const FORM_ITEM_WITHOUT_LABEL = {
+  wrapperCol: {
+sm: { span: 14, offset: 7 },
+  },
+};
+
+const ApiBreaker: React.FC = ({ form }) => {
+  const { formatMessage } = useIntl()
+
+  return (
+
+  
+
+  
+
+  
+

Review comment:
   @LiteSun this one.




-- 
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] [apisix-dashboard] juzhiyuan commented on a change in pull request #1730: feat: add api-breaker plugin form

2021-04-14 Thread GitBox


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



##
File path: web/src/components/Plugin/UI/api-breaker.tsx
##
@@ -0,0 +1,186 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Button, Form, InputNumber } from 'antd';
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+
+type Props = {
+  form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+  labelCol: {
+span: 7,
+  },
+  wrapperCol: {
+span: 7
+  },
+};
+
+const FORM_ITEM_WITHOUT_LABEL = {
+  wrapperCol: {
+sm: { span: 14, offset: 7 },
+  },
+};
+
+const ApiBreaker: React.FC = ({ form }) => {
+  const { formatMessage } = useIntl()
+
+  return (
+
+  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 type { FormInstance } from 'antd/es/form';
+import { Button, Form, InputNumber } from 'antd';
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+
+type Props = {
+  form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+  labelCol: {
+span: 7,
+  },
+  wrapperCol: {
+span: 7
+  },
+};
+
+const FORM_ITEM_WITHOUT_LABEL = {
+  wrapperCol: {
+sm: { span: 14, offset: 7 },
+  },
+};
+
+const ApiBreaker: React.FC = ({ form }) => {
+  const { formatMessage } = useIntl()
+
+  return (
+
+  
+
+  
+
+  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 type { FormInstance } from 'antd/es/form';
+import { Button, Form, InputNumber } from 'antd';
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+
+type Props = {
+  form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+  labelCol: {
+span: 7,
+  },
+  wrapperCol: {
+span: 7
+  },
+};
+
+const FORM_ITEM_WITHOUT_LABEL = {
+  wrapperCol: {
+sm: { span: 14, offset: 7 },
+  },
+};
+
+const ApiBreaker: React.FC = ({ form }) => {
+  const { formatMessage } = useIntl()
+
+  return (
+
+  
+
+  
+
+  
+

Review comment:
   
https://github.com/apache/apisix/blob/master/apisix/plugins/api-breaker.lua#L40




-- 
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] [apisix-dashboard] juzhiyuan commented on a change in pull request #1730: feat: add api-breaker plugin form

2021-04-12 Thread GitBox


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



##
File path: web/src/components/Plugin/locales/zh-CN.ts
##
@@ -29,6 +29,12 @@ export default {
   'component.pluginForm.api-breaker.unhealthy.failures.tooltip': 
'触发不健康状态的连续错误请求次数。',
   'component.pluginForm.api-breaker.healthy.http_statuses.tooltip': 
'健康时候的状态码。',
   'component.pluginForm.api-breaker.healthy.successes.tooltip': 
'触发健康状态的连续正常请求次数。',
+  // limit-conn
+  'component.pluginForm.limit-conn.conn.tooltip': '允许的最大并发请求数。超过 conn 的限制、但是低于 
conn + burst 的请求,将被延迟处理。',
+  'component.pluginForm.limit-conn.burst.tooltip': '允许被延迟处理的并发请求数。',
+  'component.pluginForm.limit-conn.default_conn_delay.tooltip': 
'默认的典型连接(或请求)的处理延迟时间。',

Review comment:
   




-- 
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] [apisix-dashboard] juzhiyuan commented on a change in pull request #1730: feat: add api-breaker plugin form

2021-04-12 Thread GitBox


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



##
File path: web/src/components/Plugin/locales/zh-CN.ts
##
@@ -29,6 +29,12 @@ export default {
   'component.pluginForm.api-breaker.unhealthy.failures.tooltip': 
'触发不健康状态的连续错误请求次数。',
   'component.pluginForm.api-breaker.healthy.http_statuses.tooltip': 
'健康时候的状态码。',
   'component.pluginForm.api-breaker.healthy.successes.tooltip': 
'触发健康状态的连续正常请求次数。',
+  // limit-conn
+  'component.pluginForm.limit-conn.conn.tooltip': '允许的最大并发请求数。超过 conn 的限制、但是低于 
conn + burst 的请求,将被延迟处理。',
+  'component.pluginForm.limit-conn.burst.tooltip': '允许被延迟处理的并发请求数。',
+  'component.pluginForm.limit-conn.default_conn_delay.tooltip': 
'默认的典型连接(或请求)的处理延迟时间。',

Review comment:
   `典型`?
   
   for those fields, need @membphis @starsz @nic-chen  to take a look




-- 
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] [apisix-dashboard] juzhiyuan commented on a change in pull request #1730: feat: add api-breaker plugin form

2021-04-11 Thread GitBox


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



##
File path: web/src/components/Plugin/UI/api-breaker.tsx
##
@@ -0,0 +1,182 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Button, Form, InputNumber } from 'antd';
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+
+type Props = {
+  form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+  labelCol: {
+span: 7,
+  },
+  wrapperCol: {
+span: 7
+  },
+};
+
+const FORM_ITEM_WITHOUT_LABEL = {
+  wrapperCol: {
+sm: { span: 14, offset: 7 },
+  },
+};
+
+const ApiBreaker: React.FC = ({ form }) => {
+  const { formatMessage } = useIntl()
+
+  return (
+
+  
+

Review comment:
   ```suggestion
   
   ```

##
File path: web/src/components/Plugin/UI/api-breaker.tsx
##
@@ -0,0 +1,182 @@
+/*
+ * 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 type { FormInstance } from 'antd/es/form';
+import { Button, Form, InputNumber } from 'antd';
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
+import { useIntl } from 'umi';
+
+type Props = {
+  form: FormInstance;
+};
+
+const FORM_ITEM_LAYOUT = {
+  labelCol: {
+span: 7,
+  },
+  wrapperCol: {
+span: 7
+  },
+};
+
+const FORM_ITEM_WITHOUT_LABEL = {
+  wrapperCol: {
+sm: { span: 14, offset: 7 },
+  },
+};
+
+const ApiBreaker: React.FC = ({ form }) => {
+  const { formatMessage } = useIntl()
+
+  return (
+