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

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

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

Loading…
Cancel
Save