Default values in templates

This commit is contained in:
piotrpekala7 2020-06-02 17:29:14 +02:00
parent 0cee6188fb
commit 455a13b96f
4 changed files with 11 additions and 5 deletions

View File

@ -57,7 +57,7 @@ export class AddDockerTemplateComponent implements OnInit {
});
this.networkAdaptersForm = this.formBuilder.group({
adapters: new FormControl('', Validators.required)
adapters: new FormControl('1', Validators.required)
});
}

View File

@ -133,6 +133,14 @@ export class AddIouTemplateComponent implements OnInit {
this.iouTemplate.name = this.templateNameForm.get("templateName").value;
if (this.newImageSelected) this.iouTemplate.path = this.imageForm.get("imageName").value;
this.iouTemplate.compute_id = this.isGns3VmChosen ? 'vm' : 'local';
if (this.selectedType === 'L2 image') {
this.iouTemplate.ethernet_adapters = 4;
this.iouTemplate.serial_adapters = 0;
} else if (this.selectedType === 'L3 image') {
this.iouTemplate.ethernet_adapters = 2;
this.iouTemplate.serial_adapters = 2;
}
this.iouService.addTemplate(this.server, this.iouTemplate).subscribe((template: IouTemplate) => {
this.goBack();

View File

@ -23,9 +23,6 @@
placeholder="Please choose a descriptive name for your new QEMU virtual machine"
ngDefaultContro/>
</mat-form-field><br/>
<mat-checkbox>
This is a legacy ASA VM
</mat-checkbox>
</form>
</mat-step>
<mat-step label="QEMU binary and memory">

View File

@ -60,7 +60,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
});
this.memoryForm = this.formBuilder.group({
ramMemory: new FormControl('', Validators.required)
ramMemory: new FormControl('256', Validators.required)
});
this.diskForm = this.formBuilder.group({
@ -98,6 +98,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
this.qemuService.getBinaries(server).subscribe((qemuBinaries: QemuBinary[]) => {
this.qemuBinaries = qemuBinaries;
if (this.qemuBinaries[0]) this.selectedBinary = this.qemuBinaries[0];
});
this.qemuService.getImages(server).subscribe((qemuImages: QemuImage[]) => {