diff options
Diffstat (limited to 'usecaseui-portal/src')
7 files changed, 227 insertions, 48 deletions
diff --git a/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.html b/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.html index 1a1a2a46..25687f67 100644 --- a/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.html +++ b/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.html @@ -13,6 +13,7 @@ See the License for the specific language governing permissions and limitations under the License. --> +<nz-spin [nzSpinning]="isSpinning" nzSize="large"> <div class="model"> <!--chart--> <button nz-button nzType="primary" *ngIf="!nonetwork" style="margin-top: 2px;display: inline-block" (click)="showForm()" @@ -148,4 +149,4 @@ <button nz-button nzType="default" nzSize="small" class="del-button" style="width: 60px;" (click)="hideForm()"> {{"i18nTextDefine_Cancel" | translate}} </button> </div> </div> - +</nz-spin> diff --git a/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.ts b/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.ts index 9a5b0e23..bb0dd967 100644 --- a/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.ts +++ b/usecaseui-portal/src/app/ccvpn-network/ccvpn-network.component.ts @@ -87,6 +87,7 @@ export class CcvpnNetworkComponent implements OnInit { outCloudShow = false; inputshow = false; delBoxisVisible = false; + isSpinning = true; d3Data = [];//D3Render the required data logicalLinks = [];//logicalLinks Existing connection data returned by the interface @@ -166,8 +167,10 @@ export class CcvpnNetworkComponent implements OnInit { //Get cloud image data getD3Data() { + this.isSpinning = true; this.myhttp.getNetworkD3Data() .subscribe((data) => { + this.isSpinning = false; if (data.length == 0) { this.addLinkDisabled = false; this.nonetwork = true; diff --git a/usecaseui-portal/src/app/components/customer/customer.component.html b/usecaseui-portal/src/app/components/customer/customer.component.html index fea9dfdf..04975e41 100644 --- a/usecaseui-portal/src/app/components/customer/customer.component.html +++ b/usecaseui-portal/src/app/components/customer/customer.component.html @@ -40,7 +40,7 @@ <div class="customer_detail"> <div class="customer_add" *ngIf="customeradd"> <input nz-input placeholder=" {{'i18nTextDefine_Input_customerName' | translate}} " class="customer_name" nzSize="default" [(ngModel)]="addNewCustomer"> - <button nz-button nzType="primary" class="customer_addbut" (click) = "createNewCustomer()">{{"i18nTextDefine_Add" | translate}}</button> + <button nz-button nzType="primary" class="customer_addbut" (click) = "createNewCustomer(notificationModel)">{{"i18nTextDefine_Add" | translate}}</button> </div> <div class="customer_list"> <ul> @@ -63,7 +63,7 @@ <div class="services_type_detail"> <div class="services_add" *ngIf="servicesadd"> <input nz-input placeholder=" {{'i18nTextDefine_Input_ServicesType' | translate}} " class="services_name" nzSize="default" [(ngModel)]="addNewServiceType"> - <button nz-button nzType="primary" class="services_addbut" (click) = "createNewServiceType()">{{"i18nTextDefine_Add" | translate}}</button> + <button nz-button nzType="primary" class="services_addbut" (click) = "createNewServiceType(notificationModel)">{{"i18nTextDefine_Add" | translate}}</button> </div> <div class="services_list"> <div class="border_size"></div> @@ -80,7 +80,7 @@ </div> <nz-modal nzWidth="428" [(nzVisible)]="deleteCustomerModelVisible" nzTitle=" {{'i18nTextDefine_delete' | translate}} " (nzOnCancel)="deleteCustomerCancel()" - (nzOnOk)="deleteCustomerOk()" nzClassName="deleteModel" nzCancelText=" {{'i18nTextDefine_Cancel' | translate}} " nzOkText=" {{'i18nTextDefine_modelOk' | translate}} "> + (nzOnOk)="deleteCustomerOk(notificationModel)" nzClassName="deleteModel" nzCancelText=" {{'i18nTextDefine_Cancel' | translate}} " nzOkText=" {{'i18nTextDefine_modelOk' | translate}} "> <h3><span style="color: red">* </span> {{"i18nTextDefine_Input_Sure_deleteCustomer" | translate}} </h3> <div class="question"> <h4> {{"i18nTextDefine_CustomerName" | translate}} :</h4> @@ -92,7 +92,7 @@ </div> </nz-modal> <nz-modal nzWidth="428" [(nzVisible)]="deleteServiceTypeModelVisible" nzTitle=" {{'i18nTextDefine_delete' | translate}} " (nzOnCancel)="deleteServiceTypeCancel()" - (nzOnOk)="deleteServiceTypeOk()" nzClassName="deleteModel deleteServiceTypeModel" nzCancelText=" {{'i18nTextDefine_Cancel' | translate}} " nzOkText=" {{'i18nTextDefine_modelOk' | translate}} "> + (nzOnOk)="deleteServiceTypeOk(notificationModel)" nzClassName="deleteModel deleteServiceTypeModel" nzCancelText=" {{'i18nTextDefine_Cancel' | translate}} " nzOkText=" {{'i18nTextDefine_modelOk' | translate}} "> <h3><span style="color: red">* </span> {{"i18nTextDefine_Input_Sure_deleteServiceType" | translate}} </h3> <div class="question"> <h4> {{"i18nTextDefine_CustomerName" | translate}} :</h4> @@ -107,5 +107,25 @@ <div class="deleteModelContent">{{thisdeleteServiceType["type"]}}</div> </div> </nz-modal> - + <!--2019.08.14 add notification--> + <ng-template #notificationModel > + <div class="ant-notification-notice-content"> + <div class="ant-notification-notice-with-icon"> + <span class="ant-notification-notice-icon"> + <img src="{{this.notificationAttributes.imgPath}}" alt="{{notificationAttributes.status}}"> + </span> + <div class="ant-notification-notice-message" *ngIf="notificationAttributes.title == 'Customer'"> + {{"i18nTextDefine_"+notificationAttributes.title | translate}} + {{"i18nTextDefine_"+notificationAttributes.action | translate}} {{"i18nTextDefine_"+notificationAttributes.status | translate}} + </div> + <div class="ant-notification-notice-description"> + <div class="notificationlist"> + <p>{{"i18nTextDefine_"+notificationAttributes.title | translate}}:</p> + <span>{{ notificationAttributes.name }}</span> + </div> + </div> + <div class="close-icons">{{"i18nTextDefine_Close" | translate}}</div> + </div> + </div> + </ng-template> </div>
\ No newline at end of file diff --git a/usecaseui-portal/src/app/components/customer/customer.component.ts b/usecaseui-portal/src/app/components/customer/customer.component.ts index f59f72bf..d4d843ff 100644 --- a/usecaseui-portal/src/app/components/customer/customer.component.ts +++ b/usecaseui-portal/src/app/components/customer/customer.component.ts @@ -13,9 +13,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit, TemplateRef} from '@angular/core'; import { ManagemencsService } from '../../managemencs.service'; - +import { NzNotificationService } from 'ng-zorro-antd'; @Component({ selector: 'app-customer', templateUrl: './customer.component.html', @@ -24,7 +24,11 @@ import { ManagemencsService } from '../../managemencs.service'; export class CustomerComponent implements OnInit { public chose = ''; - constructor(private managemencs: ManagemencsService) { } + constructor( + private managemencs: ManagemencsService, + private notification: NzNotificationService + ) { + } ngOnInit() { this.getAllCustomers(); @@ -43,7 +47,28 @@ export class CustomerComponent implements OnInit { addNewServiceType = null; deleteCustomerModelVisible = false; deleteServiceTypeModelVisible = false; - + //2019.08.14 add + notificationAttributes = { + "title":"Customer", + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"Create", + "status":"InProgress", + "name":"" + }; + notificationModelShow(template: TemplateRef<{}>): void { + console.log(this.notificationAttributes,"notificationModelShow show"); + this.notification.template(template); + } + notificationSuccess(notificationModel){ + this.notificationAttributes.imgPath = "../../../assets/images/execute-success.png"; + this.notificationAttributes.status = "Success"; + this.notificationModelShow(notificationModel); + } + notificationFailed(notificationModel){ + this.notificationAttributes.imgPath = "../../../assets/images/execute-faild.png"; + this.notificationAttributes.status = "Failed"; + this.notificationModelShow(notificationModel); + } getAllCustomers() { this.managemencs.getAllCustomers().subscribe((data) => { this.AllCustomersdata = data.map((item) => { @@ -359,18 +384,28 @@ export class CustomerComponent implements OnInit { }) } - createNewCustomer() { + createNewCustomer(notificationModel) { let createParams = { customerId: this.addNewCustomer, 'global-customer-id':this.addNewCustomer, 'subscriber-name':this.addNewCustomer, 'subscriber-type':'INFRA' }; + this.notificationAttributes = { + "title":"Customer", + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"Create", + "status":"InProgress", + "name":this.addNewCustomer + }; + this.notificationModelShow(notificationModel); this.managemencs.createCustomer(this.addNewCustomer, createParams).subscribe((data) => { if (data["status"] == 'SUCCESS') { + this.notificationSuccess(notificationModel); this.getAllCustomers(); console.log(data, "Interface returned success") } else { + this.notificationFailed(notificationModel); console.log(data, "Interface returned error") } }) @@ -388,48 +423,68 @@ export class CustomerComponent implements OnInit { deleteCustomerCancel() { this.deleteCustomerModelVisible = false; } - deleteCustomerOk() { + deleteCustomerOk(notificationModel) { this.deleteCustomerModelVisible = false; - this.getCustomerVersion(this.thisdeleteCustomer); + this.getCustomerVersion(this.thisdeleteCustomer,notificationModel); + this.notificationAttributes = { + "title":"Customer", + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"delete", + "status":"InProgress", + "name":this.thisdeleteCustomer.name + }; + this.notificationModelShow(notificationModel); } - getCustomerVersion(thisdeleteCustomer){ + getCustomerVersion(thisdeleteCustomer,notificationModel){ this.managemencs.getdeleteCustomerVersion(thisdeleteCustomer).subscribe((data) => { if (data["status"] == 'SUCCESS') { let params = { customerId:thisdeleteCustomer.id, version:data["result"]["resource-version"] }; - this.deleteCustomer(params); + this.deleteCustomer(params,notificationModel); console.log(data, "Interface returned success") } else { console.log(data, "Interface returned error") } }) } - deleteCustomer(params){ + deleteCustomer(params,notificationModel){ this.managemencs.deleteSelectCustomer(params).subscribe((data) => { if (data["status"] == 'SUCCESS') { + this.notificationSuccess(notificationModel); this.getAllCustomers(); console.log(data, "Interface returned success") } else { + this.notificationFailed(notificationModel); console.log(data, "Interface returned error") } }) } - createNewServiceType() { + createNewServiceType(notificationModel) { let createParams = { customer: this.selectCustomer, ServiceType: this.addNewServiceType, "service-type":this.addNewServiceType, "temp-ub-sub-account-id":"sotnaccount" }; + this.notificationAttributes = { + "title":"ServiceType", + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"Create", + "status":"InProgress", + "name":this.addNewServiceType + }; + this.notificationModelShow(notificationModel); this.managemencs.createServiceType(createParams).subscribe((data) => { if (data["status"] == 'SUCCESS') { + this.notificationSuccess(notificationModel); this.getCustomersColumn(this.selectCustomer); this.getAllCustomers(); console.log(data, "Interface returned success") } else { + this.notificationFailed(notificationModel); console.log(data, "Interface returned error") } }) @@ -446,15 +501,23 @@ export class CustomerComponent implements OnInit { deleteServiceTypeCancel() { this.deleteServiceTypeModelVisible = false; } - deleteServiceTypeOk() { + deleteServiceTypeOk(notificationModel) { this.deleteServiceTypeModelVisible = false; - this.getServiceTypeVersion(); + this.getServiceTypeVersion(notificationModel); } - getServiceTypeVersion() { + getServiceTypeVersion(notificationModel) { let paramss = { customerId: this.selectCustomer, ServiceType: this.thisdeleteServiceType["type"] }; + this.notificationAttributes = { + "title":"ServiceType", + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"delete", + "status":"InProgress", + "name":this.thisdeleteServiceType["type"] + }; + this.notificationModelShow(notificationModel); this.managemencs.getdeleteServiceTypeVersion(paramss).subscribe((data) => { console.log(data) if (data["status"] == 'SUCCESS') { @@ -463,21 +526,23 @@ export class CustomerComponent implements OnInit { ServiceType:this.thisdeleteServiceType["type"], version:data["result"]["resource-version"] }; - this.deleteServiceType(params); + this.deleteServiceType(params,notificationModel); console.log(data, "Interface returned success") } else { console.log(data, "Interface returned error") } }) } - deleteServiceType(params){ + deleteServiceType(params,notificationModel){ this.managemencs.deleteSelectServiceType(params).subscribe((data) => { if (data["status"] == 'SUCCESS') { + this.notificationSuccess(notificationModel); this.getServiceTypes(params.customerId); this.getCustomersColumn(params.customerId); this.getAllCustomers(); console.log(data, "Interface returned success") } else { + this.notificationFailed(notificationModel); console.log(data, "Interface returned error") } }) diff --git a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html index 81b77fbb..70ee81c0 100644 --- a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html +++ b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.html @@ -100,9 +100,9 @@ <td>{{item.nsdUsageState}}</td> <td> <i [ngClass]="{'cannotclick':onboardData.status == 'onboarding' && i == currentIndex}" - class="anticon anticon-upload upicon" #upload_icon (click)="updataNsService(item.uuid,i)" + class="anticon anticon-upload upicon" #upload_icon (click)="updataNsService(item.uuid,i,notificationModel)" *ngIf="item.uuid"></i> - <i class="anticon anticon-delete" nzType="info" (click)="showConfirm(i,item.id,tab)" + <i class="anticon anticon-delete" nzType="info" (click)="showConfirm(i,item.id,tab,notificationModel)" *ngIf="item.id"></i> <!--<span *ngIf="item.id" [ngClass]="{'fileIcon':OnboardFile == 'disNone'}">--> <!--<span *ngIf="item.id && item.sameid == undefined">--> @@ -199,9 +199,9 @@ <td>{{item.usageState}}</td> <td> <i [ngClass]="{'cannotclick':onboardData.status == 'onboarding' && i == currentIndex}" - class="anticon anticon-upload upicon" #upload_icon (click)="updataVnfService(item.uuid,i)" + class="anticon anticon-upload upicon" #upload_icon (click)="updataVnfService(item.uuid,i,notificationModel)" *ngIf="item.uuid"></i> - <i class="anticon anticon-delete" nzType="info" (click)="showConfirm(i,item.id,tab)" + <i class="anticon anticon-delete" nzType="info" (click)="showConfirm(i,item.id,tab,notificationModel)" *ngIf="item.id"></i> <!--<span *ngIf="item.id && item.sameid == undefined">--> <!--<nz-upload [(nzFileList)]="fileList" [nzBeforeUpload]="beforeUpload">--> @@ -289,7 +289,7 @@ <td>{{item.pnfdOnboardingState}}</td> <td>{{item.pnfdUsageState}}</td> <td> - <i class="anticon anticon-delete" nzType="info" (click)="showConfirm(i,item.id,tab)"></i> + <i class="anticon anticon-delete" nzType="info" (click)="showConfirm(i,item.id,tab,notificationModel)"></i> <!--<span *ngIf="item.id" [ngClass]="{'fileIcon':OnboardFile == 'disNone'}">--> <!--<nz-upload [(nzFileList)]="fileList" [nzBeforeUpload]="beforeUpload">--> <!--<i class="anticon anticon-file" type="upload" (click)="onClickId(item.id,tab)"></i>--> @@ -308,5 +308,26 @@ </div> </nz-tab> + <!--2019.08.14 add notification--> + <ng-template #notificationModel > + <div class="ant-notification-notice-content"> + <div class="ant-notification-notice-with-icon"> + <span class="ant-notification-notice-icon"> + <img src="{{notificationAttributes.imgPath}}" alt="{{notificationAttributes.status}}"> + </span> + <div class="ant-notification-notice-message"> + {{notificationAttributes.title}} + {{"i18nTextDefine_"+notificationAttributes.action | translate}} {{"i18nTextDefine_"+notificationAttributes.status | translate}} + </div> + <div class="ant-notification-notice-description"> + <div class="notificationlist"> + <p>{{notificationAttributes.title}} id: </p> + <span>{{ notificationAttributes.id }}</span> + </div> + </div> + <div class="close-icons">{{"i18nTextDefine_Close" | translate}}</div> + </div> + </div> + </ng-template> </nz-tabset> diff --git a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts index ac880f4a..f65a9560 100644 --- a/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts +++ b/usecaseui-portal/src/app/services/onboard-vnf-vm/onboard-vnf-vm.component.ts @@ -14,7 +14,8 @@ limitations under the License. */ import { HttpClient, HttpRequest, HttpResponse } from '@angular/common/http'; -import { Component, OnInit, HostBinding } from '@angular/core'; +import {Component, OnInit, HostBinding, TemplateRef} from '@angular/core'; +import { NzNotificationService } from 'ng-zorro-antd'; // import { MyhttpService } from '../../myhttp.service'; import { onboardService } from '../../onboard.service'; import { slideToRight } from '../../animates'; @@ -22,7 +23,6 @@ import { NzMessageService, UploadFile, NzModalRef, NzModalService } from 'ng-zor import { filter } from 'rxjs/operators'; import { Title } from '@angular/platform-browser'; import * as $ from 'jquery'; -import { NzNotificationService } from 'ng-zorro-antd'; @Component({ @@ -61,8 +61,15 @@ export class OnboardVnfVmComponent implements OnInit { //vnf: 'https://jsonplaceholder.typicode.com/posts/', //pnf: 'https://jsonplaceholder.typicode.com/posts/', }; - constructor(private myhttp: onboardService, private http: HttpClient, private msg: NzMessageService,private titleService: Title,private modal: NzModalService, private modalService: NzModalService) { } - + constructor( + private myhttp: onboardService, + private http: HttpClient, + private msg: NzMessageService, + private titleService: Title, + private modal: NzModalService, + private modalService: NzModalService, + private notification: NzNotificationService + ) { } //default Call ns data by default ngOnInit() { this.getTableData(); @@ -90,6 +97,28 @@ export class OnboardVnfVmComponent implements OnInit { tabs = ['NS', 'VNF', 'PNF']; isSpinning = false; + //2019.08.14 add + notificationAttributes = { + "title":this.tabs[0], + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"OnboardingState", + "status":"InProgress", + "id":null + }; + notificationModelShow(template: TemplateRef<{}>): void { + console.log(this.notificationAttributes,"notificationModelShow show"); + this.notification.template(template); + } + notificationSuccess(notificationModel){ + this.notificationAttributes.imgPath = "../../../assets/images/execute-success.png"; + this.notificationAttributes.status = "Success"; + this.notificationModelShow(notificationModel); + } + notificationFailed(notificationModel){ + this.notificationAttributes.imgPath = "../../../assets/images/execute-faild.png"; + this.notificationAttributes.status = "Failed"; + this.notificationModelShow(notificationModel); + } // Handling tab switching request data handleTabChange(tab) { this.tabTitle = tab; @@ -571,25 +600,35 @@ changeUploadingSta(tab) { } currentIndex = 0; // ns onboard Upload button - updataNsService(id,index) { + updataNsService(id,index,notificationModel) { this.currentIndex = index; this.onboardData.status = "onboarding"; //Disabled this.onboardData.progress = 0; console.log("NS-onboard-id-->" + id); let requestBody = { "csarId": id - } + }; + this.notificationAttributes = { + "title":this.tabs[0], + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"OnboardingState", + "status":"InProgress", + "id":id + }; + this.notificationModelShow(notificationModel); this.myhttp.getNsonboard(requestBody) .subscribe((data) => { console.log('onboard ns sdc-->', data); if(data.status == "failed"){ console.log("Package Onboard Failed") this.onboardData.status = "Failed"; + this.notificationFailed(notificationModel); this.error(); return false }else if(data.status == "success"){ this.success("NS"); this.onboardData.status = "onboarded"; + this.notificationSuccess(notificationModel); } }, (err) => { console.log(err); @@ -597,7 +636,7 @@ changeUploadingSta(tab) { } // vnf onboard Upload button - updataVnfService(id,index) { + updataVnfService(id,index,notificationModel) { this.currentIndex = index; this.onboardData.status = "onboarding"; //Disabled button this.onboardData.progress = 0; @@ -605,13 +644,21 @@ changeUploadingSta(tab) { console.log("VNF-onboard-id-->" + id) let requestBody = { "csarId": id - } + }; + this.notificationAttributes = { + "title":this.tabs[1], + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"OnboardingState", + "status":"InProgress", + "id":id + }; + this.notificationModelShow(notificationModel); this.myhttp.getVnfonboard(requestBody) .subscribe((data) => { console.log('onboard vnf sdc-->', data); this.jobId = data.jobId; console.log('onboard vnf sdc jobId-->'+ data.jobId); - this.queryProgress(this.jobId,0); //vnf Need to query progress interface + this.queryProgress(this.jobId,0,notificationModel); //vnf Need to query progress interface }, (err) => { console.log(err); }) @@ -623,7 +670,7 @@ changeUploadingSta(tab) { // } //Progress Progress inquiry - queryProgress(jobId,responseId){ + queryProgress(jobId,responseId,notificationModel){ let mypromise = new Promise((res)=>{ this.myhttp.getProgress(jobId,responseId) .subscribe((data)=>{ @@ -633,7 +680,7 @@ changeUploadingSta(tab) { console.log("progress == undefined"); this.onboardData.status = "onboarding"; setTimeout(()=>{ - this.queryProgress(this.jobId,0); + this.queryProgress(this.jobId,0,notificationModel); },10000) return false } @@ -641,6 +688,7 @@ changeUploadingSta(tab) { console.log("progress-->",data.responseDescriptor.progress) console.log("Package Onboard Failed") this.onboardData.status = "Failed"; + this.notificationFailed(notificationModel); this.error(); return false } @@ -648,7 +696,7 @@ changeUploadingSta(tab) { this.onboardData.status = "onboarding"; console.log("progress < 100") setTimeout(()=>{ - this.queryProgress(this.jobId,0); + this.queryProgress(this.jobId,0,notificationModel); },5000) }else if(data.responseDescriptor.progress == 100){ res(data); @@ -656,7 +704,8 @@ changeUploadingSta(tab) { console.log(data); this.success("VNF"); this.onboardData.status = "onboarded"; - } + this.notificationSuccess(notificationModel); + } return false }) }) @@ -665,7 +714,14 @@ changeUploadingSta(tab) { //-------------------------------------------------------------------------------- /* delete button */ - showConfirm(index,pkgid,tab): void { + showConfirm(index,pkgid,tab,notificationModel): void { + this.notificationAttributes = { + "title":this.tabs[0], + "imgPath":"../../../../assets/images/execute-inproess.png", + "action":"OnboardingState", + "status":"InProgress", + "id":pkgid + }; this.confirmModal = this.modal.confirm({ nzTitle: 'Do you Want to delete these items?', nzContent: 'Do you Want to delete these items?', @@ -674,15 +730,21 @@ changeUploadingSta(tab) { nzOnOk: () => new Promise((resolve, reject) => { switch (tab) { case 'NS': - this.deleteNsService(index,pkgid); + this.notificationAttributes.title = this.tabs[0]; + this.notificationModelShow(notificationModel); + this.deleteNsService(index,pkgid,notificationModel); setTimeout(Math.random() > 0.5 ? resolve : reject,2000); break case 'VNF': - this.deleteVnfService(index,pkgid); + this.notificationAttributes.title = this.tabs[1]; + this.notificationModelShow(notificationModel); + this.deleteVnfService(index,pkgid,notificationModel); setTimeout(Math.random() > 0.5 ? resolve : reject,2000); break case 'PNF': - this.deletePnfService(index,pkgid); + this.notificationAttributes.title = this.tabs[2]; + this.notificationModelShow(notificationModel); + this.deletePnfService(index,pkgid,notificationModel); setTimeout(Math.random() > 0.5 ? resolve : reject,2000); break } @@ -691,44 +753,50 @@ changeUploadingSta(tab) { } //delete nsItem - deleteNsService(index,pkgid) { + deleteNsService(index,pkgid,notificationModel) { console.log(pkgid) console.log("deleteService!"); this.myhttp.deleteNsIdData(pkgid) .subscribe((data) => { console.log("nsdel--->", data); + this.notificationSuccess(notificationModel); //refresh list after successful deletion this.getTableData(); }, (err) => { console.log(err); + this.notificationFailed(notificationModel); }) } //delete vnfItem - deleteVnfService(index,pkgid) { + deleteVnfService(index,pkgid,notificationModel) { console.log(pkgid) console.log("deleteVnfService!"); this.myhttp.deleteVnfIdData(pkgid) .subscribe((data) => { console.log('vnfdel--->', data); + this.notificationSuccess(notificationModel); //refresh list after successful deletion this.getTableVnfData() }, (err) => { console.log(err); + this.notificationFailed(notificationModel); }) } //delete PnfItem - deletePnfService(index,pkgid) { + deletePnfService(index,pkgid,notificationModel) { console.log(pkgid) console.log("deletePnfService!"); this.myhttp.deletePnfIdData(pkgid) .subscribe((data) => { console.log('pnfdel--->', data); //refresh list after successful deletion + this.notificationSuccess(notificationModel); this.getTablePnfData() }, (err) => { console.log(err); + this.notificationFailed(notificationModel); }) } diff --git a/usecaseui-portal/src/app/services/services-list/services-list.component.ts b/usecaseui-portal/src/app/services/services-list/services-list.component.ts index 5856442e..a17c195d 100644 --- a/usecaseui-portal/src/app/services/services-list/services-list.component.ts +++ b/usecaseui-portal/src/app/services/services-list/services-list.component.ts @@ -275,7 +275,7 @@ export class ServicesListComponent implements OnInit { pageIndex = 1; pageSize = 10; total = 100; - loading = false; + loading = true; getTableData(){ @@ -288,6 +288,7 @@ export class ServicesListComponent implements OnInit { } this.myhttp.getServicesTableData(paramsObj) .subscribe((data)=>{ + this.loading = false; console.log(data); this.total = data.body.total; this.tableData = data.body.tableList.map((item)=>{ |