diff options
Diffstat (limited to 'src/app/vnfs/myvnfs/myvnfs.component.ts')
-rw-r--r-- | src/app/vnfs/myvnfs/myvnfs.component.ts | 67 |
1 files changed, 44 insertions, 23 deletions
diff --git a/src/app/vnfs/myvnfs/myvnfs.component.ts b/src/app/vnfs/myvnfs/myvnfs.component.ts index a124705..49f4f42 100644 --- a/src/app/vnfs/myvnfs/myvnfs.component.ts +++ b/src/app/vnfs/myvnfs/myvnfs.component.ts @@ -55,8 +55,8 @@ export class MyvnfsComponent implements OnInit, OnDestroy { } subscription: Subscription; - constructor(private paramShareService: ParamShareService, private ngProgress: NgProgress, private httpUtil: HttpUtilService, private router: Router, private activeROute: ActivatedRoute, - private mappingEditorService: MappingEditorService, private modalService: NgbModal, private nService: NotificationsService) { + constructor (private paramShareService: ParamShareService, private ngProgress: NgProgress, private httpUtil: HttpUtilService, private router: Router, private activeROute: ActivatedRoute, + private mappingEditorService: MappingEditorService, private modalService: NgbModal) { } ngOnInit() { @@ -89,28 +89,22 @@ export class MyvnfsComponent implements OnInit, OnDestroy { getArtifacts(data) { let tempObj: any; this.ngProgress.start(); - //this.subscription = this.httpUtil.post({ this.httpUtil.post({ url: environment.getDesigns, data: data }) - .subscribe( resp => { + .subscribe(resp => { if (resp.output.data.block !== undefined && resp.output.data.block !== null && resp.output.data.block.length !== 0) { - console.log("getArtifacts: resp:", resp.output.data.block); - tempObj = JSON.parse(resp.output.data.block); - this.vnfData = tempObj.designInfo; + tempObj = JSON.parse(resp.output.data.block); + this.vnfData = tempObj.designInfo; } - if (this.vnfData == undefined || this.vnfData == null || this.vnfData.length == 0) { + if (this.vnfData === undefined || this.vnfData === null || this.vnfData.length === 0) { this.noData = true; - // this.noDataMsg = resp.output.data.status.message; + // this.noDataMsg = resp.output.status.message; } else { this.noData = false; } - console.log("getArtifacts: noData:"+this.noData); this.ngProgress.done(); - }, - error => { - this.nService.error(appConstants.errors.error, appConstants.errors.connectionError) }); this.filter = ['vnf-type', 'vnfc-type', 'artifact-name']; @@ -124,14 +118,25 @@ export class MyvnfsComponent implements OnInit, OnDestroy { getData() { } - buildNewDesign( response) { - // this.modalService.open(content).result.then(res => { - // this.mappingEditorService.referenceNameObjects = undefined; - // sessionStorage.setItem('vnfParams', JSON.stringify({ vnfType: this.vnfType, vnfcType: this.vnfcType })); - // this.router.navigate([ - // 'vnfs', 'design', 'references' - // ]); - // }); + buildNewDesign(response) { + + // this.modalService.open(content).result.then(res => { + // if(res=='yes'){ + // sessionStorage.setItem('vnfParams', JSON.stringify({ vnfType: this.vnfType})); + // sessionStorage.setItem("vnfcSelectionFlag",''+this.vnfcRequired+'') + // } else{ + // sessionStorage.setItem('vnfParams',"") + // } + + // this.mappingEditorService.referenceNameObjects = undefined; + // this.mappingEditorService.identifier = ''; + // //this.mappingEditorService.newObject = {}; + // this.router.navigate([ + // 'vnfs', 'design', 'references' + // ]); + + // }); + if (response == 'yes') { sessionStorage.setItem('vnfParams', JSON.stringify({ vnfType: this.vnfType })); sessionStorage.setItem("vnfcSelectionFlag", '' + this.vnfcRequired + '') @@ -198,7 +203,7 @@ export class MyvnfsComponent implements OnInit, OnDestroy { clearCache() { // get the value and save the userid and persist it. - sessionStorage.setItem("vnfcSelectionFlag", '' + this.vnfcRequired + ''); + sessionStorage.setItem("vnfcSelectionFlag", '' + this.vnfcRequired + '') this.mappingEditorService.setTemplateMappingDataFromStore(undefined); localStorage['paramsContent'] = '{}'; this.mappingEditorService.setParamContent(undefined); @@ -212,4 +217,20 @@ export class MyvnfsComponent implements OnInit, OnDestroy { this.mappingEditorService.changeNavAppData(appData); this.mappingEditorService.changeNavDownloadData(downloadData); } -} + defineData(item) { + let artVnfc = item['artifact-name'].substring(this.lastIndexofEnd("AllAction_", item['artifact-name']), item['artifact-name'].lastIndexOf("_")) + if (item['vnf-type'] == artVnfc && item['vnfc-type'] == 'null') { + + return item['vnfc-type'] + } else { + return "" + } + + } + lastIndexofEnd(str, originlStr) { + var io = originlStr.lastIndexOf(str); + return io == -1 ? -1 : io + str.length; + } + + +}
\ No newline at end of file |