"activity_factor": "60",\r
"resource_sharing_level": "shared",\r
"max_number_of_ues": "10000",\r
- "area_traffic_cap_ul":"222",\r
- "area_traffic_cap_dl":"444",\r
- "serviceProfile_Availability":"",\r
- "serviceProfile_PLMNIdList":"",\r
- "serviceProfile_Reliability":"test-Reliability",\r
- "serviceProfile_ULThptPerUE":"1000",\r
- "serviceProfile_DLThptPerUE":"2000",\r
- "serviceProfile_ULThptPerSlice":"3000",\r
- "serviceProfile_DLThptPerSlice":"4000",\r
- "serviceProfile_MaxPktSize":"10000",\r
- "serviceProfile_MaxNumberofConns":"12345",\r
- "serviceProfile_TermDensity":"500",\r
- "serviceProfile_Jitter":"10",\r
- "serviceProfile_SurvivalTime":"10"\r
+ "area_traffic_cap_ul": "222",\r
+ "area_traffic_cap_dl": "444",\r
+ "serviceProfile_Availability": "",\r
+ "serviceProfile_PLMNIdList": "",\r
+ "serviceProfile_Reliability": "test-Reliability",\r
+ "serviceProfile_ULThptPerUE": "1000",\r
+ "serviceProfile_DLThptPerUE": "2000",\r
+ "serviceProfile_ULThptPerSlice": "3000",\r
+ "serviceProfile_DLThptPerSlice": "4000",\r
+ "serviceProfile_MaxPktSize": "10000",\r
+ "serviceProfile_MaxNumberofConns": "12345",\r
+ "serviceProfile_TermDensity": "500",\r
+ "serviceProfile_Jitter": "10",\r
+ "serviceProfile_SurvivalTime": "10"\r
},\r
"nst_info": {\r
"nst_id": "46da8cf8-0878-48ac-bea3-f2200959411a",\r
"sliceProfile_AN_uEMobilityLevel": "stationary",\r
"an_latency": "10",\r
"sliceProfile_AN_maxNumberofUEs": "10000",\r
- "sliceProfile_AN_maxNumberofPDUSession":"10000",\r
+ "sliceProfile_AN_maxNumberofPDUSession": "10000",\r
"sliceProfile_AN_activityFactor": "60",\r
"sliceProfile_AN_expDataRateDL": "300",\r
"sliceProfile_AN_expDataRateUL": "300",\r
"sliceProfile_AN_areaTrafficCapDL": "300",\r
"sliceProfile_AN_areaTrafficCapUL": "300",\r
- "sliceProfile_AN_overallUserDensity":"test_an_overalluser_density_01",\r
- "an_enableNSSISelection":false,\r
- "sliceProfile_AN_ipAddress":"test_an_ip_address_01",\r
- "sliceProfile_AN_logicInterfaceId":"test_an_logical_link_01",\r
- "sliceProfile_AN_nextHopInfo":"sliceProfile_AN_nextHopInfo",\r
- "an_script_name":"test_an_01",\r
+ "sliceProfile_AN_overallUserDensity": "test_an_overalluser_density_01",\r
+ "an_enableNSSISelection": false,\r
+ "sliceProfile_AN_ipAddress": "2.2.2.2",\r
+ "sliceProfile_AN_logicInterfaceId": "23432",\r
+ "sliceProfile_AN_nextHopInfo": "sliceProfile_AN_nextHopInfo",\r
+ "an_script_name": "test_an_01",\r
"an_coverage_area_ta_list": ["北京;北京市;海淀区", "北京;北京市;西城区", "北京;北京市;昌平区"],\r
"tn_bh_suggest_nssi_id": "46da8cf8-0878-48ac-bea3-f2200959411b",\r
"tn_bh_suggest_nssi_name": "eMBB TNinstance2",\r
"tn_bh_latency": "10",\r
"tn_bh_bandwidth": "300",\r
- "tn_bh_script_name":"test_tn_01",\r
- "sliceProfile_TN_BH_jitte":"test_tn_jitter_01",\r
+ "tn_bh_script_name": "test_tn_01",\r
+ "sliceProfile_TN_BH_jitte": "test_tn_jitter_01",\r
"sliceProfile_TN_BH_pLMNIdList": "test_sliceProfile_TN_BH_pLMNIdList",\r
"sliceProfile_TN_BH_sST": "test_sliceProfile_TN_BH _sST",\r
- "sliceProfile_TN_BH_sNSSAI":"test_tn_service_snssai_01",\r
- "tn_bh_enableNSSISelection":false,\r
+ "sliceProfile_TN_BH_sNSSAI": "test_tn_service_snssai_01",\r
+ "sliceProfile_TN_resourceSharingLevel": "shared",\r
+ "tn_connection_links": ["123213"],\r
+ "tn_connection_links_option": [{\r
+ "id": "123213",\r
+ "AN": "1an",\r
+ "CN": "1cn",\r
+ "TN": "1tn",\r
+ "properties": "1pp"\r
+ },\r
+ {\r
+ "id": "123214",\r
+ "AN": "2an",\r
+ "CN": "2cn",\r
+ "TN": "2tn",\r
+ "properties": "2pp"\r
+ },\r
+ {\r
+ "id": "123215",\r
+ "AN": "3an",\r
+ "CN": "3cn",\r
+ "TN": "3tn",\r
+ "properties": "3pp"\r
+ }\r
+ ],\r
+ "tn_bh_enableNSSISelection": false,\r
"cn_suggest_nssi_id": "46da8cf8-0878-48ac-bea3-f2200959411c",\r
"cn_suggest_nssi_name": "eMBB CNinstance3",\r
"cn_service_snssai": "cn_1-010101",\r
"cn_exp_data_rate_ul": "300",\r
"cn_area_traffic_cap_dl": "300",\r
"cn_area_traffic_cap_ul": "300",\r
- "cn_script_name":"test_cn_01",\r
- "sliceProfile_CN_maxNumberofPDUSession":"10000",\r
- "sliceProfile_CN_overallUserDensity":"test_cn_overalluser_density_01",\r
- "cn_enableNSSISelection":true,\r
+ "cn_script_name": "test_cn_01",\r
+ "sliceProfile_CN_maxNumberofPDUSession": "10000",\r
+ "sliceProfile_CN_overallUserDensity": "test_cn_overalluser_density_01",\r
+ "cn_enableNSSISelection": true,\r
"sliceProfile_CN_coverageAreaTAList": "",\r
- "sliceProfile_CN_ipAddress":"1.1.1.1",\r
- "sliceProfile_CN_logicInterfaceId":"2222",\r
- "sliceProfile_CN_nextHopInfo":"nexthopj"\r
+ "sliceProfile_CN_ipAddress": "1.1.1.1",\r
+ "sliceProfile_CN_logicInterfaceId": "2222",\r
+ "sliceProfile_CN_nextHopInfo": "nexthopj"\r
}\r
\r
}\r
</nz-list-item>
<nz-list-item nz-row nzType="flex" nzJustify="start" [nzGutter]="8">
<p class="listitem_subtitle" nz-col nzSpan="24">Matching Shared NSSI:</p>
- <nz-card *ngFor="let item of slicingSubnet,let i = index" nzType="inner" nz-col nzSpan="24" [nzTitle]="item.title">
+ <nz-card *ngFor="let item of slicingSubnet,let i = index" nzType="inner" nz-col nzSpan="24"
+ [nzTitle]="item.title">
<div nz-row [nzGutter]="8">
<div nz-col nzSpan="12">
NSSI ID:
<button nz-button nzType="primary" [nzLoading]='loading' (click)="handleOk()">OK</button>
</ng-template>
<app-subnet-params-model [showModel]="isShowParams" *ngIf="isShowParams" [detailData]="params" [title]="paramsTitle"
- (cancel)="isShowParams=$event" (paramsDataChange)="changeParams($event)">
+ (cancel)="isShowParams=$event" (paramsDataChange)="changeParams($event)"
+ (noPassParaChange)="noPassParaChange($event)">
</app-subnet-params-model>
<app-notification #notification [isServicesList]="false" [parentComponent]="'slicing'"></app-notification>
\ No newline at end of file
isShowParams: boolean;
paramsTitle: string;
params: any;
+ noPassPara: string[];
// 获取数据loading
isSpinning: boolean = false;
loading: boolean = false;
'sliceProfile_AN_logicInterfaceId',
'sliceProfile_AN_nextHopInfo'
]), an_coverage_area_ta_list: area};
- this.slicingSubnet[1].params = this.pick(nsi_nssi_info, ['tn_bh_latency', 'tn_bh_bandwidth', 'tn_bh_script_name', 'sliceProfile_TN_BH_jitte', 'sliceProfile_TN_BH_sNSSAI',"tn_bh_enableNSSISelection"]);
+ this.slicingSubnet[1].params = this.pick(nsi_nssi_info, [
+ 'tn_bh_latency',
+ 'tn_bh_bandwidth',
+ 'tn_bh_script_name',
+ 'sliceProfile_TN_BH_jitte',
+ 'sliceProfile_TN_BH_sNSSAI',
+ 'tn_bh_enableNSSISelection',
+ 'sliceProfile_TN_resourceSharingLevel',
+ 'sliceProfile_CN_logicInterfaceId',
+ 'sliceProfile_CN_ipAddress',
+ 'sliceProfile_CN_nextHopInfo',
+ 'sliceProfile_AN_ipAddress',
+ 'sliceProfile_AN_logicInterfaceId',
+ 'sliceProfile_AN_nextHopInfo',
+ 'tn_connection_links',
+ 'tn_connection_links_option']);
this.slicingSubnet[2].params = {...this.pick(nsi_nssi_info, [
'cn_service_snssai',
'cn_resource_sharing_level',
const index = this.paramsTitle === 'An' ? 0 : (this.paramsTitle === 'Tn' ? 1 : 2);
this.slicingSubnet[index].params = params
}
-
+ noPassParaChange (noPassPara: string[]): void {
+ this.noPassPara = noPassPara
+ }
handleCancel(bool: boolean = false) {
this.showDetail = false;
this.cancel.emit({ showDetail: this.showDetail, bool });
handleOk() {
this.loading = true;
const { selectedServiceId, selectedServiceName, slicingSubnet, checkDetail, businessRequirement, NSTinfo } = this;
+ // slicingSubnet[1] is about Tn,
+ // Delete parameters that do not need to be passed
+ this.noPassPara.forEach((item) => {
+ for (let val in slicingSubnet[1].params) {
+ if (val === item) {
+ delete slicingSubnet[1].params[val]
+ }
+ }
+ })
const nsi_nssi_info: object = {
suggest_nsi_id: selectedServiceId,
suggest_nsi_name: selectedServiceName,
<nz-modal [(nzVisible)]="showModel" [nzTitle]="title + 'Parameter'" (nzOnCancel)="handleCancel()" (nzOnOk)="handleOk()"
- nzWidth="700px">
+ nzWidth="960px">
<div class="subnet_params_container">
<form nz-form *ngIf="title === 'Tn'">
<nz-form-item *ngFor="let item of transferFormItems">
- <nz-form-label [nzSpan]="7" [nzRequired]="item.required" [nzFor]="item.key" [ngStyle]="labelStyle(item.required)">
+ <nz-form-label [nzSpan]="7" [nzRequired]="item.required" [nzFor]="item.key"
+ [ngStyle]="labelStyle(item.required)">
{{item.title}}
</nz-form-label>
- <nz-form-control [nzSpan]="12">
- <input nz-input
- [(ngModel)]="formData[item.key]"
- [name]="item.key"
- [id]="item.key"
- [readOnly]="item.title === 'S-NSSAI'"
- [disabled]="item.title === 'S-NSSAI'"
- [placeholder]="inputHolder(item.title)"
- />
- <div class="validation_alert" *ngIf="item.required">{{Util.isEmpty(formData[item.key])? 'can not be empty!':' '}}</div>
+ <nz-form-control [nzSpan]="16">
+ <input nz-input [(ngModel)]="formData[item.key]" [name]="item.key" [id]="item.key"
+ [readOnly]="item.title === 'S-NSSAI'" [disabled]="item.title === 'S-NSSAI'"
+ [placeholder]="inputHolder(item.title)" *ngIf="specialParaTN.indexOf(item.title)===-1" />
+ <nz-radio-group [name]=" item.key" [(ngModel)]="formData[item.key]"
+ *ngIf="item.title==='Resource Sharing Level'" (ngModelChange)="changeResourceShare()">
+ <label nz-radio [nzValue]="option.key" *ngFor="let option of item.options">
+ {{ option.title }}
+ </label>
+ </nz-radio-group>
+ <nz-input-group *ngIf="(item.title === 'AN Endpoint') && EndpointEnable">
+ <div *ngFor="let option of item.options;let i=index">
+ <div class="tn_endpoint_input">
+ <input nz-input [id]="option.key" [name]="option.key"
+ [title]="ANEndpointInputs[option.key]" [(ngModel)]="ANEndpointInputs[option.key]"
+ [placeholder]="option.holder" style="width:32%;margin-right:1%"
+ [disabled]="item.disable" />
+ <div class="end_alert_ip" *ngIf="option.title === 'ip_address'">
+ {{validateEndPoint(option.title, ANEndpointInputs[option.key], item.required)}}
+ </div>
+ <div class="end_alert_logical" *ngIf="option.title === 'logical_link'">
+ {{validateEndPoint(option.title, ANEndpointInputs[option.key], item.required)}}
+ </div>
+ <div class="end_alert_nexthop" *ngIf="option.title === 'nexthop_info'">
+ {{validateEndPoint(option.title, ANEndpointInputs[option.key], item.required)}}
+ </div>
+ </div>
+ </div>
+ </nz-input-group>
+ <nz-input-group *ngIf="(item.title === 'CN Endpoint') && EndpointEnable">
+ <div *ngFor="let option of item.options;let i=index">
+ <div class="tn_endpoint_input">
+ <input nz-input [id]="option.key" [name]="option.key"
+ [title]="CNEndpointInputs[option.key]" [(ngModel)]="CNEndpointInputs[option.key]"
+ [placeholder]="option.holder" style="width:32%;margin-right:1%"
+ [disabled]="item.disable" />
+ <div class="end_alert_ip" *ngIf="option.title === 'ip_address'">
+ {{validateEndPoint(option.title, CNEndpointInputs[option.key], item.required)}}
+ </div>
+ <div class="end_alert_logical" *ngIf="option.title === 'logical_link'">
+ {{validateEndPoint(option.title, CNEndpointInputs[option.key], item.required)}}
+ </div>
+ <div class="end_alert_nexthop" *ngIf="option.title === 'nexthop_info'">
+ {{validateEndPoint(option.title, CNEndpointInputs[option.key], item.required)}}
+ </div>
+ </div>
+ </div>
+ </nz-input-group>
+ <!-- connection links table -->
+ <div *ngIf="item.title === 'Connection Links'">
+ <nz-table #basicTable [nzData]="[{}]" nzShowPagination="false">
+ <thead>
+ <tr>
+ <th *ngFor="let val of item.header" class="subnet_td">{{val.title}}</th>
+ <th class="subnet_td"> action </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr *ngFor="let t of formData[item.options.key]">
+ <td *ngFor="let val of item.header" class="subnet_td">
+ {{t[val.key]}}
+ </td>
+ <td nzShowCheckbox="true" [nzChecked]="t.checked"
+ (nzCheckedChange)="changeLinkCheck(t.id, $event)" [nzDisabled]="item.disable"
+ class="subnet_td">
+ <!-- <input type="checkbox" ng-model="t.checked" ng-change="nzCheckedChange(t.id)"> -->
+ </td>
+ </tr>
+ </tbody>
+ </nz-table>
+ </div>
+ <div class="validation_alert" *ngIf="item.required">
+ {{Util.isEmpty(formData[item.key])? 'can not be empty!':' '}}</div>
</nz-form-control>
</nz-form-item>
</form>
<form nz-form *ngIf="title === 'An' || title === 'Cn'">
<nz-form-item *ngFor="let item of coreFormItems">
- <nz-form-label [nzSpan]="(item.key === 'an_coverage_area_ta_list' || item.title === 'Endpoint')?7:13" [nzRequired]="item.required" *ngIf=" item.title !== 'Endpoint' || EndpointEnable " [ngStyle]="labelStyle(item.required)">
+ <nz-form-label [nzSpan]="(item.key === 'an_coverage_area_ta_list' || item.title === 'Endpoint')?7:13"
+ [nzRequired]="item.required" *ngIf=" item.title !== 'Endpoint' || EndpointEnable "
+ [ngStyle]="labelStyle(item.required)">
{{ item.title }}
</nz-form-label>
- <nz-form-control [nzSpan]="item.title === 'Endpoint'?14:8" *ngIf="item.key !== 'an_coverage_area_ta_list'">
+ <nz-form-control [nzSpan]="item.title === 'Endpoint'?14:8"
+ *ngIf="item.key !== 'an_coverage_area_ta_list'">
<input nz-input [id]="item.key" [name]="item.key" [(ngModel)]="formData[item.key]"
[readOnly]="item.title === 'S-NSSAI'" [disabled]="item.title === 'S-NSSAI'"
- *ngIf=" item.title !== 'Resource Sharing Level' && item.title !== 'Mobility' && item.title !== 'Endpoint' " [placeholder]="inputHolder(item.title)"/>
+ *ngIf=" item.title !== 'Resource Sharing Level' && item.title !== 'Mobility' && item.title !== 'Endpoint' "
+ [placeholder]="inputHolder(item.title)" />
<nz-radio-group [name]="item.key" [(ngModel)]="formData[item.key]"
*ngIf="item.title === 'Resource Sharing Level'">
<label nz-radio [nzValue]="option.key" *ngFor="let option of item.options">
<nz-option [nzValue]="option.key" [nzLabel]="option.title" *ngFor="let option of item.options">
</nz-option>
</nz-select>
- <div class="validation_alert" *ngIf="item.required">{{Util.isEmpty(formData[item.key])? 'can not be empty!':' '}}</div>
+ <div class="validation_alert" *ngIf="item.required">
+ {{Util.isEmpty(formData[item.key])? 'can not be empty!':' '}}</div>
<!-- 2020.08.17 Add 3 parameters for Endpoint-->
<!-- Comment: The following code-->
<nz-input-group *ngIf="item.title === 'Endpoint' && EndpointEnable">
<div *ngFor="let option of item.options;let i=index">
<div class="endpoint_input">
- <input nz-input
- [id]="option.key"
- [name]="option.key"
- [title]="EndpointInputs[option.key]"
- [(ngModel)]="EndpointInputs[option.key]"
- [placeholder]="option.holder"
- style="width:32%;margin-right:1%" />
- <div class="end_alert_ip" *ngIf="option.title === 'ip_address'">{{validateEndPoint(option.title, EndpointInputs[option.key])}}</div>
- <div class="end_alert_logical" *ngIf="option.title === 'logical_link'">{{validateEndPoint(option.title, EndpointInputs[option.key])}}</div>
- <div class="end_alert_nexthop" *ngIf="option.title === 'nexthop_info'">{{validateEndPoint(option.title, EndpointInputs[option.key])}}</div>
+ <input nz-input [id]="option.key" [name]="option.key"
+ [title]="EndpointInputs[option.key]" [(ngModel)]="EndpointInputs[option.key]"
+ [placeholder]="option.holder" style="width:32%;margin-right:1%" />
+ <div class="end_alert_ip" *ngIf="option.title === 'ip_address'">
+ {{validateEndPoint(option.title, EndpointInputs[option.key], item.required)}}</div>
+ <div class="end_alert_logical" *ngIf="option.title === 'logical_link'">
+ {{validateEndPoint(option.title, EndpointInputs[option.key], item.required)}}</div>
+ <div class="end_alert_nexthop" *ngIf="option.title === 'nexthop_info'">
+ {{validateEndPoint(option.title, EndpointInputs[option.key], item.required)}}</div>
</div>
</div>
</nz-input-group>
</nz-form-control>
<div *ngIf="title === 'An' && item.key === 'an_coverage_area_ta_list'">
<div *ngFor="let area of areaList; let i = index">
- <nz-form-control [nzSpan]="!ind ? 4 : 4" [nzOffset]="i && !ind ? 7 : 0" class="subnet_params_area"
- *ngFor="let item of area; let ind = index">
+ <nz-form-control [nzSpan]="!ind ? 4 : 4" [nzOffset]="i && !ind ? 7 : 0"
+ class="subnet_params_area" *ngFor="let item of area; let ind = index">
<nz-select [(ngModel)]="item.selected" [name]="'area' + i + ind"
- (nzOpenChange)="handleChange(area, item)"
- (ngModelChange)=" handleChangeSelected(area, item) ">
+ (nzOpenChange)="handleChange(area, item)"
+ (ngModelChange)=" handleChangeSelected(area, item) ">
<nz-option [nzValue]="op.name" [nzLabel]="op.name" *ngFor="let op of item.options">
</nz-option>
</nz-select>
<div class="validation_alert_area">{{checkArea(area)}}</div>
</nz-form-control>
<nz-form-control [nzSpan]="1" [nzOffset]="2">
- <button nz-button nzType="primary" type="button" nzSize="small" class="subnet_params_button" *ngIf="!i"
- (click)="creatAreaList()">
+ <button nz-button nzType="primary" type="button" nzSize="small" class="subnet_params_button"
+ *ngIf="!i" (click)="creatAreaList()">
<i nz-icon class="anticon anticon-plus subnet_params_icon"></i>
</button>
- <button nz-button nzType="primary" type="button" nzSize="small" class="subnet_params_button" *ngIf="i"
- (click)="deleteAreaList(i)">
+ <button nz-button nzType="primary" type="button" nzSize="small" class="subnet_params_button"
+ *ngIf="i" (click)="deleteAreaList(i)">
<i nz-icon class="anticon anticon-minus subnet_params_icon"></i>
</button>
</nz-form-control>
-.subnet_params_container{\r
+.subnet_params_container {\r
padding-left: 3%;\r
- .subnet_params_area{\r
+\r
+ .subnet_td {\r
+ width: 100px;\r
+ }\r
+\r
+ .subnet_params_area {\r
margin-right: 5px;\r
}\r
- .ant-btn-icon-only{\r
+\r
+ .ant-btn-icon-only {\r
padding: 0 5px !important;\r
}\r
- .subnet_params_button{\r
+\r
+ .subnet_params_button {\r
margin-top: 7px;\r
margin-left: 10px;\r
}\r
- .subnet_params_icon{\r
+\r
+ .subnet_params_icon {\r
font-size: 14px;\r
}\r
}\r
+\r
.ant-form-item-label {\r
text-align: left;\r
}\r
+\r
.validation_alert {\r
color: red;\r
position: absolute;\r
top: 0;\r
margin-top: 15px;\r
}\r
+\r
.validation_alert_area {\r
color: red;\r
margin-left: 6px;\r
}\r
+\r
.endpoint_input {\r
position: relative;\r
+\r
.end_alert_ip {\r
position: absolute;\r
color: red;\r
margin-top: 30px;\r
margin-left: 6px;\r
}\r
+\r
.end_alert_logical {\r
position: absolute;\r
color: red;\r
top: 0;\r
margin: 30px 0 0 126px;\r
}\r
+\r
.end_alert_nexthop {\r
position: absolute;\r
color: red;\r
top: 0;\r
margin: 30px 0 0 246px;\r
}\r
+}\r
+\r
+.tn_endpoint_input {\r
+ position: relative;\r
+\r
+ .end_alert_ip {\r
+ position: absolute;\r
+ color: red;\r
+ top: 0;\r
+ margin-top: 30px;\r
+ margin-left: 6px;\r
+ }\r
+\r
+ .end_alert_logical {\r
+ position: absolute;\r
+ color: red;\r
+ top: 0;\r
+ margin: 30px 0 0 196px;\r
+ }\r
+\r
+ .end_alert_nexthop {\r
+ position: absolute;\r
+ color: red;\r
+ top: 0;\r
+ margin: 30px 0 0 396px;\r
+ }\r
}
\ No newline at end of file
@Input() title: string;
@Output() cancel = new EventEmitter<boolean>();
@Output() paramsDataChange = new EventEmitter<any>();
+ @Output() noPassParaChange = new EventEmitter<any>();
- transferFormItems = TRANSFRER_FORM_ITEMS;
+ transferFormItems: any[] = TRANSFRER_FORM_ITEMS;
regxpIP = /^((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)$/; // check for correct ip address
formData: any;
coreFormItems : any = [];
areaList: any[] = [];
// 2020.08.17 Add 3 parameters for Endpoint, Comment: The following code
NexthopInfoOptions = NexthopInfo_Options;
- EndpointInputs: object = {};
+ EndpointInputs: object = {};
+ ANEndpointInputs: object = {};
+ CNEndpointInputs: object = {};
+ ANkeyList: string[] = [];
+ CNkeyList: string[] = [];
EndpointEnable: boolean = true; // Whether to enable the three parameters of Endpoint
keyList: string[] = []; // keys of endPoint
+ specialParaTN: string[] = ['Resource Sharing Level', 'Connection Links', 'AN Endpoint', 'CN Endpoint'];
+ // Parameters not passed to the back end
+ notPassPara: string[] = ['tn_connection_links'];
// Comment: Above code
constructor(
}
ngOnChanges() {
- if(this.title){
+ if (this.title) {
this.formData = JSON.parse(JSON.stringify(this.detailData));
if (this.title === 'An' || this.title === 'Cn') {
this.coreFormItems = this.title === 'An'?CORE_FORM_ITEMS.An:this.title === 'Cn'?CORE_FORM_ITEMS.Cn:[];
this.keyList = this.coreFormItems.find((item) => {return item.title === 'Endpoint'}).options.map((val) => {return val.key});
- if(this.formData !==undefined && Object.keys(this.formData).length!==0){
- this.EndpointEnable = this.keyList.every((item) => {return this.formData.hasOwnProperty(item)})
- }
- if(this.EndpointEnable){
- this.EndpointInputs = this.Util.pick(this.formData, this.keyList)// no?
- }else{
- this.coreFormItems.map((item,index)=>{
- if(item.title === 'Endpoint'){
- this.coreFormItems.splice(index,1)
}
+ else if (this.title === 'Tn') {
+ this.ANkeyList = this.transferFormItems.find((item) => {return item.title === 'AN Endpoint'}).options.map((val) => {return val.key})
+ this.CNkeyList = this.transferFormItems.find((item) => {return item.title === 'CN Endpoint'}).options.map((val) => {return val.key})
+ this.keyList = this.ANkeyList.concat(this.CNkeyList)
+ this.formData['tn_connection_links_option'].forEach((item) => { // add init selection status
+ if (this.formData['tn_connection_links']!== null && this.formData['tn_connection_links'].indexOf(item.id) !== -1) {
+ item.checked = true
+ } else {
+ item.checked = false
+ }
})
+ this.judgeTn() // init judge
+ }
+ // If the endpoint related parameters from the back end are incomplete, delete the endpoint item
+ if(this.formData !==undefined && Object.keys(this.formData).length!==0) {
+ this.EndpointEnable = this.keyList.every((item) => {return this.formData.hasOwnProperty(item)})
+ }
+ if(this.EndpointEnable){
+ if (this.title === 'An' || this.title === 'Cn') {
+ this.EndpointInputs = this.Util.pick(this.formData, this.keyList)
+ } else if (this.title === 'Tn') {
+ this.ANEndpointInputs = this.Util.pick(this.formData, this.ANkeyList)
+ this.CNEndpointInputs = this.Util.pick(this.formData, this.CNkeyList)
+ } else {
+ if (this.title === 'An' || this.title === 'Cn') {
+ this.coreFormItems.map((item,index)=>{
+ if (item.title === 'Endpoint') {
+ this.coreFormItems.splice(index,1)
+ }
+ })
+ } else if (this.title === 'Tn') {
+ this.transferFormItems.map((item,index)=>{
+ if (item.title === 'AN Endpoint' || item.title === 'CN Endpoint') {
+ this.coreFormItems.splice(index,1)
+ }
+ })
}
}
-
+ //-------> Comment: Above code
+ if (this.title === 'An') {
+ this.AreaFormatting();
+ }
+ }
}
- //-------> Comment: Above code
- if (this.title === 'An') {
- this.AreaFormatting();
+ }
+ changeResourceShare () {
+ this.judgeTn()
+ }
+
+ judgeTn (): void {
+ if (this.formData['sliceProfile_TN_resourceSharingLevel'] === 'non-shared') {
+ this.formData['tn_connection_links_option'].forEach ((item) => {
+ item.checked = false
+ })
+ this.formData['tn_connection_links'] = null
+ this.transferFormItems.forEach((item) => {
+ if (item.title === 'Connection Links') {
+ item.disable = true
+ this.notPassPara = ['tn_connection_links', 'tn_connection_links_option']
+ } else if (item.title === 'AN Endpoint' || item.title === 'CN Endpoint') {
+ item.required = true
+ item.disable = false
+ }
+ })
+ } else if (this.formData['sliceProfile_TN_resourceSharingLevel'] === 'shared') {
+ this.transferFormItems.forEach((item) => {
+ if (item.title === 'Connection Links') {
+ item.disable = false
+ } else if (item.title === 'AN Endpoint' || item.title === 'CN Endpoint') {
+ if (this.formData['tn_connection_links']!==null && this.formData['tn_connection_links'].length !== 0) {
+ item.disable = true
+ item.required = false
+ this.notPassPara = ['tn_connection_links_option']
+ this.notPassPara = this.notPassPara.concat(this.ANkeyList, this.CNkeyList)
+ console.log('not', this.notPassPara)
+ } else if (this.formData['tn_connection_links']!==null && this.formData['tn_connection_links'].length === 0) {
+ item.disable = false
+ item.required = true
+ }
+ }
+ })
}
}
- validateEndPoint (key: string, value: any): string {
- if (this.Util.isEmpty(value)) {
- return 'can not be empty';
+
+ validateEndPoint (key: string, value: any, required: boolean): string {
+ if (required) {
+ if (this.Util.isEmpty(value)) {
+ return 'can not be empty';
+ }
}
if (key === 'ip_address') {
if (!this.regxpIP.test(value)) {
- return 'xxx.xxx.xxx.xxx';
+ if (value !== '') {
+ return 'xxx.xxx.xxx.xxx';
+ } else {
+ return ''
+ }
} else {
return '';
}
} else if (key === 'logical_link') {
if (!this.Util.isInteger(value)){
- return 'integer only'
+ if (value !== ''){
+ return 'integer only'
+ } else {
+ return ''
+ }
} else {
return ''
}
}
}
- // onInput ($event:any, title: string) {
- // if (!$event) {
- // return;
- // }
- // const target = $event.target;
- // if (title === 'ip_address') {
- // // only number and '.' can be inputted
- // const regexp = /[^\d^\.]+/g;
- // target.value = target.value.replace(regexp, '');
- // } else if (title === 'logical_link') {
- // // only number can be inputted
- // const regxp = /[^\d]/g;
- // target.value = target.value.replace(regxp, '');
- // }
- // }
+ changeLinkCheck (id: string, e: boolean) : void{ // update the selection state
+ this.formData['tn_connection_links_option'].find((item) => {
+ return item.id === id
+ }).checked = e
+ const checkedList = this.formData['tn_connection_links_option'].filter((item) => {return item.checked === true})
+ this.formData['tn_connection_links'] = checkedList.map((item) => {return item.id}) // get the selected id
+ this.judgeTn()
+ }
+
AreaFormatting () {
let areaList = [...this.formData.an_coverage_area_ta_list];
this.areaList = areaList.map ( (item: any) => {
}
}
- handleCancel() {
+ handleCancel() : void{
this.showModel = false
this.cancel.emit(this.showModel)
}
// prompt text for each item of area_list
- checkArea (area: any) {
+ checkArea (area: any) : string{
if (area.every((item) => {return item.selected === ''})) {
return 'empty';
}
return true;
}
- endCheckBeforeSubmit () : Array<any>{
+ endCheckBeforeSubmit (endpoint, required) : Array<any>{
// check params of Endpoint
- let result: Array<any> = [true, ''];
- const endPointList = this.coreFormItems&&this.coreFormItems.length!==0?this.coreFormItems.find((item) => {return item.title === 'Endpoint'}).options:{};
- let ipKey = '';
- let logicalKey = '';
- for (let item of endPointList) {
- if (item.title === 'ip_address') {
- ipKey = item.key
- } else if (item.title === 'logical_link') {
- logicalKey = item.key
+ console.log('end', endpoint)
+ let result: Array<any> = [true, ''];
+ let endPointList;
+ if (this.title === 'An' || this.title === 'Cn') {
+ endPointList = this.coreFormItems.find((item) => {return item.title === 'Endpoint'}).options
+ } else {
+ endPointList = this.transferFormItems.find((item) => {return item.title === 'AN Endpoint'}).options
}
- }
- for (let prop in this.EndpointInputs) {
- if (prop === ipKey) {
- if (!this.regxpIP.test(this.EndpointInputs[prop])) {
- result = [false, 'Illegal IpAddress']
- }
- } else if (prop === logicalKey) {
- if (!this.Util.isInteger(this.EndpointInputs[prop])) {
- result = [false, 'LogicalID can only be an integer']
+ let ipKey = '';
+ let logicalKey = '';
+ let nextKey = ''
+ for (let item of endPointList) {
+ if (item.title === 'ip_address') {
+ ipKey = item.key
+ } else if (item.title === 'logical_link') {
+ logicalKey = item.key
+ } else if (item.title === 'nexthop_info') {
+ nextKey = item.key
}
}
- }
- return result;
+ for (let prop in endpoint) {
+ if (prop === ipKey) {
+ if (required) {
+ if (endpoint[prop] === '') {
+ result = [false, 'Endpoint can not be empty']
+ } else if (!this.regxpIP.test(endpoint[prop])) {
+ result = [false, 'Illegal IpAddress']
+ }
+ } else if (!this.regxpIP.test(endpoint[prop]) && endpoint[prop] !== '') {
+ result = [false, 'Illegal IpAddress']
+ }
+ } else if (prop === logicalKey) {
+ if (required) {
+ if (endpoint[prop] === '') {
+ result = [false, 'logical can not be empty']
+ } else if (!this.Util.isInteger(endpoint[prop])) {
+ result = [false, 'LogicalID can only be an integer']
+ }
+ } else if (!this.Util.isInteger(endpoint[prop]) && endpoint[prop] !== '') {
+ result = [false, 'LogicalID can only be an integer']
+ }
+ } else if (prop === nextKey) {
+ if (required && endpoint[prop] === '') {
+ result = [false, 'Endpoint can not be empty']
+ }
+ }
+ }
+ return result;
}
inputHolder (title: string): string {
handleOk(): void {
// Verify that items of EndPoint is correct
- let endCheckResult = this.endCheckBeforeSubmit()
- if (!endCheckResult[0]) {
- this.message.error(endCheckResult[1].toString());
- return;
- }
- // replace the params about endPoint
- for (let prop in this.formData) {
- if (typeof this.EndpointInputs[prop] !== 'undefined') {
- this.formData[prop] = this.EndpointInputs[prop];
+ if (this.EndpointEnable) {
+ let endCheckResult = []
+ if (this.title === 'An' || this.title === 'Cn') {
+ endCheckResult = this.endCheckBeforeSubmit(this.EndpointInputs, this.coreFormItems.find((item) => {return item.title === 'Endpoint'}).required)
+ } else if (this.title === 'Tn') {
+ const ANendCheckResult = this.endCheckBeforeSubmit(this.ANEndpointInputs, this.transferFormItems.find((item) => {return item.title === 'AN Endpoint'}).required)
+ const CNendCheckResult = this.endCheckBeforeSubmit(this.CNEndpointInputs, this.transferFormItems.find((item) => {return item.title === 'CN Endpoint'}).required)
+ if (ANendCheckResult[0] && CNendCheckResult[0]) {
+ endCheckResult[0] = true
+ } else {
+ if (ANendCheckResult[0] === false) {
+ endCheckResult = ANendCheckResult
+ } else {
+ endCheckResult = CNendCheckResult
+ }
+ }
+ }
+ if (!endCheckResult[0]) {
+ this.message.error(endCheckResult[1].toString());
+ return;
+ }
+ // replace the params about endPoint
+ for (let prop in this.formData) {
+ if ((this.title === 'An' || this.title === 'Cn') && typeof this.EndpointInputs[prop] !== 'undefined') {
+ this.formData[prop] = this.EndpointInputs[prop];
+ } else if (this.title === 'Tn' && typeof this.ANEndpointInputs[prop] !== 'undefined') {
+ this.formData[prop] = this.ANEndpointInputs[prop];
+ } else if (this.title === 'Tn' && typeof this.CNEndpointInputs[prop] !== 'undefined') {
+ this.formData[prop] = this.CNEndpointInputs[prop];
+ }
}
}
let params: object;
} else {
params = {...this.formData};
}
- // Verify that each item is not empty, include special handeling of area_list
- console.log(params)
+ // Verify that each item exclude endpoint is not empty, include special handeling of area_list
let checkParams = params
if (this.title === 'An' || this.title === 'Cn') {
checkParams = this.coreFormItems.filter((item) => {
}
if (this.Util.deepCheck(checkParams) && this.areaCheckBeforeSubmit(params)) {
this.paramsDataChange.emit(params);
+ this.noPassParaChange.emit(this.notPassPara)
this.handleCancel();
} else {
this.message.error('Please complete the form');
{\r
title: 'S-NSSAI',\r
key: 'sliceProfile_TN_BH_sNSSAI',\r
- required: true\r
+ required: true,\r
},\r
{\r
title: 'Latency (ms)',\r
title: 'MaxBandwidth',\r
key: 'tn_bh_bandwidth',\r
required: true\r
- },\r
+ },\r
+ {\r
+ title: 'Resource Sharing Level', // select\r
+ key: 'sliceProfile_TN_resourceSharingLevel', // :new\r
+ required: true,\r
+ options: [\r
+ {\r
+ title: 'Shared',\r
+ key: 'shared'\r
+ },\r
+ {\r
+ title: 'Non-shared',\r
+ key: 'non-shared'\r
+ }\r
+ ]\r
+ },\r
+ {\r
+ title: 'Connection Links',// table\r
+ key: 'tn_connection_links', // :new\r
+ required: false, // combined\r
+ options: {\r
+ title: 'connection_links_option',\r
+ key: 'tn_connection_links_option'\r
+ },\r
+ disable: false,\r
+ header: [\r
+ {\r
+ title: 'ID',\r
+ key: 'id'\r
+ },\r
+ {\r
+ title: 'AN',\r
+ key: 'AN'\r
+ },\r
+ {\r
+ title: 'CN',\r
+ key: 'CN'\r
+ },\r
+ {\r
+ title: 'TN',\r
+ key: 'TN'\r
+ },\r
+ {\r
+ title: 'Properties',\r
+ key: 'properties'\r
+ }\r
+ ]\r
+ },\r
+ {\r
+ title:'AN Endpoint', // input group\r
+ key:"an_Endpoint",\r
+ required: false,\r
+ disable: false,\r
+ options: [\r
+ {\r
+ title: 'ip_address',\r
+ key: 'sliceProfile_AN_ipAddress',\r
+ holder: 'IpAddress'\r
+ },\r
+ {\r
+ title: 'logical_link',\r
+ key: 'sliceProfile_AN_logicInterfaceId',\r
+ holder: 'LogicId'\r
+ },\r
+ {\r
+ title: 'nexthop_info',\r
+ key: 'sliceProfile_AN_nextHopInfo',\r
+ holder: 'NextHop'\r
+ }\r
+ ]\r
+ },\r
+ {\r
+ title:'CN Endpoint',\r
+ key:"cn_Endpoint",\r
+ required: false,\r
+ disable: false,\r
+ options: [\r
+ {\r
+ title: 'ip_address',\r
+ key: 'sliceProfile_CN_ipAddress',\r
+ holder: 'IpAddress'\r
+ },\r
+ {\r
+ title: 'logical_link',\r
+ key: 'sliceProfile_CN_logicInterfaceId',\r
+ holder: 'LogicId'\r
+ },\r
+ {\r
+ title: 'nexthop_info',\r
+ key: 'sliceProfile_CN_nextHopInfo',\r
+ holder: 'NextHop'\r
+ }\r
+ ]\r
+ },\r
]\r
\r
export const CORE_FORM_ITEMS = {\r