[GitHub] [apisix-dashboard] juzhiyuan commented on a change in pull request #1764: chore: added Fields to Upstream module

2021-04-14 Thread GitBox


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



##
File path: web/src/components/Upstream/UpstreamForm.tsx
##
@@ -86,14 +87,18 @@ const UpstreamForm: React.FC = forwardRef(
 if (required) {
   requestAnimationFrame(() => {
 form.resetFields();
-form.setFieldsValue(DEFAULT_UPSTREAM);
 setHiddenForm(false);
   });
 }
   } else {
 if (upstream_id) {
   requestAnimationFrame(() => {
-form.setFieldsValue(list.find((item) => item.id === upstream_id));
+const targetData = list.find((item) => item.id === upstream_id) as 
UpstreamComponent.ResponseData
+if (targetData) {
+  
form.setFieldsValue(transformUpstreamDataFromRequest(targetData));
+} else {
+  // TODO: 提示 upstream_id 找不到想要的数据

Review comment:
   sure! I missed some notes, and will file a new PR to remove all Chinese.




-- 
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 #1764: chore: added Fields to Upstream module

2021-04-13 Thread GitBox


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



##
File path: 
web/src/components/Upstream/components/active-check/Healthy/HttpStatuses.tsx
##
@@ -0,0 +1,75 @@
+/*
+ * 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 { Form, Row, Col, Button, InputNumber } from 'antd'
+import { useIntl } from 'umi'
+import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'
+
+import { removeBtnStyle } from '@/components/Upstream'
+
+type Props = {
+  readonly?: boolean
+}
+
+const Component: React.FC = ({ readonly }) => {
+  const { formatMessage } = useIntl()
+
+  return (
+
+  {(fields, { add, remove }) => (
+<>
+  https://user-images.githubusercontent.com/2106987/114651435-8a4bd900-9d16-11eb-845d-26b54358f3cc.png)
   




-- 
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 #1764: chore: added Fields to Upstream module

2021-04-13 Thread GitBox


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



##
File path: web/src/components/Upstream/components/active-check/Host.tsx
##
@@ -26,30 +26,30 @@ const Component: React.FC = ({ readonly }) => {
   const { formatMessage } = useIntl()
   return (
 
= ({ readonly }) => {
   const { formatMessage } = useIntl()
   return (
 
   https://github.com/apache/apisix/blob/master/apisix/schema_def.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