Fix for network addapters c7200, c3725, c3745, c2691

This commit is contained in:
piotrpekala7 2020-06-03 12:49:05 +02:00
parent 7625ff5cfa
commit 6bf268b47f
4 changed files with 36 additions and 6 deletions

View File

@ -169,7 +169,7 @@ const routes: Routes = [
]; ];
@NgModule({ @NgModule({
imports: [RouterModule.forRoot(routes, { anchorScrolling: 'enabled', enableTracing: true, scrollPositionRestoration: 'enabled'})], imports: [RouterModule.forRoot(routes, { anchorScrolling: 'enabled', enableTracing: false, scrollPositionRestoration: 'enabled'})],
exports: [RouterModule] exports: [RouterModule]
}) })
export class AppRoutingModule {} export class AppRoutingModule {}

View File

@ -88,7 +88,7 @@
</form> </form>
</mat-step> </mat-step>
<mat-step label="Network adapters"> <mat-step label="Network adapters">
<div *ngIf="chassis[iosNameForm.get('platform').value]"> <!-- <div *ngIf="chassis[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,7]">
<mat-select <mat-select
placeholder="Slot {{index}}" placeholder="Slot {{index}}"
@ -100,8 +100,8 @@
</mat-option> </mat-option>
</mat-select> </mat-select>
</div> </div>
</div> </div> -->
<div *ngIf="chassis[iosNameForm.get('platform').value]"> <div *ngIf="selectedPlatform">
<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,7]">
<mat-select <mat-select
placeholder="Slot {{index}}" placeholder="Slot {{index}}"

View File

@ -28,6 +28,7 @@ export class AddIosTemplateComponent implements OnInit {
iosImageForm: FormGroup; iosImageForm: FormGroup;
iosNameForm: FormGroup; iosNameForm: FormGroup;
iosMemoryForm: FormGroup; iosMemoryForm: FormGroup;
selectedPlatform: string;
networkAdaptersForTemplate: string[] = []; networkAdaptersForTemplate: string[] = [];
networkModulesForTemplate: string[] = []; networkModulesForTemplate: string[] = [];
@ -187,8 +188,8 @@ export class AddIosTemplateComponent implements OnInit {
} }
} }
} else { } else {
if(Object.keys(this.networkAdaptersForPlatform[this.iosTemplate.chassis])){ if(this.networkAdaptersForPlatform[this.iosNameForm.get('platform').value]){
for(let i=0; i<Object.keys(this.networkAdaptersForPlatform[this.iosTemplate.chassis]).length; i++){ 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[i]) this.networkAdaptersForTemplate[i] = '';
} }
} }
@ -226,6 +227,8 @@ export class AddIosTemplateComponent implements OnInit {
if (this.platforms.includes(name.split('-')[0])) { if (this.platforms.includes(name.split('-')[0])) {
this.iosNameForm.controls['platform'].setValue(name); this.iosNameForm.controls['platform'].setValue(name);
this.selectedPlatform = name;
this.iosNameForm.controls['chassis'].setValue(''); this.iosNameForm.controls['chassis'].setValue('');
this.iosMemoryForm.controls['memory'].setValue(this.defaultRam[name]); this.iosMemoryForm.controls['memory'].setValue(this.defaultRam[name]);
} }

View File

@ -216,6 +216,33 @@ export class IosConfigurationService {
} }
getNetworkAdaptersForPlatform() { getNetworkAdaptersForPlatform() {
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 { return {
"c2691": { "c2691": {
0: ["GT96100-FE"], 0: ["GT96100-FE"],