diff --git a/webui/src/app/host-form/host-form.component.ts b/webui/src/app/host-form/host-form.component.ts index 5854f4b17..9907d6810 100644 --- a/webui/src/app/host-form/host-form.component.ts +++ b/webui/src/app/host-form/host-form.component.ts @@ -570,16 +570,19 @@ export class HostFormComponent implements OnInit, OnDestroy { } } if (host.prefixReservations?.length > 0) { + let addressReservationCount = host.addressReservations?.length ?? 0 for (let i = 0; i < host.prefixReservations.length; i++) { - if (this.ipGroups.length <= i) { + let ipGroupsIndex = i + addressReservationCount + if (this.ipGroups.length <= ipGroupsIndex) { this.addIPInput() } let pdSplit = host.prefixReservations[i].address.split('/', 2) if (pdSplit.length == 2) { let pdLen = parseInt(pdSplit[1], 10) if (!isNaN(pdLen) && pdLen <= 128) { - this.ipGroups.at(i).get('inputPDLen').setValue(pdLen) - this.ipGroups.at(i).get('inputPD').setValue(pdSplit[0]) + this.ipGroups.at(ipGroupsIndex).get('ipType').setValue('ia_pd') + this.ipGroups.at(ipGroupsIndex).get('inputPDLength').setValue(pdLen) + this.ipGroups.at(ipGroupsIndex).get('inputPD').setValue(pdSplit[0]) } } }