diff options
author | Tao Shen <shentao@chinamobile.com> | 2019-09-29 10:26:47 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-29 10:26:47 +0000 |
commit | cdbcd0fe038918c360e8e8b2fc04d57e14e22b1c (patch) | |
tree | 6f86928f930e91ae1991237422d175027f10e70d /usecaseui-portal/src/app/views/services | |
parent | d59d5304f12591bd8d2d5c93e29b596b7b59e6c3 (diff) | |
parent | 083b5b3df111e14225c2b254ec621a66793b9b8d (diff) |
Merge "feat: reduce unnecessary request code"
Diffstat (limited to 'usecaseui-portal/src/app/views/services')
-rw-r--r-- | usecaseui-portal/src/app/views/services/onboard-vnf-vm/onboard-vnf-vm.component.ts | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/usecaseui-portal/src/app/views/services/onboard-vnf-vm/onboard-vnf-vm.component.ts b/usecaseui-portal/src/app/views/services/onboard-vnf-vm/onboard-vnf-vm.component.ts index ed6f0d74..b57eab6a 100644 --- a/usecaseui-portal/src/app/views/services/onboard-vnf-vm/onboard-vnf-vm.component.ts +++ b/usecaseui-portal/src/app/views/services/onboard-vnf-vm/onboard-vnf-vm.component.ts @@ -20,7 +20,6 @@ import { onboardService } from '../../../core/services/onboard.service'; import { slideToRight } from '../../../shared/utils/animates'; import { NzMessageService, UploadFile, NzModalRef, NzModalService } from 'ng-zorro-antd'; import { filter } from 'rxjs/operators'; -import { Title } from '@angular/platform-browser'; @Component({ selector: 'app-onboard-vnf-vm', @@ -104,6 +103,7 @@ export class OnboardVnfVmComponent implements OnInit { handleTabChange(tab: string): void { this.currentTab = tab; this.fileList = []; + this.display = 'block'; delete this.file; switch (tab) { case 'NS': @@ -149,20 +149,8 @@ export class OnboardVnfVmComponent implements OnInit { // Drag and drop and click the upload button onClick(): void { this.display = 'none'; - switch (this.currentTab) { - case 'NS': - this.handleUpload(this.url.ns.replace("*_*", this.infoId)); - this.getTableData(); - break - case 'VNF': - this.handleUpload(this.url.vnf.replace("*_*", this.infoId)); - this.getTableVnfData() - break - case 'PNF': - this.handleUpload(this.url.pnf.replace("*_*", this.infoId)); - this.getTablePnfData(); - break - } + let tab = this.currentTab === 'NS' ? 'ns' : (this.currentTab === 'VNF' ? 'vnf' : 'pnf') + this.handleUpload(this.url[tab].replace("*_*", this.infoId)); } handleUpload(url: string): void { @@ -200,9 +188,9 @@ export class OnboardVnfVmComponent implements OnInit { (event: {}) => { this.file.progress = 100; this.file.status = false; - this.display = 'block'; this.uploading = false; this.msg.success('upload successfully.'); + this.currentTab === 'NS' ? this.getTableData() : (this.currentTab === 'VNF' ? this.getTableVnfData() : this.getTablePnfData()); }, err => { this.file.progress = 100; |