This commit is contained in:
Rajnikant Lodhi 2022-08-01 17:18:46 +05:30
parent 408130596a
commit 4d5a5b8934
8 changed files with 1 additions and 59 deletions

View File

@ -32,10 +32,6 @@ export class MockedQemuService {
return of(qemuTemplate);
}
public getBinaries(controller:Controller ) {
return of([]);
}
public getImages(controller:Controller ) {
return of([]);
}
@ -105,10 +101,6 @@ xdescribe('AddQemuVmTemplateComponent', () => {
component.memoryForm.controls['ramMemory'].setValue(0);
component.diskForm.controls['fileName'].setValue('file name');
component.chosenImage = 'path';
component.selectedBinary = {
path: 'path',
version: 'version',
};
component.newImageSelected = true;
component.controller = { id: 1 } as Controller ;
@ -124,10 +116,6 @@ xdescribe('AddQemuVmTemplateComponent', () => {
component.memoryForm.controls['ramMemory'].setValue(0);
component.diskForm.controls['fileName'].setValue('file name');
component.chosenImage = 'path';
component.selectedBinary = {
path: 'path',
version: 'version',
};
component.newImageSelected = true;
component.controller = { id: 1 } as Controller ;
@ -142,10 +130,6 @@ xdescribe('AddQemuVmTemplateComponent', () => {
component.memoryForm.controls['binary'].setValue('binary');
component.diskForm.controls['fileName'].setValue('file name');
component.chosenImage = 'path';
component.selectedBinary = {
path: 'path',
version: 'version',
};
component.newImageSelected = true;
component.controller = { id: 1 } as Controller ;

View File

@ -25,10 +25,8 @@ import { ToasterService } from '../../../../services/toaster.service';
})
export class AddQemuVmTemplateComponent implements OnInit {
controller:Controller ;
qemuBinaries: QemuBinary[] = [];
selectPlatform: string[] = [];
selectedPlatform: string;
selectedBinary: QemuBinary;
ramMemory: number;
consoleTypes: string[] = [];
newImageSelected: boolean = false;
@ -172,7 +170,6 @@ export class AddQemuVmTemplateComponent implements OnInit {
addTemplate() {
if (!this.nameForm.invalid && !this.memoryForm.invalid && (this.selectedImage || this.chosenImage)) {
this.qemuTemplate.ram = +this.memoryForm.get('ramMemory').value;
// this.qemuTemplate.qemu_path = this.selectedBinary.path;
this.qemuTemplate.platform = this.selectedPlatform;
if (this.newImageSelected) {
this.qemuTemplate.hda_disk_image = this.diskForm.get('fileName').value;

View File

@ -16,7 +16,6 @@ import { ToasterService } from '../../../../services/toaster.service';
})
export class CopyQemuVmTemplateComponent implements OnInit {
controller:Controller ;
qemuBinaries: QemuBinary[] = [];
templateName: string = '';
qemuTemplate: QemuTemplate;
nameForm: FormGroup;

View File

@ -68,13 +68,7 @@
<mat-form-field class="form-field">
<input matInput type="number" [(ngModel)]="qemuTemplate.cpus" placeholder="vCPUs" />
</mat-form-field>
<!-- <mat-form-field class="form-field">
<mat-select placeholder="Qemu binary" [(ngModel)]="qemuTemplate.qemu_path">
<mat-option *ngFor="let binary of binaries" [value]="binary.path">
{{ binary.path }}
</mat-option>
</mat-select>
</mat-form-field> -->
<mat-form-field class="form-field">
<mat-select placeholder="Boot priority" [(ngModel)]="qemuTemplate.boot_priority">
<mat-option *ngFor="let priority of bootPriorities" [value]="priority[1]">

View File

@ -31,9 +31,6 @@ export class MockedQemuService {
return of(qemuTemplate);
}
public getBinaries(controller:Controller ) {
return of([]);
}
public getImages(controller:Controller ) {
return of([]);

View File

@ -27,7 +27,6 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
onCloseOptions = [];
categories = [];
priorities: string[] = [];
binaries: QemuBinary[] = [];
activateCpuThrottling: boolean = true;
isConfiguratorOpened: boolean = false;
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];

View File

@ -65,8 +65,6 @@ export class NewTemplateDialogComponent implements OnInit {
public isLinuxPlatform = false;
private isLocalComputerChosen = false;
public qemuBinaries: QemuBinary[] = [];
public selectedBinary: QemuBinary;
public categories: string[] = ['all categories', 'router', 'multilayer_switch', 'guest', 'firewall'];
public category: string = 'all categories';
@ -332,30 +330,6 @@ export class NewTemplateDialogComponent implements OnInit {
this.applianceToInstall = object;
setTimeout(() => {
this.stepper.next();
if (this.applianceToInstall.qemu) {
setTimeout(() => {
if (this.qemuBinaries.length) {
if (this.applianceToInstall.qemu.arch === 'x86_64') {
let filtered_binaries = this.qemuBinaries.filter((n) => n.path.includes('qemu-system-x86_64'));
if (filtered_binaries.length) {
this.selectedBinary = filtered_binaries[0];
}
} else if (this.applianceToInstall.qemu.arch === 'i386') {
let filtered_binaries = this.qemuBinaries.filter((n) => n.path.includes('qemu-system-i386'));
if (filtered_binaries.length) {
this.selectedBinary = filtered_binaries[0];
}
} else if (this.applianceToInstall.qemu.arch === 'x86_64') {
let filtered_binaries = this.qemuBinaries.filter((n) => n.path.includes('qemu-system-arm'));
if (filtered_binaries.length) {
this.selectedBinary = filtered_binaries[0];
}
} else {
this.selectedBinary = this.qemuBinaries[0];
}
}
}, 100);
}
}, 100);
}
@ -658,7 +632,6 @@ export class NewTemplateDialogComponent implements OnInit {
qemuTemplate.first_port_name = this.applianceToInstall.first_port_name;
qemuTemplate.port_name_format = this.applianceToInstall.port_name_format;
qemuTemplate.symbol = this.applianceToInstall.symbol;
// qemuTemplate.qemu_path = this.selectedBinary.path;
qemuTemplate.compute_id = 'local';
qemuTemplate.template_id = uuid();
qemuTemplate.hda_disk_image = version.images.hda_disk_image;

View File

@ -21,7 +21,6 @@ export class ConfiguratorDialogCloudComponent implements OnInit {
name: string;
generalSettingsForm: FormGroup;
consoleTypes: string[] = [];
binaries: QemuBinary[] = [];
onCloseOptions = [];
bootPriorities = [];
diskInterfaces: string[] = [];