X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Finstances%2Fns-instances%2FNSInstancesComponent.ts;h=e7de4a757fc10244568021ca982fd1e4ca7a190d;hb=5f8c802910e7c64d476296448487b9cfa774380d;hp=07184da63a8de1a2682f812efa5cefbf16d5bc90;hpb=3b4814aa2d3dec621dadb52f058ba95a3dc3a86a;p=osm%2FNG-UI.git diff --git a/src/app/instances/ns-instances/NSInstancesComponent.ts b/src/app/instances/ns-instances/NSInstancesComponent.ts index 07184da..e7de4a7 100644 --- a/src/app/instances/ns-instances/NSInstancesComponent.ts +++ b/src/app/instances/ns-instances/NSInstancesComponent.ts @@ -81,6 +81,9 @@ export class NSInstancesComponent implements OnInit { /** operational State failed data @public */ public operationalStateThirdStep: string = CONFIGCONSTANT.operationalStateThirdStep; + /** operational State scaling data @public */ + public operationalStateFourthStep: string = CONFIGCONSTANT.operationalStateFourthStep; + /** Config State init data @public */ public configStateFirstStep: string = CONFIGCONSTANT.configStateFirstStep; @@ -124,7 +127,7 @@ export class NSInstancesComponent implements OnInit { this.generateTableColumn(); this.generateTableSettings(); this.generateData(); - this.generateDataSub = this.sharedService.dataEvent.subscribe(() => { this.generateData(); }); + this.generateDataSub = this.sharedService.dataEvent.subscribe((): void => { this.generateData(); }); } /** Generate smart table row title and filters @public */ @@ -141,9 +144,13 @@ export class NSInstancesComponent implements OnInit { /** Generate smart table row title and filters @public */ public generateTableColumn(): void { this.columnList = { - name: { title: this.translateService.instant('NAME'), width: '15%', sortDirection: 'asc' }, + name: { title: this.translateService.instant('NAME'), width: '15%' }, identifier: { title: this.translateService.instant('IDENTIFIER'), width: '20%' }, NsdName: { title: this.translateService.instant('NSDNAME'), width: '15%' }, + 'create-time': { + title: this.translateService.instant('DATE'), width: '15%', sortDirection: 'desc', + compareFunction: this.sharedService.compareFunction + }, OperationalStatus: { title: this.translateService.instant('OPERATIONALSTATUS'), width: '10%', type: 'html', filter: { @@ -153,7 +160,8 @@ export class NSInstancesComponent implements OnInit { list: [ { value: this.operationalStateFirstStep, title: this.operationalStateFirstStep }, { value: this.operationalStateSecondStep, title: this.operationalStateSecondStep }, - { value: this.operationalStateThirdStep, title: this.operationalStateThirdStep } + { value: this.operationalStateThirdStep, title: this.operationalStateThirdStep }, + { value: this.operationalStateFourthStep, title: this.operationalStateFourthStep } ] } }, @@ -170,6 +178,10 @@ export class NSInstancesComponent implements OnInit { return ` `; + } else if (row.OperationalStatus === this.operationalStateFourthStep) { + return ` + + `; } else { return `${row.OperationalStatus}`; } @@ -219,9 +231,9 @@ export class NSInstancesComponent implements OnInit { /** generateData initiate the ns-instance list @public */ public generateData(): void { this.isLoadingResults = true; - this.restService.getResource(environment.NSDINSTANCES_URL).subscribe((nsdInstancesData: NSInstanceDetails[]) => { + this.restService.getResource(environment.NSDINSTANCES_URL).subscribe((nsdInstancesData: NSInstanceDetails[]): void => { this.nsInstanceData = []; - nsdInstancesData.forEach((nsdInstanceData: NSInstanceDetails) => { + nsdInstancesData.forEach((nsdInstanceData: NSInstanceDetails): void => { const nsDataObj: NSDInstanceData = { name: nsdInstanceData.name, identifier: nsdInstanceData.id, @@ -229,8 +241,15 @@ export class NSInstancesComponent implements OnInit { OperationalStatus: nsdInstanceData['operational-status'], ConfigStatus: nsdInstanceData['config-status'], DetailedStatus: nsdInstanceData['detailed-status'], - memberIndex: nsdInstanceData.nsd['constituent-vnfd'], - nsConfig: nsdInstanceData.nsd['ns-configuration'] + memberIndex: nsdInstanceData.nsd.df, + nsConfig: nsdInstanceData.nsd['ns-configuration'], + adminDetails: nsdInstanceData._admin, + vnfID: nsdInstanceData['vnfd-id'], + nsd: nsdInstanceData.nsd, + 'nsd-id': nsdInstanceData['nsd-id'], + vcaStatus: nsdInstanceData.vcaStatus, + constituent: nsdInstanceData['constituent-vnfr-ref'], + 'create-time': this.sharedService.convertEpochTime(Number(nsdInstanceData['create-time'])) }; this.nsInstanceData.push(nsDataObj); }); @@ -239,10 +258,12 @@ export class NSInstancesComponent implements OnInit { } else { this.checkDataClass = 'dataTables_empty'; } - this.dataSource.load(this.nsInstanceData).then((data: {}) => { + this.dataSource.load(this.nsInstanceData).then((data: {}): void => { this.isLoadingResults = false; - }).catch(); - }, (error: ERRORDATA) => { + }).catch((): void => { + // Catch Navigation Error + }); + }, (error: ERRORDATA): void => { this.restService.handleError(error, 'get'); this.isLoadingResults = false; }); @@ -261,12 +282,15 @@ export class NSInstancesComponent implements OnInit { /** Instantiate NS using modalservice @public */ public instantiateNS(): void { + // eslint-disable-next-line security/detect-non-literal-fs-filename const modalRef: NgbModalRef = this.modalService.open(InstantiateNsComponent, { backdrop: 'static' }); - modalRef.result.then((result: MODALCLOSERESPONSEDATA) => { + modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => { if (result) { this.generateData(); } - }).catch(); + }).catch((): void => { + // Catch Navigation Error + }); } /**