summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal
diff options
context:
space:
mode:
Diffstat (limited to 'usecaseui-portal')
-rw-r--r--usecaseui-portal/src/app/mock/routes.js7
-rw-r--r--usecaseui-portal/src/app/mock/server.js3
-rw-r--r--usecaseui-portal/src/app/shared/components/notification/notification.component.html16
-rw-r--r--usecaseui-portal/src/app/shared/components/notification/notification.component.ts4
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.html15
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-management.component.ts78
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html5
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts22
8 files changed, 119 insertions, 31 deletions
diff --git a/usecaseui-portal/src/app/mock/routes.js b/usecaseui-portal/src/app/mock/routes.js
index 56ff27c3..b25ada4f 100644
--- a/usecaseui-portal/src/app/mock/routes.js
+++ b/usecaseui-portal/src/app/mock/routes.js
@@ -100,13 +100,14 @@ module.exports =
"/uui-slicing/nsmf/resource/nssi/:environmentContext/instances/pageNo/:pageNo/pageSize/:pageSize": "/slicing_subnet_context",
"/uui-slicing/nsmf/task/:taskId/taskCreationInfo": "/slicing_taskCreationInfo",
"/uui-slicing/nsmf/task/:taskId/taskCreationProgress": "/slicing_taskCreationProgress",
+ "/PUT/uui-slicing/nsmf/task/auditInfo": "/PUT_task_auditInfo",
///////<-------------slicing_business--------->/////
"/uui-slicing/nsmf/resource/business/pageNo/:pageNo/pageSize/:pageSize": "/slicing_business_list",
"/uui-slicing/nsmf/resource/:businessStatus/business/pageNo/:pageNo/pageSize/:pageSize": "/slicing_business_list_activated",
- "/uui-slicing/nsmf/resource/:serviceId/activate": "/slicing_business_activate",
- "/uui-slicing/nsmf/resource/:serviceId/deactivate": "/slicing_business_activate",
- "/uui-slicing/nsmf/resource/:serviceId": "/slicing_business_activate",
+ "/PUT/uui-slicing/nsmf/resource/:serviceId/activate": "/slicing_business_activate",
+ "/PUT/uui-slicing/nsmf/resource/:serviceId/deactivate": "/slicing_business_activate",
+ "/DELETE/uui-slicing/nsmf/resource/:serviceId": "/slicing_business_activate",
"/uui-slicing/nsmf/resource/:serviceId/progress":"/getSlicingBusinessProgress",
///////<-------------slicing_nsi--------->/////
"/uui-slicing/nsmf/resource/nsi/:instanceStatus/instances/pageNo/:pageNo/pageSize/:pageSize": "/slicing_nsi_list_activated",
diff --git a/usecaseui-portal/src/app/mock/server.js b/usecaseui-portal/src/app/mock/server.js
index f8e6b194..930f500b 100644
--- a/usecaseui-portal/src/app/mock/server.js
+++ b/usecaseui-portal/src/app/mock/server.js
@@ -105,14 +105,17 @@ server.delete(`${baseUrl}/*`, (req, res, next) => {
})
server.put(`${nsmfBaseUrl}/*`, (req, res, next) => {
req.method = 'GET';
+ req.url = '/PUT'+req.url;
next();
})
server.post(`${nsmfBaseUrl}/*`, (req, res, next) => {
req.method = 'GET';
+ req.url = '/POST'+req.url;
next();
})
server.delete(`${nsmfBaseUrl}/*`, (req, res, next) => {
req.method = 'GET';
+ req.url = '/DELETE'+req.url;
next();
})
diff --git a/usecaseui-portal/src/app/shared/components/notification/notification.component.html b/usecaseui-portal/src/app/shared/components/notification/notification.component.html
index f20fd48c..0a40da9a 100644
--- a/usecaseui-portal/src/app/shared/components/notification/notification.component.html
+++ b/usecaseui-portal/src/app/shared/components/notification/notification.component.html
@@ -5,7 +5,7 @@
<img src="{{notificationAttributes.imgPath}}" alt="{{notificationAttributes.status}}">
</span>
<!-- customer&onboard -->
- <div *ngIf="!isServicesList">
+ <div *ngIf="!isServicesList && !parentComponent">
<div class="ant-notification-notice-message">
{{(notificationAttributes.action === 'OnboardingState'? notificationAttributes.title : "i18nTextDefine_"+notificationAttributes.title) | translate}}&nbsp;
{{"i18nTextDefine_"+notificationAttributes.action | translate}}&nbsp;&nbsp;{{"i18nTextDefine_"+notificationAttributes.status | translate}}
@@ -45,6 +45,20 @@
</div>
<div class="close-icons">{{"i18nTextDefine_Close" | translate}}</div>
</div>
+ <!-- slicing -->
+ <div *ngIf="!isServicesList && parentComponent">
+ <div class="ant-notification-notice-message">
+ {{ notificationAttributes.title}}&nbsp;
+ {{ notificationAttributes.action }}&nbsp;&nbsp;{{notificationAttributes.status}}
+ </div>
+ <div class="ant-notification-notice-description">
+ <div class="notificationlist">
+ <p>{{notificationAttributes.title}} id:&nbsp;</p>
+ <span>{{ notificationAttributes.name }}</span>
+ </div>
+ </div>
+ <div class="close-icons">{{"i18nTextDefine_Close" | translate}}</div>
+ </div>
</div>
</div>
</ng-template>
diff --git a/usecaseui-portal/src/app/shared/components/notification/notification.component.ts b/usecaseui-portal/src/app/shared/components/notification/notification.component.ts
index de0df083..18f91b35 100644
--- a/usecaseui-portal/src/app/shared/components/notification/notification.component.ts
+++ b/usecaseui-portal/src/app/shared/components/notification/notification.component.ts
@@ -9,6 +9,7 @@ import { NzNotificationService } from 'ng-zorro-antd';
export class NotificationComponent implements OnInit {
@ViewChild('notificationModel')notificationModel: any;
@Input()isServicesList: boolean;
+ @Input()parentComponent: string;
@Input()customerSelected: object;
notificationAttributes: {
@@ -21,8 +22,7 @@ export class NotificationComponent implements OnInit {
constructor(private notification: NzNotificationService) { }
- ngOnInit() {
- }
+ ngOnInit() { }
setNotification({ title, imgPath, action, status, name }):void{
this.notificationAttributes = { title, imgPath, action, status, name };
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 76f0fcf5..943b946d 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
@@ -7,14 +7,25 @@
nzAllowClear
[(ngModel)]="selectedValue"
nzPlaceHolder="Select a processing status"
- (ngModelChange)="getListOfProcessingStatus()"
+ (ngModelChange)="processingStatusChange()"
>
<nz-option *ngFor="let item of statusOptions" [nzLabel]="item.title" [nzValue]="item.value"></nz-option>
</nz-select>
</div>
</div>
<div>
- <nz-table #basicTable [nzData]="listOfData">
+ <nz-table
+ #basicTable
+ nzShowPagination
+ nzPageSizeOptions
+ nzShowSizeChanger
+ [nzTotal]="total"
+ [nzLoading]="loading"
+ [nzData]="listOfData"
+ [nzFrontPagination]="false"
+ (nzPageSizeChange)="pageSizeChange($event)"
+ (nzPageIndexChange)="pageNumChange($event)"
+ >
<thead>
<tr>
<th>任务ID</th>
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 a3203695..26f485b9 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
@@ -1,4 +1,5 @@
import { Component, OnInit } from '@angular/core';
+import { NzMessageService } from 'ng-zorro-antd';
import * as moment from 'moment';
import { SlicingTaskServices } from '.././../../../core/services/slicingTaskServices';
import { TASK_PROCESSING_STATUS } from '../../../../../constants/constants';
@@ -10,11 +11,8 @@ import { TASK_PROCESSING_STATUS } from '../../../../../constants/constants';
})
export class SlicingTaskManagementComponent implements OnInit {
- constructor(private myhttp: SlicingTaskServices) { }
-
- ngOnInit() {
- this.getTaskList()
- }
+ constructor(private myhttp: SlicingTaskServices, private message: NzMessageService) { }
+
showDetail: boolean = false;
showProcess: boolean = false;
selectedValue = null;
@@ -22,26 +20,74 @@ export class SlicingTaskManagementComponent implements OnInit {
moduleTitle: string = "";
listOfData: any[] = [];
statusOptions: any[] = TASK_PROCESSING_STATUS;
+ loading: boolean = false;
+ total: number = 1;
+ pageSize: string = '10';
+ pageNum: string = '1';
+
+ ngOnInit() {
+ this.getTaskList()
+ }
getTaskList (): void{
- this.myhttp.getSlicingTaskList('1', '10').subscribe (res => {
- const { result_header: { result_code }, result_body: { slicing_task_list } } = res
+ const { pageNum, pageSize } = this;
+ this.loading = true;
+ this.myhttp.getSlicingTaskList(pageNum, pageSize).subscribe (res => {
+ const { result_header: { result_code }, result_body } = res
if (+result_code === 200) {
- this.dataFormatting(slicing_task_list)
- }
+ const { slicing_task_list, record_number } = result_body;
+ this.dataFormatting(slicing_task_list);
+ this.total = record_number;
+ } else {
+ this.message.error('Failed to get form data')
+ }
+ this.loading = false;
})
}
- getListOfProcessingStatus():void {
- const { selectedValue } = this;
- if (selectedValue) {
- this.myhttp.getTaskProcessingStatus(selectedValue, '1', '10').subscribe (res => {
- const { result_header: { result_code }, result_body: { slicing_task_list } } = res
+
+ processingStatusChange():void {
+ this.pageSize = '10';
+ this.pageNum = '1';
+ if (this.selectedValue) {
+ this.getListOfProcessingStatus();
+ } else {
+ this.getTaskList();
+ }
+ }
+
+ getListOfProcessingStatus (): void {
+ const { selectedValue, pageNum, pageSize } = this;
+ this.loading = true;
+ this.myhttp.getTaskProcessingStatus(selectedValue, pageNum+'', pageSize+'').subscribe (res => {
+ const { result_header: { result_code }, result_body } = res
if (+result_code === 200) {
+ const { slicing_task_list,record_number } = result_body;
this.dataFormatting(slicing_task_list)
- }
+ this.total = record_number;
+ } else {
+ this.message.error('Failed to get form data')
+ }
+ this.loading = false;
})
+ }
+
+ pageSizeChange (pageSize: number): void{
+ this.pageSize = pageSize + '';
+ const { selectedValue } = this;
+ if (selectedValue) {
+ this.getListOfProcessingStatus();
+ } else {
+ this.getTaskList();
+ }
+ }
+
+ pageNumChange (pageNum: number): void{
+ this.pageNum = pageNum + '';
+ const { selectedValue } = this;
+ if (selectedValue) {
+ this.getListOfProcessingStatus();
} else {
- this.getTaskList()
+ this.getTaskList();
}
}
diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html
index 19c83728..666fa16b 100644
--- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html
+++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.html
@@ -95,5 +95,6 @@
(paramsDataChange)="changeParams($event)"
>
</app-subnet-params-model>
-
-</nz-modal> \ No newline at end of file
+
+</nz-modal>
+<app-notification #notification [isServicesList]="false" [parentComponent]="'slicing'"></app-notification> \ No newline at end of file
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 9d0e3aec..ff64dfe1 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
@@ -1,4 +1,5 @@
-import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
+import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
+import { NzMessageService } from 'ng-zorro-antd';
import { SlicingTaskServices } from '../../../../../core/services/slicingTaskServices';
@Component({
@@ -11,8 +12,9 @@ export class SlicingTaskModelComponent implements OnInit {
@Input() moduleTitle: string;
@Input() taskId: string;
@Output() cancel = new EventEmitter<boolean>();
+ @ViewChild('notification') notification1: any;
- constructor(private http: SlicingTaskServices) { }
+ constructor(private http: SlicingTaskServices, private message: NzMessageService) { }
// 配置审核详情
checkDetail: any[] = [{}];
@@ -189,9 +191,12 @@ export class SlicingTaskModelComponent implements OnInit {
const { nsi_service_instances, record_number } = result_body;
this.slicingInstances.total = record_number;
this.slicingInstances.list.push(...nsi_service_instances);
- this.slicingInstances.isLoading = false;
- this.slicingInstances.flag = false;
+ } else {
+ this.message.error('Failed to get slicing instance ID')
}
+ this.slicingInstances.isLoading = false;
+ this.slicingInstances.flag = false;
+
})
}
@@ -203,6 +208,8 @@ export class SlicingTaskModelComponent implements OnInit {
const { result_header: { result_code }, result_body, record_number} = res;
if (+result_code === 200) {
this.subnetDataFormatting(result_body, record_number)
+ } else {
+ this.message.error('Failed to get slicing subnet instance ID')
}
})
this.slicingInstances.list.forEach (item => {
@@ -286,6 +293,8 @@ export class SlicingTaskModelComponent implements OnInit {
item.flag = false;
}
})
+ } else {
+ this.message.error('Failed to get slicing subnet instance ID');
}
})
}
@@ -335,11 +344,14 @@ export class SlicingTaskModelComponent implements OnInit {
}
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) {
- console.log('成功提交')
this.handleCancel();
+ this.notification1.notificationSuccess('Task', 'Sumbit', this.taskId)
+ } else {
+ this.notification1.notificationFailed('Task', 'Sumbit', this.taskId)
}
})
}