diff --git a/client/src/helpers/helpers.tsx b/client/src/helpers/helpers.tsx index fff7d45a..04e09768 100644 --- a/client/src/helpers/helpers.tsx +++ b/client/src/helpers/helpers.tsx @@ -28,7 +28,7 @@ import { THEMES, } from './constants'; import { LOCAL_STORAGE_KEYS, LocalStorageHelper } from './localStorageHelper'; -import { DhcpInterface } from '../initialState'; +import { DhcpInterface, InstallInterface } from '../initialState'; /** * @param time {string} The time to format @@ -217,9 +217,9 @@ export const getInterfaceIp = (option: any) => { return interfaceIP; }; -export const getIpList = (interfaces: DhcpInterface[]) => +export const getIpList = (interfaces: InstallInterface[]) => Object.values(interfaces) - .reduce((acc: string[], curr: DhcpInterface) => acc.concat(curr.ip_addresses), [] as string[]) + .reduce((acc: string[], curr: InstallInterface) => acc.concat(curr.ip_addresses), [] as string[]) .sort(); /** diff --git a/client/src/initialState.ts b/client/src/initialState.ts index 7292693c..bfb22e3a 100644 --- a/client/src/initialState.ts +++ b/client/src/initialState.ts @@ -9,6 +9,14 @@ import { import { DEFAULT_BLOCKING_IPV4, DEFAULT_BLOCKING_IPV6 } from './reducers/dnsConfig'; import { Filter } from './helpers/helpers'; +export type InstallInterface = { + flags: string; + hardware_address: string; + ip_addresses: string[]; + mtu: number; + name: string; +}; + export type InstallData = { step: number; processingDefault: boolean; @@ -31,13 +39,7 @@ export type InstallData = { ip: string; error: string; }; - interfaces: { - flags: string; - hardware_address: string; - ip_addresses: string[]; - mtu: number; - name: string; - }[]; + interfaces: InstallInterface[]; dnsVersion: string; }; diff --git a/client/src/install/Setup/AddressList.tsx b/client/src/install/Setup/AddressList.tsx index b943d2a4..4d9488fa 100644 --- a/client/src/install/Setup/AddressList.tsx +++ b/client/src/install/Setup/AddressList.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { getIpList, getDnsAddress, getWebAddress } from '../../helpers/helpers'; import { ALL_INTERFACES_IP } from '../../helpers/constants'; -import { DhcpInterface } from '../../initialState'; +import { InstallInterface } from '../../initialState'; interface renderItemProps { ip: string; @@ -28,7 +28,7 @@ const renderItem = ({ ip, port, isDns }: renderItemProps) => { }; interface AddressListProps { - interfaces: DhcpInterface[]; + interfaces: InstallInterface[]; address: string; port: number; isDns?: boolean; diff --git a/client/src/install/Setup/Auth.tsx b/client/src/install/Setup/Auth.tsx index 90d1c097..a0632383 100644 --- a/client/src/install/Setup/Auth.tsx +++ b/client/src/install/Setup/Auth.tsx @@ -60,6 +60,7 @@ export const Auth = ({ onAuthSubmit }: Props) => { { { { case 3: return ( ); @@ -69,6 +62,7 @@ class Controls extends Component { case 3: return ( ); case 5: return (