diff options
Diffstat (limited to 'usecaseui-portal')
5 files changed, 51 insertions, 22 deletions
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts index 797165f6..181eaf7a 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts @@ -12,6 +12,7 @@ export class CheckProcessModelComponent implements OnInit { @Input() moduleTitle: string; @Input() showProcess: boolean; @Input() taskId: string; + @Input() moduleOperation: string; @Output() cancel = new EventEmitter<boolean>(); @@ -41,11 +42,6 @@ export class CheckProcessModelComponent implements OnInit { getInfo(): void { this.http.getSlicingBasicInfo(this.taskId).subscribe(res => { - if (this.isGetData) { - this.isSpinning = false; - } else { - this.isGetData = true; - } const { result_body, result_header: { result_code } } = res; if (+result_code === 200) { const { @@ -73,19 +69,26 @@ export class CheckProcessModelComponent implements OnInit { // 匹配NST信息 this.NSTinfo = [nst_info]; } else { - const errorMessage = this.moduleTitle === '切片创建中' ? 'Failed to get data' : 'Viewing results failed'; - this.message.error(errorMessage) + const errorMessage = this.moduleOperation === 'Creating' ? 'Failed to get data' : 'Viewing results failed'; + this.message.error(errorMessage); } + this.isLoadingShow(); + }, ({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + this.isLoadingShow(); }) } + isLoadingShow () { + if (this.isGetData) { + this.isSpinning = false; + } else { + this.isGetData = true; + } + } + getProgress(): void { this.http.getSlicingCreateProgress(this.taskId).subscribe(res => { - if (this.isGetData) { - this.isSpinning = false; - } else { - this.isGetData = true; - } const { result_body, result_header: { result_code } } = res; if (+result_code === 200) { this.data = []; @@ -115,6 +118,10 @@ export class CheckProcessModelComponent implements OnInit { } else { this.message.error('Failed to get progress') } + this.isLoadingShow(); + }, ({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + this.isLoadingShow(); }) } diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html index 4a69cf7a..0fadf70a 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html @@ -76,6 +76,7 @@ <app-check-process-model [moduleTitle]="moduleTitle" [showProcess]="showProcess" + [moduleOperation]="moduleOperation" [taskId]="taskId" (cancel)="showProcess = $event" > diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts index 66adf7b4..1429adec 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts @@ -17,6 +17,7 @@ export class SlicingTaskManagementComponent implements OnInit { selectedValue = 'all'; taskId: string; moduleTitle: string = ""; + moduleOperation: string; listOfData: any[] = []; statusOptions: any[] = TASK_PROCESSING_STATUS; loading: boolean = false; @@ -38,9 +39,12 @@ export class SlicingTaskManagementComponent implements OnInit { this.dataFormatting(slicing_task_list); this.total = record_number; } else { - this.message.error('Failed to get form data') + this.message.error('Failed to get form data'); } this.loading = false; + },({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + this.loading = false; }) } @@ -64,9 +68,13 @@ export class SlicingTaskManagementComponent implements OnInit { this.dataFormatting(slicing_task_list) this.total = record_number; } else { - this.message.error('Failed to get form data') + this.message.error('Failed to get form data'); } this.loading = false; + }, ({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + this.listOfData = []; + this.loading = false; }) } @@ -120,6 +128,7 @@ export class SlicingTaskManagementComponent implements OnInit { if (data.processing_status === 'Waiting to Confirm') { this.showDetail = true; } else { + this.moduleOperation = data.operation; this.showProcess = true; } } diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts index 4bf55dde..bca8e75c 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts @@ -178,6 +178,9 @@ export class SlicingTaskModelComponent implements OnInit { } else { this.message.error('Failed to get data') } + },({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + this.isSpinning = false; }) } @@ -214,7 +217,10 @@ export class SlicingTaskModelComponent implements OnInit { this.slicingInstances.isLoading = false; this.slicingInstances.flag = false; },2000) - + }, ({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + this.slicingInstances.isLoading = false; + this.slicingInstances.flag = false; }) } @@ -229,6 +235,8 @@ export class SlicingTaskModelComponent implements OnInit { } else { this.message.error('Failed to get slicing subnet instance ID') } + }, ({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); }) this.slicingInstances.list.forEach (item => { if (item.service_instance_id === this.selectedServiceId) { @@ -305,16 +313,18 @@ export class SlicingTaskModelComponent implements OnInit { this.slicingSubnet.map (item => { if (item.context === context) { item.total = record_number; - setTimeout(() => { - item.instances.push(...nssi_service_instances); - item.isLoading = false; - item.flag = false; - },2000) + item.instances.push(...nssi_service_instances); } }) } else { this.message.error('Failed to get slicing subnet instance ID'); } + instance.isLoading = false; + instance.flag = false; + }, ({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + instance.isLoading = false; + instance.flag = false; }) } @@ -365,7 +375,6 @@ export class SlicingTaskModelComponent implements OnInit { delete businessRequirement[0].area let reqBody = {...checkDetail[0], business_demand_info: businessRequirement[0], nst_info: NSTinfo[0], nsi_nssi_info}; delete reqBody.service_snssai; - // this.notification1.notificationStart('Task', 'Sumbit', this.taskId) this.http.submitSlicing(reqBody).subscribe (res => { const { result_header: { result_code } } = res; if (+result_code === 200) { @@ -375,6 +384,9 @@ export class SlicingTaskModelComponent implements OnInit { } this.loading = false; this.handleCancel(true); + }, ({status, statusText}) => { + this.message.error(status + ' (' + statusText + ')'); + this.loading = false; }) } } diff --git a/usecaseui-portal/src/constants/constants.ts b/usecaseui-portal/src/constants/constants.ts index fa3c682e..d35c4c75 100644 --- a/usecaseui-portal/src/constants/constants.ts +++ b/usecaseui-portal/src/constants/constants.ts @@ -9,7 +9,7 @@ export const TASK_PROCESSING_STATUS = [ },
{
title: 'Waiting to Confirm',
- value: 'Waiting to Confirm'
+ value: 'WaitingtoConfirm'
},
{
title: 'Creating',
|