Updating stepper for qemu nodes

This commit is contained in:
piotrpekala7 2020-06-10 12:39:59 +02:00
parent 68a13e293b
commit d190765a99
2 changed files with 9 additions and 6 deletions

View File

@ -7,14 +7,14 @@
<div class="default-content"> <div class="default-content">
<div class="container mat-elevation-z8"> <div class="container mat-elevation-z8">
<mat-vertical-stepper [linear]="true"> <mat-vertical-stepper [linear]="true">
<mat-step label="Server type"> <mat-step label="Server type" [completed]="isGns3VmChosen || isLocalComputerChosen">
<mat-radio-group class="radio-group"> <mat-radio-group class="radio-group">
<mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked>Run this QEMU VM locally</mat-radio-button> <mat-radio-button class="radio-button" value="1" (click)="setServerType('local')" checked>Run this QEMU VM locally</mat-radio-button>
<mat-radio-button [disabled]="!isGns3VmAvailable" class="radio-button" value="2" (click)="setServerType('gns3 vm')">Run this QEMU VM on the GNS3 VM</mat-radio-button> <mat-radio-button [disabled]="!isGns3VmAvailable" class="radio-button" value="2" (click)="setServerType('gns3 vm')">Run this QEMU VM on the GNS3 VM</mat-radio-button>
</mat-radio-group> </mat-radio-group>
</mat-step> </mat-step>
<mat-step label="QEMU VM Name"> <mat-step label="QEMU VM Name" [completed]="nameForm.get('templateName').value">
<form [formGroup]="nameForm"> <form [formGroup]="nameForm">
<mat-form-field class="form-field"> <mat-form-field class="form-field">
<input <input
@ -25,7 +25,8 @@
</mat-form-field><br/> </mat-form-field><br/>
</form> </form>
</mat-step> </mat-step>
<mat-step label="QEMU binary and memory">
<mat-step label="QEMU binary and memory" [completed]="memoryForm.get('ramMemory').value && selectedBinary">
<form [formGroup]="memoryForm"> <form [formGroup]="memoryForm">
<mat-form-field class="form-field"> <mat-form-field class="form-field">
<mat-select <mat-select
@ -42,12 +43,13 @@
matInput type="number" matInput type="number"
placeholder="RAM" placeholder="RAM"
formControlName="ramMemory" formControlName="ramMemory"
ngDefaultContro/> ngDefaultControl/>
<span matSuffix>MB</span> <span matSuffix>MB</span>
</mat-form-field> </mat-form-field>
</form> </form>
</mat-step> </mat-step>
<mat-step label="Console type">
<mat-step label="Console type" [completed]="qemuTemplate.console_type">
<mat-form-field class="form-field"> <mat-form-field class="form-field">
<mat-select <mat-select
placeholder="Console type" placeholder="Console type"
@ -59,6 +61,7 @@
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
</mat-step> </mat-step>
<mat-step label="Disk image"> <mat-step label="Disk image">
<form [formGroup]="diskForm"> <form [formGroup]="diskForm">
<mat-radio-group class="radio-group"> <mat-radio-group class="radio-group">

View File

@ -56,7 +56,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
this.qemuTemplate = new QemuTemplate(); this.qemuTemplate = new QemuTemplate();
this.nameForm = this.formBuilder.group({ this.nameForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required) templateName: new FormControl(null, Validators.required)
}); });
this.memoryForm = this.formBuilder.group({ this.memoryForm = this.formBuilder.group({