"suggest_nsi_name": "eMBB instance1",\r
"an_suggest_nssi_id": "46da8cf8-0878-48ac-bea3-f2200959411a",\r
"an_suggest_nssi_name": "eMBB ANinstance1",\r
- "an_service_snssai": "an_1-010101",\r
- "an_resource_sharing_level": "shared",\r
- "an_ue_mobility_level": "stationary",\r
+ "sliceProfile_AN_sNSSAI": "an_1-010101",\r
+ "sliceProfile_AN_resourceSharingLevel": "shared",\r
+ "sliceProfile_AN_uEMobilityLevel": "stationary",\r
"an_latency": "10",\r
- "an_max_number_of_ues": "10000",\r
- "an_max_number_of_pud_session":"10000",\r
- "an_activity_factor": "60",\r
- "an_exp_data_rate_dl": "300",\r
- "an_exp_data_rate_ul": "300",\r
- "an_area_traffic_cap_dl": "300",\r
- "an_area_traffic_cap_ul": "300",\r
- "an_overalluser_density":"test_an_overalluser_density_01",\r
+ "sliceProfile_AN_maxNumberofUEs": "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
- "an_Endpoint":[\r
- {\r
- "an_ip_address":"test_an_ip_address_01"\r
- },\r
- {\r
- "an_logical_link": "test_an_logical_link_01"\r
- },\r
- {\r
- "an_nexthop_info":"test_info_01"\r
- }\r
- ],\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
"an_coverage_area_ta_list": ["北京;北京市;海淀区", "北京;北京市;西城区", "北京;北京市;昌平区"],\r
"tn_suggest_nssi_id": "46da8cf8-0878-48ac-bea3-f2200959411b",\r
"tn_latency": "10",\r
"tn_bandwidth": "300",\r
"tn_script_name":"test_tn_01",\r
- "tn_jitter":"test_tn_jitter_01",\r
- "tn_service_snssai":"test_tn_service_snssai_01",\r
+ "sliceProfile_TN_jitte":"test_tn_jitter_01",\r
+ "sliceProfile_TN_sNSSAI":"test_tn_service_snssai_01",\r
"tn_enableNSSISelection":false,\r
"cn_suggest_nssi_id": "46da8cf8-0878-48ac-bea3-f2200959411c",\r
"cn_suggest_nssi_name": "eMBB CNinstance3",\r
"cn_area_traffic_cap_dl": "300",\r
"cn_area_traffic_cap_ul": "300",\r
"cn_script_name":"test_cn_01",\r
- "cn_max_number_of_pud_session":"10000",\r
- "cn_overalluser_density":"test_cn_overalluser_density_01",\r
+ "sliceProfile_CN_maxNumberofPDUSession":"10000",\r
+ "sliceProfile_CN_overallUserDensity":"test_cn_overalluser_density_01",\r
"cn_enableNSSISelection":true,\r
- "cn_Endpoint":[\r
- {\r
- "cn_ip_address":"test_cn_ip_address_01"\r
- },\r
- {\r
- "cn_logical_link": "test_cn_logical_link_01"\r
- },\r
- {\r
- "cn_nexthop_info":"test_info_01"\r
- }\r
- ]\r
+ "sliceProfile_CN_coverageAreaTAList": "",\r
+ "sliceProfile_CN_ipAddress":"1.1.1.1",\r
+ "sliceProfile_CN_logicInterfaceId":"2222",\r
+ "sliceProfile_CN_nextHopInfo":"nexthopj"\r
}\r
\r
}\r
return false;
} else if (isNaN(parseInt(value))) {
return false;
- } else if (Number(value) >= 0 && Number(value)%1 !== 0){
+ } else if (Number(value) < 0 || (Number(value)%1 !== 0)){
return false;
} else {
return true;
}
isEmpty (a: any): boolean {
const type = this.judgeType(a);
- if (type === 'object Null' || type === '[object undefined]' || a === false || a === '') {
+ if (type === 'object Null' || type === '[object undefined]' || a === '') {
return true;
} else {
return false;
}
return true;
}
+ pick(obj: object, arr: Array<string>): Object {
+ return arr.reduce((iter, val) => {
+ if(val in obj) {
+ iter[val] = obj[val];
+ }
+ return iter;
+ }, {});
+ }
}
\ No newline at end of file
// 前端模拟数据
let area = ["Beijing;Beijing;Haidian District", "Beijing;Beijing;Xicheng District", "Beijing;Beijing;Changping District"];
this.slicingSubnet[0].params = {...this.pick(nsi_nssi_info, [
- 'an_service_snssai',
- 'an_resource_sharing_level',
- 'an_ue_mobility_level',
+ 'sliceProfile_AN_sNSSAI',
+ 'sliceProfile_AN_resourceSharingLevel',
+ 'sliceProfile_AN_uEMobilityLevel',
'an_latency',
- 'an_max_number_of_ues',
- 'an_activity_factor',
- 'an_exp_data_rate_dl',
- 'an_exp_data_rate_ul',
- 'an_area_traffic_cap_dl',
- 'an_area_traffic_cap_ul',
+ 'sliceProfile_AN_maxNumberofUEs',
+ 'sliceProfile_AN_activityFactor',
+ 'sliceProfile_AN_expDataRateDL',
+ 'sliceProfile_AN_expDataRateUL',
+ 'sliceProfile_AN_areaTrafficCapDL',
+ 'sliceProfile_AN_areaTrafficCapUL',
'an_script_name',
- 'an_overalluser_density',
- 'an_Endpoint',
+ 'sliceProfile_AN_overallUserDensity',
'an_enableNSSISelection',
- 'an_max_number_of_pud_session'
+ 'sliceProfile_AN_maxNumberofPDUSession',
+ 'sliceProfile_AN_ipAddress',
+ 'sliceProfile_AN_logicInterfaceId',
+ 'sliceProfile_AN_nextHopInfo'
]), an_coverage_area_ta_list: area};
- this.slicingSubnet[1].params = this.pick(nsi_nssi_info, ['tn_latency', 'tn_bandwidth', 'tn_script_name', 'tn_jitter', 'tn_service_snssai',"tn_enableNSSISelection"]);
+ this.slicingSubnet[1].params = this.pick(nsi_nssi_info, ['tn_latency', 'tn_bandwidth', 'tn_script_name', 'sliceProfile_TN_jitte', 'sliceProfile_TN_sNSSAI',"tn_enableNSSISelection"]);
this.slicingSubnet[2].params = {...this.pick(nsi_nssi_info, [
'cn_service_snssai',
'cn_resource_sharing_level',
'cn_area_traffic_cap_dl',
'cn_area_traffic_cap_ul',
'cn_script_name',
- 'cn_overalluser_density',
- 'cn_Endpoint',
+ 'sliceProfile_CN_overallUserDensity',
'cn_enableNSSISelection',
- 'cn_max_number_of_pud_session'
+ 'sliceProfile_CN_maxNumberofPDUSession',
+ 'sliceProfile_CN_logicInterfaceId',
+ 'sliceProfile_CN_ipAddress',
+ 'sliceProfile_CN_nextHopInfo'
])};
} else {
this.message.error(result_message || 'Failed to get data')
<input nz-input
[id]="option.key"
[name]="option.key"
- [title]="EndpointInputs[i][option.key]"
- [(ngModel)]="EndpointInputs[i][option.key]"
+ [title]="EndpointInputs[option.key]"
+ [(ngModel)]="EndpointInputs[option.key]"
[placeholder]="option.holder"
- (input)="onInput($event, option.title)"
style="width:32%;margin-right:1%" />
- <div class="end_alert_ip" *ngIf="option.title === 'ip_address'">{{validateEndPoint(option.title, EndpointInputs[i][option.key])}}</div>
- <div class="end_alert_logical" *ngIf="option.title === 'logical_link'">{{validateEndPoint(option.title, EndpointInputs[i][option.key])}}</div>
- <div class="end_alert_nexthop" *ngIf="option.title === 'nexthop_info'">{{validateEndPoint(option.title, EndpointInputs[i][option.key])}}</div>
+ <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>
</div>
</div>
</nz-input-group>
areaList: any[] = [];
// 2020.08.17 Add 3 parameters for Endpoint, Comment: The following code
NexthopInfoOptions = NexthopInfo_Options;
- EndpointInputs: any[] = [];
+ EndpointInputs: object = {};
EndpointEnable: boolean = true; // Whether to enable the three parameters of Endpoint
+ keyList: string[] = []; // keys of endPoint
// Comment: Above code
constructor(
if(this.title){
this.coreFormItems = this.title === 'An'?CORE_FORM_ITEMS.An:this.title === 'Cn'?CORE_FORM_ITEMS.Cn:[];
this.formData = JSON.parse(JSON.stringify(this.detailData));
+ 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.formData.hasOwnProperty("an_Endpoint") && this.formData['an_Endpoint'].length!==0) || (this.formData.hasOwnProperty("cn_Endpoint") && this.formData['cn_Endpoint'].length!==0)
+ this.EndpointEnable = this.keyList.every((item) => {return this.formData.hasOwnProperty(item)})
}
// -------> 2020.08.17 Add 3 parameters for Endpoint, Comment: The following code
if(this.EndpointEnable){
- this.EndpointInputs = this.title === 'An'
- ?this.formData["an_Endpoint"]
- :this.title === 'Cn'
- ?this.formData["cn_Endpoint"]
- :[];
+ this.EndpointInputs = this.Util.pick(this.formData, this.keyList)// no?
}else{
this.coreFormItems.map((item,index)=>{
if(item.title === 'Endpoint'){
}
}
- 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, '');
- }
- }
+ // 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, '');
+ // }
+ // }
AreaFormatting () {
let areaList = [...this.formData.an_coverage_area_ta_list];
this.areaList = areaList.map ( (item: any) => {
endCheckBeforeSubmit () : Array<any>{
// check params of Endpoint
let result: Array<any> = [true, ''];
- let formatedEndpoint = {};
- this.EndpointInputs.forEach((item) => {
- formatedEndpoint[Object.keys(item)[0]] = item[Object.keys(item)[0]];
- })
- if (this.title === 'An') {
- for (let prop in formatedEndpoint) {
- if (prop === 'an_ip_address') {
- if (!this.regxpIP.test(formatedEndpoint[prop])) {
- result = [false, 'Illegal IpAddress']
- }
- } else if (prop === 'an_logical_link') {
- if (!this.Util.isInteger(formatedEndpoint[prop])) {
- result = [false, 'LogicalID can only be an integer']
- }
+ const endPointList = 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
+ }
+ }
+ for (let prop in this.EndpointInputs) {
+ if (prop === ipKey) {
+ if (!this.regxpIP.test(this.EndpointInputs[prop])) {
+ result = [false, 'Illegal IpAddress']
}
- }
- } else if (this.title === 'Cn') {
- for (let prop in formatedEndpoint) {
- if (prop === 'cn_ip_address') {
- if (!this.regxpIP.test(formatedEndpoint[prop])) {
- result = [false, 'Illegal IpAddress']
- }
- } else if (prop === 'cn_logical_link') {
- if (!this.Util.isInteger(formatedEndpoint[prop])) {
- result = [false, 'LogicalID can only be an integer']
- }
+ } else if (prop === logicalKey) {
+ if (!this.Util.isInteger(this.EndpointInputs[prop])) {
+ result = [false, 'LogicalID can only be an integer']
}
- }
- }
+ }
+ }
return result;
}
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];
+ }
+ }
let params: object;
if (this.title === 'An') {
const an_coverage_area_ta_list: string[] = [];
export const TRANSFRER_FORM_ITEMS = [\r
{\r
title: 'S-NSSAI',\r
- key: 'tn_service_snssai',\r
+ key: 'iceProfile_TN_sNSSAI',\r
required: true\r
},\r
{\r
},\r
{\r
title: 'Jitter',\r
- key: 'tn_jitter',\r
+ key: 'sliceProfile_TN_jitte',\r
required: false,\r
},\r
{\r
"An": [\r
{\r
title: 'S-NSSAI',\r
- key: 'an_service_snssai',\r
+ key: 'sliceProfile_AN_sNSSAI',\r
required: true\r
},\r
{\r
title: 'Resource Sharing Level',\r
- key: 'an_resource_sharing_level',\r
+ key: 'sliceProfile_AN_resourceSharingLevel',\r
required: true,\r
options: [\r
{\r
},\r
{\r
title: 'Mobility',\r
- key: 'an_ue_mobility_level',\r
+ key: 'sliceProfile_AN_uEMobilityLevel',\r
required: true,\r
options: [\r
{\r
},\r
{\r
title: 'Max Number of PUD Session',\r
- key: 'an_max_number_of_pud_session',\r
+ key: 'sliceProfile_AN_maxNumberofPDUSession',\r
required: true\r
},\r
{\r
title: 'Max Number of UEs',\r
- key: 'an_max_number_of_ues',\r
+ key: 'sliceProfile_AN_maxNumberofUEs',\r
required: true\r
},\r
{\r
title: 'Activity Factor (%)',\r
- key: 'an_activity_factor',\r
+ key: 'sliceProfile_AN_activityFactor',\r
required: true\r
},\r
{\r
title: 'User Downlink Experience Rate(Mbps)',\r
- key: 'an_exp_data_rate_dl',\r
+ key: 'sliceProfile_AN_expDataRateDL',\r
required: true\r
},\r
{\r
title: 'User Uplink Experience Rate(Mbps)',\r
- key: 'an_exp_data_rate_ul',\r
+ key: 'sliceProfile_AN_expDataRateUL',\r
required: true\r
},\r
{\r
title: 'Downlink Regional Traffic Density(Mbps/km )',\r
- key: 'an_area_traffic_cap_dl',\r
+ key: 'sliceProfile_AN_areaTrafficCapDL',\r
required: true\r
},\r
{\r
title: 'Uplink Regional Traffic Density(Mbps/km )',\r
- key: 'an_area_traffic_cap_ul',\r
- required: true\r
+ key: 'sliceProfile_AN_areaTrafficCapUL',\r
+ required: true,\r
},\r
{\r
title: 'Script Name',\r
},\r
{\r
title: 'Overall User Density',\r
- key: 'an_overalluser_density',\r
+ key: 'sliceProfile_AN_overallUserDensity',\r
required: true\r
},\r
{\r
options: [\r
{\r
title: 'ip_address',\r
- key: 'an_ip_address',\r
+ key: 'sliceProfile_AN_ipAddress',\r
holder: 'IpAddress'\r
},\r
{\r
title: 'logical_link',\r
- key: 'an_logical_link',\r
+ key: 'sliceProfile_AN_logicInterfaceId',\r
holder: 'LogicId'\r
},\r
{\r
title: 'nexthop_info',\r
- key: 'an_nexthop_info',\r
+ key: 'sliceProfile_AN_nextHopInfo',\r
holder: 'NextHop'\r
}\r
]\r
},\r
+ // {\r
+ // title: 'ip_address',\r
+ // key: 'an_coverage_area_ta_list',\r
+ // required: true,\r
+ // holder: 'IpAddress'\r
+ // },\r
+ // {\r
+ // title: 'logical_link',\r
+ // key: 'sliceProfile_AN_logicInterfaceId',\r
+ // required: true,\r
+ // holder: 'LogicalId'\r
+ // },\r
+ // {\r
+ // title: 'nexthop_info',\r
+ // key: 'sliceProfile_AN_nextHopInfo',\r
+ // required: true,\r
+ // holder: 'NextHop'\r
+ // },\r
{\r
title: 'Coverage Area Ta List',\r
key: 'an_coverage_area_ta_list',\r
},\r
{\r
title: 'Max Number of PUD Session',\r
- key: 'cn_max_number_of_pud_session',\r
+ key: 'sliceProfile_CN_maxNumberofPDUSession',\r
required: true\r
},\r
{\r
title: 'OverAll User Density',\r
- key: 'cn_overalluser_density',\r
+ key: 'sliceProfile_CN_overallUserDensity',\r
required: true\r
},\r
+ // {\r
+ // title: 'ip-address',\r
+ // key: 'sliceProfile_CN_ipAddress',\r
+ // required: true,\r
+ // holder: 'IpAddress'\r
+ // },\r
+ // {\r
+ // title: 'logical_link',\r
+ // key: 'sliceProfile_CN_logicInterfaceId',\r
+ // required: true,\r
+ // holder: 'LogicId'\r
+ // },\r
+ // {\r
+ // title: 'cn_nexthop_info',\r
+ // key: 'sliceProfile_CN_nextHopInfo',\r
+ // required: true,\r
+ // holder: 'NextHop'\r
+ // },\r
{\r
title:'Endpoint',\r
key:"cn_Endpoint",\r
options: [\r
{\r
title: 'ip_address',\r
- key: 'cn_ip_address',\r
+ key: 'sliceProfile_CN_ipAddress',\r
holder: 'IpAddress'\r
},\r
{\r
title: 'logical_link',\r
- key: 'cn_logical_link',\r
+ key: 'sliceProfile_CN_logicInterfaceId',\r
holder: 'LogicId'\r
},\r
{\r
title: 'nexthop_info',\r
- key: 'cn_nexthop_info',\r
+ key: 'sliceProfile_CN_nextHopInfo',\r
holder: 'NextHop'\r
}\r
]\r