fix(striker-ui): fallback to ifaceId in striker conn config

main^2
Tsu-ba-me 7 months ago
parent 6d7829b5e0
commit aa1d53c737
  1. 27
      striker-ui/components/StrikerConfig/ConfigPeersForm.tsx
  2. 1
      striker-ui/types/APIHost.d.ts
  3. 1
      striker-ui/types/ConfigPeerForm.d.ts

@ -67,12 +67,16 @@ const ConfigPeersForm: FC<ConfigPeerFormProps> = ({
Object.entries(ipAddressList).reduce<InboundConnectionList>( Object.entries(ipAddressList).reduce<InboundConnectionList>(
( (
nyu, nyu,
[ipAddress, { networkLinkNumber, networkNumber, networkType }], [
ipAddress,
{ ifaceId, networkLinkNumber, networkNumber, networkType },
],
) => { ) => {
nyu[ipAddress] = { nyu[ipAddress] = {
...previous[ipAddress], ...previous[ipAddress],
dbPort, dbPort,
dbUser, dbUser,
ifaceId,
ipAddress, ipAddress,
networkLinkNumber, networkLinkNumber,
networkNumber, networkNumber,
@ -135,13 +139,20 @@ const ConfigPeersForm: FC<ConfigPeerFormProps> = ({
listItems={inboundConnections} listItems={inboundConnections}
renderListItem={( renderListItem={(
ipAddress, ipAddress,
{ dbPort, dbUser, networkNumber, networkType }, { dbPort, dbUser, ifaceId, networkNumber, networkType },
) => ( ) => {
<FlexBox spacing={0} sx={{ width: '100%' }}> const network: string =
<MonoText>{`${dbUser}@${ipAddress}:${dbPort}`}</MonoText> NETWORK_TYPES[networkType] && networkNumber
<SmallText>{`${NETWORK_TYPES[networkType]} ${networkNumber}`}</SmallText> ? `${NETWORK_TYPES[networkType]} ${networkNumber}`
</FlexBox> : `Unknown network; interface: ${ifaceId}`;
)}
return (
<FlexBox spacing={0} sx={{ width: '100%' }}>
<MonoText>{`${dbUser}@${ipAddress}:${dbPort}`}</MonoText>
<SmallText>{network}</SmallText>
</FlexBox>
);
}}
/> />
</Grid> </Grid>
<Grid item xs={1}> <Grid item xs={1}>

@ -4,6 +4,7 @@ type APIHostConnectionOverviewList = {
ipAddress: { ipAddress: {
[ipAddress: string]: { [ipAddress: string]: {
hostUUID: string; hostUUID: string;
ifaceId: string;
ipAddress: string; ipAddress: string;
ipAddressUUID: string; ipAddressUUID: string;
networkLinkNumber: number; networkLinkNumber: number;

@ -2,6 +2,7 @@ type InboundConnectionList = {
[ipAddress: string]: { [ipAddress: string]: {
dbPort: number; dbPort: number;
dbUser: string; dbUser: string;
ifaceId: string;
ipAddress: string; ipAddress: string;
networkLinkNumber: number; networkLinkNumber: number;
networkNumber: number; networkNumber: number;

Loading…
Cancel
Save