From aa5fa7d3e6fa02f07fbe4a7fbac9da0d382bb62a Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Sun, 2 Jul 2023 05:04:59 -0400 Subject: [PATCH] fix(striker-ui): repop gateway iface, iface name in network config --- striker-ui/components/NetworkInitForm.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/striker-ui/components/NetworkInitForm.tsx b/striker-ui/components/NetworkInitForm.tsx index 73c2017d..f4fe3da2 100644 --- a/striker-ui/components/NetworkInitForm.tsx +++ b/striker-ui/components/NetworkInitForm.tsx @@ -585,6 +585,7 @@ const NetworkInitForm = forwardRef< const { dns: previousDns, gateway: previousGateway, + gatewayInterface: previousGatewayInterface, hostType, hostUUID = 'local', networks: previousNetworks, @@ -1189,10 +1190,11 @@ const NetworkInitForm = forwardRef< const applied: string[] = []; const inputs = Object.values(previousNetworks).reduce( (previous, { ip, link1Uuid, link2Uuid = '', subnetMask, type }) => { - const name = NETWORK_TYPES[type]; const typeCount = getNetworkTypeCount(type, { inputs: previous }) + 1; const isRequired = requiredNetworks[type] === typeCount; + const name = `${NETWORK_TYPES[type]} ${typeCount}`; + applied.push(link1Uuid, link2Uuid); previous.push({ @@ -1214,6 +1216,8 @@ const NetworkInitForm = forwardRef< [], ); + setGatewayInterface(previousGatewayInterface); + setNetworkInterfaceInputMap((previous) => { const result = { ...previous }; @@ -1235,6 +1239,7 @@ const NetworkInitForm = forwardRef< hostDetail, networkInputs, networkInterfaceInputMap, + previousGatewayInterface, previousNetworks, requiredNetworks, ]);