mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-06-18 06:48:09 +00:00
Edit page for Ios routers
This commit is contained in:
@ -132,6 +132,7 @@ import { ExternalSoftwareDefinitionService } from './services/external-software-
|
|||||||
import { PlatformService } from './services/platform.service';
|
import { PlatformService } from './services/platform.service';
|
||||||
import { IosTemplateDetailsComponent } from './components/preferences/dynamips/ios-template-details/ios-template-details.component';
|
import { IosTemplateDetailsComponent } from './components/preferences/dynamips/ios-template-details/ios-template-details.component';
|
||||||
import { AddIosTemplateComponent } from './components/preferences/dynamips/add-ios-template/add-ios-template.component';
|
import { AddIosTemplateComponent } from './components/preferences/dynamips/add-ios-template/add-ios-template.component';
|
||||||
|
import { IosConfigurationService } from './services/ios-configuration.service';
|
||||||
|
|
||||||
if (environment.production) {
|
if (environment.production) {
|
||||||
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
Raven.config('https://b2b1cfd9b043491eb6b566fd8acee358@sentry.io/842726', {
|
||||||
@ -270,7 +271,8 @@ if (environment.production) {
|
|||||||
IosService,
|
IosService,
|
||||||
InstalledSoftwareService,
|
InstalledSoftwareService,
|
||||||
ExternalSoftwareDefinitionService,
|
ExternalSoftwareDefinitionService,
|
||||||
PlatformService
|
PlatformService,
|
||||||
|
IosConfigurationService
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
AddServerDialogComponent,
|
AddServerDialogComponent,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<div class="content" [ngClass]="{ shadowed: isSymbolSelectionOpened }">
|
<div class="content">
|
||||||
<div class="default-header">
|
<div class="default-header">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<h1 class="col">New IOS router</h1>
|
<h1 class="col">New IOS router</h1>
|
||||||
@ -99,7 +99,7 @@
|
|||||||
</mat-step>
|
</mat-step>
|
||||||
<mat-step label="WIC modules">
|
<mat-step label="WIC modules">
|
||||||
<div *ngIf="iosTemplate.platform && networkModules[iosTemplate.platform]">
|
<div *ngIf="iosTemplate.platform && networkModules[iosTemplate.platform]">
|
||||||
<div *ngFor="let index of [0,1,2,3,4,5,6,7]">
|
<div *ngFor="let index of [0,1,2,3]">
|
||||||
<mat-select
|
<mat-select
|
||||||
placeholder="WIC {{index}}"
|
placeholder="WIC {{index}}"
|
||||||
[(ngModel)]="networkModulesForTemplate[index]"
|
[(ngModel)]="networkModulesForTemplate[index]"
|
||||||
|
@ -8,6 +8,7 @@ import { IosTemplate } from '../../../../models/templates/ios-template';
|
|||||||
import { IosService } from '../../../../services/ios.service';
|
import { IosService } from '../../../../services/ios.service';
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
import { TemplateMocksService } from '../../../../services/template-mocks.service';
|
||||||
|
import { IosConfigurationService } from '../../../../services/ios-configuration.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -27,224 +28,17 @@ export class AddIosTemplateComponent implements OnInit {
|
|||||||
networkAdaptersForTemplate: string[] = [];
|
networkAdaptersForTemplate: string[] = [];
|
||||||
networkModulesForTemplate: string[] = [];
|
networkModulesForTemplate: string[] = [];
|
||||||
|
|
||||||
platforms: string[] = ["c1700", "c2600", "c2691", "c3725", "c3745", "c3600", "c7200"];
|
platforms: string[] = [];
|
||||||
platformsWithEtherSwitchRouterOption = {
|
platformsWithEtherSwitchRouterOption = {};
|
||||||
"c1700": false,
|
platformsWithChassis = {};
|
||||||
"c2600": true,
|
chassis = {};
|
||||||
"c2691": true,
|
defaultRam = {};
|
||||||
"c3725": true,
|
defaultNvram = {};
|
||||||
"c3745": true,
|
networkAdapters = {};
|
||||||
"c3600": true,
|
networkAdaptersForPlatform = {};
|
||||||
"c7200": false
|
networkModules = {};
|
||||||
};
|
|
||||||
platformsWithChassis = {
|
|
||||||
"c1700": true,
|
|
||||||
"c2600": true,
|
|
||||||
"c2691": false,
|
|
||||||
"c3725": false,
|
|
||||||
"c3745": false,
|
|
||||||
"c3600": true,
|
|
||||||
"c7200": false
|
|
||||||
};
|
|
||||||
chassis = {
|
|
||||||
"c1700": ["1720", "1721", "1750", "1751", "1760"],
|
|
||||||
"c2600": ["2610", "2611", "2620", "2621", "2610XM", "2611XM", "2620XM", "2621XM", "2650XM", "2651XM"],
|
|
||||||
"c3600": ["3620", "3640", "3660"]
|
|
||||||
};
|
|
||||||
defaultRam = {
|
|
||||||
"c1700": 160,
|
|
||||||
"c2600": 160,
|
|
||||||
"c2691": 192,
|
|
||||||
"c3600": 192,
|
|
||||||
"c3725": 128,
|
|
||||||
"c3745": 256,
|
|
||||||
"c7200": 512
|
|
||||||
};
|
|
||||||
defaultNvram = {
|
|
||||||
"c1700": 128,
|
|
||||||
"c2600": 128,
|
|
||||||
"c2691": 256,
|
|
||||||
"c3600": 256,
|
|
||||||
"c3725": 256,
|
|
||||||
"c3745": 256,
|
|
||||||
"c7200": 512
|
|
||||||
};
|
|
||||||
ciscoUrl: string = "https://cfn.cloudapps.cisco.com/ITDIT/CFN/jsp/SearchBySoftware.jsp";
|
ciscoUrl: string = "https://cfn.cloudapps.cisco.com/ITDIT/CFN/jsp/SearchBySoftware.jsp";
|
||||||
|
|
||||||
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"
|
|
||||||
];
|
|
||||||
c3600_nms = [
|
|
||||||
"NM-1FE-TX",
|
|
||||||
"NM-1E",
|
|
||||||
"NM-4E",
|
|
||||||
"NM-16ESW",
|
|
||||||
"NM-4T"
|
|
||||||
];
|
|
||||||
c3700_nms = [
|
|
||||||
"NM-1FE-TX",
|
|
||||||
"NM-4T",
|
|
||||||
"NM-16ESW",
|
|
||||||
];
|
|
||||||
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"
|
|
||||||
];
|
|
||||||
|
|
||||||
networkAdapters = {
|
|
||||||
"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,
|
|
||||||
7: this.c3600_nms
|
|
||||||
}
|
|
||||||
};
|
|
||||||
networkAdaptersForPlatform = {
|
|
||||||
"c2691": {
|
|
||||||
0: ["GT96100-FE"],
|
|
||||||
1: this.c3700_nms
|
|
||||||
},
|
|
||||||
"c3725": {
|
|
||||||
0: ["GT96100-FE"],
|
|
||||||
1: this.c3700_nms,
|
|
||||||
2: this.c3700_nms,
|
|
||||||
3: this.c3700_nms
|
|
||||||
},
|
|
||||||
"c3745": {
|
|
||||||
0: ["GT96100-FE"],
|
|
||||||
1: this.c3700_nms,
|
|
||||||
2: this.c3700_nms,
|
|
||||||
3: this.c3700_nms,
|
|
||||||
4: this.c3700_nms,
|
|
||||||
5: this.c3700_nms
|
|
||||||
},
|
|
||||||
"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,
|
|
||||||
7: this.c7200_pas
|
|
||||||
}
|
|
||||||
};
|
|
||||||
networkModules = {
|
|
||||||
"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
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
@ -253,7 +47,8 @@ export class AddIosTemplateComponent implements OnInit {
|
|||||||
private toasterService: ToasterService,
|
private toasterService: ToasterService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private templateMocksService: TemplateMocksService
|
private templateMocksService: TemplateMocksService,
|
||||||
|
private iosConfigurationService: IosConfigurationService
|
||||||
) {
|
) {
|
||||||
this.iosTemplate = new IosTemplate();
|
this.iosTemplate = new IosTemplate();
|
||||||
|
|
||||||
@ -277,6 +72,15 @@ export class AddIosTemplateComponent implements OnInit {
|
|||||||
|
|
||||||
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.platformsWithEtherSwitchRouterOption = this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption();
|
||||||
|
this.platformsWithChassis = this.iosConfigurationService.getPlatformsWithChassis();
|
||||||
|
this.chassis = this.iosConfigurationService.getChassis();
|
||||||
|
this.defaultRam = this.iosConfigurationService.getDefaultRamSettings();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -302,6 +106,20 @@ export class AddIosTemplateComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
completeAdaptersData() {
|
completeAdaptersData() {
|
||||||
|
if (this.chassis[this.iosTemplate.platform]) {
|
||||||
|
if(Object.keys(this.networkAdapters[this.iosTemplate.platform])){
|
||||||
|
for(let i=0; i<Object.keys(this.networkAdapters[this.iosTemplate.platform]).length; i++){
|
||||||
|
if(!this.networkAdaptersForTemplate[i]) this.networkAdaptersForTemplate[i] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(Object.keys(this.networkAdaptersForPlatform[this.iosTemplate.platform])){
|
||||||
|
for(let i=0; i<Object.keys(this.networkAdaptersForPlatform[this.iosTemplate.platform]).length; i++){
|
||||||
|
if(!this.networkAdaptersForTemplate[i]) this.networkAdaptersForTemplate[i] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.networkAdaptersForTemplate[0]) this.iosTemplate.slot0 = this.networkAdaptersForTemplate[0];
|
if (this.networkAdaptersForTemplate[0]) this.iosTemplate.slot0 = this.networkAdaptersForTemplate[0];
|
||||||
if (this.networkAdaptersForTemplate[1]) this.iosTemplate.slot1 = this.networkAdaptersForTemplate[1];
|
if (this.networkAdaptersForTemplate[1]) this.iosTemplate.slot1 = this.networkAdaptersForTemplate[1];
|
||||||
if (this.networkAdaptersForTemplate[2]) this.iosTemplate.slot2 = this.networkAdaptersForTemplate[2];
|
if (this.networkAdaptersForTemplate[2]) this.iosTemplate.slot2 = this.networkAdaptersForTemplate[2];
|
||||||
@ -313,6 +131,12 @@ export class AddIosTemplateComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
completeModulesData() {
|
completeModulesData() {
|
||||||
|
if(Object.keys(this.networkModules[this.iosTemplate.platform])){
|
||||||
|
for(let i=0; i<Object.keys(this.networkModules[this.iosTemplate.platform]).length; i++){
|
||||||
|
if(!this.networkModulesForTemplate[i]) this.networkModulesForTemplate[i] = '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.networkModulesForTemplate[0]) this.iosTemplate.wic0 = this.networkModulesForTemplate[0];
|
if (this.networkModulesForTemplate[0]) this.iosTemplate.wic0 = this.networkModulesForTemplate[0];
|
||||||
if (this.networkModulesForTemplate[1]) this.iosTemplate.wic1 = this.networkModulesForTemplate[1];
|
if (this.networkModulesForTemplate[1]) this.iosTemplate.wic1 = this.networkModulesForTemplate[1];
|
||||||
if (this.networkModulesForTemplate[2]) this.iosTemplate.wic2 = this.networkModulesForTemplate[2];
|
if (this.networkModulesForTemplate[2]) this.iosTemplate.wic2 = this.networkModulesForTemplate[2];
|
||||||
|
@ -82,6 +82,64 @@
|
|||||||
Slots
|
Slots
|
||||||
</mat-panel-title>
|
</mat-panel-title>
|
||||||
</mat-expansion-panel-header>
|
</mat-expansion-panel-header>
|
||||||
|
<h6>Adapters</h6>
|
||||||
|
<div *ngIf="iosTemplate.chassis && 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="networkAdapters[iosTemplate.chassis][index]">
|
||||||
|
<mat-option *ngFor="let option of networkAdapters[iosTemplate.chassis][index]" [value]="option">
|
||||||
|
{{option}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</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>
|
||||||
|
@ -6,6 +6,7 @@ import { ToasterService } from '../../../../services/toaster.service';
|
|||||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||||
import { IosTemplate } from '../../../../models/templates/ios-template';
|
import { IosTemplate } from '../../../../models/templates/ios-template';
|
||||||
import { IosService } from '../../../../services/ios.service';
|
import { IosService } from '../../../../services/ios.service';
|
||||||
|
import { IosConfigurationService } from '../../../../services/ios-configuration.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -19,20 +20,24 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
|
|
||||||
isSymbolSelectionOpened: boolean = false;
|
isSymbolSelectionOpened: boolean = false;
|
||||||
|
|
||||||
consoleTypes: string[] = ['telnet', 'none'];
|
networkAdaptersForTemplate: string[] = [];
|
||||||
categories = [["Default", "guest"],
|
platforms: string[] = [];
|
||||||
["Routers", "router"],
|
platformsWithEtherSwitchRouterOption = {};
|
||||||
["Switches", "switch"],
|
platformsWithChassis = {};
|
||||||
["End devices", "end_device"],
|
chassis = {};
|
||||||
["Security devices", "security_device"]];
|
defaultRam = {};
|
||||||
isConfiguratorOpened: boolean = false;
|
defaultNvram = {};
|
||||||
|
networkAdapters = {};
|
||||||
|
networkAdaptersForPlatform = {};
|
||||||
|
networkModules = {};
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private serverService: ServerService,
|
private serverService: ServerService,
|
||||||
private iosService: IosService,
|
private iosService: IosService,
|
||||||
private toasterService: ToasterService,
|
private toasterService: ToasterService,
|
||||||
private formBuilder: FormBuilder
|
private formBuilder: FormBuilder,
|
||||||
|
private iosConfigurationService: IosConfigurationService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@ -43,11 +48,47 @@ export class IosTemplateDetailsComponent implements OnInit {
|
|||||||
|
|
||||||
this.iosService.getTemplate(this.server, template_id).subscribe((iosTemplate: IosTemplate) => {
|
this.iosService.getTemplate(this.server, template_id).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.platformsWithEtherSwitchRouterOption = this.iosConfigurationService.getPlatformsWithEtherSwitchRouterOption();
|
||||||
|
this.platformsWithChassis = this.iosConfigurationService.getPlatformsWithChassis();
|
||||||
|
this.chassis = this.iosConfigurationService.getChassis();
|
||||||
|
this.defaultRam = this.iosConfigurationService.getDefaultRamSettings();
|
||||||
|
this.fillAdaptersData();
|
||||||
|
|
||||||
|
console.log(this.iosTemplate.slot3);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fillAdaptersData() {
|
||||||
|
if (this.iosTemplate.slot0) this.networkAdaptersForTemplate[0] = this.iosTemplate.slot0;
|
||||||
|
if (this.iosTemplate.slot1) this.networkAdaptersForTemplate[1] = this.iosTemplate.slot1;
|
||||||
|
if (this.iosTemplate.slot2) this.networkAdaptersForTemplate[2] = this.iosTemplate.slot2;
|
||||||
|
if (this.iosTemplate.slot3) this.networkAdaptersForTemplate[3] = this.iosTemplate.slot3;
|
||||||
|
if (this.iosTemplate.slot4) this.networkAdaptersForTemplate[4] = this.iosTemplate.slot4;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
completeAdaptersData() {
|
||||||
|
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];
|
||||||
|
}
|
||||||
|
|
||||||
onSave() {
|
onSave() {
|
||||||
|
this.completeAdaptersData();
|
||||||
|
|
||||||
this.iosService.saveTemplate(this.server, this.iosTemplate).subscribe((iosTemplate: IosTemplate) => {
|
this.iosService.saveTemplate(this.server, this.iosTemplate).subscribe((iosTemplate: IosTemplate) => {
|
||||||
this.toasterService.success("Changes saved");
|
this.toasterService.success("Changes saved");
|
||||||
});
|
});
|
||||||
|
0
src/app/services/ios-configuration.service.spec.ts
Normal file
0
src/app/services/ios-configuration.service.spec.ts
Normal file
243
src/app/services/ios-configuration.service.ts
Normal file
243
src/app/services/ios-configuration.service.ts
Normal file
@ -0,0 +1,243 @@
|
|||||||
|
import { Injectable } from "@angular/core";
|
||||||
|
|
||||||
|
@Injectable()
|
||||||
|
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"
|
||||||
|
];
|
||||||
|
c3600_nms = [
|
||||||
|
"NM-1FE-TX",
|
||||||
|
"NM-1E",
|
||||||
|
"NM-4E",
|
||||||
|
"NM-16ESW",
|
||||||
|
"NM-4T"
|
||||||
|
];
|
||||||
|
c3700_nms = [
|
||||||
|
"NM-1FE-TX",
|
||||||
|
"NM-4T",
|
||||||
|
"NM-16ESW",
|
||||||
|
];
|
||||||
|
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"
|
||||||
|
];
|
||||||
|
|
||||||
|
getDefaultRamSettings() {
|
||||||
|
return {
|
||||||
|
"c1700": 160,
|
||||||
|
"c2600": 160,
|
||||||
|
"c2691": 192,
|
||||||
|
"c3600": 192,
|
||||||
|
"c3725": 128,
|
||||||
|
"c3745": 256,
|
||||||
|
"c7200": 512
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getDefaultNvRamSettings() {
|
||||||
|
return {
|
||||||
|
"c1700": 128,
|
||||||
|
"c2600": 128,
|
||||||
|
"c2691": 256,
|
||||||
|
"c3600": 256,
|
||||||
|
"c3725": 256,
|
||||||
|
"c3745": 256,
|
||||||
|
"c7200": 512
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
getAvailablePlatforms() {
|
||||||
|
return ["c1700", "c2600", "c2691", "c3725", "c3745", "c3600", "c7200"];
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlatformsWithEtherSwitchRouterOption() {
|
||||||
|
return {
|
||||||
|
"c1700": false,
|
||||||
|
"c2600": true,
|
||||||
|
"c2691": true,
|
||||||
|
"c3725": true,
|
||||||
|
"c3745": true,
|
||||||
|
"c3600": true,
|
||||||
|
"c7200": false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getPlatformsWithChassis() {
|
||||||
|
return {
|
||||||
|
"c1700": true,
|
||||||
|
"c2600": true,
|
||||||
|
"c2691": false,
|
||||||
|
"c3725": false,
|
||||||
|
"c3745": false,
|
||||||
|
"c3600": true,
|
||||||
|
"c7200": false
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getChassis() {
|
||||||
|
return {
|
||||||
|
"c1700": ["1720", "1721", "1750", "1751", "1760"],
|
||||||
|
"c2600": ["2610", "2611", "2620", "2621", "2610XM", "2611XM", "2620XM", "2621XM", "2650XM", "2651XM"],
|
||||||
|
"c3600": ["3620", "3640", "3660"]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
getNetworkModules() {
|
||||||
|
return {
|
||||||
|
"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() {
|
||||||
|
return {
|
||||||
|
"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() {
|
||||||
|
return {
|
||||||
|
"c2691": {
|
||||||
|
0: ["GT96100-FE"],
|
||||||
|
1: this.c3700_nms
|
||||||
|
},
|
||||||
|
"c3725": {
|
||||||
|
0: ["GT96100-FE"],
|
||||||
|
1: this.c3700_nms,
|
||||||
|
2: this.c3700_nms
|
||||||
|
},
|
||||||
|
"c3745": {
|
||||||
|
0: ["GT96100-FE"],
|
||||||
|
1: this.c3700_nms,
|
||||||
|
2: this.c3700_nms,
|
||||||
|
3: this.c3700_nms,
|
||||||
|
4: this.c3700_nms
|
||||||
|
},
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user