summaryrefslogtreecommitdiffstats
path: root/usecaseui-portal/src
diff options
context:
space:
mode:
authorcyuamber <xuranyjy@chinamobile.com>2020-09-08 11:04:10 +0800
committercyuamber <xuranyjy@chinamobile.com>2020-09-08 11:04:20 +0800
commit4900b654e209223e5948d51f0b629972a8eb917c (patch)
treebf3eec37440e6d6f6150340c021619a2c66b1e21 /usecaseui-portal/src
parent43cb242d5a78e86786d4274fc539d81680fc15c4 (diff)
feat: Delete the useless message.error code in the code of slicing-task-model page
Change-Id: I517edc6a3aea2cc268771ec5082d99fddf7107b5 Issue-ID: USECASEUI-444 Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src')
-rw-r--r--usecaseui-portal/src/app/core/services/slicingTaskServices.ts35
-rw-r--r--usecaseui-portal/src/app/shared/utils/http.ts5
-rw-r--r--usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/slicing-task-model.component.ts25
3 files changed, 28 insertions, 37 deletions
diff --git a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts
index e7a0a6ff..1a2c9893 100644
--- a/usecaseui-portal/src/app/core/services/slicingTaskServices.ts
+++ b/usecaseui-portal/src/app/core/services/slicingTaskServices.ts
@@ -65,30 +65,30 @@ export class SlicingTaskServices {
// Get slicing order task list
- getSlicingTaskList(pageNo: string, pageSize: string) {
+ getSlicingTaskList(pageNo: string, pageSize: string, failedCallback?:any) {
const url = this.url.slicingTaskList
.replace("{pageNo}", pageNo)
.replace("{pageSize}", pageSize);
- return this.Http.httpAxios("get", url)
+ return this.Http.httpAxios("get", url, null, failedCallback)
}
// Get list based on task processing status
- getTaskProcessingStatus(processingStatus: string, pageNo: string, pageSize: string) {
+ getTaskProcessingStatus(processingStatus: string, pageNo: string, pageSize: string, failedCallback?:any) {
const url = this.url.taskProcessingStatus
.replace('{processingStatus}', processingStatus)
.replace("{pageNo}", pageNo)
.replace("{pageSize}", pageSize);
- return this.Http.httpAxios("get", url);
+ return this.Http.httpAxios("get", url, null, failedCallback)
}
// Get
- getAuditInfo(taskId: string) {
+ getAuditInfo(taskId: string, failedCallback?:any) {
const url = this.url.auditInfo.replace('{taskId}', taskId);
- return this.Http.httpAxios("get", url);
+ return this.Http.httpAxios("get", url, null, failedCallback);
}
- getSlicingInstance(pageNo: string, pageSize: string) {
+ getSlicingInstance(pageNo: string, pageSize: string, failedCallback?:any) {
const url = this.url.slicingInstance
.replace("{pageNo}", pageNo)
.replace("{pageSize}", pageSize);
- return this.Http.httpAxios("get", url);
+ return this.Http.httpAxios("get", url, null, failedCallback);
}
getSlicingSubnetInstance(nsiId: string, failedCallback?:any) {
const url = this.url.slicingSubnetInstance.replace('{nsiId}', nsiId);
@@ -188,19 +188,18 @@ export class SlicingTaskServices {
if (!activate) {
url = this.url.csmfDeactivate.replace("{serviceId}", paramsObj.serviceId)
}
- // return this.http.put<any>(url, paramsObj);
return this.Http.httpAxios("put", url, paramsObj, failedCallback);
}
// terminate CSMF slicing business
- csmfTerminate(paramsObj) {
- const url = this.url.csmfTerminate.replace('{serviceId}', paramsObj.serviceId);
- return this.http.delete<any>(url);
- }
- // query CSMF slicing business progress
- csmfSlicingProgress(paramsObj) {
- let url = this.url.csmfGetProgress.replace("{serviceId}", paramsObj.serviceId);
- return this.http.get<any>(url);
- }
+ // csmfTerminate(paramsObj) {
+ // const url = this.url.csmfTerminate.replace('{serviceId}', paramsObj.serviceId);
+ // return this.http.delete<any>(url);
+ // }
+ // // query CSMF slicing business progress
+ // csmfSlicingProgress(paramsObj) {
+ // let url = this.url.csmfGetProgress.replace("{serviceId}", paramsObj.serviceId);
+ // return this.http.get<any>(url);
+ // }
csmfSlicingPurchase(paramsObj: any, failedCallback?:any){
let url = this.url.csmfPurchase;
return this.Http.httpAxios("post", url, paramsObj, failedCallback);
diff --git a/usecaseui-portal/src/app/shared/utils/http.ts b/usecaseui-portal/src/app/shared/utils/http.ts
index bbfc19c7..598d2afb 100644
--- a/usecaseui-portal/src/app/shared/utils/http.ts
+++ b/usecaseui-portal/src/app/shared/utils/http.ts
@@ -49,11 +49,6 @@ export class Http {
if(+result_code === 200){
resolve(response.data)
}else{
- // let res = {
- // message:this.message.error(result_message || "Network exception, please try again."),
- // callbackFunction:callback
- // }
- // reject(res)
this.message.error(result_message || "Network exception, please try again.")
if(callback)callback();
}
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 f7828594..4e80de03 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,5 +1,4 @@
import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from '@angular/core';
-import { NzMessageService } from 'ng-zorro-antd';
import { SlicingTaskServices } from '@src/app/core/services/slicingTaskServices';
import { indexDebugNode } from '@angular/core/src/debug/debug_node';
@@ -15,7 +14,7 @@ export class SlicingTaskModelComponent implements OnInit {
@Output() cancel = new EventEmitter<object>();
@ViewChild('notification') notification1: any;
- constructor(private http: SlicingTaskServices, private message: NzMessageService) { }
+ constructor(private http: SlicingTaskServices) { }
// 配置审核详情
checkDetail: any[] = [{}];
@@ -102,7 +101,10 @@ export class SlicingTaskModelComponent implements OnInit {
}
getautidInfo(): void {
- this.http.getAuditInfo(this.taskId).then( res => {
+ let getAuditInfoFailedCallback = () => {
+ this.isSpinning = false;
+ }
+ this.http.getAuditInfo(this.taskId, getAuditInfoFailedCallback).then( res => {
this.isSpinning = false;
const {
business_demand_info,
@@ -195,9 +197,6 @@ export class SlicingTaskModelComponent implements OnInit {
'sliceProfile_CN_ipAddress',
'sliceProfile_CN_nextHopInfo'
])};
- }, ({ status, statusText }) => {
- this.message.error(status + ' (' + statusText + ')');
- this.isSpinning = false;
})
}
@@ -221,7 +220,11 @@ export class SlicingTaskModelComponent implements OnInit {
getSlicingInstances(pageNo: string, pageSize: string): void {
this.slicingInstances.isLoading = true;
- this.http.getSlicingInstance(pageNo, pageSize).then(res => {
+ let getSlicingInstanceFailedCallback = () => {
+ this.slicingInstances.isLoading = false;
+ this.slicingInstances.flag = false;
+ }
+ this.http.getSlicingInstance(pageNo, pageSize, getSlicingInstanceFailedCallback).then(res => {
const { result_body } = res;
setTimeout(() => {
const { nsi_service_instances, record_number } = result_body;
@@ -230,10 +233,6 @@ 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;
})
}
@@ -391,15 +390,13 @@ 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;
let submitSlicingFailedCallback = () => {
+ this.loading = false;
this.notification1.notificationFailed('Task', 'Sumbit', this.taskId)
}
this.http.submitSlicing(reqBody,submitSlicingFailedCallback).then(res => {
this.notification1.notificationSuccess('Task', 'Sumbit', this.taskId)
this.loading = false;
this.handleCancel(true);
- }, ({ status, statusText }) => {
- this.message.error(status + ' (' + statusText + ')');
- this.loading = false;
})
}
}