fix(striker-ui): repop gateway iface, iface name in network config

main
Tsu-ba-me 1 year ago
parent c35bc358b9
commit aa5fa7d3e6
  1. 7
      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<NetworkInput[]>(
(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,
]);

Loading…
Cancel
Save