in frontend/src/app/modules/config-editor/components/config-editor/config-editor.component.ts [255:304]
private fillForm(resp: ConfigEditor) {
this.configEditorForm.patchValue(resp);
const dataMountsValues = this.configEditorForm.get('data_mounts_values') as FormArray;
if (resp.misc_config_values?.swap_blk_device) {
resp.data_mounts_values?.push({
blk_device: resp.misc_config_values?.swap_blk_device,
fstype: 'xfs',
mount_opts: 'nofail',
mount_point: '',
name: '',
purpose: "swap",
})
}
if (resp.data_mounts_values) {
dataMountsValues.removeAt(0)
resp.data_mounts_values.forEach((dmv) => {
this.lunsOptions.forEach( (lun, index) => {
if (lun.text === dmv.blk_device){
this.selectedLuns[index] = index;
}
})
dataMountsValues.push(this.createDevices
(dmv.blk_device, dmv.fstype, dmv.mount_opts, dmv.mount_point.trim(), dmv.name, dmv.purpose));
});
} else {
dataMountsValues.push(this.createDevices());
}
const asmConfigValues = this.configEditorForm.get('asm_config_values') as FormArray;
if (resp.asm_config_values?.length && resp.asm_config_values?.length > 0) {
asmConfigValues.removeAt(0);
resp.asm_config_values?.forEach((acv: any ) => {
asmConfigValues.push(
this.formBuilder.group({
diskgroup: new FormControl(acv.diskgroup , [Validators.required]),
au_size: new FormControl(acv.au_size, [Validators.required]),
redundancy: new FormControl(acv.redundancy , [Validators.required]),
disks: this.fillDisk(acv.disks)
}
));
} );
}
if(this.mappings) {
this.initRedundancy(this.mappings.oracle_version)
}
}