diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-12-09 18:24:43 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-12-09 18:24:49 +0800 |
commit | 31509ed10df8d254647bbad39739f42b378cff90 (patch) | |
tree | 8d2763b2e9070f43a23817980315b3bdcf049f77 /usecaseui-portal/src/app | |
parent | 2ec3c8dbf2644f3e99e5494620b2811c5dccbac0 (diff) |
feat: support jonit test
Change-Id: Id337965c68f9636cab8dc14b9ba91773bdefebe3
Issue-ID: USECASEUI-352
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app')
4 files changed, 109 insertions, 127 deletions
diff --git a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts index bf74fea7..69916c66 100644 --- a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts +++ b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts @@ -20,7 +20,7 @@ import { Observable } from 'rxjs/Observable'; @Injectable()
export class SlicingTaskServices {
constructor(private http: HttpClient) { }
- baseUrl: string = '/api/uui-slicing/nsmf';
+ baseUrl: string = '/api/usecaseui-server/v1/uui-slicing/nsmf';
url = {
slicingTaskList: this.baseUrl + "/task/business/pageNo/{pageNo}/pageSize/{pageSize}",
taskProcessingStatus: this.baseUrl + '/task/{processingStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}',
@@ -28,102 +28,102 @@ export class SlicingTaskServices { slicingInstance: this.baseUrl + '/resource/nsi/instances/pageNo/{pageNo}/pageSize/{pageSize}',
slicingSubnetInstance: this.baseUrl + '/resource/nsi/{nsiId}/nssiInstances',
subnetInContext: this.baseUrl + '/resource/nssi/{environmentContext}/instances/pageNo/{pageNo}/pageSize/{pageSize}',
- submitSlicing: this.baseUrl + '/task/auditInfo',
+ submitSlicing: this.baseUrl + '/task/auditInfo',
slicingBasicInfo: this.baseUrl + '/task/{taskId}/taskCreationInfo',
slicingCreateProgress: this.baseUrl + '/task/{taskId}/taskCreationProgress',
//slicing-business-management
- slicingBusinessList:this.baseUrl+"/resource/business/pageNo/{pageNo}/pageSize/{pageSize}",
- slicingBusinesQueryOfStatus:this.baseUrl+"/resource/{businessStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}",
- activateSlicingService:this.baseUrl+"/resource/{serviceId}/activate",
- deactivateSlicingService:this.baseUrl+"/resource/{serviceId}/deactivate",
- terminateSlicingService:this.baseUrl+"/resource/{serviceId}",
- queryOperationProgress:this.baseUrl+"/resource/{serviceId}/progress",
- slicingBusinessDetail:this.baseUrl+"/resource/business/{businessId}/details",
+ slicingBusinessList: this.baseUrl + "/resource/business/pageNo/{pageNo}/pageSize/{pageSize}",
+ slicingBusinesQueryOfStatus: this.baseUrl + "/resource/{businessStatus}/business/pageNo/{pageNo}/pageSize/{pageSize}",
+ activateSlicingService: this.baseUrl + "/resource/{serviceId}/activate",
+ deactivateSlicingService: this.baseUrl + "/resource/{serviceId}/deactivate",
+ terminateSlicingService: this.baseUrl + "/resource/{serviceId}",
+ queryOperationProgress: this.baseUrl + "/resource/{serviceId}/progress",
+ slicingBusinessDetail: this.baseUrl + "/resource/business/{businessId}/details",
//slicing-nsi-management
- slicingNsiList:this.baseUrl+"/resource/nsi/instances/pageNo/{pageNo}/pageSize/{pageSize}",
- slicingNsiQueryOfStatus:this.baseUrl+"/resource/nsi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}",
- slicingNsiDetail:this.baseUrl+"/resource/nsi/{nsiId}/details",
+ slicingNsiList: this.baseUrl + "/resource/nsi/instances/pageNo/{pageNo}/pageSize/{pageSize}",
+ slicingNsiQueryOfStatus: this.baseUrl + "/resource/nsi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}",
+ slicingNsiDetail: this.baseUrl + "/resource/nsi/{nsiId}/details",
//slicing-nssi-management
- slicingNssiList:this.baseUrl+"/resource/nssi/instances/pageNo/{pageNo}/pageSize/{pageSize}",
- slicingNssiQueryOfStatus:this.baseUrl+"/resource/nssi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}",
- slicingNssiDetail:this.baseUrl+"/resource/nssi/{nssiId}/details",
+ slicingNssiList: this.baseUrl + "/resource/nssi/instances/pageNo/{pageNo}/pageSize/{pageSize}",
+ slicingNssiQueryOfStatus: this.baseUrl + "/resource/nssi/{instanceStatus}/instances/pageNo/{pageNo}/pageSize/{pageSize}",
+ slicingNssiDetail: this.baseUrl + "/resource/nssi/{nssiId}/details",
//monitor 5G
- fetchTraffic:this.baseUrl+"/monitoring/queryTimestamp/{queryTimestamp}/trafficData",
- fetchOnlineusers:this.baseUrl+"/monitoring/queryTimestamp/{queryTimestamp}/onlineUsers",
- fetchBandwidth:this.baseUrl+"/monitoring/queryTimestamp/{queryTimestamp}/bandwidth"
+ fetchTraffic: this.baseUrl + "/monitoring/queryTimestamp/{queryTimestamp}/trafficData",
+ fetchOnlineusers: this.baseUrl + "/monitoring/queryTimestamp/{queryTimestamp}/onlineUsers",
+ fetchBandwidth: this.baseUrl + "/monitoring/queryTimestamp/{queryTimestamp}/bandwidth"
}
-
+
// Get slicing order task list
- getSlicingTaskList (pageNo: string, pageSize: string) {
+ getSlicingTaskList(pageNo: string, pageSize: string) {
const url = this.url.slicingTaskList
- .replace("{pageNo}", pageNo)
- .replace("{pageSize}", pageSize);
+ .replace("{pageNo}", pageNo)
+ .replace("{pageSize}", pageSize);
return this.http.get<any>(url);
}
// Get list based on task processing status
- getTaskProcessingStatus (processingStatus: string, pageNo: string, pageSize: string) {
+ getTaskProcessingStatus(processingStatus: string, pageNo: string, pageSize: string) {
const url = this.url.taskProcessingStatus
- .replace('{processingStatus}', processingStatus)
- .replace("{pageNo}", pageNo)
- .replace("{pageSize}", pageSize);
+ .replace('{processingStatus}', processingStatus)
+ .replace("{pageNo}", pageNo)
+ .replace("{pageSize}", pageSize);
return this.http.get<any>(url);
}
// Get
- getAuditInfo (taskId: string){
+ getAuditInfo(taskId: string) {
const url = this.url.auditInfo.replace('{taskId}', taskId);
return this.http.get<any>(url);
}
- getSlicingInstance (pageNo: string, pageSize: string){
+ getSlicingInstance(pageNo: string, pageSize: string) {
const url = this.url.slicingInstance
- .replace("{pageNo}", pageNo)
- .replace("{pageSize}", pageSize);
+ .replace("{pageNo}", pageNo)
+ .replace("{pageSize}", pageSize);
return this.http.get<any>(url);
}
- getSlicingSubnetInstance(nsiId: string){
+ getSlicingSubnetInstance(nsiId: string) {
const url = this.url.slicingSubnetInstance.replace('{nsiId}', nsiId);
return this.http.get<any>(url);
}
- getSubnetInContext (context: string, pageNo: string, pageSize: string) {
+ getSubnetInContext(context: string, pageNo: string, pageSize: string) {
const url = this.url.subnetInContext
- .replace('{environmentContext}', context)
- .replace('{pageNo}', pageNo)
- .replace('{pageSize}', pageSize);
+ .replace('{environmentContext}', context)
+ .replace('{pageNo}', pageNo)
+ .replace('{pageSize}', pageSize);
return this.http.get<any>(url);
}
- submitSlicing (reqbody) {
+ submitSlicing(reqbody) {
return this.http.put<any>(this.url.submitSlicing, reqbody)
}
- getSlicingBasicInfo (taskId: string) {
+ getSlicingBasicInfo(taskId: string) {
const url = this.url.slicingBasicInfo.replace('{taskId}', taskId);
return this.http.get<any>(url);
}
- getSlicingCreateProgress (taskId: string) {
+ getSlicingCreateProgress(taskId: string) {
const url = this.url.slicingCreateProgress.replace('{taskId', taskId);
return this.http.get<any>(url);
}
// Get slicing business list
- getSlicingBusinessList (paramsObj,isSelect: boolean) {
- let url = this.url.slicingBusinessList .replace("{pageNo}", paramsObj.pageNo)
+ getSlicingBusinessList(paramsObj, isSelect: boolean) {
+ let url = this.url.slicingBusinessList.replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
- if(isSelect){
+ if (isSelect) {
url = this.url.slicingBusinesQueryOfStatus.replace("{businessStatus}", paramsObj.businessStatus).replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
}
return this.http.get<any>(url);
}
// change slicing business activate status
- changeActivateSlicingService(paramsObj, activate: boolean){
+ changeActivateSlicingService(paramsObj, activate: boolean) {
let url = this.url.activateSlicingService.replace("{serviceId}", paramsObj.serviceId);
- if(activate){
+ if (activate) {
url = this.url.deactivateSlicingService.replace("{serviceId}", paramsObj.serviceId)
}
- return this.http.put<any>(url,paramsObj);
+ return this.http.put<any>(url, paramsObj);
}
// terminate slicing business
- terminateSlicingService(paramsObj){
+ terminateSlicingService(paramsObj) {
const url = this.url.terminateSlicingService.replace('{serviceId}', paramsObj.serviceId);
return this.http.delete<any>(url);
}
@@ -133,52 +133,52 @@ export class SlicingTaskServices { return this.http.get<any>(url);
}
//get slicingBusinessDetail
- getSlicingBusinessDetail(businessId: string){
- let url = this.url.slicingBusinessDetail.replace("{businessId}",businessId);
+ getSlicingBusinessDetail(businessId: string) {
+ let url = this.url.slicingBusinessDetail.replace("{businessId}", businessId);
return this.http.get<any>(url);
}
// Get slicing nsi list
- getSlicingNsiList (paramsObj,isSelect: boolean) {
- let url = this.url.slicingNsiList .replace("{pageNo}", paramsObj.pageNo)
+ getSlicingNsiList(paramsObj, isSelect: boolean) {
+ let url = this.url.slicingNsiList.replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
- if(isSelect){
+ if (isSelect) {
url = this.url.slicingNsiQueryOfStatus.replace("{instanceStatus}", paramsObj.instanceStatus).replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
}
return this.http.get<any>(url);
}
//get slicingNsiDetail
- getSlicingNsiDetail(nsiId: string){
- let url = this.url.slicingNsiDetail.replace("{nsiId}",nsiId);
+ getSlicingNsiDetail(nsiId: string) {
+ let url = this.url.slicingNsiDetail.replace("{nsiId}", nsiId);
return this.http.get<any>(url);
}
// Get slicing nssi list
- getSlicingNssiList (paramsObj,isSelect: boolean) {
- let url = this.url.slicingNssiList .replace("{pageNo}", paramsObj.pageNo)
+ getSlicingNssiList(paramsObj, isSelect: boolean) {
+ let url = this.url.slicingNssiList.replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
- if(isSelect){
+ if (isSelect) {
url = this.url.slicingNssiQueryOfStatus.replace("{instanceStatus}", paramsObj.instanceStatus).replace("{pageNo}", paramsObj.pageNo)
.replace("{pageSize}", paramsObj.pageSize);
}
return this.http.get<any>(url);
}
//get slicingNssiDetail
- getSlicingNssiDetail(nssiId: string){
- let url = this.url.slicingNssiDetail.replace("{nssiId}",nssiId);
+ getSlicingNssiDetail(nssiId: string) {
+ let url = this.url.slicingNssiDetail.replace("{nssiId}", nssiId);
return this.http.get<any>(url);
}
//monitor 5G
- getFetchTraffic(service_list,time){
- let url = this.url.fetchTraffic.replace("{queryTimestamp}",time);
- return this.http.post<any>(url,service_list);
+ getFetchTraffic(service_list, time) {
+ let url = this.url.fetchTraffic.replace("{queryTimestamp}", time);
+ return this.http.post<any>(url, service_list);
}
- getFetchOnlineusers(service_list,time){
- let url = this.url.fetchOnlineusers.replace("{queryTimestamp}",time);
- return this.http.post<any>(url,service_list);
+ getFetchOnlineusers(service_list, time) {
+ let url = this.url.fetchOnlineusers.replace("{queryTimestamp}", time);
+ return this.http.post<any>(url, service_list);
}
- getFetchBandwidth(service_list,time){
- let url = this.url.fetchBandwidth.replace("{queryTimestamp}",time);
- return this.http.post<any>(url,service_list);
+ getFetchBandwidth(service_list, time) {
+ let url = this.url.fetchBandwidth.replace("{queryTimestamp}", time);
+ return this.http.post<any>(url, service_list);
}
}
diff --git a/usecaseui-portal/src/app/mock/json/slicing_task_list.json b/usecaseui-portal/src/app/mock/json/slicing_task_list.json index 31cdc4df..fba4bae7 100644 --- a/usecaseui-portal/src/app/mock/json/slicing_task_list.json +++ b/usecaseui-portal/src/app/mock/json/slicing_task_list.json @@ -5,13 +5,12 @@ },
"result_body": {
"record_number": 30,
- "slicing_task_list": [
- {
+ "slicing_task_list": [{
"task_id": "b1bb0ce7-ebca-4fa7-95ed-4840d70a1177",
"task_name": "5G Slice service eMMB",
"service_snssai": "1-010101",
"service_type": "eMMB",
- "arrival_time": "1454171445000",
+ "create_time": "1454171445000",
"processing_status": "Waiting to Confirm"
},
{
@@ -19,7 +18,7 @@ "task_name": "5G Slice service eMMB",
"service_snssai": "1-010101",
"service_type": "eMMB",
- "arrival_time": "1454171445500",
+ "create_time": "1454171445500",
"processing_status": "Creating"
},
{
@@ -27,7 +26,7 @@ "task_name": "5G Slice service eMMB",
"service_snssai": "1-010101",
"service_type": "eMMB",
- "arrival_time": "1454471445000",
+ "create_time": "1454471445000",
"processing_status": "Planning"
},
{
@@ -35,9 +34,9 @@ "task_name": "5G Slice service eMMB",
"service_snssai": "1-010101",
"service_type": "eMMB",
- "arrival_time": "1544471445000",
+ "create_time": "1544471445000",
"processing_status": "Completed"
}
]
}
-}
+}
\ No newline at end of file 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 943b946d..85ed0880 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 @@ -2,30 +2,16 @@ <div nz-row> <div nz-col nzSpan="12" class="task_status"> <span>Status : </span> - <nz-select - nzShowSearch - nzAllowClear - [(ngModel)]="selectedValue" - nzPlaceHolder="Select a processing status" - (ngModelChange)="processingStatusChange()" - > + <nz-select nzShowSearch nzAllowClear [(ngModel)]="selectedValue" nzPlaceHolder="Select a processing status" + (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 - nzShowPagination - nzPageSizeOptions - nzShowSizeChanger - [nzTotal]="total" - [nzLoading]="loading" - [nzData]="listOfData" - [nzFrontPagination]="false" - (nzPageSizeChange)="pageSizeChange($event)" - (nzPageIndexChange)="pageNumChange($event)" - > + <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> @@ -43,10 +29,11 @@ <td>{{ data.task_name }}</td> <td>{{ data.service_snssai }}</td> <td>{{ data.service_type }}</td> - <td>{{ data.arrival_time }}</td> + <td>{{ data.create_time }}</td> <td>{{ data.status }}</td> <td> - <span *ngIf="data.processing_status === 'Planning'" class="task_operation_disabled">{{ data.operation }}</span> + <span *ngIf="data.processing_status === 'Planning'" + class="task_operation_disabled">{{ data.operation }}</span> <a (click)="showdetail(data)" *ngIf="data.processing_status !== 'Planning'">{{ data.operation }}</a> </td> </tr> @@ -56,11 +43,7 @@ <app-slicing-task-model [moduleTitle]="moduleTitle" [showDetail]="showDetail" [taskId]="taskId" (cancel)="showDetail=$event"> </app-slicing-task-model> - <app-check-process-model - [moduleTitle]="moduleTitle" - [showProcess]="showProcess" - [taskId]="taskId" - (cancel)="showProcess=$event" - > + <app-check-process-model [moduleTitle]="moduleTitle" [showProcess]="showProcess" [taskId]="taskId" + (cancel)="showProcess=$event"> </app-check-process-model> </div>
\ No newline at end of file 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 26f485b9..e70e6d44 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 @@ -12,27 +12,27 @@ import { TASK_PROCESSING_STATUS } from '../../../../../constants/constants'; export class SlicingTaskManagementComponent implements OnInit { constructor(private myhttp: SlicingTaskServices, private message: NzMessageService) { } - + showDetail: boolean = false; showProcess: boolean = false; selectedValue = null; taskId: string; moduleTitle: string = ""; - listOfData: any[] = []; + listOfData: any[] = []; statusOptions: any[] = TASK_PROCESSING_STATUS; loading: boolean = false; total: number = 1; pageSize: string = '10'; pageNum: string = '1'; - ngOnInit() { + ngOnInit() { this.getTaskList() } - getTaskList (): void{ + getTaskList(): void { const { pageNum, pageSize } = this; this.loading = true; - this.myhttp.getSlicingTaskList(pageNum, pageSize).subscribe (res => { + this.myhttp.getSlicingTaskList(pageNum, pageSize).subscribe(res => { const { result_header: { result_code }, result_body } = res if (+result_code === 200) { const { slicing_task_list, record_number } = result_body; @@ -40,12 +40,12 @@ export class SlicingTaskManagementComponent implements OnInit { this.total = record_number; } else { this.message.error('Failed to get form data') - } + } this.loading = false; }) } - processingStatusChange():void { + processingStatusChange(): void { this.pageSize = '10'; this.pageNum = '1'; if (this.selectedValue) { @@ -55,23 +55,23 @@ export class SlicingTaskManagementComponent implements OnInit { } } - getListOfProcessingStatus (): void { + 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; - }) + 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{ + pageSizeChange(pageSize: number): void { this.pageSize = pageSize + ''; const { selectedValue } = this; if (selectedValue) { @@ -81,7 +81,7 @@ export class SlicingTaskManagementComponent implements OnInit { } } - pageNumChange (pageNum: number): void{ + pageNumChange(pageNum: number): void { this.pageNum = pageNum + ''; const { selectedValue } = this; if (selectedValue) { @@ -91,10 +91,10 @@ export class SlicingTaskManagementComponent implements OnInit { } } - dataFormatting(list: any):void{ - this.listOfData = list.map( item => { - item.arrival_time = moment(+item.arrival_time).format('YYYY-MM-DD hh:mm') - switch (item.processing_status){ + dataFormatting(list: any): void { + this.listOfData = list.map(item => { + item.create_time = moment(item.create_time).format('YYYY-MM-DD hh:mm') + switch (item.processing_status) { case 'Planning': item.status = '规划阶段'; item.operation = '任务处理' @@ -107,7 +107,7 @@ export class SlicingTaskManagementComponent implements OnInit { item.status = '切片创建中'; item.operation = '查看进度' break; - case 'Completed': + case 'Completed': item.status = '创建完成'; item.operation = '查看结果' break; @@ -119,7 +119,7 @@ export class SlicingTaskManagementComponent implements OnInit { showdetail(data: any): void { this.taskId = data.task_id; this.moduleTitle = data.status; - if(data.status === '审核阶段') { + if (data.status === '审核阶段') { this.showDetail = true; } else { this.showProcess = true; |