feat: set a initial weight value for the upstream node (#1979)
Co-authored-by: lixingwang <lixingwang@yiche.com>
diff --git a/web/cypress/integration/route/import_export_route.spec.js b/web/cypress/integration/route/import_export_route.spec.js
index 7e841d7..17e3afc 100644
--- a/web/cypress/integration/route/import_export_route.spec.js
+++ b/web/cypress/integration/route/import_export_route.spec.js
@@ -84,7 +84,7 @@
// input nodes_0_host, click Next
cy.get(selector.nodes_0_host).type(data[`upstream_node0_host_${i}`]);
cy.get(selector.nodes_0_port).type(data.port);
- cy.get(selector.nodes_0_weight).type(data.weight);
+ cy.get(selector.nodes_0_weight).clear().type(data.weight);
cy.contains(actionBarUS['component.actionbar.button.nextStep']).click();
// do not config plugins, click Next
cy.contains(actionBarUS['component.actionbar.button.nextStep']).click();
diff --git a/web/src/components/Upstream/components/Nodes.tsx b/web/src/components/Upstream/components/Nodes.tsx
index 50fabd3..4b95c5a 100644
--- a/web/src/components/Upstream/components/Nodes.tsx
+++ b/web/src/components/Upstream/components/Nodes.tsx
@@ -95,6 +95,7 @@
message: formatMessage({ id: 'page.upstream.step.input.weight' }),
},
]}
+ initialValue={1}
>
<InputNumber
placeholder={formatMessage({ id: 'page.upstream.step.weight' })}