@Input() moduleTitle: string;
@Input() showProcess: boolean;
@Input() taskId: string;
+ @Input() moduleOperation: string;
@Output() cancel = new EventEmitter<boolean>();
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 {
// 匹配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 = [];
} else {
this.message.error('Failed to get progress')
}
+ this.isLoadingShow();
+ }, ({status, statusText}) => {
+ this.message.error(status + ' (' + statusText + ')');
+ this.isLoadingShow();
})
}
<app-check-process-model
[moduleTitle]="moduleTitle"
[showProcess]="showProcess"
+ [moduleOperation]="moduleOperation"
[taskId]="taskId"
(cancel)="showProcess = $event"
>
selectedValue = 'all';
taskId: string;
moduleTitle: string = "";
+ moduleOperation: string;
listOfData: any[] = [];
statusOptions: any[] = TASK_PROCESSING_STATUS;
loading: boolean = false;
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;
})
}
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;
})
}
if (data.processing_status === 'Waiting to Confirm') {
this.showDetail = true;
} else {
+ this.moduleOperation = data.operation;
this.showProcess = true;
}
}
} else {
this.message.error('Failed to get data')
}
+ },({status, statusText}) => {
+ this.message.error(status + ' (' + statusText + ')');
+ this.isSpinning = false;
})
}
this.slicingInstances.isLoading = false;
this.slicingInstances.flag = false;
},2000)
-
+ }, ({status, statusText}) => {
+ this.message.error(status + ' (' + statusText + ')');
+ this.slicingInstances.isLoading = false;
+ this.slicingInstances.flag = false;
})
}
} 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) {
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;
})
}
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) {
}
this.loading = false;
this.handleCancel(true);
+ }, ({status, statusText}) => {
+ this.message.error(status + ' (' + statusText + ')');
+ this.loading = false;
})
}
}
},\r
{\r
title: 'Waiting to Confirm',\r
- value: 'Waiting to Confirm'\r
+ value: 'WaitingtoConfirm'\r
},\r
{\r
title: 'Creating',\r