fix(striker-ui): match GET /host/connection output in ConfigPeersForm

main
Tsu-ba-me 2 years ago
parent 25f1e1e206
commit 35471cbedc
  1. 16
      striker-ui/components/StrikerConfig/ConfigPeersForm.tsx

@ -47,8 +47,9 @@ const ConfigPeersForm: FC = () => {
useState<boolean>(false);
const { isLoading } = periodicFetch<{
local: {
inbound: {
ipAddresses: {
ipAddress: {
[ipAddress: string]: {
hostUUID: string;
ipAddress: string;
@ -70,13 +71,16 @@ const ConfigPeersForm: FC = () => {
user: string;
};
};
};
}>(`${API_BASE_URL}/host/connection`, {
onSuccess: ({
inbound: { ipAddresses, port: dbPort, user: dbUser },
local: {
inbound: { ipAddress: ipAddressList, port: dbPort, user: dbUser },
peer,
},
}) => {
setInboundConnections(
Object.entries(ipAddresses).reduce<InboundConnections>(
Object.entries(ipAddressList).reduce<InboundConnections>(
(
previous,
[ipAddress, { networkLinkNumber, networkNumber, networkType }],
@ -123,7 +127,7 @@ const ConfigPeersForm: FC = () => {
return (
<ExpandablePanel
header={<BodyText>Configure striker peers</BodyText>}
isLoading={isLoading}
loading={isLoading}
>
<Grid columns={{ xs: 1, sm: 2 }} container spacing="1em">
<Grid item xs={1}>
@ -145,8 +149,8 @@ const ConfigPeersForm: FC = () => {
<Grid item xs={1}>
<List
header="Peer connections"
isAllowEdit
isEdit={isEditPeerConnections}
allowEdit
edit={isEditPeerConnections}
listItemKeyPrefix="config-peers-peer-connection"
listItems={peerConnections}
onEdit={() => {

Loading…
Cancel
Save