gns3-web-ui/src/app/components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component.html
grossmj 7ac3a628a4 Merge remote-tracking branch 'origin/master' into master-3.0
# Conflicts:
#	angular.json
#	package.json
#	src/ReleaseNotes.txt
#	src/app/cartography/helpers/font-fixer.spec.ts
#	src/app/cartography/models/node.ts
#	src/app/components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component.html
#	src/app/components/preferences/qemu/add-qemu-vm-template/add-qemu-vm-template.component.ts
#	src/app/components/project-map/node-editors/configurator/docker/configurator-docker.component.ts
#	src/app/components/project-map/project-map-menu/project-map-menu.component.ts
#	src/app/components/project-map/project-map.component.html
#	src/app/components/project-map/project-map.component.ts
#	src/app/components/projects/projects.component.html
#	src/app/components/settings/settings.component.html
#	src/app/components/settings/settings.component.spec.ts
#	src/app/components/template/template-list-dialog/template-list-dialog.component.html
#	src/app/components/template/template.component.html
#	src/app/components/template/template.component.ts
#	src/app/services/link.service.ts
#	yarn.lock
2023-02-01 10:32:12 +08:00

120 lines
4.6 KiB
HTML

<div class="content">
<div class="default-header">
<div class="row">
<div class="col col-md-1">
<button class="top-button" *ngIf="controller" class="cancel-button" mat-button (click)="goBack()">
<mat-icon>arrow_back</mat-icon>
</button>
</div>
<div class="col col-md-11">
<h1 class="col">New QEMU VM template</h1>
</div>
</div>
</div>
<div class="default-content">
<div class="container mat-elevation-z8">
<mat-vertical-stepper [linear]="true">
<mat-step label="Controller type" [completed]="isLocalComputerChosen">
<mat-radio-group class="radio-group">
<mat-radio-button class="radio-button" value="1" (click)="setControllerType('local')" checked
>Run this QEMU VM locally</mat-radio-button
>
</mat-radio-group>
</mat-step>
<mat-step label="QEMU VM Name" [completed]="nameForm.get('templateName').value">
<form [formGroup]="nameForm">
<mat-form-field class="form-field">
<input
matInput
type="text"
formControlName="templateName"
placeholder="Please choose a descriptive name for your new QEMU virtual machine"
ngDefaultContro
/> </mat-form-field
><br />
</form>
</mat-step>
<mat-step label="Platform and memory" [completed]="memoryForm.get('ramMemory').value && selectedPlatform">
<form [formGroup]="memoryForm">
<mat-form-field class="form-field">
<mat-select placeholder="Platform" [(ngModel)]="selectedPlatform" [ngModelOptions]="{ standalone: true }">
<mat-option *ngFor="let platform of selectPlatform" [value]="platform">
{{ platform }}
</mat-option>
</mat-select> </mat-form-field
><br />
<mat-form-field class="form-field">
<input matInput type="number" placeholder="RAM" formControlName="ramMemory" ngDefaultControl />
<span matSuffix>MB</span>
</mat-form-field>
</form>
</mat-step>
<mat-step label="Console type" [completed]="qemuTemplate.console_type">
<mat-form-field class="form-field">
<mat-select
placeholder="Console type"
[(ngModel)]="qemuTemplate.console_type"
[ngModelOptions]="{ standalone: true }"
>
<mat-option *ngFor="let type of consoleTypes" [value]="type">
{{ type }}
</mat-option>
</mat-select>
</mat-form-field>
</mat-step>
<mat-step label="Disk image">
<form [formGroup]="diskForm">
<mat-radio-group class="radio-group">
<mat-radio-button class="radio-button" value="1" (click)="setDiskImage('existingImage')" checked
>Existing image</mat-radio-button
>
<mat-radio-button class="radio-button" value="2" (click)="setDiskImage('newImage')"
>New image</mat-radio-button
> </mat-radio-group
><br /><br />
<mat-select
*ngIf="!newImageSelected"
placeholder="Disk image (hda)"
[ngModelOptions]="{ standalone: true }"
[(ngModel)]="selectedImage"
>
<mat-option *ngFor="let image of qemuImages" [value]="image">
{{ image.filename }}
</mat-option>
</mat-select>
<div *ngIf="newImageSelected">
<input
type="file"
accept=".qcow2"
#file
class="nonvisible"
(change)="uploadImageFile($event)"
ng2FileSelect
[uploader]="uploader"
/>
<button mat-raised-button color="primary" (click)="file.click()" class="file-button">Browse</button>
<mat-form-field class="file-name-form-field">
<input
matInput
type="text"
[(ngModel)]="chosenImage"
formControlName="fileName"
placeholder="Please enter name"
/>
</mat-form-field>
</div>
</form>
</mat-step>
</mat-vertical-stepper>
</div>
<div class="buttons-bar">
<button mat-button class="cancel-button" (click)="goBack()">Cancel</button>
<button mat-raised-button color="primary" (click)="addTemplate()">Add template</button>
</div>
</div>
</div>