liuxiran commented on a change in pull request #489:
URL: https://github.com/apache/apisix-dashboard/pull/489#discussion_r492046907
##########
File path: src/pages/Upstream/components/Step1.tsx
##########
@@ -43,9 +47,38 @@ const initialValues = {
send: 6000,
read: 6000,
},
+ active: false,
+ passive: false,
+ checks: {
+ active: {
+ timeout: 5,
+ http_path: '',
+ host: '',
+ healthy: {
+ interval: 2,
+ successes: 1,
+ },
+ unhealthy: {
+ interval: 1,
+ http_failures: 2,
+ },
+ req_headers: [''],
+ },
+ passive: {
+ healthy: {
+ http_statuses: [undefined],
Review comment:
empty array will lose the first item while rendering Form.List
we tried to use [''], but the type of the http_statuses: number[], so we use
[undefined] here
##########
File path: src/pages/Upstream/components/Step1.tsx
##########
@@ -171,6 +204,390 @@ const Step1: React.FC<Props> = ({ form, disabled }) => {
const renderTimeUnit = () => <span style={{ margin: '0 8px' }}>ms</span>;
+ function activeChange() {
Review comment:
done
##########
File path: src/pages/Upstream/components/Step1.tsx
##########
@@ -171,6 +204,390 @@ const Step1: React.FC<Props> = ({ form, disabled }) => {
const renderTimeUnit = () => <span style={{ margin: '0 8px' }}>ms</span>;
+ function activeChange() {
+ if (isActive) {
+ onChange(!isActive, false);
+ form.setFieldsValue({ ...form.getFieldsValue(), passive: false });
+ return;
+ }
+ onChange(!isActive, isPassive);
+ form.setFieldsValue({ ...form.getFieldsValue(), active: !isActive });
+ }
+ function passiveChange() {
Review comment:
done
----------------------------------------------------------------
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:
[email protected]