aboutsummaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts')
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/check-process-model/check-process-model.component.ts26
1 files changed, 14 insertions, 12 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 8a0ef970..95106050 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
@@ -92,23 +92,25 @@ export class CheckProcessModelComponent implements OnInit {
const { result_body, result_header: { result_code } } = res;
if (+result_code === 200) {
this.data = [];
- Object.keys(result_body).forEach(item => {
- let currentProgress = 1
- let status = 'process';
- if (+result_body[item] === 100) {
- currentProgress = 3;
- status = 'finish'
- }
- const title = item === 'an_progress' ? 'An' : (item === 'tn_progress' ? 'Tn' : 'Cn')
- let obj = { [item]: result_body[item], currentProgress, title, status };
- if (result_body[item]) {
+ const nssiList: string[] = ['an', 'tn', 'cn'];
+ nssiList.forEach( item => {
+ const progress: number = +result_body[item +'_progress'];
+ const title: string = item.charAt(0).toUpperCase() + item.slice(1);
+ let status: string = result_body[item +'_status'];
+ if ((progress || progress === 0) && status) {
+ let currentProgress = 1
+ if (progress === 100 && status === 'finished') {
+ currentProgress = 3;
+ status = 'finish'
+ }
+ const obj = { progress, currentProgress, title, status };
this.data.push(obj)
}
})
this.data = [this.data];
let flag: boolean = false;
- Object.values(result_body).forEach(item => {
- if (+item !== 100 && typeof item !== 'object') {
+ nssiList.forEach(item => {
+ if (result_body[item +'_status'] === 'processing' && result_body[item +'_progress'] !== 0) {
flag = true;
}
})