mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-02 07:20:42 +00:00
.
This commit is contained in:
parent
408130596a
commit
4d5a5b8934
@ -32,10 +32,6 @@ export class MockedQemuService {
|
|||||||
return of(qemuTemplate);
|
return of(qemuTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBinaries(controller:Controller ) {
|
|
||||||
return of([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getImages(controller:Controller ) {
|
public getImages(controller:Controller ) {
|
||||||
return of([]);
|
return of([]);
|
||||||
}
|
}
|
||||||
@ -105,10 +101,6 @@ xdescribe('AddQemuVmTemplateComponent', () => {
|
|||||||
component.memoryForm.controls['ramMemory'].setValue(0);
|
component.memoryForm.controls['ramMemory'].setValue(0);
|
||||||
component.diskForm.controls['fileName'].setValue('file name');
|
component.diskForm.controls['fileName'].setValue('file name');
|
||||||
component.chosenImage = 'path';
|
component.chosenImage = 'path';
|
||||||
component.selectedBinary = {
|
|
||||||
path: 'path',
|
|
||||||
version: 'version',
|
|
||||||
};
|
|
||||||
component.newImageSelected = true;
|
component.newImageSelected = true;
|
||||||
component.controller = { id: 1 } as Controller ;
|
component.controller = { id: 1 } as Controller ;
|
||||||
|
|
||||||
@ -124,10 +116,6 @@ xdescribe('AddQemuVmTemplateComponent', () => {
|
|||||||
component.memoryForm.controls['ramMemory'].setValue(0);
|
component.memoryForm.controls['ramMemory'].setValue(0);
|
||||||
component.diskForm.controls['fileName'].setValue('file name');
|
component.diskForm.controls['fileName'].setValue('file name');
|
||||||
component.chosenImage = 'path';
|
component.chosenImage = 'path';
|
||||||
component.selectedBinary = {
|
|
||||||
path: 'path',
|
|
||||||
version: 'version',
|
|
||||||
};
|
|
||||||
component.newImageSelected = true;
|
component.newImageSelected = true;
|
||||||
component.controller = { id: 1 } as Controller ;
|
component.controller = { id: 1 } as Controller ;
|
||||||
|
|
||||||
@ -142,10 +130,6 @@ xdescribe('AddQemuVmTemplateComponent', () => {
|
|||||||
component.memoryForm.controls['binary'].setValue('binary');
|
component.memoryForm.controls['binary'].setValue('binary');
|
||||||
component.diskForm.controls['fileName'].setValue('file name');
|
component.diskForm.controls['fileName'].setValue('file name');
|
||||||
component.chosenImage = 'path';
|
component.chosenImage = 'path';
|
||||||
component.selectedBinary = {
|
|
||||||
path: 'path',
|
|
||||||
version: 'version',
|
|
||||||
};
|
|
||||||
component.newImageSelected = true;
|
component.newImageSelected = true;
|
||||||
component.controller = { id: 1 } as Controller ;
|
component.controller = { id: 1 } as Controller ;
|
||||||
|
|
||||||
|
@ -25,10 +25,8 @@ import { ToasterService } from '../../../../services/toaster.service';
|
|||||||
})
|
})
|
||||||
export class AddQemuVmTemplateComponent implements OnInit {
|
export class AddQemuVmTemplateComponent implements OnInit {
|
||||||
controller:Controller ;
|
controller:Controller ;
|
||||||
qemuBinaries: QemuBinary[] = [];
|
|
||||||
selectPlatform: string[] = [];
|
selectPlatform: string[] = [];
|
||||||
selectedPlatform: string;
|
selectedPlatform: string;
|
||||||
selectedBinary: QemuBinary;
|
|
||||||
ramMemory: number;
|
ramMemory: number;
|
||||||
consoleTypes: string[] = [];
|
consoleTypes: string[] = [];
|
||||||
newImageSelected: boolean = false;
|
newImageSelected: boolean = false;
|
||||||
@ -172,7 +170,6 @@ export class AddQemuVmTemplateComponent implements OnInit {
|
|||||||
addTemplate() {
|
addTemplate() {
|
||||||
if (!this.nameForm.invalid && !this.memoryForm.invalid && (this.selectedImage || this.chosenImage)) {
|
if (!this.nameForm.invalid && !this.memoryForm.invalid && (this.selectedImage || this.chosenImage)) {
|
||||||
this.qemuTemplate.ram = +this.memoryForm.get('ramMemory').value;
|
this.qemuTemplate.ram = +this.memoryForm.get('ramMemory').value;
|
||||||
// this.qemuTemplate.qemu_path = this.selectedBinary.path;
|
|
||||||
this.qemuTemplate.platform = this.selectedPlatform;
|
this.qemuTemplate.platform = this.selectedPlatform;
|
||||||
if (this.newImageSelected) {
|
if (this.newImageSelected) {
|
||||||
this.qemuTemplate.hda_disk_image = this.diskForm.get('fileName').value;
|
this.qemuTemplate.hda_disk_image = this.diskForm.get('fileName').value;
|
||||||
|
@ -16,7 +16,6 @@ import { ToasterService } from '../../../../services/toaster.service';
|
|||||||
})
|
})
|
||||||
export class CopyQemuVmTemplateComponent implements OnInit {
|
export class CopyQemuVmTemplateComponent implements OnInit {
|
||||||
controller:Controller ;
|
controller:Controller ;
|
||||||
qemuBinaries: QemuBinary[] = [];
|
|
||||||
templateName: string = '';
|
templateName: string = '';
|
||||||
qemuTemplate: QemuTemplate;
|
qemuTemplate: QemuTemplate;
|
||||||
nameForm: FormGroup;
|
nameForm: FormGroup;
|
||||||
|
@ -68,13 +68,7 @@
|
|||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input matInput type="number" [(ngModel)]="qemuTemplate.cpus" placeholder="vCPUs" />
|
<input matInput type="number" [(ngModel)]="qemuTemplate.cpus" placeholder="vCPUs" />
|
||||||
</mat-form-field>
|
</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-form-field class="form-field">
|
||||||
<mat-select placeholder="Boot priority" [(ngModel)]="qemuTemplate.boot_priority">
|
<mat-select placeholder="Boot priority" [(ngModel)]="qemuTemplate.boot_priority">
|
||||||
<mat-option *ngFor="let priority of bootPriorities" [value]="priority[1]">
|
<mat-option *ngFor="let priority of bootPriorities" [value]="priority[1]">
|
||||||
|
@ -31,9 +31,6 @@ export class MockedQemuService {
|
|||||||
return of(qemuTemplate);
|
return of(qemuTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBinaries(controller:Controller ) {
|
|
||||||
return of([]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public getImages(controller:Controller ) {
|
public getImages(controller:Controller ) {
|
||||||
return of([]);
|
return of([]);
|
||||||
|
@ -27,7 +27,6 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
|
|||||||
onCloseOptions = [];
|
onCloseOptions = [];
|
||||||
categories = [];
|
categories = [];
|
||||||
priorities: string[] = [];
|
priorities: string[] = [];
|
||||||
binaries: QemuBinary[] = [];
|
|
||||||
activateCpuThrottling: boolean = true;
|
activateCpuThrottling: boolean = true;
|
||||||
isConfiguratorOpened: boolean = false;
|
isConfiguratorOpened: boolean = false;
|
||||||
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
|
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
|
||||||
|
@ -65,8 +65,6 @@ export class NewTemplateDialogComponent implements OnInit {
|
|||||||
public isLinuxPlatform = false;
|
public isLinuxPlatform = false;
|
||||||
private isLocalComputerChosen = false;
|
private isLocalComputerChosen = false;
|
||||||
|
|
||||||
public qemuBinaries: QemuBinary[] = [];
|
|
||||||
public selectedBinary: QemuBinary;
|
|
||||||
|
|
||||||
public categories: string[] = ['all categories', 'router', 'multilayer_switch', 'guest', 'firewall'];
|
public categories: string[] = ['all categories', 'router', 'multilayer_switch', 'guest', 'firewall'];
|
||||||
public category: string = 'all categories';
|
public category: string = 'all categories';
|
||||||
@ -332,30 +330,6 @@ export class NewTemplateDialogComponent implements OnInit {
|
|||||||
this.applianceToInstall = object;
|
this.applianceToInstall = object;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.stepper.next();
|
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);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -658,7 +632,6 @@ export class NewTemplateDialogComponent implements OnInit {
|
|||||||
qemuTemplate.first_port_name = this.applianceToInstall.first_port_name;
|
qemuTemplate.first_port_name = this.applianceToInstall.first_port_name;
|
||||||
qemuTemplate.port_name_format = this.applianceToInstall.port_name_format;
|
qemuTemplate.port_name_format = this.applianceToInstall.port_name_format;
|
||||||
qemuTemplate.symbol = this.applianceToInstall.symbol;
|
qemuTemplate.symbol = this.applianceToInstall.symbol;
|
||||||
// qemuTemplate.qemu_path = this.selectedBinary.path;
|
|
||||||
qemuTemplate.compute_id = 'local';
|
qemuTemplate.compute_id = 'local';
|
||||||
qemuTemplate.template_id = uuid();
|
qemuTemplate.template_id = uuid();
|
||||||
qemuTemplate.hda_disk_image = version.images.hda_disk_image;
|
qemuTemplate.hda_disk_image = version.images.hda_disk_image;
|
||||||
|
@ -21,7 +21,6 @@ export class ConfiguratorDialogCloudComponent implements OnInit {
|
|||||||
name: string;
|
name: string;
|
||||||
generalSettingsForm: FormGroup;
|
generalSettingsForm: FormGroup;
|
||||||
consoleTypes: string[] = [];
|
consoleTypes: string[] = [];
|
||||||
binaries: QemuBinary[] = [];
|
|
||||||
onCloseOptions = [];
|
onCloseOptions = [];
|
||||||
bootPriorities = [];
|
bootPriorities = [];
|
||||||
diskInterfaces: string[] = [];
|
diskInterfaces: string[] = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user