mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-30 14:04:14 +00:00
Merge pull request #1541 from GNS3/add-missing-settings
Add missing settings for nodes/templates
This commit is contained in:
commit
64cc001512
@ -14,10 +14,14 @@ export class Properties {
|
|||||||
headless: boolean;
|
headless: boolean;
|
||||||
linked_clone: boolean;
|
linked_clone: boolean;
|
||||||
on_close: string;
|
on_close: string;
|
||||||
aux_type: boolean;
|
|
||||||
aux: number;
|
aux: number;
|
||||||
|
aux_type: boolean;
|
||||||
ram: number;
|
ram: number;
|
||||||
|
system_id: string;
|
||||||
|
npe?: string;
|
||||||
|
midplane?: string;
|
||||||
nvram: number;
|
nvram: number;
|
||||||
|
image: string;
|
||||||
usage: string;
|
usage: string;
|
||||||
use_any_adapter: boolean;
|
use_any_adapter: boolean;
|
||||||
vmname: string;
|
vmname: string;
|
||||||
@ -48,16 +52,40 @@ export class Properties {
|
|||||||
kernel_image: string;
|
kernel_image: string;
|
||||||
kernel_image_md5sum?: any;
|
kernel_image_md5sum?: any;
|
||||||
mac_address: string;
|
mac_address: string;
|
||||||
|
mac_addr: string;
|
||||||
options: string;
|
options: string;
|
||||||
platform: string;
|
platform: string;
|
||||||
|
chassis?: string;
|
||||||
|
iomem?: number;
|
||||||
|
disk0: number;
|
||||||
|
disk1: number;
|
||||||
|
idlepc: string;
|
||||||
|
idlemax: number;
|
||||||
|
idlesleep: number;
|
||||||
|
exec_area: number;
|
||||||
|
mmap: boolean;
|
||||||
|
sparsemem: boolean;
|
||||||
|
auto_delete_disks: boolean;
|
||||||
process_priority: string;
|
process_priority: string;
|
||||||
qemu_path: string;
|
qemu_path: string;
|
||||||
environment: string;
|
environment: string;
|
||||||
extra_hosts: string;
|
extra_hosts: string;
|
||||||
|
start_command: string;
|
||||||
replicate_network_connection_state: boolean;
|
replicate_network_connection_state: boolean;
|
||||||
memory: number;
|
memory: number;
|
||||||
tpm: boolean;
|
tpm: boolean;
|
||||||
uefi: boolean;
|
uefi: boolean;
|
||||||
|
slot0?: string;
|
||||||
|
slot1?: string;
|
||||||
|
slot2?: string;
|
||||||
|
slot3?: string;
|
||||||
|
slot4?: string;
|
||||||
|
slot5?: string;
|
||||||
|
slot6?: string;
|
||||||
|
slot7?: string;
|
||||||
|
wic0?: string;
|
||||||
|
wic1?: string;
|
||||||
|
wic2?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class Node {
|
export class Node {
|
||||||
|
@ -109,32 +109,24 @@
|
|||||||
</mat-step>
|
</mat-step>
|
||||||
|
|
||||||
<mat-step label="Network adapters">
|
<mat-step label="Network adapters">
|
||||||
<!-- <div *ngIf="chassis[iosNameForm.get('platform').value]">
|
<div *ngIf="iosNameForm.get('platform').value">
|
||||||
<div *ngFor="let index of [0,1,2,3,4,5,6,7]">
|
<div *ngFor="let index of [0, 1, 2, 3, 4, 5, 6]">
|
||||||
<mat-select
|
|
||||||
placeholder="Slot {{index}}"
|
|
||||||
[(ngModel)]="networkAdaptersForTemplate[index]"
|
|
||||||
[ngModelOptions]="{standalone: true}"
|
|
||||||
*ngIf="networkAdapters[iosNameForm.get('chassis').value] && networkAdapters[iosNameForm.get('chassis').value][index]">
|
|
||||||
<mat-option *ngFor="let option of networkAdapters[iosNameForm.get('chassis').value][index]" [value]="option">
|
|
||||||
{{option}}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<div *ngIf="selectedPlatform">
|
|
||||||
<div *ngFor="let index of [0, 1, 2, 3, 4, 5, 6, 7]">
|
|
||||||
<mat-select
|
<mat-select
|
||||||
placeholder="Slot {{ index }}"
|
placeholder="Slot {{ index }}"
|
||||||
[(ngModel)]="networkAdaptersForTemplate[index]"
|
[(ngModel)]="networkAdaptersForTemplate[index]"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
*ngIf="
|
*ngIf="adapterMatrix[iosNameForm.get('platform').value][iosNameForm.get('chassis').value || '']
|
||||||
networkAdaptersForPlatform[iosNameForm.get('platform').value] &&
|
&& adapterMatrix[iosNameForm.get('platform').value][iosNameForm.get('chassis').value || ''][index]"
|
||||||
networkAdaptersForPlatform[iosNameForm.get('platform').value][index]
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<mat-option
|
<mat-option
|
||||||
*ngFor="let option of networkAdaptersForPlatform[iosNameForm.get('platform').value][index]"
|
*ngIf="adapterMatrix[iosNameForm.get('platform').value][iosNameForm.get('chassis').value|| ''][index].length > 1 &&
|
||||||
|
!adapterMatrix[iosNameForm.get('platform').value][iosNameForm.get('chassis').value|| ''][index][0].startsWith('C7200')"
|
||||||
|
[value]=""
|
||||||
|
>
|
||||||
|
{{ "" }}
|
||||||
|
</mat-option>
|
||||||
|
<mat-option
|
||||||
|
*ngFor="let option of adapterMatrix[iosNameForm.get('platform').value][iosNameForm.get('chassis').value || ''][index]"
|
||||||
[value]="option"
|
[value]="option"
|
||||||
>
|
>
|
||||||
{{ option }}
|
{{ option }}
|
||||||
@ -144,33 +136,33 @@
|
|||||||
</div>
|
</div>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
|
|
||||||
<mat-step label="WIC modules">
|
<mat-step label="WIC modules" *ngIf="iosNameForm.get('platform').value && wicMatrix[iosNameForm.get('platform').value]">
|
||||||
<div *ngIf="iosNameForm.get('platform').value">
|
<div *ngFor="let index of [0, 1, 2]">
|
||||||
<div *ngFor="let index of [0, 1, 2, 3]">
|
<mat-select
|
||||||
<mat-select
|
placeholder="WIC {{ index }}"
|
||||||
placeholder="WIC {{ index }}"
|
[(ngModel)]="wicsForTemplate[index]"
|
||||||
[(ngModel)]="networkModulesForTemplate[index]"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
*ngIf="wicMatrix[iosNameForm.get('platform').value] && wicMatrix[iosNameForm.get('platform').value][index]"
|
||||||
*ngIf="
|
>
|
||||||
networkModules[iosNameForm.get('platform').value] &&
|
<mat-option [value]="">
|
||||||
networkModules[iosNameForm.get('platform').value][index]
|
{{ "" }}
|
||||||
"
|
</mat-option>
|
||||||
|
<mat-option
|
||||||
|
*ngFor="let option of wicMatrix[iosNameForm.get('platform').value][index]"
|
||||||
|
[value]="option"
|
||||||
>
|
>
|
||||||
<mat-option
|
{{ option }}
|
||||||
*ngFor="let option of networkModules[iosNameForm.get('platform').value][index]"
|
</mat-option>
|
||||||
[value]="option"
|
</mat-select>
|
||||||
>
|
|
||||||
{{ option }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
|
|
||||||
<mat-step label="Idle-PC">
|
<mat-step label="Idle-PC">
|
||||||
<mat-form-field class="form-field">
|
<form [formGroup]="iosIdlePCForm">
|
||||||
<input matInput type="text" [(ngModel)]="iosTemplate.idlepc" placeholder="Idle-PC" />
|
<mat-form-field class="form-field">
|
||||||
</mat-form-field>
|
<input matInput type="text" formControlName="idlepc" [(ngModel)]="iosTemplate.idlepc" placeholder="Idle-PC" />
|
||||||
|
</mat-form-field>
|
||||||
|
</form>
|
||||||
</mat-step>
|
</mat-step>
|
||||||
</mat-vertical-stepper>
|
</mat-vertical-stepper>
|
||||||
</div>
|
</div>
|
||||||
|
@ -32,11 +32,8 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
iosImageForm: UntypedFormGroup;
|
iosImageForm: UntypedFormGroup;
|
||||||
iosNameForm: UntypedFormGroup;
|
iosNameForm: UntypedFormGroup;
|
||||||
iosMemoryForm: UntypedFormGroup;
|
iosMemoryForm: UntypedFormGroup;
|
||||||
|
iosIdlePCForm: UntypedFormGroup;
|
||||||
selectedPlatform: string;
|
selectedPlatform: string;
|
||||||
|
|
||||||
networkAdaptersForTemplate: string[] = [];
|
|
||||||
networkModulesForTemplate: string[] = [];
|
|
||||||
|
|
||||||
iosImages: IosImage[] = [];
|
iosImages: IosImage[] = [];
|
||||||
platforms: string[] = [];
|
platforms: string[] = [];
|
||||||
platformsWithEtherSwitchRouterOption = {};
|
platformsWithEtherSwitchRouterOption = {};
|
||||||
@ -44,9 +41,10 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
chassis = {};
|
chassis = {};
|
||||||
defaultRam = {};
|
defaultRam = {};
|
||||||
defaultNvram = {};
|
defaultNvram = {};
|
||||||
networkAdapters = {};
|
networkAdaptersForTemplate: string[] = [];
|
||||||
networkAdaptersForPlatform = {};
|
wicsForTemplate: string[] = [];
|
||||||
networkModules = {};
|
adapterMatrix = {};
|
||||||
|
wicMatrix = {};
|
||||||
|
|
||||||
ciscoUrl: string = 'https://cfn.cloudapps.cisco.com/ITDIT/CFN/jsp/SearchBySoftware.jsp';
|
ciscoUrl: string = 'https://cfn.cloudapps.cisco.com/ITDIT/CFN/jsp/SearchBySoftware.jsp';
|
||||||
uploader: FileUploader;
|
uploader: FileUploader;
|
||||||
@ -82,6 +80,10 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
this.iosMemoryForm = this.formBuilder.group({
|
this.iosMemoryForm = this.formBuilder.group({
|
||||||
memory: new UntypedFormControl(null, [Validators.required]),
|
memory: new UntypedFormControl(null, [Validators.required]),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.iosIdlePCForm = this.formBuilder.group({
|
||||||
|
idlepc: new UntypedFormControl(null, [Validators.pattern(this.iosConfigurationService.getIdlepcRegex())]),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -120,19 +122,31 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
this.templateMocksService.getIosTemplate().subscribe((iosTemplate: IosTemplate) => {
|
this.templateMocksService.getIosTemplate().subscribe((iosTemplate: IosTemplate) => {
|
||||||
this.iosTemplate = iosTemplate;
|
this.iosTemplate = iosTemplate;
|
||||||
|
|
||||||
this.networkModules = this.iosConfigurationService.getNetworkModules();
|
|
||||||
this.networkAdaptersForPlatform = this.iosConfigurationService.getNetworkAdaptersForPlatform();
|
|
||||||
this.networkAdapters = this.iosConfigurationService.getNetworkAdapters();
|
|
||||||
this.platforms = this.iosConfigurationService.getAvailablePlatforms();
|
this.platforms = this.iosConfigurationService.getAvailablePlatforms();
|
||||||
this.platformsWithEtherSwitchRouterOption = this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption();
|
this.platformsWithEtherSwitchRouterOption = this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption();
|
||||||
this.platformsWithChassis = this.iosConfigurationService.getPlatformsWithChassis();
|
this.platformsWithChassis = this.iosConfigurationService.getPlatformsWithChassis();
|
||||||
this.chassis = this.iosConfigurationService.getChassis();
|
this.chassis = this.iosConfigurationService.getChassis();
|
||||||
this.defaultRam = this.iosConfigurationService.getDefaultRamSettings();
|
this.defaultRam = this.iosConfigurationService.getDefaultRamSettings();
|
||||||
|
this.adapterMatrix = this.iosConfigurationService.getAdapterMatrix();
|
||||||
|
this.wicMatrix = this.iosConfigurationService.getWicMatrix();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fillDefaultSlots() {
|
||||||
|
|
||||||
|
console.log("Fill default slots");
|
||||||
|
if (this.iosNameForm.get('platform').value) {
|
||||||
|
for (let i = 0; i <= 6; i++) {
|
||||||
|
let adapters = this.adapterMatrix[this.iosNameForm.get('platform').value][this.iosNameForm.get('chassis').value || ''][i];
|
||||||
|
if (adapters && (adapters.length === 1 || adapters[0].startsWith('C7200'))) {
|
||||||
|
console.log("Set default adapter for slot" + i + " to " + adapters[0]);
|
||||||
|
this.networkAdaptersForTemplate[i] = adapters[0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setControllerType(controllerType: string) {
|
setControllerType(controllerType: string) {
|
||||||
if (controllerType === 'local') {
|
if (controllerType === 'local') {
|
||||||
this.isLocalComputerChosen = true;
|
this.isLocalComputerChosen = true;
|
||||||
@ -166,6 +180,7 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
if (
|
if (
|
||||||
!this.iosImageForm.invalid &&
|
!this.iosImageForm.invalid &&
|
||||||
!this.iosMemoryForm.invalid &&
|
!this.iosMemoryForm.invalid &&
|
||||||
|
!this.iosIdlePCForm.invalid &&
|
||||||
this.iosNameForm.get('templateName').value &&
|
this.iosNameForm.get('templateName').value &&
|
||||||
this.iosNameForm.get('platform').value
|
this.iosNameForm.get('platform').value
|
||||||
) {
|
) {
|
||||||
@ -184,7 +199,7 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.networkAdaptersForTemplate.length > 0) this.completeAdaptersData();
|
if (this.networkAdaptersForTemplate.length > 0) this.completeAdaptersData();
|
||||||
if (this.networkModulesForTemplate.length > 0) this.completeModulesData();
|
if (this.wicsForTemplate.length > 0) this.completeWicsData();
|
||||||
this.iosTemplate.compute_id = 'local';
|
this.iosTemplate.compute_id = 'local';
|
||||||
|
|
||||||
this.iosService.addTemplate(this.controller, this.iosTemplate).subscribe((template: IosTemplate) => {
|
this.iosService.addTemplate(this.controller, this.iosTemplate).subscribe((template: IosTemplate) => {
|
||||||
@ -196,44 +211,25 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
completeAdaptersData() {
|
completeAdaptersData() {
|
||||||
if (this.chassis[this.iosTemplate.platform]) {
|
for (let i = 0; i <= 6; i++) {
|
||||||
if (Object.keys(this.networkAdapters[this.iosTemplate.chassis])) {
|
if (this.adapterMatrix[this.iosTemplate.platform][this.iosTemplate.chassis || ''][i]) {
|
||||||
for (let i = 0; i < Object.keys(this.networkAdapters[this.iosTemplate.chassis]).length; i++) {
|
if (this.networkAdaptersForTemplate[i] === undefined)
|
||||||
if (!this.networkAdaptersForTemplate[i]) this.networkAdaptersForTemplate[i] = '';
|
this.iosTemplate[`slot${i}`] = ""
|
||||||
}
|
else
|
||||||
}
|
this.iosTemplate[`slot${i}`] = this.networkAdaptersForTemplate[i];
|
||||||
} else {
|
|
||||||
if (this.networkAdaptersForPlatform[this.iosNameForm.get('platform').value]) {
|
|
||||||
for (
|
|
||||||
let i = 0;
|
|
||||||
i < Object.keys(this.networkAdaptersForPlatform[this.iosNameForm.get('platform').value]).length;
|
|
||||||
i++
|
|
||||||
) {
|
|
||||||
if (!this.networkAdaptersForTemplate[i]) this.networkAdaptersForTemplate[i] = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.networkAdaptersForTemplate[0]) this.iosTemplate.slot0 = this.networkAdaptersForTemplate[0];
|
|
||||||
if (this.networkAdaptersForTemplate[1]) this.iosTemplate.slot1 = this.networkAdaptersForTemplate[1];
|
|
||||||
if (this.networkAdaptersForTemplate[2]) this.iosTemplate.slot2 = this.networkAdaptersForTemplate[2];
|
|
||||||
if (this.networkAdaptersForTemplate[3]) this.iosTemplate.slot3 = this.networkAdaptersForTemplate[3];
|
|
||||||
if (this.networkAdaptersForTemplate[4]) this.iosTemplate.slot4 = this.networkAdaptersForTemplate[4];
|
|
||||||
if (this.networkAdaptersForTemplate[5]) this.iosTemplate.slot5 = this.networkAdaptersForTemplate[5];
|
|
||||||
if (this.networkAdaptersForTemplate[6]) this.iosTemplate.slot6 = this.networkAdaptersForTemplate[6];
|
|
||||||
if (this.networkAdaptersForTemplate[7]) this.iosTemplate.slot7 = this.networkAdaptersForTemplate[7];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
completeModulesData() {
|
completeWicsData() {
|
||||||
if (Object.keys(this.networkModules[this.iosTemplate.platform])) {
|
for (let i = 0; i <= 3; i++) {
|
||||||
for (let i = 0; i < Object.keys(this.networkModules[this.iosTemplate.platform]).length; i++) {
|
if (this.wicMatrix[this.iosTemplate.platform][i]) {
|
||||||
if (!this.networkModulesForTemplate[i]) this.networkModulesForTemplate[i] = '';
|
if (this.wicsForTemplate[i] === undefined)
|
||||||
|
this.iosTemplate[`wic${i}`] = ""
|
||||||
|
else
|
||||||
|
this.iosTemplate[`wic${i}`] = this.wicsForTemplate[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.networkModulesForTemplate[0]) this.iosTemplate.wic0 = this.networkModulesForTemplate[0];
|
|
||||||
if (this.networkModulesForTemplate[1]) this.iosTemplate.wic1 = this.networkModulesForTemplate[1];
|
|
||||||
if (this.networkModulesForTemplate[2]) this.iosTemplate.wic2 = this.networkModulesForTemplate[2];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
@ -252,25 +248,31 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
|
|||||||
this.selectedPlatform = name;
|
this.selectedPlatform = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (name === 'c1700') {
|
if (name === 'c3620' || name === 'c3640' || name === 'c3660')
|
||||||
this.iosNameForm.controls['chassis'].setValue('1720');
|
this.iosNameForm.controls['chassis'].setValue(name.substring(1));
|
||||||
|
else if (name === 'c1700') {
|
||||||
|
this.iosNameForm.controls['chassis'].setValue('1760');
|
||||||
} else if (name === 'c2600') {
|
} else if (name === 'c2600') {
|
||||||
this.iosNameForm.controls['chassis'].setValue('2610');
|
this.iosNameForm.controls['chassis'].setValue('2651XM');
|
||||||
} else {
|
} else {
|
||||||
this.iosNameForm.controls['chassis'].setValue('');
|
this.iosNameForm.controls['chassis'].setValue('');
|
||||||
}
|
}
|
||||||
|
this.iosMemoryForm.controls['memory'].setValue(this.defaultRam[this.selectedPlatform]);
|
||||||
this.iosMemoryForm.controls['memory'].setValue(this.defaultRam[name]);
|
this.fillDefaultSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
onPlatformChosen() {
|
onPlatformChosen() {
|
||||||
this.iosTemplate.chassis = '';
|
this.iosTemplate.chassis = '';
|
||||||
this.networkAdaptersForTemplate = [];
|
this.networkAdaptersForTemplate = [];
|
||||||
this.networkModulesForTemplate = [];
|
this.wicsForTemplate = [];
|
||||||
|
if (!this.chassis[this.iosNameForm.get('platform').value])
|
||||||
|
this.fillDefaultSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
onChassisChosen() {
|
onChassisChosen() {
|
||||||
this.networkAdaptersForTemplate = [];
|
this.networkAdaptersForTemplate = [];
|
||||||
|
if (this.chassis[this.iosNameForm.get('platform').value])
|
||||||
|
this.fillDefaultSlots();
|
||||||
}
|
}
|
||||||
|
|
||||||
cancelUploading() {
|
cancelUploading() {
|
||||||
|
@ -169,60 +169,47 @@
|
|||||||
<mat-panel-title> Slots </mat-panel-title>
|
<mat-panel-title> Slots </mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
<h6>Adapters</h6>
|
<h6>Adapters</h6>
|
||||||
<div *ngIf="iosTemplate.chassis && chassis[iosTemplate.platform]">
|
<div *ngFor="let index of [0, 1, 2, 3, 4, 5, 6]">
|
||||||
<div *ngFor="let index of [0, 1, 2, 3, 4, 5, 6, 7]">
|
<mat-select
|
||||||
<mat-select
|
placeholder="Slot {{ index }}"
|
||||||
placeholder="Slot {{ index }}"
|
[(ngModel)]="networkAdaptersForTemplate[index]"
|
||||||
[(ngModel)]="networkAdaptersForTemplate[index]"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
[ngModelOptions]="{ standalone: true }"
|
*ngIf="adapterMatrix[iosTemplate.platform][iosTemplate.chassis || ''][index]"
|
||||||
*ngIf="networkAdapters[iosTemplate.chassis][index]"
|
>
|
||||||
|
<mat-option
|
||||||
|
*ngIf="adapterMatrix[iosTemplate.platform][iosTemplate.chassis || ''][index].length > 1 &&
|
||||||
|
!adapterMatrix[iosTemplate.platform][iosTemplate.chassis || ''][index][0].startsWith('C7200')"
|
||||||
|
[value]=""
|
||||||
>
|
>
|
||||||
<mat-option *ngFor="let option of networkAdapters[iosTemplate.chassis][index]" [value]="option">
|
{{ "" }}
|
||||||
|
</mat-option>
|
||||||
|
<mat-option
|
||||||
|
*ngFor="let option of adapterMatrix[iosTemplate.platform][iosTemplate.chassis || ''][index]"
|
||||||
|
[value]="option"
|
||||||
|
>
|
||||||
|
{{ option }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div *ngIf="wicMatrix[iosTemplate.platform]">
|
||||||
|
<h6>WICs</h6>
|
||||||
|
<div *ngFor="let index of [0, 1, 2]">
|
||||||
|
<mat-select
|
||||||
|
placeholder="WIC {{ index }}"
|
||||||
|
[(ngModel)]="wicsForTemplate[index]"
|
||||||
|
[ngModelOptions]="{ standalone: true }"
|
||||||
|
*ngIf="wicMatrix[iosTemplate.platform][index]"
|
||||||
|
>
|
||||||
|
<mat-option [value]="">
|
||||||
|
{{ "" }}
|
||||||
|
</mat-option>
|
||||||
|
<mat-option *ngFor="let option of wicMatrix[iosTemplate.platform][index]" [value]="option">
|
||||||
{{ option }}
|
{{ option }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
</mat-select>
|
</mat-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="iosTemplate.platform && !chassis[iosTemplate.platform]">
|
|
||||||
<div *ngFor="let index of [0, 1, 2, 3, 4, 5, 6, 7]">
|
|
||||||
<mat-select
|
|
||||||
placeholder="Slot {{ index }}"
|
|
||||||
[(ngModel)]="networkAdaptersForTemplate[index]"
|
|
||||||
[ngModelOptions]="{ standalone: true }"
|
|
||||||
*ngIf="networkAdaptersForPlatform[iosTemplate.platform][index]"
|
|
||||||
>
|
|
||||||
<mat-option
|
|
||||||
*ngFor="let option of networkAdaptersForPlatform[iosTemplate.platform][index]"
|
|
||||||
[value]="option"
|
|
||||||
>
|
|
||||||
{{ option }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<br /><br />
|
|
||||||
<h6>WICs</h6>
|
|
||||||
<div *ngIf="iosTemplate.wic0 || iosTemplate.wic0 === ''">
|
|
||||||
<mat-select placeholder="WIC 0" [(ngModel)]="iosTemplate.wic0" [ngModelOptions]="{ standalone: true }">
|
|
||||||
<mat-option *ngFor="let option of networkModules[iosTemplate.platform][0]" [value]="option">
|
|
||||||
{{ option }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="iosTemplate.wic1 || iosTemplate.wic1 === ''">
|
|
||||||
<mat-select placeholder="WIC 1" [(ngModel)]="iosTemplate.wic1" [ngModelOptions]="{ standalone: true }">
|
|
||||||
<mat-option *ngFor="let option of networkModules[iosTemplate.platform][1]" [value]="option">
|
|
||||||
{{ option }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</div>
|
|
||||||
<div *ngIf="iosTemplate.wic2 || iosTemplate.wic2 === ''">
|
|
||||||
<mat-select placeholder="WIC 2" [(ngModel)]="iosTemplate.wic2" [ngModelOptions]="{ standalone: true }">
|
|
||||||
<mat-option *ngFor="let option of networkModules[iosTemplate.platform][2]" [value]="option">
|
|
||||||
{{ option }}
|
|
||||||
</mat-option>
|
|
||||||
</mat-select>
|
|
||||||
</div>
|
|
||||||
</mat-expansion-panel>
|
</mat-expansion-panel>
|
||||||
<mat-expansion-panel>
|
<mat-expansion-panel>
|
||||||
<mat-expansion-panel-header>
|
<mat-expansion-panel-header>
|
||||||
@ -240,8 +227,8 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input
|
<input
|
||||||
[ngModelOptions]="{ standalone: true }"
|
|
||||||
matInput
|
matInput
|
||||||
|
formControlName="mac_addr"
|
||||||
type="text"
|
type="text"
|
||||||
[(ngModel)]="iosTemplate.mac_addr"
|
[(ngModel)]="iosTemplate.mac_addr"
|
||||||
placeholder="Base MAC"
|
placeholder="Base MAC"
|
||||||
@ -249,8 +236,8 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input
|
<input
|
||||||
[ngModelOptions]="{ standalone: true }"
|
|
||||||
matInput
|
matInput
|
||||||
|
formControlName="idlepc"
|
||||||
type="text"
|
type="text"
|
||||||
[(ngModel)]="iosTemplate.idlepc"
|
[(ngModel)]="iosTemplate.idlepc"
|
||||||
placeholder="Idle-PC"
|
placeholder="Idle-PC"
|
||||||
|
@ -94,9 +94,10 @@ describe('IosTemplateDetailsComponent', () => {
|
|||||||
component.advancedForm.controls['idlemax'].setValue('0');
|
component.advancedForm.controls['idlemax'].setValue('0');
|
||||||
component.advancedForm.controls['idlesleep'].setValue('0');
|
component.advancedForm.controls['idlesleep'].setValue('0');
|
||||||
component.advancedForm.controls['execarea'].setValue('0');
|
component.advancedForm.controls['execarea'].setValue('0');
|
||||||
|
component.advancedForm.controls['idlepc'].setValue('0x0');
|
||||||
|
component.advancedForm.controls['mac_addr'].setValue('');
|
||||||
|
spyOn(component, 'saveSlotsData').and.returnValue();
|
||||||
component.onSave();
|
component.onSave();
|
||||||
|
|
||||||
expect(mockedIosService.saveTemplate).toHaveBeenCalled();
|
expect(mockedIosService.saveTemplate).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -16,10 +16,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
|||||||
export class IosTemplateDetailsComponent implements OnInit {
|
export class IosTemplateDetailsComponent implements OnInit {
|
||||||
controller:Controller ;
|
controller:Controller ;
|
||||||
iosTemplate: IosTemplate;
|
iosTemplate: IosTemplate;
|
||||||
|
|
||||||
isSymbolSelectionOpened: boolean = false;
|
isSymbolSelectionOpened: boolean = false;
|
||||||
|
|
||||||
networkAdaptersForTemplate: string[] = [];
|
|
||||||
platforms: string[] = [];
|
platforms: string[] = [];
|
||||||
consoleTypes: string[] = [];
|
consoleTypes: string[] = [];
|
||||||
categories = [];
|
categories = [];
|
||||||
@ -28,9 +25,10 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
chassis = {};
|
chassis = {};
|
||||||
defaultRam = {};
|
defaultRam = {};
|
||||||
defaultNvram = {};
|
defaultNvram = {};
|
||||||
networkAdapters = {};
|
networkAdaptersForTemplate: string[] = [];
|
||||||
networkAdaptersForPlatform = {};
|
wicsForTemplate: string[] = [];
|
||||||
networkModules = {};
|
adapterMatrix = {};
|
||||||
|
wicMatrix = {};
|
||||||
|
|
||||||
generalSettingsForm: UntypedFormGroup;
|
generalSettingsForm: UntypedFormGroup;
|
||||||
memoryForm: UntypedFormGroup;
|
memoryForm: UntypedFormGroup;
|
||||||
@ -66,6 +64,8 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
idlemax: new UntypedFormControl('', Validators.required),
|
idlemax: new UntypedFormControl('', Validators.required),
|
||||||
idlesleep: new UntypedFormControl('', Validators.required),
|
idlesleep: new UntypedFormControl('', Validators.required),
|
||||||
execarea: new UntypedFormControl('', Validators.required),
|
execarea: new UntypedFormControl('', Validators.required),
|
||||||
|
idlepc: new UntypedFormControl('', Validators.pattern(this.iosConfigurationService.getIdlepcRegex())),
|
||||||
|
mac_addr: new UntypedFormControl('', Validators.pattern(this.iosConfigurationService.getMacAddrRegex())),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -78,16 +78,12 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
this.getConfiguration();
|
this.getConfiguration();
|
||||||
this.iosService.getTemplate(this.controller, template_id).subscribe((iosTemplate: IosTemplate) => {
|
this.iosService.getTemplate(this.controller, template_id).subscribe((iosTemplate: IosTemplate) => {
|
||||||
this.iosTemplate = iosTemplate;
|
this.iosTemplate = iosTemplate;
|
||||||
|
this.fillSlotsData();
|
||||||
this.fillAdaptersData();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getConfiguration() {
|
getConfiguration() {
|
||||||
this.networkModules = this.iosConfigurationService.getNetworkModules();
|
|
||||||
this.networkAdaptersForPlatform = this.iosConfigurationService.getNetworkAdaptersForPlatform();
|
|
||||||
this.networkAdapters = this.iosConfigurationService.getNetworkAdapters();
|
|
||||||
this.platforms = this.iosConfigurationService.getAvailablePlatforms();
|
this.platforms = this.iosConfigurationService.getAvailablePlatforms();
|
||||||
this.platformsWithEtherSwitchRouterOption = this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption();
|
this.platformsWithEtherSwitchRouterOption = this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption();
|
||||||
this.platformsWithChassis = this.iosConfigurationService.getPlatformsWithChassis();
|
this.platformsWithChassis = this.iosConfigurationService.getPlatformsWithChassis();
|
||||||
@ -95,35 +91,55 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
this.defaultRam = this.iosConfigurationService.getDefaultRamSettings();
|
this.defaultRam = this.iosConfigurationService.getDefaultRamSettings();
|
||||||
this.consoleTypes = this.iosConfigurationService.getConsoleTypes();
|
this.consoleTypes = this.iosConfigurationService.getConsoleTypes();
|
||||||
this.categories = this.iosConfigurationService.getCategories();
|
this.categories = this.iosConfigurationService.getCategories();
|
||||||
|
this.adapterMatrix = this.iosConfigurationService.getAdapterMatrix();
|
||||||
|
this.wicMatrix = this.iosConfigurationService.getWicMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
fillAdaptersData() {
|
fillSlotsData() {
|
||||||
if (this.iosTemplate.slot0) this.networkAdaptersForTemplate[0] = this.iosTemplate.slot0;
|
|
||||||
if (this.iosTemplate.slot1) this.networkAdaptersForTemplate[1] = this.iosTemplate.slot1;
|
// load network adapters
|
||||||
if (this.iosTemplate.slot2) this.networkAdaptersForTemplate[2] = this.iosTemplate.slot2;
|
for (let i = 0; i <= 6; i++) {
|
||||||
if (this.iosTemplate.slot3) this.networkAdaptersForTemplate[3] = this.iosTemplate.slot3;
|
if (this.iosTemplate[`slot${i}`]) {
|
||||||
if (this.iosTemplate.slot4) this.networkAdaptersForTemplate[4] = this.iosTemplate.slot4;
|
this.networkAdaptersForTemplate[i] = this.iosTemplate[`slot${i}`];
|
||||||
if (this.iosTemplate.slot5) this.networkAdaptersForTemplate[5] = this.iosTemplate.slot5;
|
}
|
||||||
if (this.iosTemplate.slot6) this.networkAdaptersForTemplate[6] = this.iosTemplate.slot6;
|
}
|
||||||
if (this.iosTemplate.slot7) this.networkAdaptersForTemplate[7] = this.iosTemplate.slot7;
|
|
||||||
|
// load WICs
|
||||||
|
for (let i = 0; i <= 3; i++) {
|
||||||
|
if (this.iosTemplate[`wic${i}`]) {
|
||||||
|
this.wicsForTemplate[i] = this.iosTemplate[`wic${i}`];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
completeAdaptersData() {
|
saveSlotsData() {
|
||||||
if (this.networkAdaptersForTemplate[0]) this.iosTemplate.slot0 = this.networkAdaptersForTemplate[0];
|
|
||||||
if (this.networkAdaptersForTemplate[1]) this.iosTemplate.slot1 = this.networkAdaptersForTemplate[1];
|
// save network adapters
|
||||||
if (this.networkAdaptersForTemplate[2]) this.iosTemplate.slot2 = this.networkAdaptersForTemplate[2];
|
for (let i = 0; i <= 6; i++) {
|
||||||
if (this.networkAdaptersForTemplate[3]) this.iosTemplate.slot3 = this.networkAdaptersForTemplate[3];
|
if (this.adapterMatrix[this.iosTemplate.platform][this.iosTemplate.chassis || ''][i]) {
|
||||||
if (this.networkAdaptersForTemplate[4]) this.iosTemplate.slot4 = this.networkAdaptersForTemplate[4];
|
if (this.networkAdaptersForTemplate[i] === undefined)
|
||||||
if (this.networkAdaptersForTemplate[5]) this.iosTemplate.slot5 = this.networkAdaptersForTemplate[5];
|
this.iosTemplate[`slot${i}`] = ""
|
||||||
if (this.networkAdaptersForTemplate[6]) this.iosTemplate.slot6 = this.networkAdaptersForTemplate[6];
|
else
|
||||||
if (this.networkAdaptersForTemplate[7]) this.iosTemplate.slot7 = this.networkAdaptersForTemplate[7];
|
this.iosTemplate[`slot${i}`] = this.networkAdaptersForTemplate[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// save WICs
|
||||||
|
for (let i = 0; i <= 3; i++) {
|
||||||
|
if (this.wicMatrix[this.iosTemplate.platform][i]) {
|
||||||
|
if (this.wicsForTemplate[i] === undefined)
|
||||||
|
this.iosTemplate[`wic${i}`] = ""
|
||||||
|
else
|
||||||
|
this.iosTemplate[`wic${i}`] = this.wicsForTemplate[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSave() {
|
onSave() {
|
||||||
if (this.generalSettingsForm.invalid || this.memoryForm.invalid || this.advancedForm.invalid) {
|
if (this.generalSettingsForm.invalid || this.memoryForm.invalid || this.advancedForm.invalid) {
|
||||||
this.toasterService.error(`Fill all required fields`);
|
this.toasterService.error(`Fill all required fields`);
|
||||||
} else {
|
} else {
|
||||||
this.completeAdaptersData();
|
this.saveSlotsData();
|
||||||
|
|
||||||
this.iosService.saveTemplate(this.controller, this.iosTemplate).subscribe((iosTemplate: IosTemplate) => {
|
this.iosService.saveTemplate(this.controller, this.iosTemplate).subscribe((iosTemplate: IosTemplate) => {
|
||||||
this.toasterService.success('Changes saved');
|
this.toasterService.success('Changes saved');
|
||||||
|
@ -33,17 +33,27 @@
|
|||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input formControlName="memory" matInput type="number" min="1" [(ngModel)]="node.properties.memory" placeholder="Maximum memory">
|
<input
|
||||||
|
matInput
|
||||||
|
formControlName="mac_address"
|
||||||
|
type="text"
|
||||||
|
[(ngModel)]="node.properties.mac_address"
|
||||||
|
placeholder="Base MAC"
|
||||||
|
/>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input formControlName="memory" matInput type="number" min="0" [(ngModel)]="node.properties.memory" placeholder="Maximum memory">
|
||||||
<span matSuffix>MB</span>
|
<span matSuffix>MB</span>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input formControlName="cpus" matInput type="number" min="1" [(ngModel)]="node.properties.cpus" placeholder="Maximum CPUs">
|
<input formControlName="cpus" matInput type="number" min="0" [(ngModel)]="node.properties.cpus" placeholder="Maximum CPUs">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<button mat-button class="form-field" (click)="configureCustomAdapters()">
|
<!-- <button mat-button class="form-field" (click)="configureCustomAdapters()">-->
|
||||||
Configure custom adapters
|
<!-- Configure custom adapters-->
|
||||||
</button>
|
<!-- </button>-->
|
||||||
|
|
||||||
<mat-form-field class="select">
|
<mat-form-field class="select">
|
||||||
<mat-select
|
<mat-select
|
||||||
|
@ -42,6 +42,7 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
|
|||||||
this.generalSettingsForm = this.formBuilder.group({
|
this.generalSettingsForm = this.formBuilder.group({
|
||||||
name: new UntypedFormControl('', Validators.required),
|
name: new UntypedFormControl('', Validators.required),
|
||||||
adapter: new UntypedFormControl('', Validators.required),
|
adapter: new UntypedFormControl('', Validators.required),
|
||||||
|
mac_address: new UntypedFormControl('', Validators.pattern(this.dockerConfigurationService.getMacAddrRegex())),
|
||||||
memory: new UntypedFormControl('', nonNegativeValidator.get),
|
memory: new UntypedFormControl('', nonNegativeValidator.get),
|
||||||
cpus: new UntypedFormControl('', nonNegativeValidator.get),
|
cpus: new UntypedFormControl('', nonNegativeValidator.get),
|
||||||
startCommand: new UntypedFormControl(''),
|
startCommand: new UntypedFormControl(''),
|
||||||
|
@ -7,11 +7,31 @@
|
|||||||
<mat-tab-group *ngIf="name">
|
<mat-tab-group *ngIf="name">
|
||||||
<mat-tab label="General settings">
|
<mat-tab label="General settings">
|
||||||
<br />
|
<br />
|
||||||
|
<mat-label>Platform: {{ node.properties.platform }}</mat-label>
|
||||||
|
<mat-label *ngIf="node.properties.chassis"> (chassis: {{ node.properties.chassis }})</mat-label>
|
||||||
|
<br /><br />
|
||||||
<form [formGroup]="generalSettingsForm">
|
<form [formGroup]="generalSettingsForm">
|
||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input matInput type="text" formControlName="name" [(ngModel)]="node.name" placeholder="Name" />
|
<input matInput type="text" formControlName="name" [(ngModel)]="node.name" placeholder="Name" />
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input matInput type="text" formControlName="path" [(ngModel)]="node.properties.image" placeholder="IOS image path"/>
|
||||||
|
</mat-form-field>
|
||||||
</form>
|
</form>
|
||||||
|
<mat-form-field class="select" *ngIf="node.properties.midplane">
|
||||||
|
<mat-select placeholder="Midplane" [(ngModel)]="node.properties.midplane">
|
||||||
|
<mat-option *ngFor="let type of MidplaneTypes" [value]="type">
|
||||||
|
{{ type }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field class="select" *ngIf="node.properties.npe">
|
||||||
|
<mat-select placeholder="NPE" [(ngModel)]="node.properties.npe">
|
||||||
|
<mat-option *ngFor="let type of NPETypes" [value]="type">
|
||||||
|
{{ type }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
||||||
<mat-form-field class="select">
|
<mat-form-field class="select">
|
||||||
<mat-select placeholder="Console type" [(ngModel)]="node.console_type">
|
<mat-select placeholder="Console type" [(ngModel)]="node.console_type">
|
||||||
<mat-option *ngFor="let type of consoleTypes" [value]="type">
|
<mat-option *ngFor="let type of consoleTypes" [value]="type">
|
||||||
@ -20,7 +40,7 @@
|
|||||||
</mat-select>
|
</mat-select>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field class="select">
|
<mat-form-field class="select">
|
||||||
<mat-select placeholder="Auxiliary console type" [(ngModel)]="node.aux_type">
|
<mat-select placeholder="Auxiliary console type" [(ngModel)]="node.properties.aux_type">
|
||||||
<mat-option *ngFor="let type of consoleTypes" [value]="type">
|
<mat-option *ngFor="let type of consoleTypes" [value]="type">
|
||||||
{{ type }}
|
{{ type }}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
@ -36,23 +56,144 @@
|
|||||||
<input
|
<input
|
||||||
matInput
|
matInput
|
||||||
type="number"
|
type="number"
|
||||||
|
min="0"
|
||||||
formControlName="ram"
|
formControlName="ram"
|
||||||
[(ngModel)]="node.properties.ram"
|
[(ngModel)]="node.properties.ram"
|
||||||
placeholder="RAM size"
|
placeholder="RAM size"
|
||||||
/>
|
/>
|
||||||
<span matSuffix>MB</span>
|
<span matSuffix>MiB</span>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<mat-form-field class="form-field">
|
<mat-form-field class="form-field">
|
||||||
<input
|
<input
|
||||||
matInput
|
matInput
|
||||||
type="number"
|
type="number"
|
||||||
|
min="0"
|
||||||
formControlName="nvram"
|
formControlName="nvram"
|
||||||
[(ngModel)]="node.properties.nvram"
|
[(ngModel)]="node.properties.nvram"
|
||||||
placeholder="NVRAM size"
|
placeholder="NVRAM size"
|
||||||
/>
|
/>
|
||||||
<span matSuffix>MB</span>
|
<span matSuffix>MiB</span>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
</form>
|
</form>
|
||||||
|
<mat-form-field class="form-field" *ngIf="node.properties.iomem">
|
||||||
|
<input
|
||||||
|
matInput
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
max="100"
|
||||||
|
[(ngModel)]="node.properties.iomem"
|
||||||
|
placeholder="I/O memory"
|
||||||
|
/>
|
||||||
|
<span matSuffix>%</span>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input
|
||||||
|
matInput
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
[(ngModel)]="node.properties.disk0"
|
||||||
|
placeholder="PCMCIA disk0"
|
||||||
|
/>
|
||||||
|
<span matSuffix>MiB</span>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input
|
||||||
|
matInput
|
||||||
|
type="number"
|
||||||
|
min="0"
|
||||||
|
[(ngModel)]="node.properties.disk1"
|
||||||
|
placeholder="PCMCIA disk1"
|
||||||
|
/>
|
||||||
|
<span matSuffix>MiB</span>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-checkbox [(ngModel)]="node.properties.auto_delete_disks"> Automatically delete NVRAM and disk files </mat-checkbox><br />
|
||||||
|
</mat-tab>
|
||||||
|
|
||||||
|
<mat-tab label="Slots">
|
||||||
|
<br />
|
||||||
|
<h6>Adapters</h6>
|
||||||
|
<div *ngFor="let index of [0, 1, 2, 3, 4, 5, 6]">
|
||||||
|
<mat-select
|
||||||
|
placeholder="Slot {{ index }}"
|
||||||
|
[(ngModel)]="networkAdaptersForNode[index]"
|
||||||
|
[ngModelOptions]="{ standalone: true }"
|
||||||
|
*ngIf="adapterMatrix[node.properties.platform][node.properties.chassis || ''][index]"
|
||||||
|
>
|
||||||
|
<mat-option
|
||||||
|
*ngIf="adapterMatrix[node.properties.platform][node.properties.chassis || ''][index].length > 1 &&
|
||||||
|
!adapterMatrix[node.properties.platform][node.properties.chassis || ''][index][0].startsWith('C7200')"
|
||||||
|
[value]=""
|
||||||
|
>
|
||||||
|
{{ "" }}
|
||||||
|
</mat-option>
|
||||||
|
<mat-option
|
||||||
|
*ngFor="let option of adapterMatrix[node.properties.platform][node.properties.chassis || ''][index]"
|
||||||
|
[value]="option"
|
||||||
|
>
|
||||||
|
{{ option }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div *ngIf="wicMatrix[node.properties.platform]">
|
||||||
|
<h6>WICs</h6>
|
||||||
|
<div *ngFor="let index of [0, 1, 2]">
|
||||||
|
<mat-select
|
||||||
|
placeholder="WIC {{ index }}"
|
||||||
|
[(ngModel)]="wicsForNode[index]"
|
||||||
|
[ngModelOptions]="{ standalone: true }"
|
||||||
|
*ngIf="wicMatrix[node.properties.platform][index]"
|
||||||
|
>
|
||||||
|
<mat-option [value]="">
|
||||||
|
{{ "" }}
|
||||||
|
</mat-option>
|
||||||
|
<mat-option *ngFor="let option of wicMatrix[node.properties.platform][index]" [value]="option">
|
||||||
|
{{ option }}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</mat-tab>
|
||||||
|
|
||||||
|
<mat-tab label="Advanced">
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-title></mat-card-title>
|
||||||
|
<mat-card-subtitle> System </mat-card-subtitle>
|
||||||
|
<mat-card-content>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input matInput type="text" [(ngModel)]="node.properties.system_id" placeholder="System ID" />
|
||||||
|
</mat-form-field>
|
||||||
|
<form [formGroup]="advancedSettingsForm">
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input matInput formControlName="mac_addr" type="text" [(ngModel)]="node.properties.mac_addr" placeholder="Base MAC" />
|
||||||
|
</mat-form-field>
|
||||||
|
</form>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
<mat-card>
|
||||||
|
<mat-card-title></mat-card-title>
|
||||||
|
<mat-card-subtitle> Optimizations </mat-card-subtitle>
|
||||||
|
<mat-card-content>
|
||||||
|
<form [formGroup]="advancedSettingsForm">
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input matInput type="text" formControlName="idlepc" [(ngModel)]="node.properties.idlepc" placeholder="Idle-PC" />
|
||||||
|
</mat-form-field>
|
||||||
|
</form>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input matInput type="number" min="0" [(ngModel)]="node.properties.idlemax" placeholder="Idlemax" />
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input matInput type="number" min="0" [(ngModel)]="node.properties.idlesleep" placeholder="Idlesleep" />
|
||||||
|
<span matSuffix>ms</span>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input matInput type="number" min="0" [(ngModel)]="node.properties.exec_area" placeholder="Exec area" />
|
||||||
|
<span matSuffix>MiB</span>
|
||||||
|
</mat-form-field>
|
||||||
|
<mat-checkbox [(ngModel)]="node.properties.mmap"> Enable mmap support </mat-checkbox><br />
|
||||||
|
<mat-checkbox [(ngModel)]="node.properties.sparsemem"> Enable sparse memory support </mat-checkbox><br />
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
|
|
||||||
<mat-tab label="Usage">
|
<mat-tab label="Usage">
|
||||||
|
@ -18,7 +18,14 @@ export class ConfiguratorDialogIosComponent implements OnInit {
|
|||||||
name: string;
|
name: string;
|
||||||
generalSettingsForm: UntypedFormGroup;
|
generalSettingsForm: UntypedFormGroup;
|
||||||
memoryForm: UntypedFormGroup;
|
memoryForm: UntypedFormGroup;
|
||||||
|
advancedSettingsForm: UntypedFormGroup;
|
||||||
consoleTypes: string[] = [];
|
consoleTypes: string[] = [];
|
||||||
|
NPETypes: string[] = [];
|
||||||
|
MidplaneTypes: string[] = [];
|
||||||
|
networkAdaptersForNode: string[] = [];
|
||||||
|
wicsForNode: string[] = [];
|
||||||
|
adapterMatrix = {};
|
||||||
|
wicMatrix = {};
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public dialogRef: MatDialogRef<ConfiguratorDialogIosComponent>,
|
public dialogRef: MatDialogRef<ConfiguratorDialogIosComponent>,
|
||||||
@ -29,12 +36,18 @@ export class ConfiguratorDialogIosComponent implements OnInit {
|
|||||||
) {
|
) {
|
||||||
this.generalSettingsForm = this.formBuilder.group({
|
this.generalSettingsForm = this.formBuilder.group({
|
||||||
name: new UntypedFormControl('', Validators.required),
|
name: new UntypedFormControl('', Validators.required),
|
||||||
|
path: new UntypedFormControl('', Validators.required),
|
||||||
});
|
});
|
||||||
|
|
||||||
this.memoryForm = this.formBuilder.group({
|
this.memoryForm = this.formBuilder.group({
|
||||||
ram: new UntypedFormControl('', Validators.required),
|
ram: new UntypedFormControl('', Validators.required),
|
||||||
nvram: new UntypedFormControl('', Validators.required),
|
nvram: new UntypedFormControl('', Validators.required),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.advancedSettingsForm = this.formBuilder.group({
|
||||||
|
mac_addr: new UntypedFormControl('', Validators.pattern(this.configurationService.getMacAddrRegex())),
|
||||||
|
idlepc: new UntypedFormControl('', Validators.pattern(this.configurationService.getIdlepcRegex())),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -42,15 +55,61 @@ export class ConfiguratorDialogIosComponent implements OnInit {
|
|||||||
this.node = node;
|
this.node = node;
|
||||||
this.name = node.name;
|
this.name = node.name;
|
||||||
this.getConfiguration();
|
this.getConfiguration();
|
||||||
|
this.fillSlotsData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getConfiguration() {
|
getConfiguration() {
|
||||||
this.consoleTypes = this.configurationService.getConsoleTypes();
|
this.consoleTypes = this.configurationService.getConsoleTypes();
|
||||||
|
this.NPETypes = this.configurationService.getNPETypes();
|
||||||
|
this.MidplaneTypes = this.configurationService.getMidplaneTypes();
|
||||||
|
this.adapterMatrix = this.configurationService.getAdapterMatrix();
|
||||||
|
this.wicMatrix = this.configurationService.getWicMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
fillSlotsData() {
|
||||||
|
|
||||||
|
// load network adapters
|
||||||
|
for (let i = 0; i <= 6; i++) {
|
||||||
|
if (this.node.properties[`slot${i}`]) {
|
||||||
|
this.networkAdaptersForNode[i] = this.node.properties[`slot${i}`];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// load WICs
|
||||||
|
for (let i = 0; i <= 3; i++) {
|
||||||
|
if (this.node.properties[`wic${i}`]) {
|
||||||
|
this.wicsForNode[i] = this.node.properties[`wic${i}`];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
saveSlotsData() {
|
||||||
|
|
||||||
|
// save network adapters
|
||||||
|
for (let i = 0; i <= 6; i++) {
|
||||||
|
if (this.adapterMatrix[this.node.properties.platform][this.node.properties.chassis || ''][i]) {
|
||||||
|
if (this.networkAdaptersForNode[i] === undefined)
|
||||||
|
this.node.properties[`slot${i}`] = ""
|
||||||
|
else
|
||||||
|
this.node.properties[`slot${i}`] = this.networkAdaptersForNode[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// save WICs
|
||||||
|
for (let i = 0; i <= 3; i++) {
|
||||||
|
if (this.wicMatrix[this.node.properties.platform][i]) {
|
||||||
|
if (this.wicsForNode[i] === undefined)
|
||||||
|
this.node.properties[`wic${i}`] = ""
|
||||||
|
else
|
||||||
|
this.node.properties[`wic${i}`] = this.wicsForNode[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onSaveClick() {
|
onSaveClick() {
|
||||||
if (this.generalSettingsForm.valid && this.memoryForm.valid) {
|
if (this.generalSettingsForm.valid && this.memoryForm.valid && this.advancedSettingsForm.valid) {
|
||||||
|
this.saveSlotsData();
|
||||||
this.nodeService.updateNode(this.controller, this.node).subscribe(() => {
|
this.nodeService.updateNode(this.controller, this.node).subscribe(() => {
|
||||||
this.toasterService.success(`Node ${this.node.name} updated.`);
|
this.toasterService.success(`Node ${this.node.name} updated.`);
|
||||||
this.onCancelClick();
|
this.onCancelClick();
|
||||||
|
@ -152,15 +152,43 @@
|
|||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab label="Network">
|
<mat-tab label="Network">
|
||||||
<br />
|
<br />
|
||||||
<br /><mat-checkbox [(ngModel)]="node.properties.replicate_network_connection_state">
|
<mat-form-field class="form-field">
|
||||||
|
<input
|
||||||
|
matInput
|
||||||
|
min=0
|
||||||
|
type="number"
|
||||||
|
[(ngModel)]="node.properties.adapters"
|
||||||
|
placeholder="Adapters"
|
||||||
|
/>
|
||||||
|
</mat-form-field>
|
||||||
|
<form [formGroup]="networkSettingsForm">
|
||||||
|
<mat-form-field class="form-field">
|
||||||
|
<input
|
||||||
|
matInput
|
||||||
|
formControlName="mac_address"
|
||||||
|
type="text"
|
||||||
|
[(ngModel)]="node.properties.mac_address"
|
||||||
|
placeholder="Base MAC"
|
||||||
|
/>
|
||||||
|
</mat-form-field>
|
||||||
|
</form>
|
||||||
|
<mat-select placeholder="Type" [(ngModel)]="node.properties.adapter_type">
|
||||||
|
<mat-option *ngFor="let type of networkTypes" [value]="type.value">
|
||||||
|
{{ type.name }} ({{ type.value }})
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
<!-- <button mat-button class="form-field" (click)="setCustomAdaptersConfiguratorState(true)">-->
|
||||||
|
<!-- Configure custom adapters-->
|
||||||
|
<!-- </button>-->
|
||||||
|
<br /><br /><mat-checkbox [(ngModel)]="node.properties.replicate_network_connection_state">
|
||||||
Replicate network connection state
|
Replicate network connection state
|
||||||
</mat-checkbox>
|
</mat-checkbox>
|
||||||
<app-custom-adapters-table
|
<!-- <app-custom-adapters-table-->
|
||||||
#customAdapters
|
<!-- #customAdapters-->
|
||||||
[networkTypes]="networkTypes"
|
<!-- [networkTypes]="networkTypes"-->
|
||||||
[displayedColumns]="displayedColumns"
|
<!-- [displayedColumns]="displayedColumns"-->
|
||||||
[adapters]="node.ports"
|
<!-- [adapters]="node.ports"-->
|
||||||
></app-custom-adapters-table>
|
<!-- ></app-custom-adapters-table>-->
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
<mat-tab label="Advanced">
|
<mat-tab label="Advanced">
|
||||||
<mat-card>
|
<mat-card>
|
||||||
|
@ -22,6 +22,7 @@ export class ConfiguratorDialogQemuComponent implements OnInit {
|
|||||||
node: Node;
|
node: Node;
|
||||||
name: string;
|
name: string;
|
||||||
generalSettingsForm: UntypedFormGroup;
|
generalSettingsForm: UntypedFormGroup;
|
||||||
|
networkSettingsForm: UntypedFormGroup;
|
||||||
consoleTypes: string[] = [];
|
consoleTypes: string[] = [];
|
||||||
onCloseOptions = [];
|
onCloseOptions = [];
|
||||||
bootPriorities = [];
|
bootPriorities = [];
|
||||||
@ -54,6 +55,10 @@ export class ConfiguratorDialogQemuComponent implements OnInit {
|
|||||||
name: new UntypedFormControl('', Validators.required),
|
name: new UntypedFormControl('', Validators.required),
|
||||||
ram: new UntypedFormControl('', Validators.required),
|
ram: new UntypedFormControl('', Validators.required),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.networkSettingsForm = this.formBuilder.group({
|
||||||
|
mac_address: new UntypedFormControl('', Validators.pattern(this.qemuConfigurationService.getMacAddrRegex())),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -103,16 +108,16 @@ export class ConfiguratorDialogQemuComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onSaveClick() {
|
onSaveClick() {
|
||||||
if (this.generalSettingsForm.valid) {
|
if (this.generalSettingsForm.valid && this.networkSettingsForm.valid) {
|
||||||
this.node.custom_adapters = [];
|
// this.node.custom_adapters = [];
|
||||||
this.customAdapters.adapters.forEach((n) => {
|
// this.customAdapters.adapters.forEach((n) => {
|
||||||
this.node.custom_adapters.push({
|
// this.node.custom_adapters.push({
|
||||||
adapter_number: n.adapter_number,
|
// adapter_number: n.adapter_number,
|
||||||
adapter_type: n.adapter_type,
|
// adapter_type: n.adapter_type,
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
|
//
|
||||||
this.node.properties.adapters = this.node.custom_adapters.length;
|
// this.node.properties.adapters = this.node.custom_adapters.length;
|
||||||
|
|
||||||
this.nodeService.updateNodeWithCustomAdapters(this.controller, this.node).subscribe(() => {
|
this.nodeService.updateNodeWithCustomAdapters(this.controller, this.node).subscribe(() => {
|
||||||
this.toasterService.success(`Node ${this.node.name} updated.`);
|
this.toasterService.success(`Node ${this.node.name} updated.`);
|
||||||
|
@ -27,4 +27,8 @@ export class DockerConfigurationService {
|
|||||||
|
|
||||||
return consoleResolutions;
|
return consoleResolutions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMacAddrRegex() {
|
||||||
|
return /^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$/;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,6 @@ import { Injectable } from '@angular/core';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class IosConfigurationService {
|
export class IosConfigurationService {
|
||||||
c1700_wics = ['WIC-1T', 'WIC-2T', 'WIC-1ENET'];
|
|
||||||
c2600_wics = ['WIC-1T', 'WIC-2T'];
|
|
||||||
c3700_wics = ['WIC-1T', 'WIC-2T'];
|
|
||||||
|
|
||||||
c2600_nms = ['NM-1FE-TX', 'NM-1E', 'NM-4E', 'NM-16ESW'];
|
c2600_nms = ['NM-1FE-TX', 'NM-1E', 'NM-4E', 'NM-16ESW'];
|
||||||
c3600_nms = ['NM-1FE-TX', 'NM-1E', 'NM-4E', 'NM-16ESW', 'NM-4T'];
|
c3600_nms = ['NM-1FE-TX', 'NM-1E', 'NM-4E', 'NM-16ESW', 'NM-4T'];
|
||||||
@ -12,6 +9,10 @@ export class IosConfigurationService {
|
|||||||
c7200_pas = ['PA-A1', 'PA-FE-TX', 'PA-2FE-TX', 'PA-GE', 'PA-4T+', 'PA-8T', 'PA-4E', 'PA-8E', 'PA-POS-OC3'];
|
c7200_pas = ['PA-A1', 'PA-FE-TX', 'PA-2FE-TX', 'PA-GE', 'PA-4T+', 'PA-8T', 'PA-4E', 'PA-8E', 'PA-POS-OC3'];
|
||||||
c7200_io = ['C7200-IO-FE', 'C7200-IO-2FE', 'C7200-IO-GE-E'];
|
c7200_io = ['C7200-IO-FE', 'C7200-IO-2FE', 'C7200-IO-GE-E'];
|
||||||
|
|
||||||
|
c1700_wics = ['WIC-1T', 'WIC-2T', 'WIC-1ENET'];
|
||||||
|
c2600_wics = ['WIC-1T', 'WIC-2T'];
|
||||||
|
c3700_wics = ['WIC-1T', 'WIC-2T'];
|
||||||
|
|
||||||
getConsoleTypes() {
|
getConsoleTypes() {
|
||||||
return ['telnet', 'none'];
|
return ['telnet', 'none'];
|
||||||
}
|
}
|
||||||
@ -45,10 +46,7 @@ export class IosConfigurationService {
|
|||||||
c1700: 128,
|
c1700: 128,
|
||||||
c2600: 128,
|
c2600: 128,
|
||||||
c2691: 256,
|
c2691: 256,
|
||||||
c3600: 192,
|
c3600: 256,
|
||||||
c3620: 192,
|
|
||||||
c3640: 192,
|
|
||||||
c3660: 192,
|
|
||||||
c3725: 256,
|
c3725: 256,
|
||||||
c3745: 256,
|
c3745: 256,
|
||||||
c7200: 512,
|
c7200: 512,
|
||||||
@ -91,170 +89,101 @@ export class IosConfigurationService {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getNetworkModules() {
|
getNPETypes() {
|
||||||
return {
|
return ['npe-100', 'npe-150', 'npe-175', 'npe-200', 'npe-225', 'npe-300', 'npe-400', 'npe-g2'];
|
||||||
c1700: {
|
|
||||||
0: this.c1700_wics,
|
|
||||||
1: this.c1700_wics,
|
|
||||||
},
|
|
||||||
c2600: {
|
|
||||||
0: this.c2600_wics,
|
|
||||||
1: this.c2600_wics,
|
|
||||||
2: this.c2600_wics,
|
|
||||||
},
|
|
||||||
c2691: {
|
|
||||||
0: this.c3700_wics,
|
|
||||||
1: this.c3700_wics,
|
|
||||||
2: this.c3700_wics,
|
|
||||||
},
|
|
||||||
c3725: {
|
|
||||||
0: this.c3700_wics,
|
|
||||||
1: this.c3700_wics,
|
|
||||||
2: this.c3700_wics,
|
|
||||||
},
|
|
||||||
c3745: {
|
|
||||||
0: this.c3700_wics,
|
|
||||||
1: this.c3700_wics,
|
|
||||||
2: this.c3700_wics,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getNetworkAdapters() {
|
getMidplaneTypes() {
|
||||||
return {
|
return ['std', 'vxr'];
|
||||||
'1720': {
|
|
||||||
0: ['C1700-MB-1FE'],
|
|
||||||
},
|
|
||||||
'1721': {
|
|
||||||
0: ['C1700-MB-1FE'],
|
|
||||||
},
|
|
||||||
'1750': {
|
|
||||||
0: ['C1700-MB-1FE'],
|
|
||||||
},
|
|
||||||
'1751': {
|
|
||||||
0: ['C1700-MB-1FE'],
|
|
||||||
1: ['C1700-MB-WIC1'],
|
|
||||||
},
|
|
||||||
'1760': {
|
|
||||||
0: ['C1700-MB-1FE'],
|
|
||||||
1: ['C1700-MB-WIC1'],
|
|
||||||
},
|
|
||||||
'2610': {
|
|
||||||
0: ['C2600-MB-1E'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2611': {
|
|
||||||
0: ['C2600-MB-2E'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2620': {
|
|
||||||
0: ['C2600-MB-1FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2621': {
|
|
||||||
0: ['C2600-MB-2FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2610XM': {
|
|
||||||
0: ['C2600-MB-1FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2611XM': {
|
|
||||||
0: ['C2600-MB-2FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2620XM': {
|
|
||||||
0: ['C2600-MB-1FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2621XM': {
|
|
||||||
0: ['C2600-MB-2FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2650XM': {
|
|
||||||
0: ['C2600-MB-1FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'2651XM': {
|
|
||||||
0: ['C2600-MB-2FE'],
|
|
||||||
1: this.c2600_nms,
|
|
||||||
},
|
|
||||||
'3620': {
|
|
||||||
0: this.c3600_nms,
|
|
||||||
1: this.c3600_nms,
|
|
||||||
},
|
|
||||||
'3640': {
|
|
||||||
0: this.c3600_nms,
|
|
||||||
1: this.c3600_nms,
|
|
||||||
2: this.c3600_nms,
|
|
||||||
3: this.c3600_nms,
|
|
||||||
},
|
|
||||||
'3660': {
|
|
||||||
0: ['Leopard-2FE'],
|
|
||||||
1: this.c3600_nms,
|
|
||||||
2: this.c3600_nms,
|
|
||||||
3: this.c3600_nms,
|
|
||||||
4: this.c3600_nms,
|
|
||||||
5: this.c3600_nms,
|
|
||||||
6: this.c3600_nms,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
getNetworkAdaptersForPlatform() {
|
getAdapterMatrix() {
|
||||||
let networkAdaptersForPlatform = {};
|
|
||||||
networkAdaptersForPlatform['c2691'] = {
|
|
||||||
0: ['GT96100-FE'],
|
|
||||||
1: this.c3700_nms,
|
|
||||||
};
|
|
||||||
networkAdaptersForPlatform['c3725'] = {
|
|
||||||
0: ['GT96100-FE'],
|
|
||||||
1: this.c3700_nms,
|
|
||||||
2: this.c3700_nms,
|
|
||||||
};
|
|
||||||
networkAdaptersForPlatform['c3745'] = {
|
|
||||||
0: ['GT96100-FE'],
|
|
||||||
1: this.c3700_nms,
|
|
||||||
2: this.c3700_nms,
|
|
||||||
3: this.c3700_nms,
|
|
||||||
4: this.c3700_nms,
|
|
||||||
};
|
|
||||||
networkAdaptersForPlatform['c7200'] = {
|
|
||||||
0: this.c7200_io,
|
|
||||||
1: this.c7200_pas,
|
|
||||||
2: this.c7200_pas,
|
|
||||||
3: this.c7200_pas,
|
|
||||||
4: this.c7200_pas,
|
|
||||||
5: this.c7200_pas,
|
|
||||||
6: this.c7200_pas,
|
|
||||||
};
|
|
||||||
|
|
||||||
return {
|
let adapter_matrix: any = {};
|
||||||
c2691: {
|
for (let platform of ["c1700", "c2600", "c2691", "c3725", "c3745", "c3600", "c7200"]) {
|
||||||
0: ['GT96100-FE'],
|
adapter_matrix[platform] = {};
|
||||||
1: this.c3700_nms,
|
}
|
||||||
},
|
|
||||||
c3725: {
|
// 1700s have one interface on the MB, 2 sub-slots for WICs, and no NM slots
|
||||||
0: ['GT96100-FE'],
|
for (let chassis of ["1720", "1721", "1750", "1751", "1760"]) {
|
||||||
1: this.c3700_nms,
|
adapter_matrix["c1700"][chassis] = { 0: ["C1700-MB-1FE"] };
|
||||||
2: this.c3700_nms,
|
}
|
||||||
},
|
|
||||||
c3745: {
|
// Add a fake NM in slot 1 on 1751s and 1760s to provide two WIC slots
|
||||||
0: ['GT96100-FE'],
|
for (let chassis of ["1751", "1760"]) {
|
||||||
1: this.c3700_nms,
|
adapter_matrix["c1700"][chassis][1] = ["C1700-MB-WIC1"];
|
||||||
2: this.c3700_nms,
|
}
|
||||||
3: this.c3700_nms,
|
|
||||||
4: this.c3700_nms,
|
// 2600s have one or more interfaces on the MB, 2 subslots for WICs, and an available NM slot 1
|
||||||
},
|
for (let chassis of ["2620", "2610XM", "2620XM", "2650XM"]) {
|
||||||
c7200: {
|
adapter_matrix["c2600"][chassis] = { 0: ["C2600-MB-1FE"], 1: this.c2600_nms };
|
||||||
0: this.c7200_io,
|
}
|
||||||
1: this.c7200_pas,
|
|
||||||
2: this.c7200_pas,
|
for (let chassis of ["2621", "2611XM", "2621XM", "2651XM"]) {
|
||||||
3: this.c7200_pas,
|
adapter_matrix["c2600"][chassis] = { 0: ["C2600-MB-2FE"], 1: this.c2600_nms };
|
||||||
4: this.c7200_pas,
|
}
|
||||||
5: this.c7200_pas,
|
|
||||||
6: this.c7200_pas,
|
adapter_matrix["c2600"]["2610"] = { 0: ["C2600-MB-1E"], 1: this.c2600_nms };
|
||||||
},
|
adapter_matrix["c2600"]["2611"] = { 0: ["C2600-MB-2E"], 1: this.c2600_nms };
|
||||||
};
|
|
||||||
|
// 2691s have two FEs on the motherboard and one NM slot
|
||||||
|
adapter_matrix["c2691"][""] = { 0: ["GT96100-FE"], 1: this.c3700_nms };
|
||||||
|
|
||||||
|
// 3620s have two generic NM slots
|
||||||
|
adapter_matrix["c3600"]["3620"] = {};
|
||||||
|
for (let slot = 0; slot < 2; slot++) {
|
||||||
|
adapter_matrix["c3600"]["3620"][slot] = this.c3600_nms;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3640s have four generic NM slots
|
||||||
|
adapter_matrix["c3600"]["3640"] = {};
|
||||||
|
for (let slot = 0; slot < 4; slot++) {
|
||||||
|
adapter_matrix["c3600"]["3640"][slot] = this.c3600_nms;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3660s have 2 FEs on the motherboard and 6 generic NM slots
|
||||||
|
adapter_matrix["c3600"]["3660"] = { 0: ["Leopard-2FE"] };
|
||||||
|
for (let slot = 1; slot < 7; slot++) {
|
||||||
|
adapter_matrix["c3600"]["3660"][slot] = this.c3600_nms;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3725s have 2 FEs on the motherboard and 2 generic NM slots
|
||||||
|
adapter_matrix["c3725"][""] = { 0: ["GT96100-FE"] };
|
||||||
|
for (let slot = 1; slot < 3; slot++) {
|
||||||
|
adapter_matrix["c3725"][""][slot] = this.c3700_nms;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 3745s have 2 FEs on the motherboard and 4 generic NM slots
|
||||||
|
adapter_matrix["c3745"][""] = { 0: ["GT96100-FE"] };
|
||||||
|
for (let slot = 1; slot < 5; slot++) {
|
||||||
|
adapter_matrix["c3745"][""][slot] = this.c3700_nms;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 7206s allow an IO controller in slot 0, and a generic PA in slots 1-6
|
||||||
|
adapter_matrix["c7200"][""] = { 0: this.c7200_io };
|
||||||
|
for (let slot = 1; slot < 7; slot++) {
|
||||||
|
adapter_matrix["c7200"][""][slot] = this.c7200_pas;
|
||||||
|
}
|
||||||
|
|
||||||
|
return adapter_matrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
getWicMatrix() {
|
||||||
|
let wic_matrix: any = {};
|
||||||
|
|
||||||
|
wic_matrix["c1700"] = { 0: this.c1700_wics, 1: this.c1700_wics };
|
||||||
|
wic_matrix["c2600"] = { 0: this.c2600_wics, 1: this.c2600_wics, 2: this.c2600_wics };
|
||||||
|
wic_matrix["c2691"] = { 0: this.c3700_wics, 1: this.c3700_wics, 2: this.c3700_wics };
|
||||||
|
wic_matrix["c3725"] = { 0: this.c3700_wics, 1: this.c3700_wics, 2: this.c3700_wics };
|
||||||
|
wic_matrix["c3745"] = { 0: this.c3700_wics, 1: this.c3700_wics, 2: this.c3700_wics };
|
||||||
|
return wic_matrix;
|
||||||
|
}
|
||||||
|
|
||||||
|
getIdlepcRegex() {
|
||||||
|
return /^(0x[0-9a-fA-F]+)?$|^$/;
|
||||||
|
}
|
||||||
|
|
||||||
|
getMacAddrRegex() {
|
||||||
|
return /^([0-9a-fA-F]{4}\.){2}[0-9a-fA-F]{4}$|^$/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -76,34 +76,6 @@ export class QemuConfigurationService {
|
|||||||
{ value: 'vmxnet3', name: 'VMWare Paravirtualized Ethernet v3' },
|
{ value: 'vmxnet3', name: 'VMWare Paravirtualized Ethernet v3' },
|
||||||
];
|
];
|
||||||
|
|
||||||
// let networkTypes = [
|
|
||||||
// 'e1000',
|
|
||||||
// 'e1000-82544gc',
|
|
||||||
// 'e1000-82545em',
|
|
||||||
// 'e1000e',
|
|
||||||
// 'rocker',
|
|
||||||
// 'Intel Gigabit Ethernet',
|
|
||||||
// 'i82550',
|
|
||||||
// 'i82551',
|
|
||||||
// 'i82557a',
|
|
||||||
// 'i82557b',
|
|
||||||
// 'i82557c',
|
|
||||||
// 'i82558a',
|
|
||||||
// 'i82558b',
|
|
||||||
// 'i82559a',
|
|
||||||
// 'i82559b',
|
|
||||||
// 'i82559c',
|
|
||||||
// 'i82559er',
|
|
||||||
// 'i82562',
|
|
||||||
// 'i82801',
|
|
||||||
// 'ne2k_pci',
|
|
||||||
// 'pcnet',
|
|
||||||
// 'rtl8139',
|
|
||||||
// 'virtio',
|
|
||||||
// 'virtio-net-pci',
|
|
||||||
// 'vmxnet3',
|
|
||||||
// ];
|
|
||||||
|
|
||||||
return networkTypes;
|
return networkTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,4 +118,8 @@ export class QemuConfigurationService {
|
|||||||
|
|
||||||
return priorities;
|
return priorities;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getMacAddrRegex() {
|
||||||
|
return /^([0-9a-fA-F]{2}[:]){5}([0-9a-fA-F]{2})$/;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user